:root {
    --bg: #08101d;
    --bg-2: #0b1526;
    --panel: rgba(11, 20, 37, 0.9);
    --panel-2: rgba(255, 255, 255, 0.045);
    --panel-3: rgba(255, 255, 255, 0.03);
    --text: #e7eef9;
    --muted: #95a5bb;
    --line: rgba(255, 255, 255, 0.08);
    --gold: #d7b46a;
    --green: #40c18e;
    --red: #e17474;
    --blue: #76a8ff;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(215, 180, 106, 0.14), transparent 24%),
        radial-gradient(circle at left center, rgba(118, 168, 255, 0.08), transparent 20%),
        linear-gradient(180deg, #08101d 0%, #0b1526 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
}

label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    display: block;
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--gold), #f0d08e);
    color: #141414;
    font-weight: 700;
}

.btn.secondary {
    background: linear-gradient(135deg, #173253, #244a79);
    color: var(--text);
}

.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-full {
    width: 100%;
}

.alert {
    background: rgba(239, 119, 119, .12);
    border: 1px solid rgba(239, 119, 119, .25);
    color: #ffd6d6;
    padding: 12px;
    border-radius: 12px;
}

.muted,
.helper-text {
    color: var(--muted);
}

.eyebrow,
.montclair-badge,
.modal-pill,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
}

.montclair-badge,
.modal-pill {
    border-color: rgba(215, 180, 106, .3);
    background: rgba(215, 180, 106, .08);
    color: var(--gold);
    text-transform: uppercase;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.neutral {
    color: var(--blue);
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-wrapper {
    width: 100%;
    max-width: 1280px;
    display: grid;
    grid-template-columns: 1.25fr .85fr;
    gap: 28px;
}

.login-hero,
.login-card,
.sidebar,
.panel,
.stat-card,
.topbar,
.message-card,
.list-item,
.hero-card,
.tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.login-hero {
    padding: 42px;
}

.login-hero h1 {
    font-size: 56px;
    margin: 12px 0;
    letter-spacing: -0.04em;
}

.login-hero p {
    font-size: 18px;
    color: var(--muted);
    max-width: 700px;
    line-height: 1.7;
}

.feature-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    padding: 18px;
    background: var(--panel-2);
    border-radius: 18px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.app-shell {
    min-height: 100vh;
    display: block;
    padding: 20px;
}

.sidebar {
    width: 290px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: 20px;
    overflow: hidden;
    background: rgba(4, 10, 20, 0.82);
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1c2841, #0d1628 58%, #caa35e);
    color: #f5dfb2;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand {
    font-size: 15px;
    font-weight: 700;
}

.brand-sub {
    color: var(--muted);
    margin-top: 4px;
    font-size: 13px;
}

.sidebar-scroll {
    margin-top: 18px;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 18px;
    overflow-y: scroll;
    padding-right: 6px;
    min-height: 0;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.menu-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-label {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #77869a;
    padding: 0 8px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: transparent;
    border: 1px solid transparent;
    transition: .2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(215, 180, 106, 0.18), rgba(255, 255, 255, 0.04));
    border-color: rgba(215, 180, 106, 0.28);
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
}

.nav-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-copy strong {
    font-size: 14px;
}

.nav-copy small {
    color: var(--muted);
    font-size: 12px;
}

.side-panel {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--line);
}

.side-panel h3 {
    margin: 8px 0 8px;
    font-size: 16px;
}

.side-panel p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.6;
    font-size: 13px;
}

.content-shell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: 310px;
}

.mobile-menu-btn {
    display: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.topbar {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar h1 {
    margin: 10px 0 6px;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.topbar-note {
    margin: 0;
}

.topbar-side {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.user-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--panel-2);
    padding: 14px 16px;
    border-radius: 16px;
    min-width: 220px;
}

.user-chip.subtle {
    background: var(--panel-3);
}

.stats-grid,
.content-grid,
.grid-2,
.hero-grid,
.tiles {
    display: grid;
    gap: 20px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: 1.2fr .8fr;
}

.hero-grid {
    grid-template-columns: 1.35fr .95fr;
}

.tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.tile {
    padding: 22px;
}

.stat-card span,
.details-grid span,
.tile span {
    color: var(--muted);
    font-size: 13px;
    display: block;
    margin-bottom: 10px;
}

.stat-card strong,
.tile strong {
    font-size: 28px;
    letter-spacing: -0.03em;
}

.panel {
    padding: 22px;
    min-width: 0;
}

.panel-lg {
    grid-column: span 3;
}

.panel-xl {
    grid-column: span 4;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-head h3,
.panel-head h4 {
    margin: 0;
}

.hero-card {
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(215, 180, 106, 0.18), transparent 70%);
    pointer-events: none;
}

.hero-card h2 {
    margin: 16px 0 10px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    max-width: 700px;
}

.hero-card p {
    margin: 0;
    max-width: 640px;
    color: var(--muted);
    line-height: 1.7;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.mini-stat {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.mini-stat strong {
    font-size: 20px;
}

.summary-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.summary-value {
    font-size: 34px;
    letter-spacing: -0.04em;
    font-weight: 700;
    margin: 10px 0 4px;
}

.alloc-row {
    display: grid;
    grid-template-columns: 110px 1fr 50px;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.bar>i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(118, 168, 255, 0.9), rgba(215, 180, 106, 0.9));
}

.action-list,
.card-list,
.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.list-item,
.message-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.list-item span,
.message-head span,
.subcopy {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

.message-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.action-btn {
    text-align: left;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
}

.action-btn strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.action-btn span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.table-wrap {
    overflow-x: auto;
}

.table-wrap table {
    min-width: 720px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.details-grid strong {
    display: block;
    margin-top: 8px;
}

.beneficiary-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.textarea {
    min-height: 108px;
    resize: vertical;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 18, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 40;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    background: #0f1b2e;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
}

@media (max-width: 1280px) {

    .hero-grid,
    .grid-2,
    .beneficiary-grid,
    .tiles,
    .stats-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .panel-lg {
        grid-column: span 1;
    }
}

@media (max-width: 980px) {

    .login-wrapper,
    .feature-grid,
    .form-grid,
    .details-grid,
    .hero-metrics,
    .action-grid {
        grid-template-columns: 1fr;
    }

    .app-shell {
        padding: 12px;
    }

    .sidebar {
        position: fixed;
        top: 12px;
        left: 12px;
        bottom: 12px;
        width: min(88vw, 320px);
        transform: translateX(-112%);
        transition: transform .25s ease;
        z-index: 50;
        min-height: auto;
    }

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

    body.menu-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 30;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        align-self: flex-start;
        margin-bottom: 10px;
        border: 1px solid var(--line);
        background: var(--panel);
        color: var(--text);
        border-radius: 14px;
        padding: 12px 14px;
    }

    .content-shell {
        margin-left: 0;
    }

    .topbar {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-side {
        justify-content: flex-start;
    }

    .topbar h1 {
        font-size: 26px;
    }

    .user-chip {
        min-width: unset;
    }
}