/* ============================================================
   Zee School Manager — portal styles

   Blue as the working colour — sidebar, headers, primary actions — with
   orange as the accent that draws the eye: buttons that matter, active
   states, highlights. Two colours doing distinct jobs reads as more
   deliberate than either alone, and the contrast keeps status colours
   (green/amber/red for ok/warn/bad) clearly separate from brand colour.
   ============================================================ */

:root {
	--ink:      #0d3d6b;
	--ink-2:    #082a4a;
	--ink-3:    #1a5590;
	--brass:    #f2660d;
	--brass-dk: #cc4e02;
	--app-bg:   #eef2f6;
	--surface:  #ffffff;
	--surface-2:#f5f8fb;
	--line:     #dbe3ea;
	--line-2:   #c2cfda;
	--text:     #16202b;
	--muted:    #5c6b7a;
	--ok:       #1b7f5a;
	--ok-bg:    #e6f4ee;
	--warn:     #a5730a;
	--warn-bg:  #fdf4e3;
	--bad:      #b3261e;
	--bad-bg:   #fdeceb;
	--info-bg:  #e8f0f9;
	--info:     #3b6ea5;
	--r:        6px;
	--shadow:   0 1px 3px rgba(13,61,107,.10), 0 4px 14px rgba(13,61,107,.07);
	--side-w:   238px;
}

*, *::before, *::after { box-sizing: border-box; }

.zsm-body { margin: 0; background: var(--app-bg); }

.zsm-app, .zsm-app * {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-variant-numeric: tabular-nums;
}
.zsm-app {
	display: flex; min-height: 100vh; color: var(--text);
	background: var(--app-bg); font-size: 14px; line-height: 1.5;
}
.zsm-app .urdu { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; direction: rtl; }

/* ── SIDEBAR ─────────────────────────────────────────────── */

