/* ============================================
   uGIS — Shared Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0c1220;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2235;
    --bg-input: rgba(255,255,255,0.06);
    --bg-hover: rgba(59,130,246,0.08);
    --border-color: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.12);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --info: #06b6d4;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --navbar-height: 48px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* --- Navbar --- */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 2000;
    position: relative;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    margin-right: 24px;
}
.navbar-brand svg { flex-shrink: 0; }
.navbar-links {
    display: flex;
    gap: 4px;
    flex: 1;
}
.navbar-links a {
    padding: 6px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
}
.navbar-links a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.navbar-links a.active {
    color: var(--accent);
    background: rgba(59,130,246,0.12);
}
.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s;
}
.health-dot.up { background: var(--success-light); }
.health-dot.down { background: var(--danger); }
.health-label {
    font-size: 11px;
    color: var(--text-dim);
    cursor: default;
}

/* --- Shared Login Styles --- */
.login-container {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}
.login-brand-panel {
    flex: 0 0 420px;
    background:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0) 0 0 / 22px 22px,
        linear-gradient(160deg, #0f1f3d 0%, #0c1220 60%, #162040 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 52px;
    border-right: 1px solid var(--border-strong);
    position: relative;
    overflow: hidden;
}
.login-brand-panel::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    top: -100px; right: -100px;
    pointer-events: none;
}
.login-brand-panel::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
    bottom: -60px; left: -60px;
    pointer-events: none;
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}
.login-logo-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(59,130,246,0.35), 0 0 0 1px rgba(255,255,255,0.1);
    overflow: hidden;
    flex-shrink: 0;
}
.login-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.login-logo-text span { color: var(--accent); }
.login-tagline {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: -30px;
    margin-bottom: 48px;
    letter-spacing: 0.3px;
}
.login-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.login-feature-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 40px;
}
.login-box {
    width: 100%;
    max-width: 360px;
    animation: loginBoxIn 0.35s ease;
}
.login-box h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.login-box p {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 32px;
}
.login-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.login-box input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.login-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.login-box button {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.login-box button:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}
.login-error {
    color: #f87171;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    display: none;
    padding: 8px 12px;
    background: rgba(239,68,68,0.12);
    border-radius: var(--radius-md);
    border: 1px solid rgba(239,68,68,0.2);
}
@keyframes loginBoxIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-spinner {
    display: none;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: login-spin 0.65s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
.login-box button.loading .login-spinner { display: inline-block; }
.login-box button.loading { pointer-events: none; opacity: 0.8; }
@media (max-width: 768px) {
    .login-brand-panel { display: none; }
    .login-form-panel { background: var(--bg-primary); padding: 20px; }
    .login-box { max-width: 100%; }
}

.nav-auth-link {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.nav-auth-link:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }
.nav-auth-register { color: #a78bfa; }
.nav-auth-register:hover { color: #c4b5fd; background: rgba(139,92,246,0.12); }

.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary, #cbd5e1);
    background: rgba(255,255,255,0.06);
    padding: 3px 8px 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
}
.nav-logout-btn {
    background: none;
    border: none;
    color: var(--text-dim, #64748b);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.nav-logout-btn:hover {
    color: var(--danger, #ef4444);
    background: rgba(239,68,68,0.1);
}

/* --- Viewer: GIS breadcrumb bar in navbar --- */
.navbar-gis-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.nav-gis-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
}
/* --- Navbar Action Buttons --- */
.nav-gis-sep {
    width: 1px;
    height: 20px;
    background: var(--border-strong);
    margin: 0 6px;
    flex-shrink: 0;
}
.nav-tool-group {
    display: flex;
    align-items: center;
    gap: 1px;
}
.nav-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-right: 4px;
    user-select: none;
}
.nav-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.nav-action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.nav-action-btn.active {
    color: var(--accent);
    background: rgba(59,130,246,0.15);
}
.nav-action-btn svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .nav-gis-sep { margin: 0 4px; }
    .nav-group-label { display: none; }
}
@media (max-width: 480px) {
    .nav-gis-label { display: none; }
    .nav-gis-sep:first-of-type { display: none; }
}

/* --- Buttons --- */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-secondary { background: #555; color: #fff; }
.btn-secondary:hover { background: #666; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* --- Cards --- */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-strong);
}
.card h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 16px;
}
.card table { width: 100%; border-collapse: collapse; }
.card table th, .card table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
    font-size: 13px;
}
.card table th { color: var(--text-muted); font-weight: 600; }

