/* =====================================================================
   GRD Uttarakhand University — ARMS design system
   Brand: GRD logo navy #1B4175 · GRD logo saffron gold #F7B418
   (accent = gold; red is kept only for warnings / errors / withdrawn)
   ===================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy-950: #0b1d36;
  --navy-900: #0f2747;
  --navy-800: #15335e;
  --navy-700: #1b4175;   /* brand — logo navy */
  --navy-600: #24569a;
  --navy-500: #3a70b5;
  --navy-200: #c6d5ea;
  --navy-100: #e2ebf6;
  --navy-50:  #f1f5fb;
  --gold-500: #f7b418;   /* brand accent — logo saffron */
  --gold-600: #e2a10c;
  --gold-700: #8a5f00;   /* gold text on white */
  --gold-50:  #fef6df;
  --red-600:  #d6331f;   /* warnings / errors only */
  --red-700:  #b42617;
  --red-50:   #fdeeec;

  --ink:    #16233a;
  --ink-2:  #3e4a60;
  --muted:  #637089;
  --line:   #e0e6ef;
  --line-2: #edf1f6;
  --bg:     #f3f6fa;
  --card:   #ffffff;

  --ok:     #11815a;  --ok-50:   #e6f5ee;
  --warn:   #a8650b;  --warn-50: #fdf3e2;
  --bad:    #c62818;  --bad-50:  #fdeeec;
  --info:   #1f5fd1;  --info-50: #e9f0fd;
  --teal:   #0b7285;  --teal-50: #e3f4f7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 39, 71, .05), 0 1px 1px rgba(15, 39, 71, .03);
  --shadow-lg: 0 12px 32px rgba(15, 39, 71, .14);
  --sidebar-w: 260px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); font-feature-settings: "cv11", "ss01"; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--navy-700); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
