/* ==========================================================================
   Academy panel design system (admin + student portal)
   Brand colours arrive as CSS variables from the academy's settings.
   ========================================================================== */
[hidden] { display: none !important; }
:root {
  --bg: #F3F5F2;
  --panel: #FFFFFF;
  --panel-2: #FAFBF9;
  --line: #E1E6E2;
  --line-2: #CDD5D0;
  --ink: #17221E;
  --ink-2: #47544F;
  --ink-3: #75817C;
  --ink-4: #A3ACA8;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
  --green: #1C7346; --green-bg: #E3F3EA;
  --amber: #8F5300; --amber-bg: #FDF0D5;
  --red: #B42318; --red-bg: #FCE9E7;
  --blue: #1B5AA0; --blue-bg: #E5EFFA;
  --purple: #673C9C; --purple-bg: #F0E9FA;
  --gray: #55615C; --gray-bg: #ECEFED;
  --r-panel: 12px;
  --r-ctl: 8px;
  --shadow-pop: 0 12px 32px -8px rgba(18, 32, 27, .22), 0 2px 6px rgba(18, 32, 27, .06);
  --sidebar-w: 252px;
  --topbar-h: 60px;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-display: var(--font-body);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: 600; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.hidden { display: none !important; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-amber { color: var(--amber); }

/* ---------- Layout shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; scrollbar-width: thin; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); min-height: var(--topbar-h); }
.sb-brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.sb-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.sb-name { font-weight: 650; font-size: 14.5px; line-height: 1.2; }
.sb-name small { display: block; color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.sb-nav { padding: 10px 10px 24px; flex: 1; }
.sb-group-label { font-size: 11.5px; color: var(--ink-4); padding: 14px 10px 4px; font-weight: 600; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 14px; text-decoration: none !important; position: relative; width: 100%; border: 0; background: none; cursor: pointer; font-family: inherit; text-align: left; }
.sb-link .ic { color: var(--ink-3); }
.sb-link:hover { background: var(--gray-bg); color: var(--ink); }
.sb-link.active { background: var(--brand-50); color: var(--brand-text); font-weight: 600; }
.sb-link.active .ic { color: var(--brand-text); }
.sb-link .chev { margin-left: auto; width: 15px; height: 15px; transition: transform .15s; }
.sb-item.open > .sb-link .chev { transform: rotate(180deg); }
.sb-sub { display: none; padding: 2px 0 6px 38px; }
.sb-item.open > .sb-sub { display: block; }
.sb-sub a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink-3); font-size: 13.5px; text-decoration: none; }
.sb-sub a:hover { color: var(--ink); background: var(--gray-bg); }
.sb-sub a.active { color: var(--brand-text); font-weight: 600; background: var(--brand-50); }
.sb-count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; line-height: 18px; }
.sb-foot { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-4); }
.sb-foot a { color: var(--ink-3); }

/* Sidebar styles chosen in Branding */
.sidebar-brand .sidebar { background: var(--brand-800); border-color: transparent; }
.sidebar-brand .sb-brand, .sidebar-brand .sb-foot { border-color: rgba(255,255,255,.1); }
.sidebar-brand .sb-name, .sidebar-brand .sb-link:hover { color: #fff; }
.sidebar-brand .sb-name small, .sidebar-brand .sb-group-label, .sidebar-brand .sb-foot, .sidebar-brand .sb-foot a { color: rgba(255,255,255,.55); }
.sidebar-brand .sb-link, .sidebar-brand .sb-link .ic, .sidebar-brand .sb-sub a { color: rgba(255,255,255,.75); }
.sidebar-brand .sb-link:hover, .sidebar-brand .sb-sub a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-brand .sb-link.active, .sidebar-brand .sb-sub a.active { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-brand .sb-link.active .ic { color: var(--accent); }
.sidebar-brand .sb-mark { background: var(--accent); color: var(--accent-ink); }
.sidebar-dark .sidebar { background: #16201C; border-color: transparent; }
.sidebar-dark .sb-brand, .sidebar-dark .sb-foot { border-color: rgba(255,255,255,.08); }
.sidebar-dark .sb-name { color: #fff; }
.sidebar-dark .sb-name small, .sidebar-dark .sb-group-label, .sidebar-dark .sb-foot, .sidebar-dark .sb-foot a { color: rgba(255,255,255,.45); }
.sidebar-dark .sb-link, .sidebar-dark .sb-link .ic, .sidebar-dark .sb-sub a { color: rgba(255,255,255,.7); }
.sidebar-dark .sb-link:hover, .sidebar-dark .sb-sub a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-dark .sb-link.active, .sidebar-dark .sb-sub a.active { background: color-mix(in srgb, var(--brand) 45%, transparent); color: #fff; }
.sidebar-dark .sb-link.active .ic { color: #fff; }

.sb-backdrop { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.topbar .menu-btn { display: none; }
.gsearch { position: relative; flex: 1; max-width: 460px; }
.gsearch input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font: inherit; color: var(--ink); }
.gsearch input:focus { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
.gsearch > .ic { position: absolute; left: 11px; top: 10px; color: var(--ink-3); }
.gsearch-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); max-height: 420px; overflow-y: auto; padding: 6px; display: none; }
.gsearch-results.open { display: block; }
.gsearch-results .grp { font-size: 11.5px; color: var(--ink-4); font-weight: 600; padding: 8px 10px 2px; }
.gsearch-results a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.gsearch-results a:hover, .gsearch-results a.hl { background: var(--brand-50); }
.gsearch-results a span { color: var(--ink-3); font-size: 12.5px; margin-left: auto; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--panel); border-color: var(--line); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; font: inherit; color: var(--ink); }
.user-chip:hover { background: var(--panel); border-color: var(--line); }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who b { display: block; font-size: 13.5px; font-weight: 600; }
.user-chip .who small { color: var(--ink-3); font-size: 11.5px; }
.content { padding: 24px 28px 48px; width: 100%; max-width: 1440px; }
.app-footer { margin-top: auto; padding: 16px 28px; font-size: 12px; color: var(--ink-4); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.app-footer a { color: var(--ink-3); }

/* ---------- Avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); display: inline-grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 21px; }
.avatar.xl { width: 92px; height: 92px; font-size: 28px; border-radius: 18px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .nm { font-weight: 600; color: var(--ink); line-height: 1.25; }
.person .sub { font-size: 12.5px; color: var(--ink-3); }
a.person:hover .nm { color: var(--brand-text); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head .lead { color: var(--ink-3); margin: 4px 0 0; max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs .ic { width: 14px; height: 14px; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel + .panel { margin-top: 16px; }
.grid > .panel + .panel, .grid > * + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 15px; font-weight: 650; }
.panel-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--r-panel) var(--r-panel); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-side-main { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 16px; position: relative; min-width: 0; }
.stat .k { color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.stat .k .ic { width: 16px; height: 16px; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.stat.hero { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.stat.hero .k, .stat.hero .s { color: color-mix(in srgb, var(--brand-ink) 75%, transparent); }
.stat a.cover { position: absolute; inset: 0; border-radius: inherit; }
.stat.warn .v { color: var(--red); }
.mini-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.mini-stats div b { display: block; font-size: 19px; font-weight: 700; }
.mini-stats div span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn { --b: var(--panel); --c: var(--ink); --bd: var(--line-2); display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--bd); background: var(--b); color: var(--c); 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:hover { background: var(--panel-2); border-color: var(--ink-4); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { --b: var(--brand); --c: var(--brand-ink); --bd: var(--brand); }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-accent { --b: var(--accent); --c: var(--accent-ink); --bd: var(--accent); }
.btn-accent:hover { background: var(--accent-700); border-color: var(--accent-700); color: #fff; }
.btn-danger { --b: var(--red); --c: #fff; --bd: var(--red); }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn-ghost { --b: transparent; --bd: transparent; --c: var(--ink-2); }
.btn-ghost:hover { background: var(--gray-bg); border-color: transparent; }
.btn-ghost.danger { --c: var(--red); }
.btn-ghost.danger:hover { background: var(--red-bg); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-xs .ic { width: 14px; height: 14px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.btn-group .btn.active { background: var(--brand-50); color: var(--brand-text); border-color: var(--brand-200); position: relative; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--red); font-weight: 500; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--panel); font: inherit; font-size: 14px; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
textarea.input.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 360px; tab-size: 2; white-space: pre; }
select.input { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2375817C' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.input[multiple] { height: auto; min-height: 110px; padding: 6px; background-image: none; }
.input:hover { border-color: var(--ink-4); }
.input:focus { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
.input.is-invalid { border-color: var(--red); }
.input-sm { height: 32px; font-size: 13px; }
.input[type=color] { padding: 3px; width: 56px; cursor: pointer; }
.input[type=file] { padding: 6px; height: auto; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.input-group .addon { display: grid; place-items: center; padding: 0 11px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--panel-2); color: var(--ink-3); font-size: 13px; }
.input-group .addon.pre { border-left: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); order: -1; }
.input-group .addon.pre + .input, .input-group .addon.pre ~ .input { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--ink); font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.form-section { padding: 20px 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > h3 { font-size: 15px; margin-bottom: 4px; }
.form-section > .desc { color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 16px; flex-wrap: wrap; }
.image-field { display: flex; gap: 14px; align-items: center; }
.image-field .preview { width: 72px; height: 72px; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--panel-2) center/cover no-repeat; display: grid; place-items: center; color: var(--ink-4); flex: none; overflow: hidden; }
.image-field .preview img { width: 100%; height: 100%; object-fit: contain; }
.image-field .preview.wide { width: 128px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field .input[type=text] { width: 110px; font-family: ui-monospace, monospace; text-transform: uppercase; }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.radio-card { position: relative; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: block; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.radio-card b { display: block; font-size: 14px; }
.radio-card span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Filters bar ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.filters .input { height: 34px; font-size: 13.5px; width: auto; min-width: 140px; }
.filters .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.filters .search .input { width: 100%; padding-left: 32px; }
.filters .search .ic { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--ink-3); }
.filters .spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none !important; cursor: pointer; }
.chip:hover { border-color: var(--ink-4); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.chip.active .n { color: rgba(255,255,255,.7); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBFCFA; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions-col { text-align: right; white-space: nowrap; width: 1%; }
.table .actions-col .btn + .btn, .table .actions-col form + .btn, .table .actions-col .btn + form { margin-left: 4px; }
.table .check-col { width: 36px; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table tfoot td { font-weight: 700; background: var(--panel-2); border-top: 1px solid var(--line-2); }
.table.compact td { padding: 7px 12px; }
.table.compact th { padding: 8px 12px; }
.table tr.is-off td { color: var(--ink-4); }
.row-link { color: var(--ink); font-weight: 600; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none !important; background: var(--panel); }
.pagination a:hover { border-color: var(--ink-4); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .gap { border: 0; background: none; }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 18px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 13.5px; flex-wrap: wrap; }
.bulkbar.show { display: flex; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-green { color: var(--green); background: var(--green-bg); }
.badge-amber { color: var(--amber); background: var(--amber-bg); }
.badge-red { color: var(--red); background: var(--red-bg); }
.badge-blue { color: var(--blue); background: var(--blue-bg); }
.badge-purple { color: var(--purple); background: var(--purple-bg); }
.badge-gray { color: var(--gray); background: var(--gray-bg); }
.badge-brand { color: var(--brand-text); background: var(--brand-50); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-2); font-weight: 500; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--ink-3); font-weight: 600; font-size: 13.5px; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; text-decoration: none !important; font-family: inherit; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a.active, .tabs button.active { color: var(--brand-text); border-bottom-color: var(--brand); }
.tabs .n { font-size: 11.5px; background: var(--gray-bg); color: var(--ink-3); padding: 0 6px; border-radius: 99px; margin-left: 4px; }
.panel > .tabs { padding: 0 12px; margin-bottom: 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: 14px; align-items: flex-start; }
.alert .ic { margin-top: 1px; }
.alert-info { background: var(--blue-bg); border-color: #c6dbf3; color: #123e6f; }
.alert-warn { background: var(--amber-bg); border-color: #f2d9a6; color: #6c3f00; }
.alert-danger { background: var(--red-bg); border-color: #f4c7c2; color: #7a1a12; }
.alert-success { background: var(--green-bg); border-color: #bfe3cf; color: #134d30; }
.alert b { font-weight: 650; }
.alert p:last-child { margin-bottom: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(400px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #17221E; color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 14px; animation: toastIn .22s ease-out; }
.toast .ic { margin-top: 1px; }
.toast.success .ic { color: #6ee7a8; }
.toast.error .ic { color: #fca5a0; }
.toast.warning .ic { color: #fcd38a; }
.toast.info .ic { color: #9cc7f5; }
.toast button { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 0 0 0 8px; font-size: 18px; line-height: 1; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17, 26, 22, .45); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.overlay.open { display: flex; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow-pop); animation: pop .18s ease-out; }
.modal.lg { max-width: 820px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 14px 14px; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(17,26,22,.4); z-index: 100; display: none; }
.drawer-overlay.open { display: block; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); z-index: 101; box-shadow: var(--shadow-pop); transform: translateX(100%); transition: transform .22s ease-out; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .modal-body { flex: 1; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--red-bg); color: var(--red); display: grid; place-items: center; margin-bottom: 12px; }
.confirm-icon .ic { width: 22px; height: 22px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 60; display: none; }
.dropdown.open .dropdown-menu { display: block; animation: pop .12s; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--ink); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none !important; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--gray-bg); }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu .sep { height: 1px; background: var(--line); margin: 5px 0; }
.dropdown-menu .head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.notif-menu { width: 360px; padding: 0; }
.notif-menu .list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--brand-50); }
.notif-item .t { font-weight: 600; font-size: 13.5px; }
.notif-item .m { font-size: 12.5px; color: var(--ink-2); }
.notif-item .w { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Empty, skeleton, progress ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .em-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--gray-bg); display: grid; place-items: center; margin: 0 auto 12px; color: var(--ink-3); }
.empty .em-ic .ic { width: 24px; height: 24px; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }
.skeleton { background: linear-gradient(90deg, #eceeec 25%, #f5f6f5 37%, #eceeec 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.progress { height: 8px; border-radius: 99px; background: var(--gray-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .4s ease; }
.progress.accent > span { background: var(--accent); }
.progress.sm { height: 6px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-row b { font-size: 13px; min-width: 40px; text-align: right; }
.ring { --p: 0; --size: 64px; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--gray-bg) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: attr(data-label); width: calc(var(--size) - 14px); height: calc(var(--size) - 14px); border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* ---------- Lists, timeline, definition ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; color: var(--ink); }
.list .m { font-size: 12.5px; color: var(--ink-3); }
.timeline { list-style: none; margin: 0; padding: 4px 18px 8px; }
.timeline li { position: relative; padding: 9px 0 9px 22px; border-left: 1px solid var(--line); margin-left: 6px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--panel); border: 2px solid var(--brand-200); }
.timeline li .w { color: var(--ink-3); font-size: 12px; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row span { color: var(--ink-3); }
.kv-row.total { font-weight: 700; font-size: 15.5px; border-bottom: 0; border-top: 1px solid var(--line-2); padding-top: 10px; }

/* ---------- Profile header ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { font-size: 22px; }
.profile-head .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
.profile-head .meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-head .meta .ic { width: 15px; height: 15px; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars .bar-row { display: grid; grid-template-columns: 140px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.bars .bar-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bars .bar-row b { text-align: right; }

/* ---------- Attendance grid ---------- */
.att-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.att-toggle label { position: relative; cursor: pointer; }
.att-toggle input { position: absolute; opacity: 0; }
.att-toggle span { display: block; padding: 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-left: 1px solid var(--line); }
.att-toggle label:first-child span { border-left: 0; }
.att-toggle input:focus-visible + span { box-shadow: inset var(--focus); }
.att-toggle input[value=present]:checked + span { background: var(--green-bg); color: var(--green); }
.att-toggle input[value=absent]:checked + span { background: var(--red-bg); color: var(--red); }
.att-toggle input[value=late]:checked + span { background: var(--amber-bg); color: var(--amber); }
.att-toggle input[value=leave]:checked + span { background: var(--purple-bg); color: var(--purple); }
.register { font-size: 12px; }
.register th, .register td { padding: 5px 4px !important; text-align: center; }
.register td:first-child, .register th:first-child { text-align: left; padding-left: 12px !important; position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 170px; }
.register .P { color: var(--green); font-weight: 700; }
.register .A { color: var(--red); font-weight: 700; background: var(--red-bg); }
.register .L { color: var(--amber); font-weight: 700; }
.register .V { color: var(--purple); font-weight: 700; }
.register .off { color: var(--ink-4); background: var(--panel-2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dh { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 4px 0; font-weight: 600; }
.cal .d { aspect-ratio: 1.2; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); }
.cal .d.present { background: var(--green-bg); border-color: #c4e6d2; color: var(--green); }
.cal .d.absent { background: var(--red-bg); border-color: #f2c9c4; color: var(--red); }
.cal .d.late { background: var(--amber-bg); border-color: #f0dbad; color: var(--amber); }
.cal .d.leave { background: var(--purple-bg); border-color: #dccff0; color: var(--purple); }
.cal .d.blank { background: none; border: 0; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .d b { font-weight: 650; color: inherit; }
.cal .d small { font-size: 10px; text-transform: capitalize; }

/* ---------- Timetable ---------- */
.tt { display: grid; grid-template-columns: repeat(var(--days, 7), minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tt-day h4 { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.tt-day.today h4 { color: var(--brand-text); }
.tt-slot { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; font-size: 13px; position: relative; }
.tt-slot.online { border-left-color: var(--accent); }
.tt-slot b { display: block; font-size: 13.5px; }
.tt-slot .time { font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
.tt-slot .m { color: var(--ink-3); font-size: 12px; }
.tt-slot .acts { position: absolute; top: 6px; right: 6px; display: none; gap: 2px; }
.tt-slot:hover .acts { display: flex; }

/* ---------- LMS tree ---------- */
.tree { list-style: none; margin: 0; padding: 0; }
.tree .node { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--panel); }
.tree .node-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.tree .node-head h4 { font-size: 14.5px; }
.tree .node-body { border-top: 1px solid var(--line); padding: 6px 0; }
.tree .leaf { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 18px; font-size: 13.5px; }
.tree .leaf:hover { background: var(--panel-2); }
.tree .leaf .grow { flex: 1; min-width: 0; }
.type-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--gray-bg); color: var(--ink-2); }
.type-ic .ic { width: 16px; height: 16px; }
.type-ic.youtube, .type-ic.video_embed { background: #fde8e7; color: #c4302b; }
.type-ic.pdf { background: #fdeee4; color: #b4501a; }
.type-ic.document { background: var(--blue-bg); color: var(--blue); }
.type-ic.image { background: var(--purple-bg); color: var(--purple); }
.type-ic.link { background: var(--brand-50); color: var(--brand-text); }
.type-ic.note { background: var(--amber-bg); color: var(--amber); }

/* ---------- Sortable ---------- */
.sortable-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px; }
.sortable-item.dragging { opacity: .5; }
.sortable-item.drag-over { border-color: var(--brand); box-shadow: var(--focus); }
.drag-handle { cursor: grab; color: var(--ink-4); display: grid; place-items: center; }
.sortable-item .grow { flex: 1; min-width: 0; }
.sortable-item.is-off { opacity: .6; background: var(--panel-2); }

/* ---------- Repeater ---------- */
.repeater-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: var(--panel-2); position: relative; }
.repeater-item .rm { position: absolute; top: 8px; right: 8px; }
.repeater-item .form-grid { gap: 10px 14px; }

/* ---------- Template editor ---------- */
.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.var-list { max-height: 560px; overflow-y: auto; }
.var-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 7px; cursor: pointer; text-align: left; font: inherit; }
.var-list button:hover { background: var(--brand-50); }
.var-list code { font-size: 12px; color: var(--brand-text); font-weight: 600; }
.var-list span { font-size: 12px; color: var(--ink-3); }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 10px; background: #e5e7e5; }

/* ---------- Quiz ---------- */
.q-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--panel); margin-bottom: 14px; }
.q-card .qn { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.q-card .qt { font-size: 15.5px; font-weight: 600; margin-bottom: 12px; white-space: pre-line; }
.q-opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 9px; margin-bottom: 8px; cursor: pointer; font-size: 14.5px; }
.q-opt:hover { border-color: var(--ink-4); }
.q-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.q-opt input { accent-color: var(--brand); width: 17px; height: 17px; margin: 0; }
.q-opt.correct { border-color: var(--green); background: var(--green-bg); }
.q-opt.wrong { border-color: var(--red); background: var(--red-bg); }
.quiz-timer { position: sticky; top: 72px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quiz-timer.low { background: var(--red); }

/* ---------- Misc ---------- */
.kbd { font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-3); background: var(--panel); }
.callout { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 16px 18px; }
.money-big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.video-frame { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #0d1210; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose { font-size: 15px; line-height: 1.7; max-width: 75ch; }
.prose h2 { font-size: 19px; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 16.5px; margin: 1.2em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--brand-200); color: var(--ink-2); }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose img { border-radius: 8px; }
.prose code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.prose pre { background: #17221E; color: #e8efe9; padding: 14px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.demo-banner { background: var(--accent-50); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: #5e4300; font-size: 13px; padding: 7px 28px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-banner a { color: #5e4300; font-weight: 600; text-decoration: underline; }
.section-type { font-size: 12px; color: var(--ink-3); }
.swatch { width: 18px; height: 18px; border-radius: 5px; display: inline-block; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.thumb { width: 64px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--gray-bg); flex: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.media-card .im { aspect-ratio: 4/3; background: var(--gray-bg) center/cover no-repeat; }
.media-card .b { padding: 8px 10px; font-size: 12.5px; }
.media-card .b .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-group td { background: var(--panel-2); font-weight: 650; font-size: 12.5px; color: var(--ink-2); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--panel); }
.auth-side { background: var(--brand-800); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(255,255,255,.06) 31px 32px); pointer-events: none; }
.auth-side.has-img::before { background: linear-gradient(180deg, color-mix(in srgb, var(--brand-800) 55%, transparent), color-mix(in srgb, var(--brand-800) 92%, transparent)); }
.auth-side > * { position: relative; }
.auth-side .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; font-weight: 650; font-size: 17px; }
.auth-side .brand img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.auth-side h2 { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; font-weight: 600; max-width: 16ch; }
.auth-side p { color: rgba(255,255,255,.75); max-width: 42ch; margin-top: 12px; }
.auth-side .foot { font-size: 12.5px; color: rgba(255,255,255,.6); }
.auth-side .foot a { color: rgba(255,255,255,.8); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-card .lead { color: var(--ink-3); margin: 6px 0 22px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--gray-bg); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.role-switch a { text-align: center; padding: 8px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-3); text-decoration: none !important; }
.role-switch a.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.role-switch.three { grid-template-columns: 1fr 1fr 1fr; }
.role-switch.four { grid-template-columns: repeat(4, 1fr); }
.role-switch.four a { padding: 8px 4px; font-size: 13px; }
.auth-card .field { margin-bottom: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-wrap button { position: absolute; right: 4px; top: 4px; height: 30px; width: 34px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 6px; }

/* ---------- Student portal ---------- */
.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-top { background: var(--brand-800); color: #fff; position: sticky; top: 0; z-index: 40; }
.portal-top .bar { display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 24px; max-width: 1240px; margin: 0 auto; }
.portal-top .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; text-decoration: none !important; }
.portal-top .brand img { width: 32px; height: 32px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.portal-top .brand .sb-mark { background: var(--accent); color: var(--accent-ink); }
.portal-nav { display: flex; gap: 2px; margin-left: 16px; overflow-x: auto; scrollbar-width: none; }
.portal-nav a { color: rgba(255,255,255,.72); padding: 7px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 500; white-space: nowrap; text-decoration: none !important; }
.portal-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.portal-nav a.active { color: #fff; background: rgba(255,255,255,.16); }
.portal-top .icon-btn { color: rgba(255,255,255,.8); }
.portal-top .icon-btn:hover { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.portal-top .icon-btn .dot { border-color: var(--brand-800); }
.portal-top .user-chip { color: #fff; }
.portal-top .user-chip:hover { background: rgba(255,255,255,.1); border-color: transparent; }
.portal-top .user-chip .who small { color: rgba(255,255,255,.6); }
.portal-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 24px 48px; }
.portal-more { display: none; }
.tabbar { display: none; }
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.welcome h1 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.welcome p { color: var(--ink-3); margin: 4px 0 0; }
.next-up { background: var(--brand); color: var(--brand-ink); border-radius: var(--r-panel); padding: 18px 20px; position: relative; overflow: hidden; }
.next-up::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(255,255,255,.07) 27px 28px); pointer-events: none; }
.next-up > * { position: relative; z-index: 1; }
.next-up .k { font-size: 12.5px; opacity: .75; }
.next-up h3 { font-size: 18px; margin: 4px 0 2px; }
.next-up .m { opacity: .85; font-size: 13.5px; }
.course-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none !important; transition: border-color .12s; }
.course-card:hover { border-color: var(--brand-200); }
.course-card .top { display: flex; gap: 12px; align-items: center; }
.course-card .cic { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-50); color: var(--brand-text); display: grid; place-items: center; font-weight: 700; flex: none; }
.course-card h3 { font-size: 15.5px; }
.course-card .m { color: var(--ink-3); font-size: 12.5px; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.lesson-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.lesson-nav a { display: flex; gap: 9px; align-items: flex-start; padding: 8px 14px; color: var(--ink-2); font-size: 13.5px; text-decoration: none !important; border-left: 2px solid transparent; }
.lesson-nav a:hover { background: var(--panel-2); color: var(--ink); }
.lesson-nav a.active { border-left-color: var(--brand); background: var(--brand-50); color: var(--brand-text); font-weight: 600; }
.lesson-nav .ch { padding: 12px 14px 4px; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.lesson-nav .done { color: var(--green); }
.content-block { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px; margin-bottom: 14px; }
.content-block .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.content-block .hd h3 { font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main-side { grid-template-columns: minmax(0, 1fr); }
  .tpl-editor { grid-template-columns: minmax(0, 1fr); }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson-nav { position: static; max-height: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(17,26,22,.4); z-index: 35; display: none; }
  .sb-backdrop.open { display: block; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: grid; }
  .user-chip .who { display: none; }
  .content { padding: 18px 16px 40px; }
  .g-2, .g-3, .g-side-main { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 24px; min-height: 0; }
  .auth-side h2, .auth-side p.lead-txt { display: none; }
  .auth-side .foot { display: none; }
  .portal-nav { display: none; }
  .portal-top .bar { padding: 0 14px; }
  .portal-main { padding: 18px 14px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none !important; border: 0; background: none; font-family: inherit; cursor: pointer; }
  .tabbar a.active { color: var(--brand-text); }
  .tabbar .ic { width: 21px; height: 21px; }
  .portal-more { display: block; position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 18px 18px 0 0; z-index: 60; transform: translateY(100%); visibility: hidden; transition: transform .22s ease-out, visibility 0s linear .22s; padding: 12px 12px calc(76px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-pop); }
  .portal-more.open { transform: none; visibility: visible; transition: transform .22s ease-out, visibility 0s; }
  .portal-more .grid-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .portal-more a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: none !important; text-align: center; }
  .portal-more a:hover, .portal-more a.active { background: var(--brand-50); color: var(--brand-text); }
  .portal-more .ic { width: 22px; height: 22px; }
  .welcome h1 { font-size: 23px; }
  .toasts { bottom: 84px; }
}
@media (max-width: 600px) {
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 20px; }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 21px; }
  .page-head .actions { width: 100%; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .filters .input, .filters .search { min-width: 0; max-width: none; width: 100%; flex: 1 1 100%; }
  .gsearch { display: none; }
  .notif-menu { width: calc(100vw - 24px); position: fixed; left: 12px; right: 12px; top: 64px; }
  .modal-body { padding: 16px; }
  .bars .bar-row { grid-template-columns: 100px 1fr 46px; }
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); color: var(--ink-3); font-size: 12.5px; text-align: left; }
  .table.stack-sm td.actions-col { justify-content: flex-end; width: auto; }
  .table.stack-sm td.actions-col::before { content: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .app-footer, .page-head .actions, .filters, .tabbar, .portal-top, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .panel { border: 0; }
  body { background: #fff; }
}
.stats.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
.stats.compact .v { font-size: 20px; white-space: normal; overflow: visible; }
.spacer { flex: 1; }
/* rich text editor */
.rte { border: 1px solid var(--line-2, var(--line)); border-radius: var(--r-ctl); background: var(--panel); overflow: hidden; }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.rte.is-invalid { border-color: var(--red); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border-bottom: 1px solid var(--line); background: var(--bg, #f7f7f5); }
.rte-bar .btn { font-weight: 600; min-width: 30px; }
.rte-bar .btn.active { background: var(--brand-50); color: var(--brand-text); }
.rte-area { min-height: 220px; max-height: 560px; overflow: auto; padding: 12px 14px; outline: none; }
.rte-area:empty::before { content: "Write your message…"; color: var(--ink-3); }
.rte textarea { border: 0; border-radius: 0; min-height: 220px; font-family: ui-monospace, monospace; font-size: 13px; }
.media-card > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--gray-bg, #eef1ef); }
.media-card .m { padding: 8px 10px; min-width: 0; }
.media-card .m b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-top .brand span { white-space: nowrap; }
.portal-more-dd { flex: none; }
.portal-more-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: rgba(255,255,255,.72); padding: 7px 11px; border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.portal-more-btn:hover, .portal-more-btn.active { color: #fff; background: rgba(255,255,255,.12); }
.portal-more-btn .ic { width: 14px; height: 14px; }
@media (max-width: 1360px) { .portal-top .user-chip .who { display: none; } }
@media (max-width: 900px) { .portal-more-dd { display: none; } }
.icon-btn .dot { top: 2px; right: 0; min-width: 14px; height: 14px; line-height: 14px; font-size: 9.5px; padding: 0 3px; transform: translate(30%, -10%); }
.fee-total { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--brand-50); color: var(--brand-text); font-size: 13.5px; }
.fee-total b { font-size: 15.5px; }
.fee-line .form-grid { padding-right: 28px; }

/* ---------- Camera attendance & face enrolment ---------- */
.att-card .att-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cam-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.cam-panel { overflow: hidden; }
.cam-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cam-late { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.cam-late .input { width: 118px; }
.cam-stage { position: relative; background: #0f172a; aspect-ratio: 4 / 3; max-height: 72vh; width: 100%; overflow: hidden; }
.cam-stage video, .cam-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-stage canvas { pointer-events: none; }
.cam-mirror .cam-stage video, .cam-mirror .cam-stage canvas { transform: scaleX(-1); }
.cam-idle { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: #e2e8f0; text-align: center; background: radial-gradient(circle at 50% 40%, #1e293b, #0f172a 70%); }
.cam-idle[hidden] { display: none; }
.cam-idle-in { max-width: 380px; display: grid; gap: 10px; justify-items: center; }
.cam-idle-in > svg { width: 44px; height: 44px; opacity: .8; }
.cam-idle-in b { font-size: 1.1rem; color: #fff; }
.cam-idle-in p { margin: 0; color: #cbd5e1; }
.cam-idle-in .muted { color: #94a3b8; }
.cam-status { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(15, 23, 42, .78); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: .85rem; max-width: calc(100% - 28px); text-align: center; }
.cam-status[hidden], .cam-status:empty { display: none; }
.cam-flash { position: absolute; left: 50%; top: 14px; transform: translate(-50%, -12px); opacity: 0; transition: opacity .18s, transform .18s; background: #16a34a; color: #fff; padding: 10px 18px; border-radius: 14px; display: grid; text-align: center; min-width: 180px; max-width: calc(100% - 28px); box-shadow: 0 10px 30px rgba(0,0,0,.35); pointer-events: none; }
.cam-flash.on { opacity: 1; transform: translate(-50%, 0); }
.cam-flash.bad { background: #dc2626; }
.cam-flash b { font-size: 1.05rem; }
.cam-flash span { font-size: .85rem; opacity: .9; }
.cam-list-panel .cam-list { max-height: 62vh; overflow-y: auto; }
.cam-list > li { padding: 9px 14px; gap: 10px; transition: background .4s; }
.cam-list > li .grow { min-width: 0; }
.cam-list > li .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-list > li.is-here { background: color-mix(in srgb, #16a34a 6%, transparent); }
.cam-list > li.just { background: color-mix(in srgb, #16a34a 22%, transparent); }
.cam-st { white-space: nowrap; }
@media (max-width: 900px) {
  .cam-layout { grid-template-columns: 1fr; gap: 12px; }
  .cam-stage { aspect-ratio: 3 / 4; max-height: 64vh; }
  .cam-list-panel .cam-list { max-height: none; }
  .cam-late { margin-left: 0; }
}
@media (max-width: 480px) {
  .cam-tools { padding: 10px; }
  .cam-tools .btn-group { width: 100%; }
  .cam-tools .btn-group .btn { flex: 1; justify-content: center; }
  .cam-panel .panel-foot .btn, .cam-list-panel .panel-foot .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Mobile refinements ---------- */
.att-sheet td .input { min-width: 160px; }
.tt-slot .acts { display: flex; opacity: 0; transition: opacity .15s; }
.tt-slot:hover .acts, .tt-slot:focus-within .acts { opacity: 1; }
@media (hover: none) { .tt-slot .acts { opacity: 1; } }
@media (max-width: 600px) {
  .demo-banner { padding: 8px 16px; font-size: 12.5px; gap: 4px 8px; display: block; }
  .demo-banner > svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
  /* Attendance sheet: one card per student, big touch targets */
  .att-sheet thead { display: none; }
  .att-sheet, .att-sheet tbody { display: block; }
  .att-sheet tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .att-sheet td { display: block; padding: 0; border: 0; }
  .att-sheet td.att-pct { align-self: center; font-size: 13px; }
  .att-sheet td:nth-child(3), .att-sheet td:nth-child(4) { grid-column: 1 / -1; }
  .att-sheet td .input { min-width: 0; width: 100%; }
  .att-sheet .att-toggle { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .att-sheet .att-toggle span { text-align: center; padding: 9px 4px; font-size: 13px; }
  /* Timetable: swipe between days, one and a bit columns visible */
  .tt { grid-template-columns: repeat(var(--days, 7), 80%); scroll-snap-type: x mandatory; }
  .tt-day { scroll-snap-align: start; }
  /* Calendar fits narrow screens */
  .cal { gap: 3px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal .d { aspect-ratio: 1; font-size: 12px; border-radius: 6px; }
  .cal .d small { font-size: 8.5px; }
  .cal .dh { font-size: 10.5px; }
}
@media (max-width: 380px) { .cal .d small { display: none; } }

/* Installer: institution type */
.seg-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.seg-choice .check { border: 1px solid var(--line-2, var(--line)); border-radius: 10px; padding: 12px 14px; align-items: flex-start; gap: 10px; cursor: pointer; }
.seg-choice .check:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }

/* Campus switcher */
.campus-switch, .campus-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 0 4px 0 10px; height: 36px; background: var(--panel); color: var(--ink-2); font-size: 13px; }
.campus-switch svg, .campus-chip svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.campus-switch select { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); padding: 0 6px 0 0; height: 32px; max-width: 170px; cursor: pointer; }
.campus-switch select:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.campus-chip { padding-right: 12px; font-weight: 600; }
@media (max-width: 600px) { .campus-switch select { max-width: 110px; } .campus-chip span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* Parent portal: child switcher */
.child-bar { background: var(--panel); border-bottom: 1px solid var(--line); }
.child-bar-in { max-width: 1240px; margin: 0 auto; padding: 8px 20px; display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.child-bar-in::-webkit-scrollbar { display: none; }
.child-bar .lbl { font-size: 12.5px; color: var(--ink-3); margin-right: 4px; flex: none; }
.child-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 13.5px; text-decoration: none !important; flex: none; background: var(--panel); }
.child-chip .avatar { width: 28px; height: 28px; font-size: 11px; }
.child-chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink, #fff); }
.child-chip:hover:not(.on) { border-color: var(--brand-200); background: var(--brand-50); }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kid-card { display: flex; flex-direction: column; }
.kid-card .kid-head { display: flex; gap: 14px; align-items: center; padding: 18px 18px 14px; }
.kid-card .kid-head h2 { font-size: 18px; margin: 0; }
.kid-card .kid-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.kid-card .kid-facts > div { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.kid-card .kid-facts > div:nth-child(odd) { border-right: 1px solid var(--line); }
.kid-card .kid-facts .k { font-size: 12px; color: var(--ink-3); }
.kid-card .kid-facts .v { font-weight: 650; margin-top: 2px; }
.kid-card .kid-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 16px; margin-top: auto; }
@media (max-width: 600px) { .child-bar-in { padding: 8px 14px; } .kid-grid { grid-template-columns: 1fr; } }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Camera attendance start page */
.cam-start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cam-start { margin: 0 !important; display: flex; gap: 16px; padding: 20px; color: var(--ink); text-decoration: none !important; align-items: flex-start; }
.cam-start > .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-50); color: var(--brand-text, var(--brand)); display: grid; place-items: center; flex: none; }
.cam-start > .ic svg { width: 24px; height: 24px; }
.cam-start > div { flex: 1; min-width: 0; }
.cam-start b { font-size: 16.5px; display: block; }
.cam-start p { color: var(--ink-3); font-size: 13.5px; margin: 6px 0 12px; }
.cam-start.gate { border-color: var(--brand-200); }
.cam-start.gate:hover { border-color: var(--brand); }
.cam-start .list > li { padding: 10px 0; }
.pick-card { display: block; color: var(--ink); text-decoration: none !important; }
.pick-card:hover { border-color: var(--brand-200); }
.section-title { font-size: 15px; font-weight: 650; margin: 8px 0 12px; color: var(--ink-2); }
.cam-search { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cam-list .cam-empty { justify-content: center; padding: 22px 14px; }
.filters-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.period-chips .chip { height: 34px; }
@media (max-width: 600px) { .filters-inline { width: 100%; } .filters-inline .input { flex: 1 1 100%; } .att-sheet td.att-pct { text-align: right; } }
.today-st { margin-top: 4px; font-size: 15px; }
.lesson-dots { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.lesson-dots li { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--line); }
.lesson-dots li span:first-child { color: var(--ink-3); font-size: 12.5px; }
.att-sheet .att-toggle.three { grid-template-columns: repeat(3, 1fr); }
.filters-inline .input { width: auto; max-width: 320px; }
.att-toggle input[value=promote]:checked + span { background: var(--green-bg); color: var(--green); }
.att-toggle input[value=repeat]:checked + span { background: var(--amber-bg); color: var(--amber); }
.promote-sheet .att-toggle input[value=leave]:checked + span { background: var(--red-bg); color: var(--red); }
.kid-grid > .panel { margin: 0; }

/* ---------- 2.1: fee collection desk, paid/unpaid tracker ---------- */
.tiny { font-size: 11px; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex: none; }
.sdot-green { background: var(--green); } .sdot-amber { background: #D98E04; } .sdot-red { background: var(--red); } .sdot-gray { background: #A8B1AD; }
.collect { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.8fr); gap: 18px; align-items: start; }
.collect .panel + .panel { margin-top: 0; }
.collect-done { grid-column: 1 / -1; }
.collect-input { display: flex; gap: 8px; }
.collect-input .search { position: relative; flex: 1; min-width: 0; }
.collect-input .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.collect-input .input { width: 100%; padding-left: 38px; height: 46px; font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.collect-input .btn { height: 46px; }
.collect-modes { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.collect-cam { position: relative; margin-top: 12px; border-radius: 10px; overflow: hidden; background: #0f172a; aspect-ratio: 4 / 3; }
.collect-cam[hidden], .collect-paste[hidden] { display: none; }
.collect-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.collect-cam-frame { position: absolute; inset: 18% 22%; border: 2px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.collect-cam-stop { position: absolute; right: 10px; bottom: 10px; }
.collect-cam-note { position: absolute; left: 12px; right: 12px; top: 12px; color: #e2e8f0; margin: 0; }
.collect-paste { margin-top: 12px; }
.collect-paste textarea { width: 100%; font-family: inherit; }
.collect-log { margin-top: 12px; display: grid; gap: 4px; }
.collect-msg { font-size: 13px; padding: 6px 10px; border-radius: 8px; border-left: 3px solid; }
.collect-msg.good { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.collect-msg.bad { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.collect-table .collect-amt { width: 104px; text-align: right; margin-left: auto; }
.collect-table td { vertical-align: middle; }
.collect-msg { line-height: 1.35; }
.collect-foot { justify-content: flex-start; align-items: flex-end; gap: 12px; }
.collect-foot .field { flex: 1 1 140px; }
.collect-foot .btn-lg { margin-left: auto; }
.collect-tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; flex: none; }
.collect-tick.good { background: var(--green-bg); color: var(--green); }
.collect-tick.bad { background: var(--red-bg); color: var(--red); }
.tracker-bar { padding: 0; margin-bottom: 14px; border: 0; gap: 10px; }
.fee-grid th.is-cur, .fee-grid td.is-cur { background: var(--brand-50); }
.fee-grid td { vertical-align: middle; }
.fcell { display: inline-block; min-width: 54px; padding: 3px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; text-align: center; text-decoration: none !important; border: 1px solid transparent; }
.fcell-paid { background: var(--green-bg); color: var(--green); }
.fcell-partial { background: var(--amber-bg); color: var(--amber); }
.fcell-unpaid { background: var(--red-bg); color: var(--red); }
.fcell-unpaid.is-overdue { border-color: var(--red); }
.fcell-none { color: var(--ink-4, #A8B1AD); }
.fee-legend { justify-content: flex-start; gap: 14px; }
.fee-legend > span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) {
  .collect { grid-template-columns: minmax(0, 1fr); }
  .collect-foot .btn-lg { flex: 1 1 100%; justify-content: center; margin-left: 0; }
  .collect-table .collect-amt { width: 100%; }
}
.narrow-form { max-width: 860px; }

/* ---------- 2.1: Admissions CRM ---------- */
.crm-filters { margin-bottom: 14px; }
.crm-filters .filters { border-bottom: 0; }
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; scroll-snap-type: x proximity; }
.crm-col { background: var(--panel-2, #F6F8F7); border: 1px solid var(--line); border-radius: 12px; min-height: 160px; display: flex; flex-direction: column; scroll-snap-align: start; border-top: 3px solid var(--gray); }
.crm-col-new { border-top-color: var(--blue); } .crm-col-contacted { border-top-color: #D98E04; } .crm-col-visit { border-top-color: var(--purple); }
.crm-col-test { border-top-color: var(--brand); } .crm-col-won { border-top-color: var(--green); } .crm-col-lost { border-top-color: #A8B1AD; }
.crm-col header { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; font-size: 13.5px; }
.crm-col header .n { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.crm-col.over { outline: 2px dashed var(--brand-200); outline-offset: -4px; }
.crm-cards { display: grid; gap: 8px; padding: 6px 8px 10px; max-height: 70vh; overflow-y: auto; }
.lead-card { display: grid; gap: 3px; padding: 10px 11px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 9px; color: var(--ink); text-decoration: none !important; cursor: grab; font-size: 13.5px; }
.lead-card:hover { border-color: var(--line-2); box-shadow: 0 2px 8px rgba(15, 30, 25, .06); }
.lead-card.prio-hot { border-left-color: var(--red); }
.lead-card.dragging { opacity: .45; }
.lead-card b { font-weight: 650; }
.lead-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.lead-due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-3); }
.lead-due .ic { width: 12px; height: 12px; }
.lead-due.late { background: var(--red-bg); color: var(--red); }
.lead-due.today { background: var(--amber-bg); color: var(--amber); }
.lead-due.later { background: var(--blue-bg); color: var(--blue); }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }
.crm-empty { padding: 10px 4px; margin: 0; text-align: center; }
.crm-more { text-align: center; padding: 4px; }
.lead-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.lead-step { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lead-step.done { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-text); }
.lead-step.cur { background: var(--brand); border-color: var(--brand); color: #fff; cursor: default; }
.lead-step.lost { border-style: dashed; }
.lead-step.lost.cur { background: var(--gray-bg); color: var(--ink-2); border-style: solid; border-color: var(--line-2); }
span.lead-step { cursor: default; }
.seg-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-pick label { position: relative; cursor: pointer; }
.seg-pick input { position: absolute; opacity: 0; pointer-events: none; }
.seg-pick span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; font-weight: 500; background: var(--panel); }
.seg-pick span .ic { width: 15px; height: 15px; }
.seg-pick input:checked + span { background: var(--brand-50); border-color: var(--brand); color: var(--brand-text); }
.seg-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.next-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.next-pick .input { width: auto; flex: 0 1 230px; }
.lead-timeline { list-style: none; margin: 0; padding: 4px 18px 10px; }
.lead-timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.lead-timeline li:last-child { border-bottom: 0; }
.lead-timeline .ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gray-bg); color: var(--ink-2); flex: none; }
.lead-timeline .ic svg { width: 15px; height: 15px; }
.lead-timeline .t-call .ic, .lead-timeline .t-whatsapp .ic { background: var(--green-bg); color: var(--green); }
.lead-timeline .t-visit .ic, .lead-timeline .t-meeting .ic { background: var(--purple-bg); color: var(--purple); }
.lead-timeline .t-stage .ic, .lead-timeline .t-system .ic { background: transparent; color: var(--ink-4, #A8B1AD); }
.lead-timeline .t-stage, .lead-timeline .t-system { color: var(--ink-3); }
.lead-timeline .body { margin: 3px 0; white-space: normal; }
.dup-hint { font-size: 12.5px; color: var(--amber); background: var(--amber-bg); padding: 6px 9px; border-radius: 7px; }
.dup-hint[hidden] { display: none; }
@media (max-width: 700px) {
  .crm-board { grid-auto-columns: 82%; }
  .hide-sm { display: none; }
  .next-pick .input { flex: 1 1 100%; }
}

.stats.compact.tracker-stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important; }
.fee-grid td:nth-child(2), .fee-grid th:nth-child(2) { min-width: 170px; }

/* ---------- 2.2: online applications ---------- */
.app-thumb { display: block; margin: 6px 0 10px; max-width: 220px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.app-thumb img { display: block; width: 100%; height: auto; }
.app-ans { text-align: right; max-width: 60%; overflow-wrap: anywhere; font-weight: 600; }
@media print {
  .sidebar, .topbar, .no-print, .crumbs, .demo-bar { display: none !important; }
  .g-main-side { grid-template-columns: minmax(0, 1fr) !important; }
}
.fb-step-head { gap: 10px; }
.fb-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.fb-step-title { font-weight: 650; font-size: 16px; flex: 1; min-width: 0; }
.fb-step-tools { display: flex; gap: 4px; align-items: center; }
.fb-qs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.fb-q { border-bottom: 1px solid var(--line); padding: 8px 14px; }
.fb-q.is-off .fb-q-label input { color: var(--ink-3); text-decoration: line-through; }
.fb-q-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 118px auto auto 28px; gap: 10px; align-items: center; }
.fb-order { display: flex; flex-direction: column; }
.fb-order .btn { height: 18px; min-height: 0; padding: 0 6px; }
.fb-q-label .input { font-weight: 600; }
.fb-more { padding: 12px 0 6px 34px; }
.fb-empty { padding: 14px; list-style: none; }
.fb-add { justify-content: flex-start; }
.fb-add .input { width: auto; }
.fb-addstep { width: 100%; border-style: dashed; justify-content: center; }
.fb-courses { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.fb-side { position: sticky; top: 76px; }
.fb-save .btn { width: 100%; justify-content: center; }
@media (max-width: 900px) {
  .fb-side { position: static; }
  .fb-q-main { grid-template-columns: auto minmax(0, 1fr) auto; }
  .fb-q-main .fb-w, .fb-q-main .check { grid-column: 2 / 3; }
  .fb-more { padding-left: 0; }
}

/* ---------- 2.2: paper designer ---------- */
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tpl-card { position: relative; display: grid; gap: 4px; cursor: pointer; }
.tpl-card input, .tpl-mini input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-thumb { display: block; aspect-ratio: 210 / 260; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 10% 11%; box-shadow: 0 1px 3px rgba(15,30,25,.06); position: relative; overflow: hidden; }
.tpl-thumb i { display: block; height: 4px; border-radius: 2px; background: #cfd6d2; margin-bottom: 7%; }
.tpl-thumb .h { height: 9px; width: 60%; margin: 0 auto 6%; background: #43504a; }
.tpl-thumb .m { height: 5px; border-top: 2px solid #43504a; border-bottom: 2px solid #43504a; background: transparent; padding: 4px 0; margin-bottom: 9%; }
.tpl-thumb .s { width: 40%; background: #43504a; }
.tpl-thumb .q { width: 92%; } .tpl-thumb .o { width: 70%; } .tpl-thumb .l { height: 22%; background: repeating-linear-gradient(#fff 0 9px, #dfe4e1 9px 10px); }
.tpl-modern .h { width: 100%; height: 18%; margin: -11% -12% 8%; width: 124%; background: var(--brand); border-radius: 0; }
.tpl-modern .s { background: var(--brand); }
.tpl-board .h { border: 2px solid #43504a; background: transparent; height: 16%; width: 100%; }
.tpl-board .m::after { content: ""; display: block; }
.tpl-board .o { height: 14%; width: 100%; background: radial-gradient(circle, transparent 2px, #43504a 2.5px, transparent 3px) 0 0 / 10px 10px; border: 1.5px solid #43504a; border-radius: 0; }
.tpl-worksheet .s { background: var(--accent); height: 8px; width: 55%; } .tpl-worksheet .l { height: 28%; background: repeating-linear-gradient(#fff 0 12px, #c7cfca 12px 13px); }
.tpl-compact i { margin-bottom: 4%; height: 3px; } .tpl-compact .q { width: 46%; display: inline-block; margin-right: 6%; }
.tpl-name { font-weight: 650; font-size: 14px; }
.tpl-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.tpl-card input:checked + .tpl-thumb, .tpl-mini input:checked + .tpl-thumb { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.tpl-card input:focus-visible + .tpl-thumb, .tpl-mini input:focus-visible + .tpl-thumb { outline: 2px solid var(--brand); outline-offset: 3px; }
.tpl-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tpl-mini label { position: relative; display: grid; gap: 3px; font-size: 11.5px; text-align: center; cursor: pointer; color: var(--ink-2); }
.tpl-mini .tpl-thumb { padding: 9%; border-radius: 5px; }
.tpl-mini .tpl-thumb i { height: 2px; margin-bottom: 9%; } .tpl-mini .tpl-thumb .h { height: 4px; }
.pe { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.pe-side { position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow-y: auto; display: grid; gap: 16px; }
.pe-side .panel { margin: 0; }
.pe-head .lead span[data-total] { font-weight: 700; color: var(--ink); }
.pe-sec { margin-bottom: 16px; }
.pe-sec-head { gap: 8px; }
.pe-sec-title { font-weight: 650; font-size: 16px; flex: 1; min-width: 0; }
.pe-sec-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pe-grow { flex: 1; min-width: 180px; }
.pe-num { width: 72px !important; display: inline-block; }
.pe-qs { list-style: none; margin: 0; padding: 0; }
.pe-q { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pe-q-side { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pe-qn { font-weight: 700; font-size: 15px; color: var(--brand-text); margin-bottom: 2px; }
.pe-q-body { display: grid; gap: 8px; min-width: 0; }
.pe-q-top { display: flex; gap: 8px; align-items: center; }
.pe-q-top .pe-marks { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.pe-text { width: 100%; resize: vertical; }
.pe-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; align-items: center; }
.pe-opt { display: flex; gap: 6px; align-items: center; border-radius: 8px; padding: 2px; }
.pe-opt.ok .input { border-color: var(--green); background: var(--green-bg); }
.pe-opt .ol { font-weight: 700; width: 14px; text-align: center; }
.pe-opt input[type=radio] { accent-color: var(--green); }
.pe-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pe-pairs { display: grid; gap: 6px; }
.pe-pair { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; }
.pe-img { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pe-img img { max-height: 120px; border: 1px solid var(--line); border-radius: 6px; }
.pe-add { justify-content: flex-start; gap: 6px; }
.pe-empty { padding: 16px; list-style: none; }
.pe-addsec { width: 100%; border-style: dashed; justify-content: center; }
.pe-toggles { display: grid; gap: 6px; }
.bank-list { display: grid; gap: 4px; max-height: 55vh; overflow-y: auto; }
.bank-q { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.bank-q span { display: grid; gap: 2px; }
.bank-q input { margin-top: 4px; }
@media (max-width: 1100px) {
  .pe { grid-template-columns: minmax(0, 1fr); }
  .pe-side { position: static; max-height: none; order: -1; }
}
@media (max-width: 640px) {
  .pe-opts { grid-template-columns: minmax(0, 1fr); }
  .pe-q { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .pe-q-side { flex-direction: row; }
  .pe-pair { grid-template-columns: 1fr; }
  .pe-pair span { display: none; }
  .tpl-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pe-row .input:not(.pe-grow):not(.pe-num) { width: auto; }

/* ---------- software license ---------- */
.lic-status { border-left: 4px solid var(--lic, var(--line-2)); }
.lic-active { --lic: var(--green); }
.lic-trial { --lic: var(--blue); }
.lic-grace, .lic-locked { --lic: var(--red); }
.lic-head { display: flex; gap: 12px; align-items: flex-start; }
.lic-head h2 { font-size: 18px; line-height: 1.35; }
.lic-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lic); flex: none; margin-top: 6px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--lic) 18%, transparent); }
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.lic-grid span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.lic-grid b { font-size: 15px; }
.lic-grid small { display: block; font-size: 12px; margin-top: 2px; }
.lic-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lic-activate { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lic-activate .field { flex: 1 1 260px; margin: 0; }
.lic-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; padding: 8px 28px; border-bottom: 1px solid transparent; }
.lic-banner a { font-weight: 600; text-decoration: underline; color: inherit; }
.lic-banner.info { background: var(--blue-bg); color: #123e6f; border-color: #c6dbf3; }
.lic-banner.warn { background: var(--amber-bg); color: #6c3f00; border-color: #f2d9a6; }
.lic-banner.danger { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); font-weight: 500; }
@media (max-width: 760px) { .lic-banner { padding: 8px 16px; font-size: 12.5px; display: block; } .lic-banner > svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; } .lic-banner a { margin-left: 6px; } }
.lock-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.lock-card { max-width: 500px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.lock-card .lock-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--red-bg); color: var(--red); margin-bottom: 14px; }
.lock-card h1 { font-size: 21px; margin: 0 0 8px; }
.lock-card p { color: var(--ink-2); line-height: 1.6; }
.lock-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.lock-attr { text-align: center; font-size: 12px; margin-top: 18px; }
.lock-attr a { color: var(--ink-3); }
.upd-new { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent); }

/* ---------- mobile app settings ---------- */
.app-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.app-stats > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.app-stats b { display: block; font-size: 24px; line-height: 1.1; }
.app-stats span { font-size: 12.5px; color: var(--ink-3); }
.app-share .app-qr { display: grid; place-items: center; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; margin-bottom: 12px; }
.app-share .app-qr img { width: 168px; height: 168px; image-rendering: pixelated; }
.app-share .btn { width: 100%; justify-content: center; }

/* ---------- public "get the app" page ---------- */
.getapp { min-height: 100vh; display: grid; place-content: center; padding: 28px 16px; background: var(--bg); }
.getapp-card { max-width: 760px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.getapp-head { display: flex; gap: 18px; align-items: center; padding: 26px 28px; background: var(--brand); color: #fff; }
.getapp-head h1 { font-size: 24px; margin: 0 0 4px; color: #fff; }
.getapp-head p { margin: 0; opacity: .88; line-height: 1.55; }
.getapp-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: contain; background: #fff; padding: 6px; flex: none; }
.getapp-logo.ph { display: grid; place-items: center; }
.getapp-body { display: grid; grid-template-columns: 1fr auto; gap: 26px; padding: 26px 28px; align-items: start; }
.getapp-btn { font-size: 16px; padding: 13px 22px; }
.getapp-steps { margin: 18px 0 0; padding-left: 20px; line-height: 1.6; color: var(--ink-2); }
.getapp-steps li { margin-bottom: 8px; }
.getapp-qr { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 200px; font-size: 12.5px; color: var(--ink-3); }
.getapp-qr img { width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.getapp-foot { margin: 0; padding: 14px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
@media (max-width: 640px) {
  .getapp-head { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .getapp-body { grid-template-columns: 1fr; padding: 22px 20px; }
  .getapp-qr { justify-self: center; }
  .getapp-btn { width: 100%; justify-content: center; }
  .getapp-foot { padding: 14px 20px; }
}
@media print { .getapp { min-height: 0; background: #fff; } .getapp-btn { display: none; } }
.login-app { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none !important; color: var(--ink); transition: border-color .2s, background-color .2s; }
.login-app:hover { border-color: var(--brand); background: var(--brand-50); }
.login-app .ic { width: 22px; height: 22px; color: var(--brand-text); flex: none; }
.login-app b { display: block; font-size: 14px; }
.login-app small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }

/* ---------- import data ---------- */
.imp-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: imp; }
.imp-steps li { counter-increment: imp; position: relative; padding: 10px 12px 10px 44px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.imp-steps li::before { content: counter(imp); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--gray-bg); color: var(--ink-3); }
.imp-steps li.on { border-color: var(--brand); }
.imp-steps li.on::before { background: var(--brand); color: #fff; }
.imp-steps li.done::before { content: "✓"; background: var(--green-bg); color: var(--green); }
.imp-steps li.on.done::before { background: var(--green); color: #fff; }
.imp-steps b { display: block; font-size: 13.5px; }
.imp-steps span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.imp-type { position: relative; cursor: pointer; }
.imp-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.imp-type-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.imp-type:hover .imp-type-card { border-color: var(--line-2); }
.imp-type input:checked + .imp-type-card { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.imp-type input:focus-visible + .imp-type-card { outline: 2px solid var(--brand); outline-offset: 2px; }
.imp-type-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gray-bg); color: var(--brand-text); margin-bottom: 4px; }
.imp-type input:checked + .imp-type-card .imp-type-ic { background: var(--brand); color: #fff; }
.imp-type-ic .ic { width: 18px; height: 18px; }
.imp-type-card b { font-size: 14.5px; }
.imp-type-card small { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; flex: 1; }
.imp-tpl { font-size: 12px; color: var(--ink-3); margin-top: 6px; position: relative; z-index: 1; }
.imp-tpl a { font-weight: 600; }
.imp-tips p { line-height: 1.55; }
.imp-map td { vertical-align: middle; }
.imp-map select { min-width: 190px; max-width: 100%; }
.imp-map tr.imp-missing td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.imp-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; border-top: 1px solid var(--line); }
.imp-opts fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.imp-opts legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; padding: 0; }
.imp-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.imp-sum > div { border-radius: 12px; padding: 12px 14px; background: var(--gray-bg); }
.imp-sum b { display: block; font-size: 26px; line-height: 1.1; }
.imp-sum span { font-size: 12.5px; }
.imp-sum .ok { background: var(--green-bg); color: var(--green); }
.imp-sum .up { background: var(--blue-bg); color: var(--blue); }
.imp-sum .sk { color: var(--ink-2); }
.imp-sum .bad { background: var(--red-bg); color: var(--red); }
.imp-rows tr.st-error td { background: color-mix(in srgb, var(--red-bg) 45%, transparent); }
.imp-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); }
.imp-logins { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .imp-steps { grid-template-columns: 1fr 1fr 1fr; }
  .imp-steps li { padding: 8px 8px 8px 36px; }
  .imp-steps li::before { left: 8px; width: 22px; height: 22px; }
  .imp-steps span { display: none; }
  .imp-steps b { font-size: 12px; line-height: 1.3; }
  .imp-sum { grid-template-columns: 1fr 1fr; }
  .imp-map select { min-width: 0; width: 100%; }
  html.in-app .imp-bar { bottom: calc(70px + env(safe-area-inset-bottom)); }
}
.imp-matchbox > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.imp-matchbox > summary::-webkit-details-marker { display: none; }
.imp-matchbox[open] > summary .btn { visibility: hidden; }
.imp-matchbox > summary h2 { font-size: 15px; }
.site-visibility.is-off { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: var(--amber-bg); }

/* ---------- Fees: generate & print (monthly run) ---------- */
.run-months { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.run-month-pick .input { width: 170px; }
.run-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.run-steps > .run-step { display: flex; flex-direction: column; margin: 0; }
.run-step .panel-body { flex: 1; }
.run-step h2 { display: flex; align-items: center; gap: 10px; }
.run-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-text); font-size: 13px; font-weight: 700; flex: none; }
.run-meter { font-size: 14px; color: var(--ink-2); }
.run-meter b { font-size: 28px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.run-meter .progress { margin-top: 10px; }
.run-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.run-due { display: flex; flex-direction: column; gap: 3px; }
.run-due .input { width: 170px; }
.run-done { display: inline-flex; align-items: center; gap: 8px; color: var(--green, #15803d); font-weight: 600; font-size: 14px; }
.run-count { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.run-job { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--gray-bg); }
.run-job.is-error { border-color: var(--red, #dc2626); }
.run-job-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13.5px; font-weight: 500; }
.run-table tr.run-same td { border-top-color: transparent; }
.run-table tfoot th { border-top: 2px solid var(--line-2); }
.run-table .inline-form { display: inline; }
@media (max-width: 900px) { .run-steps { grid-template-columns: 1fr; } .run-foot .btn-lg { width: 100%; justify-content: center; } }

/* ---------- Backup: Google Drive ---------- */
.drive-title { display: flex; align-items: center; gap: 12px; }
.drive-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); flex: none; }
.drive-status { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.drive-state { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 320px; min-width: 0; }
.drive-state > .ic { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--ink-3); }
.drive-state b { display: block; font-size: 14px; }
.drive-state span { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.drive-state.is-ok > .ic { color: var(--green, #15803d); }
.drive-state.is-bad > .ic, .drive-state.is-bad b { color: var(--red, #b91c1c); }
.drive-state.is-standby > .ic { color: var(--brand); }
.drive-now { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.drive-settings { border-top: 1px solid var(--line); }
.drive-settings > summary { cursor: pointer; padding: 12px 18px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
.drive-settings > summary::-webkit-details-marker { display: none; }
.drive-settings > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; }
.drive-settings[open] > summary::before { transform: rotate(45deg); }
.drive-settings > .panel-body { padding-top: 0; }
.drive-settings .seg-choice .check { display: flex; }
.drive-list { border-top: 1px solid var(--line); }
.drive-list-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px 4px; }
.drive-list-head h3 { font-size: 14px; margin: 0; }
.drive-list .badge { margin-left: 4px; }
.drive-list .alert { margin: 8px 18px 16px; }
.getapp-desk { display: flex; gap: 16px; padding: 22px 28px; border-top: 1px solid var(--line); }
.getapp-desk-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand-text); display: grid; place-items: center; flex: none; }
.getapp-desk-ic .ic { width: 22px; height: 22px; }
.getapp-desk h2 { font-size: 17px; margin: 2px 0 4px; }
.getapp-desk p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.55; }
.getapp-desk .btn-row { align-items: center; }
.getapp-desk [hidden] { display: none !important; }
.offline-card .getapp-body { grid-template-columns: 1fr; }
@media (max-width: 640px) { .getapp-desk { padding: 20px; flex-direction: column; } }
.offline-ic { color: var(--brand); } .offline-ic .ic { width: 30px; height: 30px; }

/* ---------- Fee lock ---------- */
.fee-lock-row { display: flex; gap: 14px; align-items: flex-start; }
.fee-lock-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gray-bg); color: var(--ink-3); flex: none; }
.fee-lock.is-on { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.fee-lock.is-on .fee-lock-ic { background: var(--brand-50); color: var(--brand-text); }
.fee-lock .field { margin: 0 0 6px; }
.lock-badge { vertical-align: middle; display: inline-flex; gap: 4px; align-items: center; }
.lock-badge .ic { width: 12px; height: 12px; }
.input.is-locked { background: var(--gray-bg); cursor: not-allowed; }

/* ---------- WhatsApp buttons ---------- */
.btn-wa { color: #0f7a3d; }
.btn-wa .ic { color: #16a34a; }
.wa-menu { min-width: 270px; }
.wa-menu-head { padding: 8px 12px 4px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.wa-menu a, .wa-menu button { display: flex !important; flex-direction: column; align-items: flex-start !important; gap: 1px; }
.wa-menu .wa-num { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wa-empty { padding: 8px 12px 12px; font-size: 13px; color: var(--ink-3); max-width: 260px; }
.actions-col .wa-dd { display: inline-block; }

/* ---------- Template designer ---------- */
.sx-modes { display: inline-flex; gap: 4px; padding: 4px; background: var(--gray-bg); border-radius: 12px; margin-bottom: 14px; }
.sx-modes button { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-3); padding: 7px 14px; border-radius: 9px; display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.sx-modes button .ic { width: 16px; height: 16px; }
.sx-modes button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sx { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--panel); overflow: hidden; }
.sx-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sx-bar-group { display: flex; gap: 6px; align-items: center; }
.sx-bar select { width: auto; }
.sx-status { font-size: 12.5px; color: var(--ink-3); min-width: 80px; }
.sx-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 640px; }
.sx-stage { background: #e8ebe9; overflow: auto; max-height: calc(100vh - 170px); min-height: 520px; }
.sx-canvas { width: 100%; border: 0; display: block; min-height: 520px; background: #e8ebe9; }
.sx-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 170px); }
.sx-tabs { display: flex; border-bottom: 1px solid var(--line); }
.sx-tabs button { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 11px 6px; border-bottom: 2px solid transparent; cursor: pointer; }
.sx-tabs button.active { color: var(--brand-text); border-bottom-color: var(--brand); }
.sx-panel { padding: 14px; overflow-y: auto; flex: 1; }
.sx-empty { text-align: center; color: var(--ink-3); font-size: 13.5px; padding: 18px 6px; }
.sx-empty .ic { width: 28px; height: 28px; color: var(--brand); margin-bottom: 6px; }
.sx-empty p { margin: 0 0 10px; line-height: 1.55; }
.sx-crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.8; }
.sx-crumbs button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-crumbs button.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-text); font-weight: 600; }
.sx-chipinfo { font-size: 12.5px; background: #eef3fc; border: 1px solid #d5e0f6; color: #2b4a85; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.sx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.sx-lbl { width: 54px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.sx-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.sx-seg button { border: 0; background: var(--panel); padding: 5px 8px; cursor: pointer; color: var(--ink-2); display: inline-grid; place-items: center; font: inherit; font-size: 12.5px; }
.sx-seg button + button { border-left: 1px solid var(--line); }
.sx-seg button .ic { width: 16px; height: 16px; }
.sx-seg button:hover { background: var(--gray-bg); }
.sx-seg button.on { background: var(--brand-50); color: var(--brand-text); }
.sx-size { display: inline-grid; place-items: center; min-width: 54px; font-size: 12.5px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.sx-row .sx-size { border: 0; }
.sx-swatches { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sx-sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.sx-sw:hover { transform: scale(1.12); }
.sx-pick { width: 26px; height: 24px; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px; background: var(--panel); cursor: pointer; }
.sx-clear { border: 0; background: none; font: inherit; font-size: 12px; color: var(--ink-3); cursor: pointer; text-decoration: underline; }
.sx-row input[type=range] { flex: 1; }
.sx-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.sx-hint { font-size: 12.5px; color: var(--ink-3); margin: 0 0 10px; }
.sx-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.sx-blocks button { display: flex; gap: 7px; align-items: center; border: 1px solid var(--line-2); background: var(--panel); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.sx-blocks button:hover { border-color: var(--brand); color: var(--brand-text); }
.sx-blocks .ic { width: 16px; height: 16px; }
.sx-fields { margin-top: 10px; }
.sx-fgroup { font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin: 12px 0 4px; }
.sx-field-btn { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; font: inherit; padding: 6px 8px; border-radius: 7px; cursor: pointer; text-align: left; }
.sx-field-btn:hover { background: #eef3fc; }
.sx-field-btn b { font-size: 13px; font-weight: 600; color: var(--ink); }
.sx-field-btn span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.sx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.sx-colors { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 14px; }
.sx-colors label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.sx-colors input[type=color] { width: 64px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: var(--panel); cursor: pointer; }
.sx-pdf-frame { width: 100%; height: 75vh; border: 0; display: block; }
@media (max-width: 1100px) { .sx-main { grid-template-columns: 1fr; } .sx-side { border-left: 0; border-top: 1px solid var(--line); max-height: none; } .sx-stage { max-height: 70vh; } }
.tpl-extras { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ==========================================================================
   2.6 — refined finish: depth, rhythm and calmer colour across every screen.
   Overrides only; layout and markup are unchanged.
   ========================================================================== */
:root {
  --bg: #EEF1EE;
  --panel-2: #F8FAF8;
  --line: #E2E7E3;
  --r-panel: 14px;
  --r-ctl: 10px;
  --shadow-1: 0 1px 2px rgba(16, 32, 26, .05), 0 3px 12px -6px rgba(16, 32, 26, .10);
  --shadow-2: 0 1px 2px rgba(16, 32, 26, .06), 0 10px 28px -12px rgba(16, 32, 26, .22);
}
body { background: radial-gradient(1200px 380px at 70% -120px, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }

/* sidebar */
.sidebar { background: linear-gradient(180deg, #FFFFFF, #FAFBFA); }
.sb-brand { gap: 12px; }
.sb-brand img, .sb-mark { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04); border-radius: 10px; }
.sb-link { border-radius: 10px; padding: 8px 10px; transition: background .12s, color .12s; }
.sb-link.active { background: var(--panel); color: var(--brand-text); box-shadow: var(--shadow-1); }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.sb-sub { border-left: 1px solid var(--line); margin-left: 19px; padding-left: 12px; }
.sb-sub a { border-radius: 8px; }
.sidebar-brand .sidebar { background: linear-gradient(180deg, var(--brand-800), color-mix(in srgb, var(--brand-800) 82%, #000)); }
.sidebar-brand .sb-link.active, .sidebar-brand .sb-sub a.active { background: rgba(255,255,255,.12); box-shadow: none; }
.sidebar-brand .sb-link.active::before, .sidebar-dark .sb-link.active::before { background: var(--accent); }
.sidebar-brand .sb-sub, .sidebar-dark .sb-sub { border-left-color: rgba(255,255,255,.12); }
.sidebar-dark .sb-link.active { box-shadow: none; }

/* top bar */
.topbar { background: color-mix(in srgb, #FFFFFF 72%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom-color: color-mix(in srgb, var(--line) 80%, transparent); }
.gsearch input { background: color-mix(in srgb, var(--bg) 70%, #fff); border-color: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.gsearch input:focus { background: #fff; }

/* headings */
.page-head h1 { font-size: 26px; letter-spacing: -.025em; }
.page-head .lead { color: var(--ink-2); opacity: .85; }
.panel-head h2, .panel-head h3 { font-size: 15.5px; letter-spacing: -.01em; }

/* surfaces */
.panel { border-color: rgba(20, 40, 30, .08); box-shadow: var(--shadow-1); }
.panel-head { padding: 15px 20px; }
.panel-body { padding: 18px 20px; }
.panel-foot { background: var(--panel-2); border-bottom-left-radius: var(--r-panel); border-bottom-right-radius: var(--r-panel); }
.stat { border-color: rgba(20, 40, 30, .08); box-shadow: var(--shadow-1); padding: 16px 18px; transition: transform .15s, box-shadow .15s; }
.stat:has(a.cover):hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.stat .v { font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat.hero { background: linear-gradient(135deg, var(--brand), var(--brand-700)); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 70%, transparent), var(--shadow-1); }
.dropdown-menu, .modal, .notif-menu { box-shadow: var(--shadow-pop), 0 0 0 1px rgba(20, 40, 30, .05); border-radius: 14px; }

/* controls */
.btn { height: 38px; border-radius: var(--r-ctl); box-shadow: 0 1px 1px rgba(16, 32, 26, .05); }
.btn-sm { height: 32px; } .btn-xs { box-shadow: none; } .btn-lg { height: 46px; }
.btn-ghost { box-shadow: none; }
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand)); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 1px 2px rgba(16, 32, 26, .25), 0 4px 10px -6px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-primary:hover { background: linear-gradient(180deg, var(--brand), var(--brand-700)); }
.btn-accent { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(16, 32, 26, .2); }
.btn:active { transform: translateY(.5px); }
.input, select.input, textarea.input { height: 40px; border-radius: var(--r-ctl); box-shadow: inset 0 1px 1px rgba(16, 32, 26, .04); }
.input-sm, select.input-sm { height: 34px; }
textarea.input { height: auto; padding-top: 9px; padding-bottom: 9px; }
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--brand); box-shadow: var(--focus); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.active .n { color: color-mix(in srgb, var(--brand-ink) 70%, transparent); }
.tabs a { border-radius: 8px 8px 0 0; }
.tabs a.active { color: var(--brand-text); }

/* tables */
.table th { background: var(--panel-2); color: var(--ink-3); font-size: 12.5px; letter-spacing: .01em; padding: 11px 16px; }
.table td { padding: 12px 16px; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--brand) 3.5%, #fff); }
.avatar { box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(16, 32, 26, .15); }

/* notices */
.alert { border-radius: 12px; }
.lic-banner, .demo-banner { font-size: 13px; }
.toast { border-radius: 12px; box-shadow: var(--shadow-pop); }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
@media (prefers-reduced-motion: reduce) { .stat, .btn, .sb-link { transition: none; } .stat:has(a.cover):hover { transform: none; } }

/* ---------- Attendance sheet (2.6) ---------- */
.att-head h1 .att-sec { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; margin-left: 6px; border-radius: 8px; background: var(--brand-50); color: var(--brand-text); font-size: 15px; vertical-align: 4px; }
.att-date { display: flex; gap: 4px; align-items: center; }
.att-date .input { width: 150px; }
.att-bar { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 12; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 10px; background: color-mix(in srgb, #fff 88%, transparent); backdrop-filter: blur(10px); border: 1px solid rgba(20, 40, 30, .08); border-radius: 16px; box-shadow: var(--shadow-1); }
.att-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.att-count { display: flex; align-items: baseline; gap: 6px; border: 1px solid transparent; border-radius: 12px; padding: 7px 14px; font: inherit; cursor: pointer; background: var(--gray-bg); color: var(--ink-2); }
.att-count b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.att-count span { font-size: 13px; font-weight: 600; }
.att-count.is-present { background: var(--green-bg); color: var(--green); }
.att-count.is-absent { background: var(--red-bg); color: var(--red); }
.att-count.is-late { background: var(--amber-bg); color: var(--amber); }
.att-count.is-leave { background: var(--purple-bg); color: var(--purple); }
.att-count.on { border-color: currentColor; box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent); }
.att-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.att-find { position: relative; }
.att-find .ic { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--ink-3); }
.att-find .input { padding-left: 32px; width: 230px; }
.att-tip { font-size: 12.5px; color: var(--ink-3); margin: 12px 4px; }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; font-size: 11px; font-weight: 700; color: var(--ink-2); background: #fff; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ast-card { position: relative; background: var(--panel); border: 1px solid rgba(20, 40, 30, .09); border-radius: 14px; box-shadow: var(--shadow-1); overflow: hidden; transition: border-color .15s, background .15s; }
.ast-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); transition: background .15s; }
.ast-card.is-absent { background: #FFF8F7; border-color: #F3CFCB; } .ast-card.is-absent::before { background: var(--red); }
.ast-card.is-late { background: #FFFBF2; border-color: #F1DEB4; } .ast-card.is-late::before { background: #D99A1E; }
.ast-card.is-leave { background: #FAF7FE; border-color: #E2D6F4; } .ast-card.is-leave::before { background: var(--purple); }
.att-main { display: flex; gap: 11px; align-items: center; width: 100%; border: 0; background: none; padding: 12px 12px 8px 16px; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.att-main:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); border-radius: 14px; }
.att-main .avatar { width: 42px; height: 42px; font-size: 14px; }
.att-who { min-width: 0; flex: 1; }
.att-name { display: block; font-weight: 650; font-size: 14.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-roll { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; margin-right: 6px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-2); font-size: 11.5px; font-weight: 700; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.att-sub { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.att-state { flex: none; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; color: var(--green); background: var(--green-bg); }
.ast-card.is-absent .att-state { color: var(--red); background: var(--red-bg); }
.ast-card.is-late .att-state { color: var(--amber); background: var(--amber-bg); }
.ast-card.is-leave .att-state { color: var(--purple); background: var(--purple-bg); }
.att-foot { display: flex; align-items: center; gap: 8px; padding: 0 12px 10px 16px; }
.att-pick { display: inline-flex; gap: 4px; }
.att-pick label { position: relative; cursor: pointer; }
.att-pick input { position: absolute; opacity: 0; pointer-events: none; }
.att-pick span { display: inline-grid; place-items: center; width: 30px; height: 26px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--ink-3); background: #fff; transition: background .12s, color .12s, border-color .12s; }
.att-pick label:hover span { border-color: var(--ink-4); color: var(--ink); }
.att-pick input:focus-visible + span { box-shadow: var(--focus); }
.att-pick input[value=present]:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.att-pick input[value=absent]:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.att-pick input[value=late]:checked + span { background: #C98712; border-color: #C98712; color: #fff; }
.att-pick input[value=leave]:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }
.att-pct { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.att-pct.low { color: var(--red); }
.att-note { border: 0; background: none; color: var(--ink-4); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-grid; }
.att-note .ic { width: 16px; height: 16px; }
.att-note.has, .att-note:hover { color: var(--brand-text); }
.att-remark { margin: 0 12px 12px 16px; width: calc(100% - 28px); }
.att-save { position: sticky; bottom: 12px; z-index: 12; margin-top: 16px; display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 14px 12px 20px; background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: blur(10px); border: 1px solid rgba(20, 40, 30, .1); border-radius: 16px; box-shadow: var(--shadow-2); }
.att-save-sum b { display: block; font-size: 15px; }
.att-save-sum span { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) {
  .att-bar { position: static; }
  .att-tools, .att-find, .att-find .input { width: 100%; }
  .att-tools .btn { flex: 1; }
  .att-grid { grid-template-columns: 1fr; }
  .att-count { padding: 6px 10px; } .att-count b { font-size: 17px; }
  .att-save .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .ast-card, .ast-card::before, .att-pick span { transition: none; } }
@media (max-width: 640px) { .att-save { padding: 8px; gap: 8px; bottom: 8px; } .att-save-sum { padding: 0 6px; } .att-save-sum span { display: none; } .att-save .btn-lg { height: 42px; } }
.att-overview .panel-body { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.att-ov-main { flex: 1 1 260px; font-size: 14px; color: var(--ink-2); }
.att-ov-main b { font-size: 18px; color: var(--ink); }
.att-ov-n { text-align: center; padding: 4px 14px; border-radius: 12px; }
.att-ov-n b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.att-ov-n span { font-size: 12px; font-weight: 600; }
.att-ov-n.is-p { background: var(--green-bg); color: var(--green); } .att-ov-n.is-a { background: var(--red-bg); color: var(--red); }
