/* ==========================================================
   CM Student Clearance System
   The College of Maasin · Nisi Dominus Frustra
   Green & white — refined
   ========================================================== */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-semibold.woff') format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('../fonts/lora-var.woff') format('woff'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('../fonts/lora-italic-var.woff') format('woff'); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --g-950: #01231C;
  --g-900: #022F26;
  --g-800: #033F33;
  --g-700: #034D3D;
  --g: #04634F;
  --g-600: #0A7A61;
  --g-400: #4FA588;
  --g-300: #8FC7B1;
  --g-200: #BFDDD1;
  --g-100: #DDEEE7;
  --g-50: #F0F7F4;
  --ink: #102019;
  --ink-2: #44554F;
  --ink-3: #6E7F78;
  --line: #E1E9E5;
  --line-2: #EDF2EF;
  --bg: #F5F7F6;
  --card: #FFFFFF;
  --ok: #04634F;   --ok-bg: #E2F2EB;
  --bad: #B42318;  --bad-bg: #FDEDEB;
  --wait: #925400; --wait-bg: #FFF2D9;
  --info: #1D5E9C; --info-bg: #E9F1FA;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 32, .05), 0 8px 24px -12px rgba(16, 40, 32, .12);
  --shadow-md: 0 2px 6px rgba(16, 40, 32, .06), 0 16px 32px -16px rgba(16, 40, 32, .18);
  --shadow-lg: 0 24px 60px -12px rgba(2, 35, 28, .35);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Lora', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 264px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: 'cv11', 'ss01'; overflow-x: hidden; }
