:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --text: #17212b;
  --muted: #617080;
  --border: #dce3e8;
  --primary: #075f53;
  --primary-dark: #06483f;
  --primary-soft: #e6f4f1;
  --success: #137a47;
  --success-soft: #e8f7ef;
  --warning: #a45b00;
  --warning-soft: #fff4dd;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --info: #1769aa;
  --info-soft: #eaf4fc;
  --shadow: 0 8px 28px rgba(24, 39, 54, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar { position: sticky; z-index: 20; top: 0; min-height: 68px; display: flex; align-items: center; gap: 28px; padding: 10px max(18px, calc((100% - 1380px) / 2)); color: #fff; background: #102d2a; box-shadow: 0 3px 16px rgba(0,0,0,.16); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 760; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #113731; background: #bbf7d0; font-family: Georgia, serif; font-size: 22px; }
.main-nav { display: flex; align-items: center; gap: 5px; flex: 1; }
.main-nav a { padding: 8px 10px; color: #d9e9e6; border-radius: 8px; font-size: 14px; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.main-nav a[aria-current="page"] { color: #fff; background: rgba(187,247,208,.13); }
.badge { display: inline-grid; min-width: 19px; height: 19px; margin-left: 5px; padding: 0 5px; place-items: center; border-radius: 10px; color: #173a34; background: #bbf7d0; font-size: 11px; font-weight: 800; }
.nav-toggle { display: none; margin-left: auto; color: #fff; background: transparent; border: 0; font-size: 24px; }
.utility-nav { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; }
.icon-button { position: relative; display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; color: #d9e9e6; background: transparent; border: 1px solid transparent; border-radius: 10px; }
.icon-button:hover, .icon-button:focus-visible, .icon-button[aria-current="page"], .settings-menu.open > .settings-toggle { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.08); text-decoration: none; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-badge { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; margin: 0; padding: 0 5px; box-shadow: 0 0 0 2px #102d2a; }
.settings-menu { position: relative; }
.settings-dropdown { position: absolute; z-index: 40; top: calc(100% + 9px); right: 0; width: min(350px, calc(100vw - 24px)); max-height: calc(100vh - 88px); overflow-y: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(7,35,31,.24); opacity: 0; visibility: hidden; transform: translateY(-7px); pointer-events: none; transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.settings-menu.open:not(.force-closed) .settings-dropdown, .settings-menu:focus-within:not(.force-closed) .settings-dropdown { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.settings-user { display: grid; gap: 2px; padding: 17px 18px; background: var(--primary-soft); border-bottom: 1px solid #cfe4df; }
.settings-user strong { font-size: 15px; overflow-wrap: anywhere; }
.settings-user span, .settings-user small { color: var(--muted); overflow-wrap: anywhere; }
.settings-user span { font-size: 12px; }
.settings-user small { margin-top: 3px; font-size: 11px; }
.settings-section { display: grid; padding: 8px; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: 0; }
.settings-section-title { padding: 6px 10px 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.settings-link { display: flex; min-height: 42px; align-items: center; width: 100%; padding: 9px 10px; color: var(--text); background: transparent; border: 0; border-radius: 8px; font-size: 13px; font-weight: 650; text-align: left; }
.settings-link:hover, .settings-link:focus-visible { color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.settings-footer { background: var(--surface-soft); }
.settings-footer form { margin: 0; }
.settings-logout { cursor: pointer; }

@media (hover: hover) and (pointer: fine) {
  .settings-menu:not(.force-closed):hover .settings-dropdown { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
}

.container { width: min(1380px, calc(100% - 36px)); margin: 0 auto; padding: 32px 0 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 2px 0 3px; font-size: clamp(25px, 4vw, 34px); line-height: 1.12; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.page-heading .back-link { display: block; width: fit-content; }
.heading-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); }

.page-card, .filter-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-card { padding: 22px; }
.page-card h2 { margin: 0 0 16px; font-size: 18px; letter-spacing: -.02em; }
.filter-card { margin-bottom: 20px; padding: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; }
.section-heading a { font-size: 13px; font-weight: 700; }
.narrow { max-width: 720px; margin: 30px auto; }

.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 720; line-height: 1.2; text-decoration: none; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { color: #fff; background: var(--primary-dark); }
.btn-secondary { color: #263440; background: #fff; border-color: #cbd5dc; }
.btn-secondary:hover { color: var(--text); background: #f4f7f8; }
.btn-success { color: #fff; background: var(--success); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger-outline { color: var(--danger); background: #fff; border-color: #eab5b0; }
.btn:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.btn-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.text-link { font-weight: 680; }
.center { text-align: center; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { min-height: 116px; padding: 20px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 650; }
.stat-card strong { display: block; margin-top: 8px; font-size: 31px; line-height: 1; }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: #e09819; }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; align-items: start; }
.report-grid { grid-template-columns: 1fr 1fr; }

.dashboard-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 26px 28px; color: #fff; background: linear-gradient(120deg, #064e43, var(--primary)); border-radius: var(--radius); box-shadow: var(--shadow); }
.dashboard-hero .eyebrow { color: #bce8df; }
.dashboard-hero h1 { margin: 4px 0 7px; color: inherit; }
.dashboard-hero p { max-width: 680px; margin: 0; color: #d9f1ec; }
.dashboard-hero .btn { flex: 0 0 auto; color: var(--primary); background: #fff; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.dashboard-metric { min-width: 0; padding: 16px 18px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); }
.dashboard-metric:hover { text-decoration: none; border-color: var(--primary); }
.dashboard-metric span, .dashboard-metric small { display: block; color: var(--muted); }
.dashboard-metric span { font-size: 13px; font-weight: 750; }
.dashboard-metric strong { display: block; margin: 7px 0 3px; font-size: 29px; line-height: 1; }
.dashboard-metric small { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-metric.warning { border-top-color: #e09819; }
.dashboard-metric.info { border-top-color: var(--info); }
.dashboard-metric.success { border-top-color: var(--success); }
.dashboard-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, .9fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.dashboard-workspace-secondary { grid-template-columns: minmax(0, 1.35fr) minmax(285px, 1fr); }
.dashboard-side-stack { display: grid; gap: 20px; }
.dashboard-primary-card, .dashboard-notifications-card, .dashboard-admissions-card, .dashboard-actions-card { min-width: 0; }
.section-heading > div { min-width: 0; }
.section-description { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-process-list, .dashboard-approval-list, .compact-process-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.dashboard-process-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 13px; color: var(--text); border: 1px solid var(--border); border-radius: 9px; }
.dashboard-process-row:hover { color: var(--text); text-decoration: none; background: var(--primary-soft); border-color: #a9d7ce; }
.dashboard-process-row > div { min-width: 0; max-width: 100%; }
.dashboard-process-row strong, .dashboard-process-row span, .dashboard-process-row small { display: block; }
.dashboard-process-row span:not(.status), .dashboard-process-row small { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-process-row > div:last-child { display: grid; justify-items: end; gap: 5px; }
.compact-process-list a { display: grid; gap: 3px; padding: 10px 0; color: var(--text); border-bottom: 1px solid var(--border); }
.compact-process-list a:last-child { padding-bottom: 0; border-bottom: 0; }
.compact-process-list a:hover { color: var(--primary); text-decoration: none; }
.compact-process-list span { color: var(--muted); font-size: 13px; }
.count-badge { display: inline-grid; min-width: 27px; min-height: 27px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 999px; font-size: 13px; font-weight: 800; }
.dashboard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dashboard-actions a { display: flex; align-items: center; min-height: 52px; padding: 10px 12px; color: var(--primary); background: var(--primary-soft); border-radius: 9px; font-size: 13px; font-weight: 750; }
.dashboard-actions a:hover { color: #fff; text-decoration: none; background: var(--primary); }

.list-cards { display: grid; gap: 9px; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.list-card:hover { border-color: #8dbbb4; box-shadow: 0 4px 14px rgba(7,95,83,.08); text-decoration: none; }
.list-card div { display: grid; min-width: 0; }
.list-card span, .list-card small { color: var(--muted); }
.list-card .status, .list-card .btn { color: inherit; }
.list-card.prominent { padding: 17px; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-links a { padding: 13px; background: var(--primary-soft); border-radius: 9px; font-weight: 700; }

.simple-table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: #536270; font-size: 11px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
th, td { padding: 12px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); margin-top: 2px; }
.table-card { padding: 7px 12px 14px; }
.interactive-table-hint { margin: 11px 0 5px; color: var(--muted); font-size: 12px; }
th[data-sortable] { cursor: pointer; user-select: none; }
th[data-sortable]:focus-visible { outline: 3px solid rgba(7,95,83,.28); outline-offset: -3px; }
th[data-sortable]::after { display: inline-block; margin-left: 6px; color: #82919c; content: "↕"; font-size: 12px; }
th[data-sortable][aria-sort="ascending"]::after { color: var(--primary); content: "▲"; }
th[data-sortable][aria-sort="descending"]::after { color: var(--primary); content: "▼"; }
th[draggable="true"] { cursor: grab; }
th[draggable="true"].column-dragging { opacity: .45; }
th[draggable="true"].column-drop-before { box-shadow: inset 3px 0 var(--primary); }
th[draggable="true"].column-drop-after { box-shadow: inset -3px 0 var(--primary); }

.status { display: inline-flex; width: fit-content; max-width: 240px; align-items: center; padding: 4px 8px; color: #4c5964; background: #edf1f3; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.25; }
.status-in_test { color: #6f4600; background: var(--warning-soft); }
.status-awaiting_test, .status-awaiting_manager, .status-awaiting_director { color: #155482; background: var(--info-soft); }
.status-admission { color: #5f3d91; background: #f2ecfb; }
.status-admitted { color: var(--success); background: var(--success-soft); }
.status-rejected { color: var(--danger); background: var(--danger-soft); }
.status-withdrawn { color: #7e4c13; background: #f9ecdc; }

.form-grid, .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field label, form > div > label { color: #3e4b57; font-size: 13px; font-weight: 700; }
.field label span { color: var(--danger); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--text); background: #fff; border: 1px solid #bcc8d0; border-radius: 8px; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7,95,83,.11); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
.field ul, .errorlist { margin: 0; padding: 0; list-style: none; }
.approval-scope-field[hidden] { display: none; }
.approval-scope-field ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.approval-scope-field ul label, .approval-scope-field [id^="id_approved_companies"] > div > label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 11px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; }
.approval-scope-field [id^="id_approved_companies"] { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.approval-scope-field > input[type="checkbox"] { width: 20px; height: 20px; }
.field .errorlist, .form-errors { color: var(--danger); font-size: 12px; font-weight: 650; }
.field small { color: var(--muted); }
.full { grid-column: 1 / -1; }
.form-actions, .filter-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 7px; }
.table-actions form, .confirmation-card .form-actions form { margin: 0; }
.table-card .table-actions > form { display: inline-flex; }
.table-card .table-actions .btn { min-height: 44px; }
.current-account-label { align-self: center; padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filter-actions { align-self: end; }
.stack-form { display: grid; gap: 16px; }
.stack-form > div { display: grid; gap: 6px; }
.stack-form ul:not(.errorlist) { display: flex; gap: 18px; margin: 4px 0; padding: 0; list-style: none; }
.stack-form ul label { display: flex; align-items: center; gap: 6px; }

.alert { margin-bottom: 14px; padding: 11px 14px; border-radius: 9px; font-size: 13px; }
.alert-success { color: var(--success); background: var(--success-soft); border: 1px solid #aedcc3; }
.alert-error, .alert-danger { color: var(--danger); background: var(--danger-soft); border: 1px solid #edc0bc; }
.alert-warning { color: #754900; background: var(--warning-soft); border: 1px solid #efd89f; }
.alert-info { color: #174f79; background: var(--info-soft); border: 1px solid #c1ddf1; }
.muted { color: var(--muted); }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.candidate-delete-unavailable { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.candidate-delete-unavailable small { color: var(--muted); font-size: 11px; }
.pcd-cid-panel { padding: 13px; border: 1px solid #cbd5dc; border-radius: 9px; background: #f8fafc; }
.pcd-cid-panel strong { display: block; color: var(--primary-dark); margin-bottom: 8px; }
.warning-text { display: block; margin-top: 5px; color: #9a5a00 !important; font-weight: 700; }
.checkbox-list ul { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.checkbox-list label { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); font-weight: 650; }
.checkbox-list input { width: auto; }
.empty-inline { padding: 20px; color: var(--muted); text-align: center; background: var(--surface-soft); border-radius: 9px; }
.empty-state { padding: 45px 20px; text-align: center; }
.empty-state h2 { margin: 0 0 5px; }
.empty-state p { color: var(--muted); }

.auth-shell { min-height: calc(100vh - 64px); display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 55px rgba(21,43,39,.12); }
.auth-card h1 { margin: 26px 0 2px; font-size: 27px; }
.auth-brand { color: #173b36; }
.profile-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 20px; align-items: start; max-width: 980px; }
.profile-summary { position: sticky; top: 92px; }
.profile-summary dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.profile-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; }
.guide-layout { display: grid; max-width: 1120px; gap: 20px; margin: 0 auto; }
.guide-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 24px; align-items: center; }
.guide-hero h1 { margin: 3px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.guide-hero p { margin: 0; color: var(--muted); }
.guide-hero-note { display: grid; gap: 5px; padding: 17px; background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: 8px; }
.guide-hero-note span { color: #315d57; }
.guide-role-grid, .guide-admission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.guide-role, .guide-admission-grid > div { min-width: 0; padding: 14px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.guide-role h3 { margin: 0 0 5px; font-size: 14px; }
.guide-role p, .guide-admission-grid span { margin: 0; color: var(--muted); font-size: 13px; }
.guide-admission-grid > div { display: grid; gap: 4px; }
.guide-flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.guide-flow li { position: relative; display: grid; min-width: 0; gap: 9px; align-content: start; justify-items: center; padding: 13px 8px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; text-align: center; }
.guide-flow li::after { position: absolute; z-index: 1; top: 25px; right: -17px; width: 18px; color: var(--primary); content: "→"; font-size: 18px; font-weight: 800; }
.guide-flow li:last-child::after { display: none; }
.guide-flow-number { display: grid; width: 30px; height: 30px; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-size: 12px; font-weight: 800; }
.guide-flow strong, .guide-flow small { display: block; overflow-wrap: anywhere; }
.guide-flow strong { font-size: 13px; }
.guide-flow small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.guide-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.guide-outcomes div { display: grid; gap: 3px; padding: 12px 14px; border-left: 4px solid var(--border); background: var(--surface-soft); border-radius: 7px; }
.guide-outcomes div:nth-child(1) { border-left-color: var(--danger); }
.guide-outcomes div:nth-child(2) { border-left-color: var(--warning); }
.guide-outcomes div:nth-child(3) { border-left-color: var(--success); }
.guide-outcomes span { color: var(--muted); font-size: 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.guide-list { display: grid; gap: 10px; margin: 0; padding-left: 20px; }
.guide-list li { padding-left: 2px; }
.guide-faq { display: grid; gap: 8px; }
.guide-faq details { padding: 11px 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; }
.guide-faq summary { cursor: pointer; color: var(--primary); font-weight: 750; }
.guide-faq p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.monthly-withdrawals-card { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, .8fr) auto auto; gap: 20px; align-items: end; margin: 20px 0; }
.monthly-withdrawals-card h2, .monthly-withdrawals-card p { margin-bottom: 4px; }
.monthly-report-form { display: flex; align-items: end; gap: 10px; }
.monthly-report-result { display: grid; justify-items: center; min-width: 115px; padding: 9px 16px; background: var(--surface-soft); border-radius: 10px; }
.monthly-report-result strong { font-size: 28px; line-height: 1; }
.monthly-report-result span, .monthly-report-result small { color: var(--muted); font-size: 11px; text-transform: capitalize; }

.process-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.main-column, .side-column { display: grid; gap: 20px; }
.action-group, .stack-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.stack-actions { display: grid; }
.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.data-grid div, .detail-list div { min-width: 0; }
dt { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.detail-list { display: grid; gap: 14px; margin: 0; }
.note-box { margin-top: 18px; padding: 14px; background: var(--surface-soft); border-left: 3px solid #9aafa9; border-radius: 6px; }
.note-box p { margin: 5px 0 0; }

.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; display: grid; justify-items: center; gap: 7px; color: var(--muted); text-align: center; }
.stepper li::after { position: absolute; z-index: 0; top: 15px; left: calc(50% + 17px); width: calc(100% - 28px); height: 2px; content: ""; background: var(--border); }
.stepper li:last-child::after { display: none; }
.stepper li > span { z-index: 1; display: grid; width: 31px; height: 31px; place-items: center; background: #e9eef1; border: 2px solid #d1dade; border-radius: 50%; font-size: 12px; font-weight: 800; }
.stepper li.done > span { color: #fff; background: var(--success); border-color: var(--success); }
.stepper li.done::after { background: #83c7a3; }
.stepper li.active > span { color: #fff; background: var(--info); border-color: var(--info); box-shadow: 0 0 0 4px var(--info-soft); }
.stepper strong { display: block; font-size: 12px; }
.stepper small { display: block; font-size: 10px; line-height: 1.25; }

.timeline { position: relative; display: grid; gap: 18px; margin-left: 6px; padding-left: 20px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; top: 4px; left: -27px; width: 12px; height: 12px; background: var(--primary); border: 3px solid #d8eee9; border-radius: 50%; }
.timeline-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.timeline-title span { color: var(--muted); font-size: 12px; }
.timeline p { margin: 2px 0; color: var(--muted); font-size: 13px; }
.timeline blockquote { margin: 8px 0; padding: 9px 12px; background: var(--surface-soft); border-left: 3px solid #a4b3bb; }
.timeline-item.invalid { opacity: .7; }
.timeline-item.invalid .timeline-dot { background: #8c959c; border-color: #e4e8eb; }
.invalid-note { margin-top: 7px; padding: 7px 9px; color: var(--danger); background: var(--danger-soft); border-radius: 6px; font-size: 12px; }
.timeline.compact { gap: 13px; }

.notification-list { display: grid; gap: 8px; }
.notification-list form, .notification-bulk-actions form, .notification-actions form { margin: 0; }
.notification-management { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 18px; padding: 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.notification-management p { margin: 0; color: var(--muted); font-size: 13px; }
.notification-management p strong { color: var(--text); }
.notification-bulk-actions, .notification-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notification-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; color: var(--text); text-align: left; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; }
.notification-item.unread { background: var(--primary-soft); border-color: #a9d2cb; }
.notification-item strong, .notification-item span, .notification-item small { display: block; }
.notification-item span { color: var(--muted); }
.notification-copy { display: grid; gap: 2px; }
.notification-meta { display: grid; justify-items: end; gap: 9px; }
.email-state { flex: 0 0 auto; padding: 4px 7px; border-radius: 12px; font-size: 11px; }
.email-sent { color: var(--success) !important; background: var(--success-soft); }
.email-failed { color: var(--danger) !important; background: var(--danger-soft); }

.admission-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.check-state { display: grid; justify-items: center; gap: 3px; padding: 15px 8px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; text-align: center; }
.check-state > span { display: grid; width: 28px; height: 28px; place-items: center; color: #fff; background: #8b989f; border-radius: 50%; font-weight: 800; }
.check-state.done { color: var(--success); background: var(--success-soft); border-color: #acd7c0; }
.check-state.done > span { background: var(--success); }
.check-state small { font-size: 11px; }
.metric-list { margin: 0; padding: 0; list-style: none; }
.metric-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); }
.pagination { display: flex; justify-content: center; gap: 16px; padding: 17px 0 5px; color: var(--muted); font-size: 13px; }

.print-container { width: min(1000px, calc(100% - 32px)); }
.print-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 18px; }
.paper { min-height: 297mm; padding: 16mm; background: #fff; border: 1px solid #ccd2d6; box-shadow: var(--shadow); }
.paper header { margin-bottom: 16px; text-align: center; }
.paper header span { color: var(--primary); font-weight: 800; }
.paper header h1 { margin: 4px 0; font-size: 21px; }
.form-table { border: 1px solid #69747b; }
.form-table th, .form-table td { padding: 8px; border: 1px solid #89949a; overflow-wrap: anywhere; }
.form-table th { width: 22%; color: var(--text); background: #eef1f2; font-size: 11px; text-transform: none; }
.large-cell { min-height: 80px; height: 80px; vertical-align: top; }
.authorization-notes { min-height: 44px; height: 44px; }
.authorization-signatures { break-inside: avoid; margin-top: 18px; }
.authorization-signatures h2 { margin: 0; color: var(--text); font-size: 13px; text-align: center; text-transform: uppercase; }
.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 12px; text-align: center; }
.signature-line { display: flex; min-height: 58px; align-items: end; justify-content: center; padding-bottom: 5px; border-bottom: 1px solid #333; font-size: 11px; }
.signature-grid strong { display: block; margin-top: 5px; font-size: 12px; }
.signature-grid small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.signature-grid .digital-confirmation { font-size: 10px; }

@media (max-width: 1050px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .nav-toggle { display: block; width: 44px; min-height: 44px; }
  .main-nav { display: none; order: 4; width: 100%; flex-direction: column; align-items: stretch; }
  .main-nav.open { display: flex; }
  .utility-nav { margin-left: 0; }
  .process-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-summary { position: static; }
  .guide-role-grid, .guide-admission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-flow li:nth-child(3)::after { display: none; }
  .settings-link { min-height: 44px; }
  .monthly-withdrawals-card { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 22px, 1380px); padding-top: 20px; }
  .topbar { padding-inline: 12px; }
  .brand > span:last-child { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading > .btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .dashboard-workspace, .dashboard-workspace-secondary, .report-grid { grid-template-columns: 1fr; }
  .dashboard-hero { align-items: stretch; flex-direction: column; padding: 22px; }
  .dashboard-hero .btn { width: 100%; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .form-grid, .filter-grid { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr 1fr; }
  .side-column { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: 1fr; justify-items: start; }
  .stepper li { width: 100%; grid-template-columns: 35px 1fr; justify-items: start; text-align: left; }
  .stepper li::after { top: 33px; left: 15px; width: 2px; height: calc(100% - 19px); }
  .guide-hero, .guide-grid { grid-template-columns: 1fr; }
  .guide-flow { grid-template-columns: 1fr; }
  .guide-flow li { grid-template-columns: 30px minmax(0, 1fr); align-items: start; justify-items: start; text-align: left; }
  .guide-flow li::after, .guide-flow li:nth-child(3)::after { display: block; top: auto; right: auto; bottom: -18px; left: 15px; width: auto; content: "↓"; }
  .guide-flow li:last-child::after { display: none; }
  .guide-outcomes { grid-template-columns: 1fr; }
  .admission-progress { grid-template-columns: 1fr 1fr; }
  .monthly-withdrawals-card { grid-template-columns: 1fr; align-items: stretch; }
  .monthly-report-form { align-items: stretch; flex-direction: column; }
  .notification-management { align-items: stretch; }
  .notification-bulk-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .notification-bulk-actions form, .notification-bulk-actions .btn { width: 100%; }
  .notification-item { align-items: start; flex-direction: column; }
  .notification-meta { width: 100%; justify-items: start; }
  .notification-actions { width: 100%; }
  .notification-actions form, .notification-actions .btn { flex: 1 1 132px; }
  .btn { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; }
  .main-nav a, .settings-link { min-height: 44px; }
  .settings-dropdown { right: -1px; max-height: calc(100vh - 76px); }
  .report-process-table, .report-process-table tbody, .report-process-table tr, .report-process-table td { display: block; width: 100%; }
  .report-process-table thead { display: none; }
  .report-process-table tbody { display: grid; gap: 12px; padding: 10px 0; }
  .report-process-table tr { padding: 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
  .report-process-table td { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
  .report-process-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
  .report-process-table td:last-child { border-bottom: 0; }
  .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
  .user-table thead { display: none; }
  .user-table tbody { display: grid; gap: 12px; padding: 10px 0; }
  .user-table tr { padding: 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
  .user-table td { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
  .user-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
  .user-table td.table-actions { display: block; padding: 12px 0 0; border-bottom: 0; }
  .user-table td.table-actions::before { display: none; }
  .user-table .btn { width: 100%; }
  .paper { padding: 8mm; }
  .print-toolbar { flex-wrap: wrap; justify-content: stretch; }
  .print-toolbar .btn { flex: 1 1 140px; min-height: 44px; }
}

@media (max-width: 460px) {
  .stats-grid, .dashboard-metrics, .data-grid, .admission-progress, .quick-links, .dashboard-actions { grid-template-columns: 1fr; }
  .dashboard-process-row { align-items: start; flex-direction: column; }
  .dashboard-process-row > div:last-child { justify-items: start; }
  .guide-role-grid, .guide-admission-grid { grid-template-columns: 1fr; }
  .page-card { padding: 17px; }
  .auth-card { padding: 24px 19px; }
  .action-group .btn, .form-actions .btn { width: 100%; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body, html { background: #fff; }
  .topbar, .messages, .print-toolbar { display: none !important; }
  .container, .print-container { width: 100%; margin: 0; padding: 0; }
  .paper { min-height: 0; padding: 0; border: 0; box-shadow: none; }
  .form-table { font-size: 10pt; }
  .form-table th, .form-table td { padding: 5px; }
  .authorization-signatures { margin-top: 12px; }
}
