/* ── Design tokens ───────────────────────────────────────────────────── */
:root {
    --header-bg:    rgb(28, 31, 137);   /* dark navy – matches reference image     */
    --brand:        #7b7fc4;   /* periwinkle – login button / accents     */
    --brand-dark:   #6a6eb8;
    --brand-deeper: #1e2478;
    --sidebar-bg:   #ffffff;
    --sidebar-border: #e4e6ef;
    --sidebar-text: #1a1a2e;
    --sidebar-hover:#f0f1fb;
    --sidebar-active-bg: #edeef9;
    --sidebar-active-text: #1e2478;
    --page-bg:      #f4f5f7;
}

/* ── Global font ─────────────────────────────────────────────────────── */
html, body {
    font-family: Inter, sans-serif;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

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

/* ── Page background ─────────────────────────────────────────────────── */
body {
    background-color: var(--page-bg) !important;
    margin-bottom: 0;
}

/* ── Focus ring ──────────────────────────────────────────────────────── */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem var(--brand);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Top header (dark navy) ──────────────────────────────────────────── */
.bg-header {
    background-color: var(--header-bg) !important;
}

.navbar.bg-header .navbar-brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: .2px;
}

.navbar.bg-header .text-white {
    opacity: .9;
}

/* ── Sidebar (white panel) ───────────────────────────────────────────── */
.sidebar-nav {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border);
    width: 210px;
    min-height: calc(100vh - 56px);
    overflow-y: auto;
}

/* ── Mobile: off-canvas sidebar ──────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar-nav {
        position: fixed;
        top: 56px;
        left: 0;
        height: calc(100% - 56px);
        width: 240px;
        z-index: 1035;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 2px 0 16px rgba(0,0,0,.12);
    }

    .sidebar-nav.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0,0,0,.4);
        z-index: 1034;
    }

    .sidebar-overlay.sidebar-overlay-visible {
        display: block;
    }
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text) !important;
    border-radius: .4rem;
    padding: .55rem .85rem;
    margin-bottom: .2rem;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.sidebar-nav .nav-link svg {
    color: #6b7280;
    transition: color .15s;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active-text) !important;
}

.sidebar-nav .nav-link:hover svg {
    color: var(--brand);
}

.sidebar-nav .nav-link.active-link {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text) !important;
    font-weight: 700;
}

.sidebar-nav .nav-link.active-link svg {
    color: var(--brand);
}

/* ── Tables: horizontal scroll on small screens ──────────────────────── */
.table-responsive-always {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card .card-body.p-0 {
    overflow-x: auto;
}

/* ── Forms: prevent overflow on mobile ───────────────────────────────── */
.card {
    word-break: break-word;
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

/* ── Primary buttons ─────────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--brand) !important;
    border-color:     var(--brand) !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-dark) !important;
    border-color:     var(--brand-dark) !important;
}

/* ── Logout button on dark header ────────────────────────────────────── */
.btn-outline-light:hover {
    background-color: rgba(255,255,255,.15);
}