a { color: var(--g); text-decoration: none; }
a:hover { color: var(--g-700); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.04rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0; }
code, .mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.ic { flex: none; vertical-align: middle; }
.hidden { display: none !important; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.only-mobile, .icon-btn.only-mobile { display: none; }
::selection { background: var(--g-100); color: var(--g-900); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none !important; min-width: 0; }
.brand img { border-radius: 50%; flex: none; background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: .05em; color: var(--g-700); white-space: nowrap; }
.brand-text em { font-family: var(--serif); font-style: italic; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; white-space: nowrap; }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text em { color: var(--g-300); }

/* ---------- shell (staff/admin) ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: linear-gradient(180deg, var(--g-700) 0%, var(--g-900) 72%, var(--g-950) 100%); color: #D3E7DF; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px 240px at -10% -5%, rgba(255,255,255,.10), transparent 60%); }
.sidebar .brand { padding: 22px 20px 14px; position: relative; z-index: 1; }
.sidebar .brand img { width: 44px; height: 44px; padding: 2px; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.sidebar .brand-text strong { color: #fff; }
.sidebar .brand-text em { color: var(--g-300); }
.sidebar-app { position: relative; z-index: 1; margin: 2px 20px 14px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.14); color: var(--g-300); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; border-radius: 8px; background: rgba(255,255,255,.04); }
.nav { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav a { display: flex; align-items: center; gap: .75rem; padding: 9px 12px; margin: 2px 0; border-radius: 10px; color: #CFE3DA; font-weight: 500; font-size: 14px; text-decoration: none; transition: background .15s, color .15s; }
.nav a .ic { color: var(--g-300); transition: color .15s; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a:hover .ic { color: #fff; }
.nav a.on { background: #fff; color: var(--g-800); font-weight: 600; box-shadow: 0 6px 16px -8px rgba(0,0,0,.45); }
.nav a.on .ic { color: var(--g); }
.sidebar-user { position: relative; z-index: 1; display: flex; align-items: center; gap: .65rem; margin: 10px 12px 14px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.sidebar-user .avatar { background: var(--g-300); color: var(--g-900); }
.sidebar-user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-user-meta strong { font-size: .85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta span { font-size: .74rem; color: var(--g-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .icon-btn { color: #CFE3DA; }
.sidebar-user .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-scrim { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; height: 64px; padding: 0 32px; background: rgba(245, 247, 246, .82); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-family: var(--serif); font-weight: 600; font-size: 1.22rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--g-900); }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.content { padding: 28px 32px 72px; max-width: 1440px; width: 100%; box-sizing: border-box; }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--g-100); color: var(--g-700); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; letter-spacing: .02em; flex: none; text-decoration: none !important; }
.avatar-light { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 5px 11px 5px 9px; border-radius: 99px; background: #fff; border: 1px solid var(--line); white-space: nowrap; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: #B8C5C0; }
.live-dot.on { color: var(--g); border-color: var(--g-200); }
.live-dot.on i { background: #16A374; animation: pulse 2.2s infinite; }
.live-dot.off { color: var(--wait); border-color: #F1D59B; }
.live-dot.off i { background: #E19A0C; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 116, .5); } 70% { box-shadow: 0 0 0 7px rgba(22, 163, 116, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 116, 0); } }

/* ---------- cards / layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); }
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
.grid > .card + .card, .grid-2 > .card + .card, .grid-3 > .card + .card, .grid-main > .card + .card { margin-top: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.65rem; letter-spacing: -.015em; color: var(--g-900); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin: .3rem 0 0; color: var(--ink-2); max-width: 760px; }
.page-head > div:first-child { min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--g-200); }
.kpi.k-ok::after { background: var(--g); }
.kpi.k-bad::after { background: #D6453B; }
.kpi.k-wait::after { background: #E3A008; }
.kpi .kpi-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 700; }
.kpi .kpi-value { font-family: var(--serif); font-size: 2.05rem; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; color: var(--g-900); font-variant-numeric: tabular-nums lining-nums; }
.kpi .kpi-sub { font-size: .8rem; color: var(--ink-2); margin-top: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; box-shadow: 0 1px 2px rgba(16, 40, 32, .05); }
.btn:hover { border-color: var(--g-200); background: var(--g-50); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(4, 99, 79, .28); outline-offset: 2px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, #0A6E58 0%, var(--g) 100%); border-color: var(--g-700); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 6px -2px rgba(4, 99, 79, .5); }
.btn-primary:hover { background: linear-gradient(180deg, var(--g) 0%, var(--g-700) 100%); border-color: var(--g-800); color: #fff; }
.btn-danger { background: #fff; border-color: #F1CAC5; color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: #E7A49C; color: #8F1C13; }
.btn-danger-solid { background: linear-gradient(180deg, #C42A1E 0%, var(--bad) 100%); border-color: #9A1E15; color: #fff; }
.btn-danger-solid:hover { background: #95190F; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .83rem; border-radius: 9px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: .79rem; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-ok { background: var(--ok-bg); border-color: var(--g-200); color: var(--g-700); box-shadow: none; }
.btn-ok:hover { background: var(--g-100); border-color: var(--g-300); color: var(--g-800); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--ink-3); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], input[type=datetime-local], input[type=date], input[type=file], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #D3DFDA; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .93rem; transition: border-color .15s, box-shadow .15s; box-shadow: inset 0 1px 1px rgba(16, 40, 32, .03);
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2344554F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
select[multiple] { background-image: none; padding-right: 12px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #BFD0C9; }
input:focus, select:focus, textarea:focus { border-color: var(--g); outline: none; box-shadow: 0 0 0 4px rgba(4, 99, 79, .12); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--g); vertical-align: middle; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-icon input { padding-left: 38px; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, #FBFDFC, #F7FAF9); border-radius: var(--radius) var(--radius) 0 0; }
.filters select, .filters input { width: auto; min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: .87rem; max-width: 100%; }
.filters select { min-width: 140px; }
.filters .input-icon input { width: 260px; padding-left: 36px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th { text-align: left; font-size: .69rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); font-weight: 700; padding: 11px 14px; background: #FAFCFB; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #F8FBFA; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-selected td { background: var(--g-50) !important; }
.table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--g); }
.table .col-check { width: 44px; padding-right: 0; }
.table .t-name { font-weight: 600; color: var(--ink); }
a.t-name:hover { color: var(--g); }
.table .t-sub { font-size: .79rem; color: var(--ink-3); margin-top: 1px; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .btn + .btn { margin-left: 4px; }
.table-empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.table-empty .ic { color: var(--g-200); margin-bottom: 10px; }

/* ---------- chips, bars ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 9px; border-radius: 99px; font-size: .74rem; font-weight: 650; white-space: nowrap; letter-spacing: .01em; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip:has(svg)::before, .chip-outline::before { display: none; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-wait { background: var(--wait-bg); color: var(--wait); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-muted { background: #EDF1EF; color: var(--ink-2); }
.chip-outline { background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; padding: 0 10px; }
.bar { height: 8px; border-radius: 99px; background: #E8EFEC; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--g-400), var(--g)); border-radius: 99px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.stackbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #E8EFEC; gap: 2px; }
.stackbar span { display: block; height: 100%; border-radius: 2px; }
.stackbar span:first-child { border-radius: 99px 2px 2px 99px; }
.stackbar .s-ok { background: var(--g); }
.stackbar .s-bad { background: #D6453B; }
.stackbar .s-wait { background: #F0C252; }
.legend { display: flex; gap: 14px; font-size: .77rem; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- flash / toast ---------- */
.flash { display: flex; gap: .65rem; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.flash .ic { margin-top: 1px; }
.flash-success { background: var(--ok-bg); border-color: var(--g-200); color: var(--g-700); }
.flash-error { background: var(--bad-bg); border-color: #F3C6C0; color: var(--bad); }
.flash-info { background: var(--info-bg); border-color: #C9DCF1; color: var(--info); }
.flash-warning { background: var(--wait-bg); border-color: #F2D69C; color: var(--wait); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(400px, calc(100vw - 40px)); }
.toast { display: flex; gap: .7rem; align-items: flex-start; background: var(--g-900); color: #fff; padding: 13px 15px; border-radius: 14px; box-shadow: var(--shadow-lg); animation: toastIn .28s cubic-bezier(.2,.8,.2,1); font-size: .9rem; border: 1px solid rgba(255,255,255,.08); }
.toast.t-bad { background: #6E170F; }
.toast.t-ok { background: var(--g-800); }
.toast .ic { margin-top: 1px; }
.toast-close { background: none; border: 0; color: rgba(255, 255, 255, .7); cursor: pointer; padding: 0 0 0 6px; margin-left: auto; font-size: 13px; }
@keyframes toastIn { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 20px; width: min(580px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal[open] { animation: modalIn .22s cubic-bezier(.2,.8,.2,1); }
@keyframes modalIn { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.modal::backdrop { background: rgba(1, 35, 28, .5); backdrop-filter: blur(3px); }
dialog.modal-wide { width: min(840px, calc(100vw - 24px)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--g-900); }
.modal-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #FAFCFB; border-radius: 0 0 20px 20px; }
.reasons { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.reasons button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink-2); transition: .15s; }
.reasons button:hover { border-color: var(--g-200); background: var(--g-50); color: var(--g-700); }

/* ---------- bulk action bar ---------- */
.bulkbar { position: sticky; bottom: 16px; z-index: 25; margin: 14px auto 0; display: flex; align-items: center; gap: .6rem; padding: 10px 12px 10px 18px; background: rgba(2, 47, 38, .96); backdrop-filter: blur(8px); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: fit-content; max-width: calc(100% - 24px); flex-wrap: wrap; transform: translateY(24px); opacity: 0; pointer-events: none; transition: .22s cubic-bezier(.2,.8,.2,1); border: 1px solid rgba(255,255,255,.08); }
.bulkbar.show { transform: none; opacity: 1; pointer-events: auto; }
.bulkbar strong { margin-right: .4rem; color: #fff; font-variant-numeric: tabular-nums; }
.bulkbar .btn { height: 36px; box-shadow: none; }
.bulkbar .btn-ghost { color: #CFE7DE; }
.bulkbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- tabs & pager ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.tabs a { padding: 13px 14px; color: var(--ink-2); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 7px; align-items: center; transition: color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--g); border-color: var(--g); }
.tabs .count { background: var(--line-2); border-radius: 99px; padding: 1px 8px; font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tabs a.on .count { background: var(--g); color: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: .6rem; flex-wrap: wrap; font-size: .85rem; border-top: 1px solid var(--line-2); }
.pager-links { display: flex; align-items: center; gap: .5rem; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: .8rem; padding: 12px 20px; border-bottom: 1px solid var(--line-2); align-items: center; }
.list > li:last-child { border-bottom: 0; }
.feed > li { align-items: flex-start; font-size: .87rem; position: relative; }
.feed .feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g-200); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--g-50); }
.feed li.flash-update .feed-dot { background: var(--g); }
.feed li.flash-update, .sig-item.flash-update, tr.flash-update td { animation: flashIn 1.8s ease; }
@keyframes flashIn { from { background: #E4F4EC; } to { background: transparent; } }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }

.empty { text-align: center; padding: 52px 24px; color: var(--ink-2); }
.empty .ic { color: var(--g-300); background: var(--g-50); border-radius: 50%; padding: 14px; box-sizing: content-box; }
.empty h3 { margin: 16px 0 6px; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--g-900); }
.empty p { max-width: 460px; margin: 0 auto 16px; }

.note-box { background: var(--bad-bg); border: 1px solid #F3CBC5; color: #7A1D14; border-radius: 12px; padding: 10px 13px; font-size: .88rem; white-space: pre-wrap; line-height: 1.45; }
.reply-box { background: var(--info-bg); border: 1px solid #CCDFF3; color: #183F66; border-radius: 12px; padding: 10px 13px; font-size: .88rem; white-space: pre-wrap; line-height: 1.45; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 14px; font-size: .86rem; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--g-300); }

.drop { border: 2px dashed var(--g-200); border-radius: 16px; padding: 32px; text-align: center; background: var(--g-50); color: var(--ink-2); cursor: pointer; transition: .15s; }
.drop:hover { border-color: var(--g-300); background: #E9F4EF; }
.drop .ic { color: var(--g); }
.drop.over { border-color: var(--g); background: var(--g-100); }
.drop input[type=file] { display: none; }
.progress-lg { height: 14px; border-radius: 99px; background: #E5ECE9; overflow: hidden; }
.progress-lg span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--g-400), var(--g)); transition: width .3s; }

/* ---------- auth ---------- */
.auth-body { min-height: 100vh; background: var(--g-900); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 18px; background:
  radial-gradient(900px 500px at 0% 0%, rgba(79, 165, 136, .35), transparent 60%),
  radial-gradient(700px 500px at 100% 100%, rgba(1, 35, 28, .9), transparent 60%),
  linear-gradient(160deg, var(--g) 0%, var(--g-800) 55%, var(--g-950) 100%); position: relative; overflow: hidden; }
.auth-wrap::before, .auth-wrap::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); pointer-events: none; }
.auth-wrap::before { width: 720px; height: 720px; top: -320px; right: -260px; box-shadow: 0 0 0 60px rgba(255,255,255,.02), 0 0 0 120px rgba(255,255,255,.015); }
.auth-wrap::after { width: 520px; height: 520px; bottom: -300px; left: -200px; }
.auth-brand { text-align: center; color: #fff; margin-bottom: 26px; position: relative; z-index: 1; }
.auth-brand img { background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 0 0 6px rgba(255,255,255,.1), 0 18px 40px rgba(0, 0, 0, .3); }
.auth-brand h1 { color: #fff; font-family: var(--serif); font-weight: 700; letter-spacing: .1em; font-size: 1.6rem; margin: 18px 0 4px; }
.auth-brand .motto { font-family: var(--serif); font-style: italic; letter-spacing: .26em; text-transform: uppercase; font-size: .8rem; color: var(--g-300); margin: 0; }
.auth-brand .auth-app { margin: 16px 0 0; display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255,255,255,.06); border-radius: 99px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #E5F3ED; }
.auth-card { position: relative; z-index: 1; width: min(430px, 100%); background: #fff; border-radius: 22px; padding: 30px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.auth-card-wide { width: min(700px, 100%); }
.auth-card h2 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; color: var(--g-900); margin-bottom: 4px; }
.auth-foot { position: relative; z-index: 1; color: rgba(255, 255, 255, .62); font-size: .76rem; margin-top: 24px; text-align: center; letter-spacing: .02em; }
.pw-toggle { position: relative; }
.pw-toggle input { padding-right: 64px; }
.pw-toggle button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--g); font-weight: 600; font-size: .8rem; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.pw-toggle button:hover { background: var(--g-50); }

/* ---------- student (mobile-first app) ---------- */
.is-student { background: #F1F6F3; padding-bottom: calc(80px + var(--safe-b)); }
.s-header { background: linear-gradient(135deg, var(--g) 0%, var(--g-800) 100%); color: #fff; position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px); box-shadow: 0 6px 20px -8px rgba(2, 47, 38, .5); }
.s-header-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; gap: .6rem; }
.s-header img { background: #fff; border-radius: 50%; padding: 2px; }
.s-header .brand-text strong { font-size: 13px; }
.s-header .brand-text em { font-size: 9.5px; }
.s-header-right { display: flex; align-items: center; gap: .55rem; }
.s-header .live-dot { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #D7EFE6; }
.s-header .live-dot.on { color: #fff; }
.s-main { max-width: 760px; margin: 0 auto; padding: 18px 14px 26px; }
.s-hello { margin: 4px 4px 16px; }
.s-hello h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; color: var(--g-900); }
.s-foot { text-align: center; color: var(--ink-3); font-size: .74rem; margin-top: 28px; }
.s-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); }
.s-tabbar a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; color: var(--ink-3); font-size: .7rem; font-weight: 600; text-decoration: none; border-radius: 12px; position: relative; }
.s-tabbar a.on { color: var(--g); }
.s-tabbar a.on::before { content: ""; position: absolute; top: -7px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--g); }
.s-tabbar a.on .ic { stroke-width: 2.4; }

.hero { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-md); display: flex; gap: 18px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, var(--g-50) 0%, transparent 70%); pointer-events: none; }
.hero-meta { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-meta h2 { font-family: var(--serif); font-weight: 600; font-size: 1.14rem; margin-bottom: 3px; color: var(--g-900); }
.hero-meta .sub { color: var(--ink-2); font-size: .85rem; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ring { --p: 0; --c: var(--g); width: 108px; height: 108px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #E6EEEA 0); position: relative; z-index: 1; }
.ring::before { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; box-shadow: inset 0 1px 3px rgba(16, 40, 32, .06); }
.ring > div { position: relative; text-align: center; line-height: 1.05; }
.ring strong { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; color: var(--g-900); }
.ring span { display: block; font-size: .64rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; font-weight: 600; }
.ring.r-bad { --c: #D6453B; }
.ring.r-done { --c: var(--g); }

.status-banner { display: flex; gap: .7rem; align-items: center; padding: 13px 15px; border-radius: 16px; margin: 14px 0; font-weight: 600; font-size: .92rem; }
.status-banner.b-ok { background: linear-gradient(135deg, var(--g) 0%, var(--g-700) 100%); color: #fff; box-shadow: 0 10px 24px -12px rgba(4, 99, 79, .7); }
.status-banner.b-bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #F3C8C2; }
.status-banner.b-wait { background: var(--wait-bg); color: var(--wait); border: 1px solid #F3DAA5; }

.sig-list { list-style: none; margin: 14px 0 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.sig-item { padding: 15px 16px; border-bottom: 1px solid var(--line-2); }
.sig-item:last-child { border-bottom: 0; }
.sig-row { display: flex; gap: 12px; align-items: center; }
.sig-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.sig-icon.i-ok { background: var(--ok-bg); color: var(--ok); }
.sig-icon.i-bad { background: var(--bad-bg); color: var(--bad); }
.sig-icon.i-wait { background: var(--wait-bg); color: var(--wait); }
.sig-icon.i-lock { background: #EDF1EF; color: var(--ink-3); }
.sig-main { flex: 1; min-width: 0; }
.sig-main strong { display: block; font-size: .95rem; font-weight: 600; }
.sig-main span { display: block; font-size: .79rem; color: var(--ink-3); }
.sig-extra { margin: 10px 0 0 52px; }
.sig-extra form { margin-top: 9px; }

.section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 700; margin: 24px 4px 9px; }
.install-hint { display: flex; gap: .75rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; margin-top: 14px; font-size: .86rem; box-shadow: var(--shadow); }
.install-hint > .ic { color: var(--g); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .only-mobile, .icon-btn.only-mobile { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(1, 35, 28, .45); backdrop-filter: blur(2px); z-index: 35; }
  .topbar { padding: 0 14px; height: 58px; }
  .content { padding: 18px 14px 88px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .filters > * { flex: 1 1 150px; }
  .filters .input-icon, .filters .input-icon input { width: 100%; }
  .table .hide-sm { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .page-head h2 { font-size: 1.4rem; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .kpi-value { font-size: 1.6rem; }
  .hero { padding: 15px; gap: 14px; border-radius: 20px; }
  .ring { width: 90px; height: 90px; }
  .ring strong { font-size: 1.3rem; }
  .s-header .brand-text strong { font-size: 12px; }
  .s-header .brand-text em { font-size: 8.5px; letter-spacing: .16em; }
  .s-header .live-dot span { display: none; }
  .s-header .live-dot { padding: 7px; }
  .bulkbar { left: 8px; right: 8px; width: auto; }
  .auth-card { padding: 24px 20px; }
  .auth-brand h1 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .s-tabbar, .s-header, .toasts, .bulkbar, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
}

/* ---------- overflow guards ---------- */
.grid > *, .grid-2 > *, .grid-3 > *, .grid-main > *, .form-grid > *, .kpis > * { min-width: 0; }
.card { min-width: 0; max-width: 100%; }
.page-head > * { max-width: 100%; }
.page-head form.row select, .page-head select { max-width: 100%; min-width: 0; }
.drop { max-width: 100%; }
@media (max-width: 520px) {
  .page-head form.row { width: 100%; }
  .page-head form.row select { flex: 1 1 100%; width: 100%; }
}
.sidebar .brand-text strong { font-size: 12.5px; letter-spacing: .035em; }
.sidebar .brand-text em { font-size: 10px; letter-spacing: .18em; }
.hero-meta .sub { display: block; }
.hero-meta .sub .ic { vertical-align: -2px; margin-right: 3px; }

/* ---------- snappy navigation ---------- */
.nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 300; background: linear-gradient(90deg, var(--g-300), #fff 50%, var(--g-300)); box-shadow: 0 0 10px rgba(143, 199, 177, .8); opacity: 0; pointer-events: none; }
.is-student .nav-progress { background: linear-gradient(90deg, var(--g-300), var(--g)); }
.nav-progress.go { opacity: 1; animation: navgo 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes navgo { 0% { width: 0; } 10% { width: 45%; } 40% { width: 75%; } 100% { width: 94%; } }
.nav a { transition: background .08s, color .08s; }
@view-transition { navigation: auto; }
.sidebar { view-transition-name: cm-sidebar; }
.s-header { view-transition-name: cm-sheader; }
.s-tabbar { view-transition-name: cm-tabbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; }