/* --- Forms --- */
.form-group { margin-bottom: 12px; }
.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 4px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: #fff;
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--accent); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.badge-raster { background: rgba(231,76,60,0.2); color: var(--danger); }
.badge-vector { background: rgba(39,174,96,0.2); color: var(--success-light); }
.badge-postgis { background: rgba(52,152,219,0.2); color: var(--info); }
.badge-group { background: rgba(155,89,182,0.2); color: #c39bd3; }
.badge-extwms { background: rgba(139,92,246,0.2); color: #8b5cf6; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.status-connected { background: rgba(39,174,96,0.2); color: var(--success-light); }
.status-disconnected { background: rgba(231,76,60,0.2); color: var(--danger); }

/* --- Toast --- */
.toast {
    position: fixed;
    top: 60px;
    right: 16px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    z-index: 9999;
    display: none;
    box-shadow: var(--shadow-md);
}
.toast.ok { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

/* --- Status Bar (Map) --- */
.status-bar {
    height: 28px;
    background: rgba(12,18,32,0.95);
    padding: 0 16px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 1px solid var(--border-strong);
    z-index: 1000;
}
.status-bar .coord { color: var(--accent); }
.status-bar span { color: var(--text-secondary); }

/* --- Loading Spinner --- */
.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(12,18,32,0.9);
    padding: 20px 30px;
    border-radius: var(--radius-xl);
    display: none;
    text-align: center;
}
.loading-overlay.active { display: block; }
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(59,130,246,0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* --- Stat Cards Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}
.stat-card h3 { color: var(--accent); margin-bottom: 8px; font-size: 14px; }
.stat-card .stat-value { font-size: 36px; font-weight: 700; }
.stat-value-raster { color: var(--accent); }
.stat-value-vector { color: var(--success); }
.stat-value-style { color: var(--warning); }
.stat-value-cache { color: var(--danger); }

/* --- Save / Modal Dialog --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 24px;
    min-width: 340px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}
.modal-box h3 { font-size: 14px; color: var(--accent); margin-bottom: 12px; }
.modal-box input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    margin-bottom: 12px;
}
.modal-box input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* --- Confirm Dialog --- */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
.confirm-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 28px;
    min-width: 360px;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}
.confirm-box h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.confirm-box p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Stackable Toast --- */
.toast-container {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast-item {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toastIn 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 380px;
}
.toast-item.ok { background: var(--success); color: #fff; }
.toast-item.error { background: var(--danger); color: #fff; }
.toast-item.info { background: var(--info); color: #fff; }
.toast-item.warn { background: var(--warning); color: #fff; }
.toast-item.removing { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* --- Dropzone --- */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(59,130,246,0.03);
}
.dropzone:hover {
    border-color: var(--accent);
    background: rgba(59,130,246,0.06);
}
.dropzone.active {
    border-color: var(--accent);
    background: rgba(59,130,246,0.1);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.dropzone-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}
.dropzone-text {
    color: var(--text-muted);
    font-size: 13px;
}
.dropzone-text strong {
    color: var(--accent);
}
.dropzone-hint {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 6px;
}
.dropzone-progress {
    margin-top: 12px;
    display: none;
}
.dropzone-progress.active { display: block; }
.dropzone-file-list {
    margin-top: 12px;
    text-align: left;
}
.dropzone-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}
.dropzone-file-item .file-status {
    margin-left: auto;
    font-size: 11px;
}
.dropzone-file-item .file-status.success { color: var(--success-light); }
.dropzone-file-item .file-status.error { color: var(--danger-light); }

/* --- Copy Button --- */
.btn-copy {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.btn-copy.copied {
    background: rgba(39,174,96,0.15);
    border-color: var(--success);
    color: var(--success-light);
}

/* --- Tabs --- */
.tab-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 0;
}
.tab {
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    font-family: var(--font-sans);
    margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab .tab-count {
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: 6px;
}
.tab.active .tab-count {
    background: rgba(59,130,246,0.2);
    color: var(--accent);
}

/* --- Role Badges --- */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.role-admin { background: rgba(231,76,60,0.2); color: var(--danger-light); }
.role-editor { background: rgba(243,156,18,0.2); color: var(--warning); }
.role-viewer { background: rgba(39,174,96,0.2); color: var(--success-light); }

/* --- Status Pills --- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pill-connected {
    background: rgba(39,174,96,0.12);
    color: var(--success-light);
}
.pill-connected::before {
    background: var(--success-light);
    animation: pulse-dot 2s ease infinite;
}
.pill-disconnected {
    background: rgba(231,76,60,0.12);
    color: var(--danger-light);
}
.pill-disconnected::before {
    background: var(--danger-light);
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--accent), var(--success-light));
}
.progress-bar-lg { height: 12px; }
.progress-bar-lg .progress-bar-fill { height: 12px; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}
.empty-state h3 {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- Button Loading State --- */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
}

/* --- Endpoint URL Block --- */
.endpoint-url {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.endpoint-url code {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.endpoint-url .endpoint-label {
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 11px;
    min-width: 40px;
    text-transform: uppercase;
}

/* --- Accessibility: Global Focus Visible (5.14) --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* --- Reduced Motion (5.14) --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Navbar Mobile (5.13) --- */
@media (max-width: 768px) {
    .navbar { padding: 0 10px; }
    .navbar-brand { margin-right: 12px; font-size: 13px; }
    .navbar-links a { padding: 4px 8px; font-size: 12px; }
    .health-label { display: none; }
}

@media (max-width: 480px) {
    .navbar-brand span { display: none; }
    .navbar-links a { padding: 4px 6px; font-size: 11px; }
}

/* --- Language Switcher (shared) --- */
.lang-switcher {
    display: flex; gap: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px; padding: 2px; flex-shrink: 0;
}
.lang-btn {
    padding: 3px 10px; border: none; border-radius: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
    cursor: pointer; transition: all .15s;
    background: transparent; color: #94a3b8;
}
.lang-btn:hover { color: #f1f5f9; background: rgba(255,255,255,0.06); }
.lang-btn.active { background: #3b82f6; color: #fff; box-shadow: 0 1px 4px rgba(59,130,246,.35); }