.zsm-side {
	width: var(--side-w); flex-shrink: 0; background: var(--ink); color: #dce7f5;
	display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0;
	z-index: 40; transition: transform .22s ease;
}
.zsm-brand {
	display: flex; align-items: center; gap: 10px; padding: 16px 14px;
	border-bottom: 1px solid rgba(255,255,255,.10);
}
.zsm-brand img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: var(--r); padding: 3px; }
.zsm-mark {
	width: 38px; height: 38px; border-radius: var(--r); background: var(--brass); color: var(--ink-2);
	display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .5px;
}
.zsm-brand-text { min-width: 0; }
.zsm-brand-text strong {
	display: block; font-size: 13.5px; color: #fff; line-height: 1.25;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zsm-brand-text span { font-size: 11px; color: var(--brass); letter-spacing: .3px; }

.zsm-nav { flex: 1; overflow-y: auto; padding: 8px 0 14px; }
.zsm-nav-group {
	font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.3px;
	color: rgba(220,231,245,.45); padding: 14px 16px 5px; font-weight: 700;
}
.zsm-nav-link {
	display: flex; align-items: center; gap: 9px; padding: 8px 16px;
	color: #c7d6ec; text-decoration: none; font-size: 13.5px;
	border-left: 3px solid transparent; transition: background .12s, color .12s;
}
.zsm-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.zsm-nav-link.active { background: var(--ink-2); color: #fff; border-left-color: var(--brass); font-weight: 600; }
.zsm-nav-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; flex-shrink: 0; }
.zsm-nav-link.active .zsm-nav-dot { background: var(--brass); opacity: 1; }

.zsm-side-foot { border-top: 1px solid rgba(255,255,255,.10); padding: 12px 14px; }
.zsm-user { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.zsm-avatar {
	width: 32px; height: 32px; border-radius: 50%; background: var(--ink-3); color: #fff;
	display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.zsm-user-text { min-width: 0; }
.zsm-user-text strong { display: block; font-size: 12.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zsm-user-text span { font-size: 10.5px; color: rgba(220,231,245,.6); }
.zsm-signout {
	display: block; text-align: center; padding: 7px; border-radius: var(--r);
	background: rgba(255,255,255,.08); color: #c7d6ec; text-decoration: none; font-size: 12.5px;
}
.zsm-signout:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ── MAIN ────────────────────────────────────────────────── */

.zsm-main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.zsm-top {
	background: var(--surface); border-bottom: 1px solid var(--line);
	padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 12px;
	position: sticky; top: 0; z-index: 20;
}
.zsm-top h1 { font-size: 18px; font-weight: 700; margin: 0; color: var(--ink); letter-spacing: -.2px; }
.zsm-top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.zsm-burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; flex-direction: column; gap: 4px; }
.zsm-burger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

.zsm-view { padding: 20px; flex: 1; }
.zsm-scrim { display: none; position: fixed; inset: 0; background: rgba(8,42,74,.45); z-index: 35; }
.zsm-scrim.on { display: block; }

/* ── CARDS & LAYOUT ──────────────────────────────────────── */

.zsm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; box-shadow: 0 1px 2px rgba(13,61,107,.05); }
.zsm-card-head {
	padding: 12px 16px; border-bottom: 1px solid var(--line);
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.zsm-card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.zsm-card-head .zsm-spacer { margin-left: auto; }
.zsm-card-body { padding: 16px; }
.zsm-card-body.flush { padding: 0; }

.zsm-grid { display: grid; gap: 14px; }
.zsm-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.zsm-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.zsm-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.zsm-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

/* ── STAT TILES ──────────────────────────────────────────── */

.zsm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 16px; }
.zsm-stat {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
	padding: 13px 15px; border-top: 3px solid var(--ink); position: relative; overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}
.zsm-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.zsm-stat.ok   { border-top-color: var(--ok); }
.zsm-stat.warn { border-top-color: var(--warn); }
.zsm-stat.bad  { border-top-color: var(--bad); }
.zsm-stat.gold { border-top-color: var(--brass); }
.zsm-stat-icon {
	position: absolute; top: 10px; right: 12px; font-size: 20px; opacity: .5;
	filter: grayscale(.15);
}
.zsm-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); font-weight: 600; padding-right: 22px; }
.zsm-stat-value { font-size: 25px; font-weight: 800; color: var(--ink); margin-top: 3px; letter-spacing: -.6px; line-height: 1.1; }
.zsm-stat.ok   .zsm-stat-value { color: var(--ok); }
.zsm-stat.warn .zsm-stat-value { color: var(--warn); }
.zsm-stat.bad  .zsm-stat-value { color: var(--bad); }
.zsm-stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.zsm-stat.zsm-flash { animation: zsmFlash .9s ease; }
@keyframes zsmFlash {
	0%   { box-shadow: inset 0 0 0 999px rgba(242,102,13,.10); }
	100% { box-shadow: inset 0 0 0 999px rgba(242,102,13,0); }
}

/* ── ATTENDANCE RING TILE ────────────────────────────────── */

.zsm-stat-ring { display: flex; flex-direction: column; align-items: flex-start; }
.zsm-ring { display: block; margin: 4px 0 2px -4px; }

/* ── LIVE INDICATOR ──────────────────────────────────────── */

.zsm-live-badge {
	display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
	color: var(--ok); background: var(--ok-bg); padding: 5px 10px; border-radius: 20px;
}
.zsm-live-dot {
	width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
	animation: zsmPulse 1.8s ease-in-out infinite;
}
@keyframes zsmPulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(27,127,90,.5); }
	50%      { opacity: .6; box-shadow: 0 0 0 5px rgba(27,127,90,0); }
}

/* ── TABLES ──────────────────────────────────────────────── */

.zsm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.zsm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.zsm-table th {
	background: var(--surface-2); text-align: left; padding: 9px 12px; font-weight: 700;
	font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted);
	border-bottom: 1.5px solid var(--line-2); white-space: nowrap; position: sticky; top: 0;
}
table.zsm-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.zsm-table tbody tr:hover td { background: var(--surface-2); }
table.zsm-table td.num, table.zsm-table th.num { text-align: right; white-space: nowrap; }
table.zsm-table td.mid, table.zsm-table th.mid { text-align: center; }
table.zsm-table tfoot td { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--ink); }
table.zsm-table tr.dim td { color: var(--muted); background: #fafbfb; }
table.zsm-table .zsm-row-actions { display: flex; gap: 5px; justify-content: flex-end; }

.zsm-empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.zsm-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; }
.zsm-empty p { margin: 0 0 14px; font-size: 13px; }

