:root {
    --navy: #223448;
    --navy-2: #152535;
    --blue: #2d6cdf;
    --sky: #f4f8fd;
    --card: #ffffff;
    --border: #dbe5ef;
    --text: #1f2937;
    --muted: #6b7280;
    --success-soft: #e8f7ef;
    --warning-soft: #fff6e5;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #eef4fa 0%, #f8fbff 100%);
    color: var(--text);
}
a { text-decoration: none; }
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
}
.sidebar {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.brand-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #48a1ff 0%, #2d6cdf 100%);
    box-shadow: 0 14px 35px rgba(0,0,0,.18);
}
.brand-title { font-weight: 800; font-size: 1.15rem; }
.brand-subtitle { color: rgba(255,255,255,.72); font-size: .92rem; }
.sidebar .nav-link {
    border-radius: 16px;
    padding: .9rem 1rem;
    color: rgba(255,255,255,.84);
    display: flex;
    gap: .75rem;
    align-items: center;
    font-weight: 600;
}
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 1rem;
}
.content-area { padding: 2rem; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.eyebrow { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.page-title { margin: .15rem 0 0; font-size: 1.9rem; font-weight: 800; }
.surface-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(31,41,55,.05);
}
.surface-card.pad { padding: 1.35rem; }
.metric-card { padding: 1.2rem; height: 100%; }
.metric-number { font-size: 2rem; font-weight: 800; }
.metric-label { color: var(--muted); font-size: .9rem; }
.section-title { font-size: 1.12rem; font-weight: 700; margin: 0; }
.section-subtitle { color: var(--muted); font-size: .9rem; }
.form-control, .form-select {
    min-height: 48px;
    border-radius: 14px;
    border-color: var(--border);
}
.btn-primary {
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #2d6cdf 0%, #1957c9 100%);
}
.btn-outline-primary, .btn-outline-secondary { border-radius: 14px; }
.badge-soft {
    background: #edf3ff;
    color: #275fce;
    border: 1px solid #d2e1ff;
    padding: .55rem .8rem;
    border-radius: 999px;
    font-size: .82rem;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
}
.assignment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.assignment-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
    background: #fff;
}
.assignment-card h3 {
    font-size: 1rem;
    margin: 0 0 .85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.assignment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.assignment-item {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: .8rem .9rem;
    background: #f9fbfd;
}
.assignment-item .name { font-weight: 700; }
.assignment-item .meta { color: var(--muted); font-size: .85rem; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: radial-gradient(circle at top right, rgba(45,108,223,.15), transparent 30%), linear-gradient(180deg, #eef5fe 0%, #f7fbff 100%);
}
.login-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 20px 55px rgba(31,41,55,.08);
    padding: 2rem;
}
.table thead th {
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.empty-state {
    padding: 1.4rem;
    border: 1px dashed var(--border);
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    background: #fcfdff;
}
@media (max-width: 991px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 1rem;
        gap: 1rem;
    }
    .content-area { padding: 1rem; }
}
@media (max-width: 767px) {
    .assignment-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 1.45rem; }
}


.sheriff-item {
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border-color: #bcd2ff;
    box-shadow: inset 0 0 0 1px rgba(45,108,223,.08);
}
.sheriff-name {
    color: #1748a6;
}
.sheriff-badge {
    background: #2d6cdf;
    color: #fff;
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .72rem;
    letter-spacing: .04em;
}

.briefing-badge {
    background: #f4c542;
    color: #4a3a00;
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .72rem;
    letter-spacing: .04em;
    border: 1px solid #e6b800;
}

.apu-badge,
.apu-badge.badge,
.alert .apu-badge,
.alert-danger .apu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff !important;
    color: #111 !important;
    font-weight: 800 !important;
    border-radius: 999px;
    padding: .42rem .82rem;
    font-size: .82rem;
    letter-spacing: .04em;
    line-height: 1;
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220,53,69,.18), inset 0 0 0 1px rgba(255,255,255,.85), 0 1px 2px rgba(0,0,0,.08);
    text-shadow: none !important;
}


.briefingaero-badge,
.briefingaero-badge.badge,
.badge.briefingaero-badge,
.assignment-item .briefingaero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #198754 !important;
    color: #fff !important;
    font-weight: 700 !important;
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .72rem;
    letter-spacing: .04em;
    line-height: 1;
    border: 1px solid #157347 !important;
    text-shadow: none !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}


.mobile-topbar {
    display: none;
}
.mobile-menu-btn {
    border-radius: 14px;
    font-weight: 700;
}

.mobile-logout-btn {
    border-radius: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.mobile-title-wrap {
    min-width: 0;
}
.mobile-title {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.1;
}
.mobile-subtitle {
    color: var(--muted);
    font-size: .82rem;
}
.assignment-item .d-flex.justify-content-between {
    flex-wrap: wrap;
}
.assignment-item .d-flex.justify-content-end {
    width: 100%;
}
.assignment-item .badge {
    white-space: normal;
}

@media (max-width: 991px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: .65rem;
        justify-content: space-between;
        padding: .85rem 1rem;
        background: rgba(255,255,255,.94);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .sidebar {
        position: static;
        padding: 0 1rem 1rem;
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
    }
    .brand-block,
    .sidebar-footer {
        display: none;
    }
    .mobile-title-wrap {
        flex: 1 1 auto;
    }
    .mobile-logout-btn {
        padding-inline: .7rem;
        flex-shrink: 0;
    }
    .sidebar .nav {
        margin-top: 0 !important;
        padding-top: .75rem;
    }
    .sidebar .nav-link {
        padding: .85rem .95rem;
        font-size: .95rem;
    }
    .topbar {
        margin-top: .5rem;
        align-items: flex-start;
    }
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .content-area {
        padding: .75rem;
    }
    .surface-card.pad,
    .metric-card,
    .assignment-card {
        padding: .95rem;
        border-radius: 18px;
    }
    .section-subtitle,
    .assignment-item .meta {
        font-size: .82rem;
    }
    .assignment-item {
        padding: .72rem .78rem;
    }
    .badge-soft,
    .assignment-card h3 .badge,
    .badge {
        font-size: .74rem;
    }
}

.stats-table th, .stats-table td { white-space: nowrap; }
@media (max-width: 991.98px) { .stats-table { font-size: 0.85rem; } }

.assignment-courses {
    color: #7b8696;
    font-size: .48rem;
    line-height: 1.0;
    margin-top: .05rem;
    font-weight: 500;
    letter-spacing: .005em;
}
