@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
:root {
    --brand-rgb: 30,95,203;
    --navy: #1B3A5C;
    --navy-deep: #102538;
    --navy-mid: #234A70;
    --gold: #D9A441;
    --gold-light: #F0CC7F;
    --danger: #B23A2E;
    --success: #1E7A4C;
    --cream: #F7F5F0;
    --cream-deep: #EFEBE2;
    --line: #DDE1E6;
    --ink: #1F2430;
    --ink-soft: #5C6470;
    --white: #FFFFFF;
    --shadow-lift: 0 10px 26px rgba(16, 37, 56, .10);
    --font-display: 'Sora', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
body {
    margin: 0; font-family: var(--font-body); background: var(--cream); color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .4em; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px; background: var(--navy-deep); color: #cdd9e4; flex-shrink: 0;
    padding: 20px 0 30px; display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 18px; }
.sidebar .brand img { width: 40px; height: 40px; border-radius: 50%; }
.sidebar .brand .name { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: #fff; line-height: 1.25; }
.sidebar .brand .tag { font-size: .68rem; color: var(--gold-light); letter-spacing: .05em; text-transform: uppercase; }
.sidebar nav { padding: 0 10px; }
.sidebar .section-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #7C8CA0; padding: 16px 12px 6px; }
.nav-link { display: block; padding: 9px 12px; border-radius: 8px; font-size: .87rem; font-weight: 500; color: #cdd9e4; margin-bottom: 2px; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--gold); color: var(--navy-deep); font-weight: 700; }
.sidebar-bottom { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-bottom a { font-size: .82rem; color: #cdd9e4; display: flex; align-items: center; gap: 6px; }

/* ---------- Topbar / content ---------- */
.content { flex: 1; min-width: 0; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--line); padding: 14px 26px;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 1.25rem; }
.topbar .user-pill { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.topbar .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy-deep); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.page-body { padding: 26px 28px 50px; }

/* ---------- Flash / alerts ---------- */
.alert { padding: 12px 16px; border-radius: 9px; font-size: .88rem; margin-bottom: 18px; }
.alert-success { background: #E4F3EA; color: var(--success); border: 1px solid #BEE3CC; }
.alert-error { background: #FBEAE3; color: #8C2E1F; border: 1px solid #F0C3B3; }

/* ---------- Panels / cards ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 22px; overflow: hidden; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 1.02rem; }
.panel-body { padding: 20px; }

.stat-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; flex: 1 1 200px; min-width: 180px; }
.stat-card .label { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-card .value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.stat-card .sub { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Forms ---------- */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=month], input[type=file], select, textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px;
    font-size: .92rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 200px; }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: .88rem;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-mid); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--cream); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F0C3B3; }
.btn-danger:hover { background: #FBEAE3; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .spacer { flex: 1; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--cream); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.badge-active { background: #E4F3EA; color: var(--success); }
.badge-disengaged { background: #F1F1EE; color: #7A7F70; }
.badge-pending { background: #FDF0DA; color: #8A5A0E; }
.badge-approved { background: #E4F3EA; color: var(--success); }
.badge-rejected { background: #FBEAE3; color: #8C2E1F; }

/* ---------- ID card (screen + print, mirrors demand-notice pattern) ---------- */
.id-card-wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 20px 0; }
.id-card { width: 340px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-lift); }
.id-card .head { background: linear-gradient(135deg, var(--navy), var(--navy-deep)); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.id-card .head img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); }
.id-card .head .t1 { font-family: var(--font-display); font-weight: 700; font-size: .92rem; }
.id-card .head .t2 { font-size: .72rem; color: var(--gold-light); }
.id-card .photo-row { display: flex; gap: 14px; padding: 16px; }
.id-card .photo { width: 84px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--cream); }
.id-card .meta h3 { font-size: 1rem; margin-bottom: 4px; }
.id-card .meta div { font-size: .78rem; color: var(--ink-soft); margin-bottom: 2px; }
.id-card .code-strip { background: var(--gold); color: var(--navy-deep); text-align: center; font-family: var(--font-mono); font-weight: 700; padding: 6px; letter-spacing: .04em; }
.id-card .qr-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px dashed var(--line); }
.id-card .qr-row .valid { font-size: 10.5px; color: var(--ink-soft); text-align: right; line-height: 1.5; }
.id-card .foot { background: var(--navy-deep); color: #cdd9e4; font-size: 10px; text-align: center; padding: 6px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    .no-print { display: none !important; }
    .sidebar, .topbar { display: none !important; }
    body { background: var(--white); }
    .id-card { box-shadow: none; border: 1px solid #999; }
}

@media (max-width: 860px) {
    .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 40; transition: left .2s; }
    .sidebar.open { left: 0; }
    .field-row { grid-template-columns: 1fr; }
}

/* ---------- Communications ---------- */
.nav-count { background: var(--gold); color: var(--navy-deep); border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 1px 7px; margin-left: 4px; }
.cm-compose { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.cm-sticky { position: sticky; top: 16px; }
@media (max-width: 1100px) { .cm-compose { grid-template-columns: 1fr; } .cm-sticky { position: static; } }
.cm-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cm-chan { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); cursor: pointer; margin: 0; font-weight: 500; }
.cm-chan input { width: auto; margin-top: 3px; }
.cm-chan small { display: block; font-size: .74rem; color: var(--ink-soft); font-weight: 400; }
.cm-chan:has(input:checked) { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 2px rgba(27,58,92,.12); }
.cm-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 9px; }
.cm-classes label { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: .84rem; margin: 0; padding: 5px 8px; border-radius: 7px; }
.cm-classes label:hover { background: var(--cream); }
.cm-classes input { width: auto; }
.cm-classes span { margin-left: auto; font-size: .72rem; color: var(--ink-soft); }
.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cm-tags button { border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: 3px 10px; font: 500 .74rem var(--font-mono); cursor: pointer; color: var(--navy); }
.cm-tags button:hover { border-color: var(--navy); }
.cm-counter { font-size: .76rem; color: var(--ink-soft); margin-top: 5px; }
.cm-find { display: flex; flex-direction: column; margin-top: 4px; border-radius: 9px; overflow: hidden; }
.cm-find button { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 12px; cursor: pointer; font: inherit; font-size: .88rem; }
.cm-find button:hover { background: var(--cream); }
.cm-find small { color: var(--ink-soft); }
.cm-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cm-picked span { background: var(--navy); color: #fff; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .82rem; display: inline-flex; gap: 6px; align-items: center; }
.cm-picked small { opacity: .75; }
.cm-picked b { cursor: pointer; background: rgba(255,255,255,.2); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }
.cm-big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--navy); }
.cm-big span { font-family: var(--font-body); font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
.cm-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.cm-line em { color: #8A5A0E; font-style: normal; }
.cm-sample { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .84rem; }
.cm-sample small { color: var(--ink-soft); }
.cm-sample p { margin: 6px 0 0; line-height: 1.5; white-space: normal; }
.cm-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; font-size: .88rem; margin-bottom: 14px; }
.cm-meta span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.cm-bar { height: 10px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.cm-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--success)); transition: width .4s; }
.cm-stats { display: flex; gap: 24px; flex-wrap: wrap; margin: 10px 0 4px; font-size: .8rem; color: var(--ink-soft); }
.cm-stats b { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--navy); }
.cm-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .cm-two { grid-template-columns: 1fr; } }
.cm-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.cm-switch input { display: none; }
.cm-switch span { width: 42px; height: 24px; border-radius: 999px; background: #C9CDD3; position: relative; transition: background .2s; }
.cm-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.cm-switch input:checked + span { background: var(--success); }
.cm-switch input:checked + span::after { left: 21px; }
.cm-switch b { font-size: .82rem; }
.cm-rule { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
/* WhatsApp inbox */
.cm-inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 600px; overflow: hidden; }
.cm-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 75vh; }
.cm-search { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.cm-search input { padding: 7px 10px; }
.cm-search select { width: auto; padding: 7px; font-size: .78rem; }
.cm-list > a { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.cm-list > a:hover, .cm-list > a.on { background: var(--cream); }
.cm-list small { display: block; font-size: .74rem; color: var(--ink-soft); }
.cm-list .cm-who { color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-list .cm-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-av { width: 38px; height: 38px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.cm-unread { background: #25D366; color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 7px; align-self: center; }
.cm-thread { display: flex; flex-direction: column; min-width: 0; max-height: 75vh; }
.cm-thead { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cm-thead small { display: block; color: var(--ink-soft); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-back { display: none; font-size: 1.2rem; }
.cm-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #EFEAE2; }
.cm-msg { max-width: 75%; padding: 8px 12px; border-radius: 10px; background: #fff; align-self: flex-start; font-size: .9rem; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; }
.cm-msg.out { align-self: flex-end; background: #D9FDD3; }
.cm-msg p { margin: 0; line-height: 1.45; }
.cm-msg i { display: block; font-style: normal; font-size: .68rem; color: var(--ink-soft); text-align: right; margin-top: 3px; }
.cm-msg .tick { color: #53BDEB; font-weight: 700; }
.cm-reply { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: flex-end; }
.cm-reply textarea { flex: 1; resize: vertical; min-height: 44px; }
.cm-warn { flex-basis: 100%; font-size: .78rem; background: #FDF0DA; color: #8A5A0E; padding: 6px 10px; border-radius: 8px; }
@media (max-width: 860px) { .cm-inbox { grid-template-columns: 1fr; } .cm-inbox.has-conv .cm-list { display: none; } .cm-inbox:not(.has-conv) .cm-thread { display: none; } .cm-back { display: inline; } .cm-list, .cm-thread { max-height: none; } }

/* ---- CBT question papers ---- */
.cp-list { display: flex; flex-direction: column; gap: 14px; }
.cp-q { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.cp-q.cp-missing { border-color: #f1b4ae; background: #fffafa; }
.cp-qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: .86rem; }
.cp-qhead b { font-family: Sora, sans-serif; color: var(--navy); }
.cp-note { font-size: .74rem; color: var(--ink-soft); background: var(--cream-deep); padding: 2px 8px; border-radius: 20px; }
.cp-marks { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; font-size: .8rem; }
.cp-marks input { width: 70px; padding: 5px 8px; }
.cp-del { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 500; font-size: .78rem; color: #b42318; }
.cp-del input, .cp-img input { width: auto; }
.cp-q textarea { width: 100%; margin-bottom: 8px; }
.cp-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; }
.cp-opt { display: flex; align-items: center; gap: 8px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-weight: 500; }
.cp-opt.on { border-color: #2e9d5b; background: #eefaf2; }
.cp-opt input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: #2e9d5b; }
.cp-opt input[type=text] { border: 0; padding: 6px 2px; background: transparent; flex: 1; min-width: 0; }
.cp-letter { font-weight: 700; color: var(--navy); width: 16px; }
.cp-img { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 8px; font-size: .8rem; }
.cp-img img { max-width: 260px; max-height: 180px; border: 1px solid var(--line); border-radius: 8px; }
.cp-imgup { margin-top: 8px; font-size: .78rem; color: var(--ink-soft); }
.cp-imgup input { width: auto; font-size: .78rem; padding: 0; border: 0; }
.cp-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 18px rgba(0,0,0,.06); }
fieldset:disabled .cp-opt input[type=text], fieldset:disabled textarea { color: var(--ink); }
.q-img { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0 10px; display: block; }


/* =====================================================================
   v22 THEME — matches the college website (blue / navy, Poppins)
   Everything above keeps working; these rules restyle it.
   ===================================================================== */
:root {
    --navy: #1E5FCB;          /* primary blue (website buttons/links) */
    --navy-mid: #174EA8;
    --navy-deep: #0F1D3A;     /* website top bar / footer navy */
    --gold: #F4A51C;          /* warm accent for secondary actions */
    --gold-light: #FFD27A;
    --cream: #F4F6FB;         /* page background */
    --cream-deep: #E9EEF8;
    --line: #E2E8F2;
    --ink: #111827;
    --ink-soft: #5B6475;
    --success: #12805C;
    --danger: #C0392B;
    --blue-soft: #E8F0FD;
    --shadow-lift: 0 10px 30px rgba(15, 29, 58, .08);
    --shadow-card: 0 1px 2px rgba(15, 29, 58, .04), 0 4px 16px rgba(15, 29, 58, .05);
    --font-display: 'Poppins', 'Sora', sans-serif;
    --font-body: 'Poppins', 'Inter', sans-serif;
    --radius: 14px;
}
body { font-size: 15px; background: var(--cream); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; color: var(--ink); }

/* ---- Sidebar ---- */
.sidebar { width: 268px; background: var(--navy-deep); padding: 0 0 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar .brand { padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 8px; position: sticky; top: 0; background: var(--navy-deep); z-index: 2; }
.sidebar .brand img { width: 44px; height: 44px; border-radius: 10px; background: #fff; padding: 2px; }
.sidebar .brand .name { font-size: .82rem; font-weight: 600; }
.sidebar .brand .tag { color: #8FB4F5; font-weight: 600; }
.sb-search { margin: 4px 14px 6px; position: relative; }
.sb-search input { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); color: #fff; font-size: .82rem; padding: 9px 12px 9px 34px; border-radius: 10px; }
.sb-search input::placeholder { color: #8291AC; }
.sb-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #8291AC; }
.sidebar nav { padding: 0 12px; }
.sidebar .section-label { display: flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 600; letter-spacing: .06em; color: #9AA8C2; padding: 11px 10px 7px; margin-top: 2px; border-radius: 8px; cursor: pointer; user-select: none; }
.sidebar .section-label:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar .section-label .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.sidebar .section-label .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .2s; opacity: .6; }
.sidebar .nav-group.closed .chev { transform: rotate(-90deg); }
.sidebar .nav-group.closed .nav-items { display: none; }
.sidebar .nav-items { padding: 2px 0 6px 18px; border-left: 1px solid rgba(255,255,255,.08); margin-left: 18px; }
.nav-link { font-size: .84rem; padding: 7px 10px; border-radius: 8px; color: #C3CEE2; position: relative; display: flex; align-items: center; gap: 6px; }
.nav-link:hover { background: rgba(255,255,255,.06); }
.nav-link.active { background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(var(--brand-rgb),.35); }
.nav-link .nav-count { margin-left: auto; background: #EF4444; color: #fff; }
.sidebar nav > a.nav-link.solo { margin: 2px 0; font-size: .88rem; padding: 10px 10px; gap: 10px; }
.sidebar-bottom { border-top: 1px solid rgba(255,255,255,.07); margin: 10px 12px 0; padding: 12px 8px 0; }
.sidebar-bottom a { color: #C3CEE2; padding: 8px 10px; border-radius: 8px; }
.sidebar-bottom a:hover { background: rgba(239,68,68,.15); color: #fff; }
.sb-hidden { display: none !important; }

/* ---- Top bar ---- */
.content { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 28px; gap: 16px; }
.topbar h1 { font-size: 1.2rem; margin: 0; }
.topbar .crumb { font-size: .74rem; color: var(--ink-soft); font-weight: 500; }
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-left > div { min-width: 0; }
.tb-left h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.menu-btn svg { width: 20px; height: 20px; }
.tb-right { display: flex; align-items: center; gap: 12px; }
.tb-icon { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.tb-icon:hover { color: var(--navy); border-color: #C9D8F3; }
.tb-icon svg { width: 19px; height: 19px; }
.tb-icon b { position: absolute; top: -5px; right: -5px; background: #EF4444; color: #fff; font-size: .64rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.tb-branch select { border-radius: 10px; }
.topbar .user-pill { position: relative; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 12px; border: 1px solid transparent; }
.topbar .user-pill:hover { border-color: var(--line); background: #fff; }
.topbar .avatar { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--navy), #4F8BEF); color: #fff; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); min-width: 210px; padding: 6px; display: none; z-index: 50; }
.user-pill.open .user-menu { display: block; }
.user-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; font-size: .86rem; color: var(--ink); }
.user-menu a:hover { background: var(--cream); }
.user-menu a.danger { color: var(--danger); }
.notif-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 8px; display: none; z-index: 50; }
.notif-wrap { position: relative; }
.notif-wrap.open .notif-pop { display: block; }
.notif-pop a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 9px; font-size: .84rem; }
.notif-pop a:hover { background: var(--cream); }
.notif-pop a i { font-style: normal; background: var(--blue-soft); color: var(--navy); font-weight: 700; border-radius: 8px; min-width: 30px; height: 30px; display: grid; place-items: center; font-size: .8rem; }
.notif-pop .empty { padding: 18px; text-align: center; color: var(--ink-soft); font-size: .85rem; }
.page-body { padding: 26px 28px 50px; flex: 1; }
.app-foot { padding: 14px 28px; font-size: .76rem; color: var(--ink-soft); border-top: 1px solid var(--line); background: #fff; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sb-backdrop { display: none; }

/* ---- Cards, panels, tables, forms, buttons ---- */
.panel { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow-card); }
.panel-head { padding: 16px 22px; gap: 10px; }
.panel-head h2 { font-size: 1rem; font-weight: 600; }
.panel-body { padding: 22px; }
.stat-card { border-radius: var(--radius); box-shadow: var(--shadow-card); }
.stat-card .label { font-size: .74rem; font-weight: 600; }
.stat-card .value { color: var(--ink); font-weight: 700; }
th { background: #F7F9FD; color: #64708A; font-weight: 600; font-size: .72rem; }
tbody tr:hover td { background: #FAFCFF; }
td { border-color: #EDF1F7; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=month],
input[type=datetime-local], input[type=time], input[type=search], input[type=url], input[type=file], select, textarea {
    border-radius: 10px; border-color: #D9E1EE; padding: 10px 13px; font-size: .9rem; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.15); }
label { font-weight: 500; color: #2B3446; }
.btn { border-radius: 10px; font-weight: 600; padding: 10px 18px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); box-shadow: 0 6px 14px rgba(var(--brand-rgb),.22); }
.btn-primary:hover { background: var(--navy-mid); }
.btn-gold { background: var(--gold); color: #1B1300; }
.btn-gold:hover { background: #F7B743; }
.btn-outline { border-color: #D9E1EE; }
.btn-outline:hover { background: var(--blue-soft); border-color: #BFD3F5; color: var(--navy); }
.btn-sm { padding: 6px 12px; border-radius: 8px; }
.badge { font-weight: 600; letter-spacing: .02em; }
.alert { border-radius: 12px; }
.alert-success { background: #E7F7F0; border-color: #BCE7D3; color: #0F6B4C; }

/* ---- Responsive shell ---- */
@media (max-width: 1024px) {
    .sidebar { position: fixed; left: -280px; top: 0; bottom: 0; z-index: 60; transition: left .22s ease; height: 100vh; }
    .sidebar.open { left: 0; box-shadow: 20px 0 40px rgba(0,0,0,.25); }
    .sb-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,29,58,.45); z-index: 55; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 10px 16px; }
    .page-body { padding: 18px 16px 40px; }
    .tb-branch label, .user-pill .who { display: none; }
}
@media (max-width: 560px) {
    .tb-branch { display: none; }
    .topbar h1 { font-size: 1.02rem; }
    .topbar .crumb { display: none; }
    .panel-body { padding: 16px; }
    .panel-head { padding: 14px 16px; flex-wrap: wrap; }
    .panel-body:has(> table), .panel-body[style*="padding:0"] { overflow-x: auto; }
    .app-foot { padding: 12px 16px; }
}

/* ---- Dashboard ---- */
.db-hero { background: linear-gradient(120deg, var(--navy-deep) 0%, var(--navy-mid) 55%, var(--navy) 100%); border-radius: 18px; color: #fff; padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; position: relative; overflow: hidden; }
.db-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.06); }
.db-hero h2 { color: #fff; font-size: 1.45rem; margin: 0 0 4px; }
.db-hero p { margin: 0; color: #C9D8F5; font-size: .9rem; }
.db-hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.db-hero .chips span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); padding: 5px 12px; border-radius: 999px; font-size: .78rem; }
.db-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.db-hero .btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.db-hero .btn-outline:hover { background: rgba(255,255,255,.2); color: #fff; }
.db-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.db-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-card); display: flex; gap: 14px; align-items: flex-start; color: inherit; transition: transform .15s, box-shadow .15s; }
a.db-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.db-stat .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.db-stat .ic svg { width: 22px; height: 22px; }
.db-stat .k { font-size: .76rem; color: var(--ink-soft); font-weight: 500; }
.db-stat .v { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.db-stat .s { font-size: .74rem; color: var(--ink-soft); margin-top: 4px; }
.db-stat .s.up { color: var(--success); } .db-stat .s.warn { color: #B45309; }
.c-blue { background: var(--blue-soft); color: var(--navy); } .c-green { background: #E6F6EF; color: #12805C; } .c-amber { background: #FEF3DC; color: #B7791F; }
.c-purple { background: #F0EBFD; color: #6D3FD8; } .c-red { background: #FDECEC; color: #C0392B; } .c-teal { background: #E3F6F8; color: #0E7C86; }
.db-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.db-grid .panel { margin-bottom: 20px; }
@media (max-width: 1100px) { .db-grid { grid-template-columns: 1fr; } }
.db-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 10px 4px 0; }
.db-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.db-chart .bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #4F8BEF, var(--navy)); border-radius: 8px 8px 3px 3px; min-height: 3px; position: relative; }
.db-chart .bar:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--navy-deep); color: #fff; font-size: .72rem; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.db-chart .lbl { font-size: .72rem; color: var(--ink-soft); }
.db-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.db-quick a { border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; font-size: .8rem; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 8px; background: #fff; transition: all .15s; }
.db-quick a:hover { border-color: #BFD3F5; background: var(--blue-soft); color: var(--navy); }
.db-quick a span { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.db-quick a svg { width: 20px; height: 20px; }
.db-todo a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid #EDF1F7; font-size: .86rem; }
.db-todo a:last-child { border-bottom: 0; }
.db-todo a b { margin-left: auto; background: var(--blue-soft); color: var(--navy); border-radius: 999px; padding: 2px 10px; font-size: .78rem; }
.db-todo a b.hot { background: #FDECEC; color: #C0392B; }
.db-todo .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.db-meter { height: 10px; border-radius: 999px; background: var(--cream-deep); overflow: hidden; margin: 8px 0 4px; }
.db-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #12805C, #34C38F); }
.db-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EDF1F7; font-size: .84rem; align-items: center; }
.db-list { list-style: none; margin: 0; padding: 0; }
.db-list li:last-child { border: 0; }
.db-list .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.db-list small { display: block; color: var(--ink-soft); font-size: .74rem; }
.db-list .av svg { width: 18px; height: 18px; }
.sb-search input[type=search] { padding: 9px 12px 9px 34px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: #fff; border-radius: 10px; font-size: .82rem; }
.sb-search input[type=search]:focus { border-color: #4F8BEF; box-shadow: 0 0 0 3px rgba(79,139,239,.25); }
.sidebar .section-label { text-transform: none; letter-spacing: 0; font-size: .86rem; font-weight: 500; color: #C3CEE2; padding: 10px 10px; }
.sidebar .nav-group:not(.closed) > .section-label { color: #fff; }
@media (max-width: 560px) {
    .tb-branch { display: none !important; }
    .db-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .db-stat { flex-direction: column; gap: 10px; padding: 14px; }
    .db-stat .v { font-size: 1.2rem; }
    .db-hero { padding: 20px; }
    .db-hero h2 { font-size: 1.2rem; }
    .db-hero .actions .btn { flex: 1; }
}