/* ── BUTTONS ─────────────────────────────────────────────── */

.zsm-btn {
	display: inline-flex; align-items: center; gap: 6px; justify-content: center;
	background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: var(--r);
	padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
	text-decoration: none; line-height: 1.3; transition: background .12s, transform .12s, box-shadow .12s;
}
.zsm-btn:hover { background: var(--ink-2); color: #fff; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(13,61,107,.18); }
.zsm-btn:active { transform: translateY(0); box-shadow: none; }
.zsm-btn:disabled { opacity: .5; cursor: not-allowed; }
.zsm-btn-block { width: 100%; }
.zsm-btn-sm { padding: 5px 10px; font-size: 12px; }
.zsm-btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.zsm-btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.zsm-btn-gold { background: var(--brass); border-color: var(--brass); color: var(--ink-2); }
.zsm-btn-gold:hover { background: var(--brass-dk); color: #fff; }
.zsm-btn-ok { background: var(--ok); border-color: var(--ok); }
.zsm-btn-ok:hover { background: #166848; }
.zsm-btn-bad { background: var(--bad); border-color: var(--bad); }
.zsm-btn-bad:hover { background: #8f1e17; }
.zsm-btn-icon { padding: 5px 8px; font-size: 12px; }

/* ── FORMS ───────────────────────────────────────────────── */

.zsm-app label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.zsm-app input[type=text], .zsm-app input[type=number], .zsm-app input[type=date],
.zsm-app input[type=email], .zsm-app input[type=tel], .zsm-app input[type=password],
.zsm-app input[type=time], .zsm-app select, .zsm-app textarea {
	width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r);
	font-size: 13.5px; color: var(--text); background: #fff; margin-top: 4px; font-weight: 400;
}
.zsm-app input:focus, .zsm-app select:focus, .zsm-app textarea:focus {
	outline: 2px solid rgba(13,61,107,.28); outline-offset: -1px; border-color: var(--ink);
}
.zsm-app textarea { resize: vertical; min-height: 64px; }
.zsm-app input[type=checkbox], .zsm-app input[type=radio] { width: auto; margin: 0 6px 0 0; vertical-align: -2px; }
.zsm-inline-label { display: flex !important; align-items: center; gap: 6px; font-weight: 500; color: var(--text); font-size: 13px; }

/* ── PHOTO UPLOAD WIDGET ─────────────────────────────────── */

.zsm-photo-field { display: flex; align-items: center; gap: 12px; margin-top: 4px; margin-bottom: 12px; }
.zsm-photo-preview {
	width: 64px; height: 64px; border-radius: var(--r); background: var(--surface-2);
	border: 1px solid var(--line-2); overflow: hidden; flex-shrink: 0;
	display: grid; place-items: center; color: var(--line-2); font-size: 22px; font-weight: 700;
}
.zsm-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.zsm-photo-controls { flex: 1; min-width: 0; }
.zsm-photo-input { width: 100%; padding: 7px 8px; font-size: 12.5px; margin-top: 0; }
.zsm-photo-status { margin-top: 4px; min-height: 14px; }

/* ── DOCUMENT SCAN WIDGET ────────────────────────────────── */

.zsm-doc-scan {
	background: var(--info-bg); border: 1px dashed var(--info); border-radius: var(--r);
	padding: 12px; margin-bottom: 14px;
}
.zsm-doc-scan-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zsm-doc-scan-btns label.zsm-btn { cursor: pointer; }
.zsm-doc-review table td { border: 0; }

.zsm-filters {
	display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
	padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.zsm-filters label { margin-bottom: 0; min-width: 128px; flex: 0 1 auto; }
.zsm-filters .grow { flex: 1; min-width: 180px; }

/* ── PILLS ───────────────────────────────────────────────── */

.zsm-pill {
	display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px;
	font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.zsm-pill-ok   { background: var(--ok-bg);   color: var(--ok); }
.zsm-pill-warn { background: var(--warn-bg); color: var(--warn); }
.zsm-pill-bad  { background: var(--bad-bg);  color: var(--bad); }
.zsm-pill-mute { background: #eceeed;        color: var(--muted); }
.zsm-pill-info { background: var(--info-bg); color: var(--info); }

/* ── ALERTS ──────────────────────────────────────────────── */

.zsm-alert {
	padding: 11px 14px; border-radius: var(--r); font-size: 13px; margin-bottom: 12px;
	border-left: 3px solid; line-height: 1.55;
}
.zsm-alert-ok   { background: var(--ok-bg);   border-color: var(--ok);   color: #145440; }
.zsm-alert-warn { background: var(--warn-bg); border-color: var(--warn); color: #6f4d05; }
.zsm-alert-bad  { background: var(--bad-bg);  border-color: var(--bad);  color: #7d1a14; }
.zsm-alert-info { background: var(--info-bg); border-color: var(--info); color: #17455f; }

/* ── AI INSIGHT STRIP ────────────────────────────────────── */

.zsm-insights { display: grid; gap: 10px; margin-bottom: 16px; }
.zsm-insight {
	background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info);
	border-radius: var(--r); padding: 12px 15px; display: flex; gap: 12px; align-items: flex-start;
}
.zsm-insight.high   { border-left-color: var(--bad); }
.zsm-insight.medium { border-left-color: var(--warn); }
.zsm-insight-icon {
	width: 26px; height: 26px; border-radius: 50%; background: var(--info-bg); color: var(--info);
	display: grid; place-items: center; font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.zsm-insight.high   .zsm-insight-icon { background: var(--bad-bg);  color: var(--bad); }
.zsm-insight.medium .zsm-insight-icon { background: var(--warn-bg); color: var(--warn); }
.zsm-insight-body strong { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.zsm-insight-body p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.zsm-insight-body a { color: var(--ink); font-weight: 600; font-size: 12.5px; text-decoration: underline; }

/* ── RISK SCORE BAR ──────────────────────────────────────── */

.zsm-score { display: flex; align-items: center; gap: 8px; min-width: 116px; }
.zsm-score-bar { flex: 1; height: 6px; background: #e4e9e8; border-radius: 4px; overflow: hidden; }
.zsm-score-fill { height: 100%; background: var(--ok); }
.zsm-score-fill.medium { background: var(--warn); }
.zsm-score-fill.high   { background: var(--bad); }
.zsm-score-num { font-size: 12px; font-weight: 800; color: var(--text); width: 24px; text-align: right; }

/* ── ARREARS CARRY CHAIN ─────────────────────────────────────
   The signature element. When a parent pays part of a voucher, the
   remainder is shown moving month to month as a linked chain rather than
   a number in a cell, because "where did this Rs. 4,200 come from" is the
   single most common question at a Pakistani school fee counter. */

.zsm-chain { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 0 10px; }
.zsm-chain-node {
	min-width: 132px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--r); padding: 9px 11px; position: relative; margin-right: 22px;
}
.zsm-chain-node:last-child { margin-right: 0; }
.zsm-chain-node::after {
	content: ""; position: absolute; right: -22px; top: 50%; width: 22px; height: 2px;
	background: var(--line-2);
}
.zsm-chain-node:last-child::after { display: none; }
.zsm-chain-node.carried::after { background: var(--warn); }
.zsm-chain-node.carried {
	border-color: var(--warn); background: var(--warn-bg);
}
.zsm-chain-node.paid { border-color: var(--ok); background: var(--ok-bg); }
.zsm-chain-month { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.zsm-chain-amt { font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.zsm-chain-note { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.zsm-chain-node.carried .zsm-chain-note { color: var(--warn); font-weight: 600; }

/* ── VOUCHER BREAKDOWN ───────────────────────────────────── */

.zsm-vrow { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.zsm-vrow.arrears { background: var(--warn-bg); font-weight: 700; color: var(--warn); padding-left: 8px; padding-right: 8px; }
.zsm-vrow.discount { color: var(--ok); }
.zsm-vrow.fine { color: var(--bad); }
.zsm-vrow.total {
	background: var(--ink); color: #fff; font-weight: 800; font-size: 15px;
	padding: 10px 12px; border: 0; border-radius: var(--r); margin-top: 8px;
}

/* ── MARKS / ATTENDANCE GRIDS ────────────────────────────── */

.zsm-mark-input { width: 74px !important; text-align: center; font-weight: 700; margin-top: 0 !important; }
.zsm-att-toggle { display: flex; gap: 3px; }
.zsm-att-btn {
	border: 1px solid var(--line-2); background: #fff; border-radius: var(--r);
	padding: 4px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.zsm-att-btn.on[data-status=present] { background: var(--ok);   border-color: var(--ok);   color: #fff; }
.zsm-att-btn.on[data-status=absent]  { background: var(--bad);  border-color: var(--bad);  color: #fff; }
.zsm-att-btn.on[data-status=leave]   { background: var(--warn); border-color: var(--warn); color: #fff; }
.zsm-att-btn.on[data-status=late]    { background: var(--brass);border-color: var(--brass);color: var(--ink-2); }

.zsm-tt-grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.zsm-tt-grid th, .zsm-tt-grid td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.zsm-tt-grid th { background: var(--ink); color: #fff; font-size: 11px; }
.zsm-tt-cell { cursor: pointer; min-height: 46px; }
.zsm-tt-cell:hover { background: var(--surface-2); }
.zsm-tt-cell strong { display: block; color: var(--ink); font-size: 12.5px; }
.zsm-tt-cell span { font-size: 10.5px; color: var(--muted); }
.zsm-tt-cell.empty { color: var(--line-2); }

/* ── CHART (pure CSS bars, no library) ───────────────────── */

.zsm-bars { display: flex; align-items: flex-end; gap: 5px; height: 148px; padding-top: 10px; }
.zsm-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.zsm-bar { width: 100%; background: var(--ink); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.zsm-bar.alt { background: var(--brass); }
.zsm-bar-label { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.zsm-bar-val { font-size: 10px; font-weight: 700; color: var(--ink); }

/* ── MODAL ───────────────────────────────────────────────── */

.zsm-modal {
	display: none; position: fixed; inset: 0; background: rgba(8,42,74,.5); z-index: 60;
	padding: 20px; overflow-y: auto;
}
.zsm-modal.on { display: flex; align-items: flex-start; justify-content: center; }
.zsm-modal-box {
	background: var(--surface); border-radius: 8px; width: 100%; max-width: 720px;
	margin: auto; box-shadow: 0 12px 44px rgba(8,42,74,.28); animation: zsmIn .16s ease;
}
.zsm-modal-box.wide { max-width: 1040px; }
@keyframes zsmIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.zsm-modal-head {
	padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.zsm-modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.zsm-modal-x {
	margin-left: auto; background: none; border: 0; font-size: 25px; line-height: 1;
	color: var(--muted); cursor: pointer; padding: 0 4px;
}
.zsm-modal-x:hover { color: var(--bad); }
.zsm-modal-body { padding: 18px; max-height: 68vh; overflow-y: auto; }
.zsm-modal-foot {
	padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px;
	justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 8px 8px;
}

/* ── TOASTS ──────────────────────────────────────────────── */

.zsm-toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.zsm-toast {
	background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r);
	font-size: 13px; box-shadow: var(--shadow); max-width: 380px; animation: zsmToast .2s ease;
	border-left: 3px solid var(--brass); line-height: 1.5;
}
.zsm-toast.bad { background: var(--bad); border-left-color: #7d1a14; }
.zsm-toast.ok  { background: var(--ok);  border-left-color: #0f5a3e; }
@keyframes zsmToast { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── LOADING ─────────────────────────────────────────────── */

.zsm-loading { padding: 64px 20px; text-align: center; color: var(--muted); }
.zsm-retry-link { color: var(--ink); font-weight: 700; text-decoration: underline; }
.zsm-spinner {
	width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--ink);
	border-radius: 50%; margin: 0 auto 14px; animation: zsmSpin .7s linear infinite;
}
@keyframes zsmSpin { to { transform: rotate(360deg); } }

.zsm-muted { color: var(--muted); font-size: 12.5px; }
.zsm-tiny  { font-size: 11.5px; color: var(--muted); }
.zsm-nowrap{ white-space: nowrap; }
.zsm-mono  { font-variant-numeric: tabular-nums; }
.zsm-right { text-align: right; }
.zsm-mb0   { margin-bottom: 0 !important; }
.zsm-hr    { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* ── LOGIN ───────────────────────────────────────────────── */

.zsm-login-wrap {
	min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px;
	font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.zsm-login-card {
	background: #fff; border-radius: 10px; padding: 30px; width: 100%; max-width: 386px;
	box-shadow: 0 18px 46px rgba(0,0,0,.28);
}
.zsm-login-brand { text-align: center; margin-bottom: 22px; }
.zsm-login-mark {
	width: 50px; height: 50px; border-radius: 10px; background: var(--brass); color: var(--ink-2);
	display: grid; place-items: center; font-weight: 800; font-size: 18px; margin: 0 auto 12px;
}
.zsm-login-card h1 { font-size: 21px; margin: 0 0 5px; color: var(--ink); font-weight: 800; }
.zsm-login-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.zsm-login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 13px; }
.zsm-login-card input {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
	font-size: 14px; margin-top: 5px; box-sizing: border-box;
}
.zsm-login-card input:focus { outline: 2px solid rgba(13,61,107,.28); border-color: var(--ink); }
.zsm-login-card .zsm-btn { margin-top: 6px; padding: 11px; font-size: 14px; }
.zsm-login-foot {
	margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
	font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.6;
}

/* ── PUBLIC ADMISSION FORM ───────────────────────────────── */

.zsm-public-form {
	max-width: 720px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
	padding: 22px; font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--text);
}
.zsm-public-form h3 { margin: 0 0 4px; color: var(--ink); font-size: 19px; }
.zsm-public-form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.zsm-public-form input, .zsm-public-form select, .zsm-public-form textarea {
	width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r);
	margin-top: 4px; font-size: 13.5px; box-sizing: border-box;
}
.zsm-public-form .zsm-btn { margin-top: 6px; }

/* ── PARENT PORTAL ───────────────────────────────────────── */

.zsm-parent { max-width: 900px; margin: 0 auto; padding: 18px; }
.zsm-parent-head {
	background: var(--ink); color: #fff; border-radius: 8px; padding: 18px 20px;
	display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.zsm-parent-head img { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; background: var(--ink-3); }
.zsm-parent-head .ph { width: 58px; height: 58px; border-radius: 8px; background: var(--ink-3); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.zsm-parent-head h2 { margin: 0; font-size: 19px; }
.zsm-parent-head span { font-size: 12.5px; opacity: .82; }
.zsm-parent-head .zsm-signout { margin-left: auto; width: auto; padding: 8px 16px; }

.zsm-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.zsm-tab {
	background: none; border: 0; padding: 9px 15px; font-size: 13.5px; font-weight: 600;
	color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.zsm-tab.active { color: var(--ink); border-bottom-color: var(--brass); }

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 1100px) {
	.zsm-cols { grid-template-columns: 1fr; }
	.zsm-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
	.zsm-side { transform: translateX(-100%); box-shadow: 4px 0 20px rgba(0,0,0,.2); }
	.zsm-side.open { transform: none; }
	.zsm-main { margin-left: 0; }
	.zsm-burger { display: flex; }
	.zsm-view { padding: 14px; }
	.zsm-top { padding: 0 14px; }
	.zsm-top h1 { font-size: 16px; }
	.zsm-grid-2, .zsm-grid-3, .zsm-grid-4 { grid-template-columns: 1fr; }
	.zsm-modal { padding: 10px; }
	.zsm-modal-body { max-height: 74vh; }
	.zsm-toast-stack { left: 12px; right: 12px; bottom: 12px; }
	.zsm-toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
	.zsm-side, .zsm-top, .zsm-toast-stack, .zsm-modal, .zsm-filters, .zsm-row-actions { display: none !important; }
	.zsm-main { margin-left: 0; }
	.zsm-card { border: 1px solid #999; page-break-inside: avoid; }
}
