/* ── Design tokens ─────────────────────────────────────── */
:root {
    --navy:      #1B3A5C;
    --gold:      #F0A500;
    --blue:      #0A6EBD;
    --sidebar-w: 240px;
    --topbar-h:  56px;
}

/* ── Base ──────────────────────────────────────────────── */
html { font-size: 14px; }

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body { background: #f1f5f9; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--blue);
}

/* ── Sidebar ───────────────────────────────────────────── */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--navy);
    z-index: 1040;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    flex-shrink: 0;
}

.sidebar-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-brand-text {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-accent { color: var(--gold); }

.sidebar-nav {
    padding: 0.5rem 0.75rem;
}

.nav-section-label {
    display: block;
    color: rgba(255,255,255,0.35);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 1rem 0.5rem 0.3rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    margin-bottom: 1px;
}

.sidebar-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar-link i { font-size: 0.95rem; flex-shrink: 0; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0.65rem 1.25rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
}

/* ── App body ──────────────────────────────────────────── */
.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f1f5f9;
}

@media (min-width: 768px) {
    .app-body { margin-left: var(--sidebar-w); }
}

/* ── Topbar ────────────────────────────────────────────── */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.25rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* ── Main ──────────────────────────────────────────────── */
.app-main {
    flex: 1;
    padding: 1.25rem;
}

/* ── Footer ────────────────────────────────────────────── */
.app-footer {
    font-size: 0.8rem;
    padding: 0.65rem 1.25rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.brand-accent-footer {
    color: var(--blue);
    font-weight: 700;
}

/* ── DB status pill ────────────────────────────────────── */
.db-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #5a6272;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    background: #f8fafc;
}

.db-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.db-status-dot.connected    { background: #22c55e; }
.db-status-dot.disconnected { background: #ef4444; }

/* ── Lang toggle ───────────────────────────────────────── */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.15rem;
    background: #f8fafc;
}

.lang-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-link:hover  { color: #1e293b; background: #e2e8f0; }
.lang-link.active { color: #fff; background: var(--navy); }

/* ── Auth shell (login page, no sidebar) ───────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
}

.auth-topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: var(--navy);
}

.auth-topbar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}

.auth-footer {
    font-size: 0.8rem;
    padding: 0.65rem 1.5rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