img { max-width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--navy-50); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%); color: #d5dfec; padding: 18px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px; color: #fff; }
.brand:hover { text-decoration: none; color: #fff; }
/* official GRD logo on a white plate (its navy lettering needs a light background) */
.brand-plate { display: block; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.brand-plate img { display: block; width: 100%; max-width: 190px; height: auto; margin: 0 auto; }
.brand-mark { width: 50px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.brand-mark img { width: 40px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: .1px; }
.brand-text span { font-size: 11.5px; letter-spacing: 2.4px; text-transform: uppercase; color: #b2c3db; font-weight: 600; }
.brand-sub { margin: 14px 6px 10px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.06); font-size: 12px; color: #c2d0e3; border-left: 3px solid var(--gold-500); }
.nav { flex: 1; }
.nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: #8ca4c4; margin: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; color: #d4deeb; font-weight: 500; position: relative; }
.nav-link i { font-size: 16px; width: 18px; text-align: center; color: #a5b9d5; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold-500); }
.nav-link.active i { color: #fff; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--gold-500); color: var(--navy-900); border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { font-size: 11px; color: #7d95b6; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.08); margin-top: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 28px;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.search input[type=search] { width: 100%; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; color: var(--ink); }
.search input[type=search]:focus { outline: none; border-color: var(--navy-500); background: #fff; box-shadow: 0 0 0 3px var(--navy-100); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.session-switch, .session-pill { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--navy-200); border-radius: 999px; background: var(--navy-50); color: var(--navy-700); font-weight: 600; font-size: 13px; }
.session-switch select { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding-right: 2px; }
.session-switch select:focus { outline: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; }
.user-meta small { font-size: 11.5px; color: var(--muted); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.user-menu .menu a, .user-menu .menu button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--bg); text-decoration: none; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; cursor: pointer; font-size: 18px; color: var(--ink); }

.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs i { font-size: 10px; }
.crumbs a { color: var(--muted); }
.scrim { display: none; }

/* ------------------------------------------------------------ cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h h2, .card-h h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h h2 i, .card-h h3 i { color: var(--navy-500); }
.card-h .muted { font-size: 12.5px; }
.card-b { padding: 18px; }
.card-b.tight { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ------------------------------------------------------------ KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; gap: 12px; align-items: center; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--navy-200); box-shadow: 0 4px 14px rgba(15,39,71,.08); }
.kpi-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; flex: none; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-body span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-body strong { font-size: 24px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-body small { font-size: 12px; color: var(--muted); }
.kpi-navy .kpi-icon { background: var(--navy-100); color: var(--navy-700); }
.kpi-blue .kpi-icon { background: var(--info-50); color: var(--info); }
.kpi-amber .kpi-icon { background: var(--warn-50); color: var(--warn); }
.kpi-green .kpi-icon { background: var(--ok-50); color: var(--ok); }
.kpi-teal .kpi-icon { background: var(--teal-50); color: var(--teal); }
.kpi-red .kpi-icon { background: var(--red-50); color: var(--red-600); }

/* ------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.stage-application  { background: var(--info-50); color: var(--info); border-color: #cfdcf8; }
.stage-registration { background: var(--warn-50); color: var(--warn); border-color: #f3dfb8; }
.stage-admission    { background: var(--ok-50); color: var(--ok); border-color: #bfe4d2; }
.stage-reported     { background: var(--navy-100); color: var(--navy-700); border-color: var(--navy-200); }
.stage-withdrawn    { background: var(--bad-50); color: var(--bad); border-color: #f5cbc5; }
.tone-ok   { background: var(--ok-50); color: var(--ok); }
.tone-warn { background: var(--warn-50); color: var(--warn); }
.tone-bad  { background: var(--bad-50); color: var(--bad); }
.tone-info { background: var(--info-50); color: var(--info); }
.tone-mute { background: #edf1f6; color: var(--muted); }
.tone-navy { background: var(--navy-100); color: var(--navy-700); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--navy-100); }
.btn-primary { background: var(--navy-700); color: #fff; }
.btn-primary:hover { background: var(--navy-800); color: #fff; }
.btn-accent { background: var(--gold-500); color: var(--navy-900); }
.btn-accent:hover { background: var(--gold-600); color: var(--navy-900); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--navy-600); }
.btn-ghost:hover { background: var(--navy-50); }
.btn-danger { background: #fff; border-color: #f1c4be; color: var(--bad); }
.btn-danger:hover { background: var(--bad-50); color: var(--bad); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #0c6a49; color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.inline-form { display: inline; }
/* student documents */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 14px 18px 18px; }
.doc-tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.doc-thumb { height: 130px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-600); font-size: 42px; }
.doc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.doc-meta { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.doc-meta small { color: var(--muted); font-size: 11.5px; }
.doc-actions { display: flex; justify-content: flex-end; gap: 2px; padding: 0 6px 6px; }
.avatar-photo { object-fit: cover; padding: 0; background: var(--navy-50); }

/* ------------------------------------------------------------ forms */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid > .field { grid-column: span 4; }
.form-grid > .field.w2 { grid-column: span 2; }
.form-grid > .field.w3 { grid-column: span 3; }
.form-grid > .field.w4 { grid-column: span 4; }
.form-grid > .field.w6 { grid-column: span 6; }
.form-grid > .field.w8 { grid-column: span 8; }
.form-grid > .field.w12, .form-grid > .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .label .req { color: var(--red-600); }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], input[type=search], input:not([type]), select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid #d3dae5; border-radius: 9px; background: #fff; font: inherit; color: var(--ink);
}
textarea { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236d6b86' d='M1.6 5.1a.8.8 0 0 1 1.1 0L8 10.3l5.3-5.2a.8.8 0 1 1 1.1 1.1l-5.8 5.8a.8.8 0 0 1-1.1 0L1.6 6.2a.8.8 0 0 1 0-1.1z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px var(--navy-100); }
input[readonly], input:disabled, select:disabled { background: var(--bg); color: var(--ink-2); }
input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy-700); }
.check.is-disabled { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg label:last-child { border-right: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--navy-500); }
.seg label:has(input:checked) { background: var(--navy-700); color: #fff; }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--navy-600); grid-column: 1 / -1; margin-top: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }

/* ------------------------------------------------------------ filters toolbar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 150px; flex: 1; max-width: 220px; }
.filters .field.grow { max-width: 320px; flex: 2; }
.filters .btns { display: flex; gap: 8px; margin-left: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.chip:hover { text-decoration: none; border-color: var(--navy-200); color: var(--navy-700); }
.chip.on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.chip em { font-style: normal; font-weight: 700; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.06); }
.chip.on em { background: rgba(255,255,255,.2); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #f7f9fd; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 700; background: #f8fafc; border-top: 1px solid var(--line); }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who > div { min-width: 170px; }
.table .who strong, .table .who a.row-link { display: block; font-weight: 600; color: var(--ink); }
.table .who small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.table a.row-link { color: var(--ink); font-weight: 600; }
.table .actions { text-align: right; white-space: nowrap; }
.table .group-row td { background: var(--navy-50); font-weight: 700; color: var(--navy-700); font-size: 12.5px; letter-spacing: .3px; }
.table .sub { font-size: 12px; color: var(--muted); }
.av-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700); display: grid; place-items: center; font-weight: 700; font-size: 11.5px; flex: none; }

/* ------------------------------------------------------------ definition lists */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.dl.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl div { min-width: 0; }
.dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ student header & tabs */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 20px; flex-wrap: wrap; }
.profile-head .avatar-lg { width: 60px; height: 60px; border-radius: 16px; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.profile-head h2 { font-size: 20px; font-weight: 700; }
.profile-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0 20px 20px; }
.pipe-step { position: relative; padding: 10px 12px 10px 38px; border-top: 3px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pipe-step::before { content: ""; position: absolute; left: 10px; top: 12px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.pipe-step small { display: block; font-weight: 500; font-size: 11.5px; }
.pipe-step.done { border-top-color: var(--ok); color: var(--ink); }
.pipe-step.done::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
.pipe-step.now { border-top-color: var(--navy-700); color: var(--navy-700); }
.pipe-step.now::before { border-color: var(--navy-700); background: var(--navy-700); box-shadow: inset 0 0 0 3px #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--navy-700); text-decoration: none; }
.tabs a.on { color: var(--navy-700); border-bottom-color: var(--gold-500); }
.tabs a em { font-style: normal; font-size: 11px; background: var(--navy-100); color: var(--navy-700); padding: 0 6px; border-radius: 999px; }

/* ------------------------------------------------------------ alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 13.5px; }
.alert > i { font-size: 16px; margin-top: 1px; }
.alert > div { flex: 1; }
.alert-success { background: var(--ok-50); border-color: #bfe4d2; color: #0b5c40; }
.alert-error   { background: var(--bad-50); border-color: #f5cbc5; color: #8d1d11; }
.alert-info    { background: var(--info-50); border-color: #cfdcf8; color: #17459a; }
.alert-warn    { background: var(--warn-50); border-color: #f3dfb8; color: #7a4a08; }
.alert-x { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------ empty */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty > i { font-size: 34px; color: var(--navy-200); display: block; margin-bottom: 10px; }
.empty h3 { font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.empty p { margin: 0 0 14px; }

/* ------------------------------------------------------------ bars & charts */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: grid; grid-template-columns: minmax(120px, 1.2fr) 3fr auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-item .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--navy-50); border-radius: 999px; overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: var(--navy-600); }
.bar-fill.f-app { background: #6d9cf0; }
.bar-fill.f-reg { background: #e3a53b; }
.bar-fill.f-adm { background: #1f9a6c; }
.bar-fill.f-rep { background: var(--navy-700); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.funnel-bar { height: 30px; border-radius: 7px; display: flex; align-items: center; padding: 0 10px; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; }
.trend { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.trend .col b { width: 100%; max-width: 22px; border-radius: 4px 4px 0 0; background: var(--navy-600); min-height: 2px; }
.trend .col b.today { background: var(--gold-500); }
.trend .col span { font-size: 10px; color: var(--muted); }
.progress { height: 8px; background: var(--navy-50); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress > b { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.progress.warn > b { background: #e3a53b; }
.progress.bad > b { background: var(--red-600); }

/* ------------------------------------------------------------ fee breakdown */
.fee-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fee-table th, .fee-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.fee-table th { background: #f8fafc; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: right; }
.fee-table th:first-child, .fee-table td:first-child { text-align: left; }
.fee-table td { text-align: right; font-variant-numeric: tabular-nums; }
.fee-table tr.minus td { color: var(--ok); }
.fee-table tr.total td { font-weight: 700; background: var(--navy-50); color: var(--navy-800); }
.fee-table tr.sub td { color: var(--muted); font-size: 12px; }
.fee-table tr.part td { color: var(--muted); font-size: 12px; padding-top: 3px; padding-bottom: 3px; }
.fee-table tr.part .part-l { padding-left: 12px; display: inline-block; }
.fee-table .yr-short { display: none; }
.swipe-hint { display: none; font-size: 12px; color: var(--muted); padding: 6px 12px 0; }
.swipe-hint.on { display: block; }
@media (max-width: 520px) {
  /* phones: compact fee table so all years fit; "Yr 1" instead of "First year" */
  .fee-table { font-size: 11.5px; }
  .fee-table th, .fee-table td { padding: 7px 4px; }
  .fee-table th { letter-spacing: 0; font-size: 10.5px; }
  .fee-table th:first-child, .fee-table td:first-child { padding-left: 10px; }
  .fee-table td:last-child, .fee-table th:last-child { padding-right: 10px; }
  .fee-table .yr-long { display: none; }
  .fee-table .yr-short { display: inline; }
  .fee-table tr.part td, .fee-table tr.sub td { font-size: 11px; }
  .fee-table tr.part .part-l { padding-left: 6px; }
}
.summary-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary-box div { background: var(--navy-50); border-radius: 10px; padding: 12px; }
.summary-box span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.summary-box strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.summary-box .save strong { color: var(--ok); }
.comp-list { list-style: none; margin: 0; padding: 0; }
.comp-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.comp-list li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ misc */
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); gap: 10px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-600); box-shadow: 0 0 0 3px #fff; }
.timeline li:last-child { border-left-color: transparent; }
.timeline strong { font-weight: 600; }
.timeline small { display: block; color: var(--muted); font-size: 12px; }
.note { background: var(--navy-50); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.warn-list { list-style: none; margin: 0; padding: 0; }
.warn-list li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.warn-list li:last-child { border-bottom: 0; }
.warn-list i { color: var(--warn); margin-top: 2px; }
.pill-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--navy-100); color: var(--navy-700); font-weight: 700; font-size: 12px; }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
.lookup-box { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 16px 18px; background: linear-gradient(90deg, var(--navy-50), #fff); border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; }
.lookup-box .field { max-width: 260px; flex: 1; }

/* ------------------------------------------------------------ login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, var(--navy-600) 0%, var(--navy-800) 45%, var(--navy-950) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; background: var(--gold-500); opacity: .9; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand.brand-plate { display: inline-block; align-self: flex-start; padding: 14px 20px; }
.auth-brand.brand-plate img { width: 220px; max-width: none; }
.auth-card-logo { display: none; width: 180px; height: auto; margin-bottom: 18px; }
.auth-brand .brand-mark { width: 64px; height: 52px; border-radius: 12px; }
.auth-brand .brand-mark img { width: 52px; }
.auth-brand strong { display: block; font-size: 20px; }
.auth-brand span { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #c2d0e3; font-weight: 600; }
.auth-art h1 { color: #fff; font-size: 38px; font-weight: 700; letter-spacing: -.6px; max-width: 460px; line-height: 1.15; }
.auth-art p { color: #cfdbeb; max-width: 420px; font-size: 15px; }
.auth-points { display: grid; gap: 10px; margin-top: 22px; max-width: 420px; }
.auth-points div { display: flex; gap: 10px; align-items: center; color: #e1e9f4; font-size: 14px; }
.auth-points i { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.auth-foot { font-size: 12px; color: #a8bbd7; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.auth-card .field { margin-bottom: 14px; }
.session-tag { display: inline-flex; gap: 6px; align-items: center; background: var(--gold-50); color: var(--gold-700); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }

/* public refund page */
.public-wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.public-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.public-head .brand-mark { width: 60px; height: 48px; }
.public-head .public-logo { width: 150px; height: auto; padding-right: 14px; border-right: 1px solid var(--line); }
.public-head strong { font-size: 18px; color: var(--navy-800); display: block; }
.public-head span { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
/* Users → Edit: permission ticks */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.perm-group legend { font-weight: 700; font-size: 13px; color: var(--navy-800); padding: 0 4px; }
.perm-item { display: flex; align-items: flex-start; gap: 6px; padding: 3px 4px; border-radius: 4px; font-size: 13px; line-height: 1.35; }
.perm-item input { margin-top: 2px; flex: none; }
.perm-added { background: var(--ok-50); color: var(--ok); padding: 0 4px; border-radius: 4px; }
.perm-removed { background: var(--red-50); color: var(--red-600); padding: 0 4px; border-radius: 4px; }
.perm-item.perm-removed { text-decoration: line-through; }
/* partner portal: wider page for the tables; the header wraps on phones */
.portal-wrap { max-width: 1000px; }
.portal-wrap .public-head { flex-wrap: wrap; }
.portal-wrap .public-head > div { min-width: 0; }
.portal-wrap .public-head span { letter-spacing: 1px; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .portal-wrap { padding: 20px 16px 48px; }
  .portal-wrap .public-head .public-logo { width: 110px; }
  .portal-wrap .public-head form { margin-left: 0 !important; width: 100%; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid > .field { grid-column: span 6; }
  .form-grid > .field.w2, .form-grid > .field.w3 { grid-column: span 3; }
  .form-grid > .field.w4 { grid-column: span 4; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(11,29,54,.45); z-index: 40; }
  .topbar .menu-btn { display: grid; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  /* pages that set their own two-column split inline (fee calculator, settings pages …) stack too */
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  select { max-width: 100%; }   /* long programme names must not widen the page */
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card-logo { display: block; }
}
@media (max-width: 720px) {
  .content { padding: 16px 16px 40px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .user-meta, .session-switch i { display: none; }
  .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .form-grid > .field, .form-grid > .field.w2, .form-grid > .field.w3, .form-grid > .field.w4, .form-grid > .field.w6, .form-grid > .field.w8 { grid-column: 1 / -1; }
  .dl, .dl.cols-3 { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .summary-box { grid-template-columns: 1fr; }
  .filters .field { max-width: none; min-width: 100%; }
  .bar-item { grid-template-columns: 1fr; gap: 4px; }
  .profile-actions { margin-left: 0; }
}

@media (max-width: 520px) {
  .session-switch, .session-pill, .user-menu summary > .bi-chevron-down { display: none; }
  .page-head h1 { font-size: 20px; }
}

/* document upload: crop window for photo / signature, and the "ready" preview */
.crop-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 39, 71, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.crop-box { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 360px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.crop-box h3 { margin: 0 0 4px; font-size: 17px; }
.crop-box .muted { margin: 0 0 12px; }
.crop-stage { display: block; margin: 0 auto 12px; border: 2px solid var(--navy-700, #1b4175); border-radius: 4px; cursor: grab; touch-action: none; background: #fff; max-width: 100%; }
.crop-stage:active { cursor: grabbing; }
.crop-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.crop-tools input[type=range] { flex: 1; }
.crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.doc-ready { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: #f3f6fb; }
.doc-ready.ok { background: #eaf7ef; }
.doc-ready.bad { background: #fdeeee; color: #9b1c1c; }
.doc-ready img { height: 56px; width: auto; border: 1px solid var(--line, #e2e6ef); border-radius: 4px; background: #fff; }
/* installable app: the button shows only when the browser offers installation (app.js) */
.install-app[hidden] { display: none !important; }
@media (max-width: 640px) { .topbar .install-app span { display: none; } }
html.in-app .install-app { display: none !important; }
/* filled from Meritto — not editable */
input.from-crm, select:disabled { background: #f3f5f9; color: #2b3245; cursor: not-allowed; }
@media print {
  .sidebar, .topbar, .page-actions, .filters, .pager, .no-print, .alert, .tabs { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}

/* outreach (app/pages/outreach) */
.text-bad { color: var(--bad); font-weight: 600; }
.or-day { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.or-day .big { font-size: 22px; font-weight: 700; }
.or-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.or-actions form { margin: 0; }
.or-actions .btn { min-height: 44px; }
.or-timeline { list-style: none; margin: 0; padding: 0; }
.or-timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.or-timeline .t { min-width: 64px; font-weight: 600; }
@media (max-width: 600px) { .or-timeline li { flex-wrap: wrap; } .or-timeline li > .or-actions, .or-timeline li > a.btn { margin-left: 76px; } }
