/* RVS University ERP design system — implements DESIGN_PROMPT.md (tokens §2, shell §3, components §4, responsive §6). */

/* ============================================================ tokens */
:root {
  --primary: #3B5BDB; --primary-hover: #2F4AC2; --primary-700: #2B44B0; --primary-50: #EEF4FF; --primary-100: #E0EAFF; --primary-200: #C7D7FE;
  --ink: #101828; --gray-700: #344054; --gray-600: #475467; --gray-500: #667085; --gray-400: #98A2B3; --gray-300: #D0D5DD;
  --gray-200: #EAECF0; --gray-100: #F2F4F7; --gray-50: #F9FAFB; --canvas: #F6F7FB; --surface: #FFFFFF;
  --success: #12B76A; --success-50: #ECFDF3; --success-700: #027A48; --success-100: #D1FADF; --success-900: #05603A;
  --warning: #F79009; --warning-50: #FFFAEB; --warning-700: #B54708; --warning-100: #FEF0C7; --warning-900: #93370D;
  --error: #F04438; --error-50: #FEF3F2; --error-700: #B42318; --error-100: #FEE4E2; --error-300: #FDA29B;
  --violet: #7A5AF8; --violet-50: #F4F3FF; --violet-700: #5925DC;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-seg: 0 1px 2px rgba(16, 24, 40, .08);
  --shadow-drawer: -12px 0 32px rgba(16, 24, 40, .18);
  --shadow-pop: 0 12px 24px rgba(16, 24, 40, .12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 260px;
  /* legacy aliases used by older page code */
  --text: var(--ink); --text-2: var(--gray-600); --text-3: var(--gray-500); --border: var(--gray-200); --border-strong: var(--gray-300);
  --bg: var(--canvas); --bg-elev: var(--surface); --bg-soft: var(--gray-50); --bg-hover: var(--gray-100);
  --danger: var(--error); --danger-50: var(--error-50); --info: var(--primary); --info-50: var(--primary-50); --violet-50: #F4F3FF;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.num, .mono, td, .kpi-value, .tt-cell, .stu .rn { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--gray-600); } .faint { color: var(--gray-500); }
.small { font-size: 13px; line-height: 18px; } .tiny { font-size: 12px; line-height: 18px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; } .grow { flex: 1; min-width: 0; } .gap-lg { gap: 16px; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-lg { margin-bottom: 20px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 16px; height: 16px; } svg.i.lg { width: 22px; height: 22px; }

/* ============================================================ login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -10%, color-mix(in srgb, var(--primary) 70%, #fff) 0%, transparent 55%),
    radial-gradient(900px 500px at 120% 110%, #0E9384 0%, transparent 55%), linear-gradient(150deg, var(--primary) 0%, #1E2A78 100%); }
.login-hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.login-hero .brand-big { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.login-hero .brand-big img { width: 68px; height: 68px; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.login-hero .bb-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.login-hero .faint { color: rgba(255, 255, 255, .72) !important; }
.login-hero h1 { font-size: 34px; line-height: 42px; letter-spacing: -.02em; max-width: 540px; margin-top: 40px; color: #fff; position: relative; z-index: 1; }
.login-hero p { color: rgba(255, 255, 255, .82); max-width: 500px; font-size: 15.5px; line-height: 25px; position: relative; z-index: 1; }
.hero-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 540px; margin-top: 26px; position: relative; z-index: 1; }
.hero-feat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  color: #fff; backdrop-filter: blur(6px); }
.hero-feat .hf-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); flex: none; }
.hero-feat b { display: block; font-size: 13.5px; font-weight: 700; } .hero-feat small { display: block; font-size: 12px; color: rgba(255, 255, 255, .72); }
.login-form-wrap { display: grid; place-items: center; align-content: center; padding: 32px; background: var(--surface); }
.login-band { display: none; }
.login-card { width: 100%; max-width: 400px; }
.login-card .lc-logo { width: 64px; height: 64px; border-radius: 50%; display: block; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(16, 24, 40, .12); }
.login-card h2 { font-size: 26px; line-height: 32px; letter-spacing: -.02em; }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--gray-500); display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { background: var(--gray-100); color: var(--gray-700); }
.login-help { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--gray-500); }
.login-card .btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
.demo-accounts { margin-top: 22px; border: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 12px; padding: 12px 14px; }
.demo-accounts summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.demo-accounts summary::-webkit-details-marker { display: none; }
.demo-accounts summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--gray-400, #98A2B3); border-bottom: 2px solid var(--gray-400, #98A2B3); transform: rotate(45deg); margin: -4px 2px 0 6px; transition: transform .15s; }
.demo-accounts[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--gray-300); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--gray-700); cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--primary); color: var(--primary-700); background: var(--primary-50); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; background: var(--canvas); }
  .login-hero { display: none; }
  .login-form-wrap { padding: 0 0 28px; display: block; place-items: normal; background: var(--canvas); }
  .login-band { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; color: #fff; padding: calc(34px + env(safe-area-inset-top, 0px)) 20px 70px;
    background: radial-gradient(500px 260px at 10% 0%, color-mix(in srgb, var(--primary) 65%, #fff) 0%, transparent 60%), linear-gradient(160deg, var(--primary) 0%, #1E2A78 100%);
    border-radius: 0 0 28px 28px; }
  .login-band img { width: 84px; height: 84px; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 8px 28px rgba(0, 0, 0, .28); }
  .login-band b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
  .login-band small { display: block; font-size: 13px; color: rgba(255, 255, 255, .8); margin-top: 2px; }
  .login-card { margin: -48px auto 0; width: calc(100% - 32px); max-width: 440px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 20px; padding: 22px 20px 20px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, .12); position: relative; }
  .login-card .lc-logo { display: none; }
  .login-card h2 { font-size: 22px; }
  .login-card .input { height: 48px; font-size: 16px; }
  .login-card .btn.lg { height: 50px; font-size: 16px; border-radius: 12px; }
}

/* friendly permission sheet (the app asks in its own words before the phone does) */
.perm-back { position: fixed; inset: 0; z-index: 400; background: rgba(16, 24, 40, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.perm-back.in { background: rgba(16, 24, 40, .5); }
.perm-sheet { width: 100%; max-width: 460px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 22px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); text-align: center; box-shadow: 0 -10px 40px rgba(16, 24, 40, .2); }
.perm-back.in .perm-sheet { transform: none; }
.perm-grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--gray-300); margin: 0 auto 14px; }
.perm-ic { width: 64px; height: 64px; border-radius: 20px; margin: 4px auto 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--primary), #0E9384); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent); }
.perm-ic svg.i.lg { width: 30px; height: 30px; }
.perm-sheet h3 { font-size: 20px; letter-spacing: -.01em; margin: 0; }
.perm-text { color: var(--gray-600); font-size: 14.5px; line-height: 22px; margin: 8px 0 14px; }
.perm-points { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; display: grid; gap: 8px; }
.perm-points li { display: flex; gap: 10px; align-items: center; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--gray-700); }
.perm-points li svg { color: var(--primary); flex: none; }
.perm-sheet .btn.lg { height: 50px; font-size: 16px; border-radius: 14px; }
.perm-later { margin-top: 8px; height: 44px; color: var(--gray-600); }
.perm-foot { font-size: 12.5px; color: var(--gray-500); margin: 10px 0 0; line-height: 18px; }
.perm-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 4px; }
.perm-opt { border: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 16px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--ink, #101828); cursor: pointer; font-family: inherit; }
.perm-opt svg.i { width: 26px; height: 26px; color: var(--primary); }
.perm-opt:active { transform: scale(.98); background: var(--primary-50); }
@media (min-width: 768px) { .perm-back { align-items: center; } .perm-sheet { border-radius: 24px; } }

/* profile photo */
.avatar { position: relative; overflow: hidden; }
.avatar.has-photo { color: transparent; background: var(--gray-100); }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar.xl { width: 112px; height: 112px; font-size: 34px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--primary-100); }
.pf-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pf-photo { position: relative; flex: none; }
.pf-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .55); border-radius: 50%; }
.pf-side { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 12px; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================ shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; height: 64px; border-bottom: 1px solid var(--gray-200); flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.brand .bt { font-weight: 800; font-size: 14px; line-height: 18px; color: var(--ink); letter-spacing: -.01em; }
.brand .bs { font-size: 11.5px; line-height: 16px; color: var(--gray-500); }
/* the link list scrolls on its own; brand and account card stay put */
.nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; scrollbar-color: transparent transparent; }
.nav:hover { scrollbar-color: var(--gray-300) transparent; }
.nav::-webkit-scrollbar { width: 6px; } .nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; } .nav:hover::-webkit-scrollbar-thumb { background: var(--gray-300); }
.nav-sec { display: flex; flex-direction: column; }
.nav-sec.top { gap: 2px; padding-bottom: 6px; }
.nav-sec + .nav-sec { margin-top: 4px; }
.nav-group { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; font: inherit; text-align: left;
  text-transform: uppercase; letter-spacing: .07em; font-size: 11px; font-weight: 700; color: var(--gray-400); padding: 10px 10px 6px; border-radius: 8px; }
.nav-group:hover { color: var(--gray-700); }
.nav-group .chev { display: grid; transition: transform .2s; transform: rotate(-90deg); }
.nav-sec.open .nav-group .chev { transform: none; }
.nav-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: var(--warning-100); color: var(--warning-700);
  font-size: 10.5px; letter-spacing: 0; transition: opacity .15s; }
.nav-sec.open .nav-dot { opacity: 0; }
.nav-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-sec.open .nav-items { grid-template-rows: 1fr; }
.nav-items > div { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 10px; color: var(--gray-700); font-weight: 500; flex: none;
  transition: background .12s, color .12s; }
.nav a:hover { background: var(--gray-100); color: var(--ink); }
.nav a.active { background: var(--primary-50); color: var(--primary-700); font-weight: 700; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav a.active svg { color: var(--primary); }
.nav a svg { color: var(--gray-500); flex: none; }
.nav .count { margin-left: auto; background: var(--warning-100); color: var(--warning-700); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 8px; }
.side-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; font: inherit; color: var(--gray-500); }
.side-me:hover { background: var(--gray-100); }
.side-me > div:nth-child(2) { flex: 1; }
.side-me .avatar { width: 34px; height: 34px; font-size: 12.5px; flex: none; }
.side-me .un { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 18px; } .side-me .ud { font-size: 11.5px; line-height: 15px; color: var(--gray-500); }
.integration { background: var(--primary-50); border: 1px solid #D1E0FF; border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 18px; color: var(--gray-700); }
.integration b { color: var(--ink); }
.integration .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-300); margin-right: 6px; }
.integration .dot.ok { background: var(--success); } .integration .dot.warn { background: var(--warning); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--gray-200); }
.search { position: relative; flex: 1; max-width: 420px; }
.search input { width: 100%; height: 40px; border: 1px solid var(--gray-300); border-radius: 8px; padding: 0 56px 0 38px; background: var(--surface); outline: none; }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.search > svg { position: absolute; left: 12px; top: 11px; color: var(--gray-400); }
.search .kbd { position: absolute; right: 10px; top: 10px; }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: var(--shadow-pop); max-height: 420px; overflow: auto; z-index: 60; padding: 6px; }
.search-results .sr { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.search-results .sr:hover, .search-results .sr.sel { background: var(--gray-100); }
.search-results .sr-h { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-400); padding: 8px 10px 4px; }
.term-pill { display: inline-flex; background: var(--gray-100); border-radius: 8px; padding: 3px; font-size: 12px; font-weight: 600; color: var(--gray-700); white-space: nowrap; }
.term-pill span { padding: 5px 10px; border-radius: 6px; }
.term-pill span.on { background: var(--surface); box-shadow: var(--shadow-seg); }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--gray-200); background: var(--surface); cursor: pointer; color: var(--gray-600); position: relative; flex-shrink: 0; }
.icon-btn:hover { background: var(--gray-50); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--error); border: 2px solid var(--surface); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--primary-700); background: var(--primary-100); flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.user-menu { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 10px; cursor: pointer; min-width: 0; }
.user-menu:hover { background: var(--gray-50); }
.user-menu .un { font-weight: 600; font-size: 13px; line-height: 18px; } .user-menu .ud { font-size: 12px; color: var(--gray-500); line-height: 16px; }
.menu-btn { display: none; }
.content { padding: 28px; width: 100%; max-width: 1480px; }

/* page header (§3) */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.crumb { font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.crumb a { color: var(--gray-500); } .crumb a:hover { color: var(--primary); }
.page-header h1 { font-size: 24px; line-height: 32px; letter-spacing: -.01em; font-weight: 700; }
.page-header .sub { font-size: 14px; color: var(--gray-500); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 1023px) {
  :root { --sidebar-w: 72px; }
  .sidebar .bt, .sidebar .bs, .nav a span.lbl, .nav-group, .nav .count, .sidebar-foot { display: none; }
  .nav a { justify-content: center; padding: 0; } .brand { justify-content: center; padding: 12px; }
  .nav-items, .nav-sec .nav-items { grid-template-rows: 1fr; } /* icon rail: every link shows */
  .nav-sec + .nav-sec { margin-top: 0; padding-top: 6px; border-top: 1px solid var(--gray-100); }
  .term-pill { display: none; }
}
@media (max-width: 767px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-drawer); }
  .sidebar.open .bt, .sidebar.open .bs, .sidebar.open .nav a span.lbl, .sidebar.open .nav .count { display: initial; }
  .sidebar.open .nav-group, .sidebar.open .sidebar-foot { display: flex; }
  .sidebar.open .nav-items { grid-template-rows: 0fr; } .sidebar.open .nav-sec.open .nav-items { grid-template-rows: 1fr; }
  .sidebar.open .nav-sec + .nav-sec { border-top: 0; padding-top: 0; margin-top: 4px; }
  .sidebar.open .nav a { justify-content: flex-start; padding: 0 10px; }
  .menu-btn { display: grid; }
  .content { padding: 16px; } .topbar { padding: 0 12px; }
  .search { max-width: none; } .user-menu .un, .user-menu .ud { display: none; }
}

/* ============================================================ components (§4) */
.card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow-card); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-h.bordered { padding-bottom: 14px; border-bottom: 1px solid var(--gray-200); }
.card-h h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.card-h .sub { font-size: 12px; color: var(--gray-500); line-height: 18px; }
.card-b { padding: 16px 18px 18px; }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.auto-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (max-width: 1279px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.section { margin-top: 20px; }

/* KPI */
.stat { padding: 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.stat .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat .l { color: var(--gray-600); font-size: 13px; font-weight: 500; line-height: 18px; }
.stat .ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.stat .v { font-size: 28px; line-height: 34px; letter-spacing: -.02em; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--gray-500); letter-spacing: 0; margin-left: 4px; }
.stat .t { font-size: 12px; font-weight: 500; color: var(--gray-500); line-height: 18px; }
.stat .t.good { color: var(--success-700); } .stat .t.warn { color: var(--warning-700); } .stat .t.bad { color: var(--error-700); }
.tint-indigo, .tint-sky { background: var(--primary-50); color: var(--primary-700); }
.tint-green { background: var(--success-50); color: var(--success-700); }
.tint-amber { background: var(--warning-50); color: var(--warning-700); }
.tint-rose { background: var(--error-50); color: var(--error-700); }
.tint-violet { background: var(--violet-50); color: var(--violet-700); }
.tint-gray { background: var(--gray-100); color: var(--gray-600); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--gray-300); background: var(--surface); color: var(--gray-700); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--gray-50); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--error-50); border-color: var(--error-50); color: var(--error-700); box-shadow: none; }
.btn.danger:hover { background: var(--error-100); }
.btn.success { background: var(--success-700); border-color: var(--success-700); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--gray-100); }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--primary); padding: 0; height: auto; font-size: 13px; }
.btn.link::after { content: " →"; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12px; gap: 6px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn .spinner { width: 15px; height: 15px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--gray-700); line-height: 18px; }
.field .hint { font-size: 12px; color: var(--gray-500); line-height: 18px; }
.field .err { font-size: 12px; color: var(--error-700); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--gray-300); background: var(--surface); outline: none; font-size: 14px; color: var(--ink); }
textarea.input { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 22px; }
.input::placeholder { color: var(--gray-400); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.input.invalid { border-color: var(--error-300); }
.input.sm { height: 32px; font-size: 13px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.input-icon .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; color: var(--gray-700); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.upload { border: 1px dashed var(--gray-300); border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; background: var(--surface); }
.upload:hover { border-color: var(--primary); background: var(--primary-50); }
.upload b { color: var(--primary); font-weight: 600; }
.upload .tiny { display: block; margin-top: 2px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* searchable select (combobox) */
.combo { position: relative; }
.combo .input { padding-right: 34px; cursor: pointer; }
.combo > svg { position: absolute; right: 10px; top: 11px; color: var(--gray-400); pointer-events: none; }
.combo-pop { position: fixed; z-index: 150; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: var(--shadow-pop); max-height: 300px; display: flex; flex-direction: column; }
.combo-pop .cs { padding: 8px; border-bottom: 1px solid var(--gray-200); }
.combo-pop .list { overflow: auto; padding: 4px; }
.combo-pop .opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.combo-pop .opt:hover, .combo-pop .opt.sel { background: var(--gray-100); }
.combo-pop .opt .od { font-size: 12px; color: var(--gray-500); }

/* pills / badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-green { background: var(--success-50); color: var(--success-700); }
.b-amber { background: var(--warning-50); color: var(--warning-700); }
.b-rose, .b-red { background: var(--error-50); color: var(--error-700); }
.b-sky, .b-indigo { background: var(--primary-50); color: var(--primary-700); }
.b-gray { background: var(--gray-100); color: var(--gray-600); }
.b-violet { background: var(--violet-50); color: var(--violet-700); }
.chip-kv { display: inline-flex; gap: 4px; max-width: 260px; padding: 2px 8px; border-radius: 6px; background: var(--gray-50); border: 1px solid var(--gray-200); font-size: 12px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-kv b { color: var(--gray-800); font-weight: 600; }
.count-badge { display: inline-block; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 18px; background: var(--gray-100); color: var(--gray-600); margin-left: 6px; }

/* tabs (underline) + segmented */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--gray-200); overflow-x: auto; }
.tab { padding: 10px 2px; font-weight: 600; font-size: 14px; color: var(--gray-500); cursor: pointer; border: 0; background: transparent; display: inline-flex; gap: 6px; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary-700); border-bottom-color: var(--primary); }
.tab.active .count-badge { background: var(--primary-50); color: var(--primary-700); }
.seg { display: inline-flex; background: var(--gray-100); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--gray-600); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-seg); }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--gray-600); padding: 10px 12px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; } .table th.sortable:hover { color: var(--ink); }
.table td { padding: 12px; border-bottom: 1px solid var(--gray-200); font-size: 14px; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 18px; } .table th:last-child, .table td:last-child { padding-right: 18px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--gray-50); }
.table tr.clickable { cursor: pointer; }
.table .t1 { font-weight: 600; color: var(--ink); } .table .t2 { font-size: 12px; color: var(--gray-500); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
.toolbar .input, .toolbar select.input { width: auto; min-width: 140px; height: 36px; font-size: 13px; }
.toolbar .input-icon .input { min-width: 220px; }
.toolbar.plain { padding: 0 0 14px; border-bottom: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--gray-200); font-size: 13px; color: var(--gray-600); }
.empty { padding: 40px 20px; text-align: center; }
.empty .ic { width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 10px; display: grid; place-items: center; background: var(--gray-100); color: var(--gray-500); }
.empty .et { display: block; padding: 0; border: 0; border-radius: 0; background: none; font-size: 16px; font-weight: 600; color: var(--ink); } .empty .ed { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-range .seg { margin-right: 4px; }

/* progress */
.progress { height: 8px; border-radius: 999px; background: var(--gray-100); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .5s ease; }
.progress.green > span { background: var(--success); } .progress.amber > span { background: var(--warning); } .progress.rose > span { background: var(--error); }
.progress .plan { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }
.ring { --p: 0; --c: var(--primary); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--gray-100) 0); flex-shrink: 0; }
.ring::after { content: attr(data-label); width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

/* approval chain + stepper */
.chain { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--gray-600); white-space: nowrap; }
.chain .d { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-300); }
.chain .d.ok { background: var(--success); } .chain .d.wait { background: var(--warning); } .chain .d.no { background: var(--error); }
.chain .ln { width: 16px; height: 1px; background: var(--gray-300); }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; min-width: 240px; }
.stepper .s { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--gray-500); }
.stepper .s i { height: 4px; border-radius: 999px; background: var(--gray-200); }
.stepper .s.on i { background: var(--primary); } .stepper .s.on { color: var(--gray-700); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-200); }
.list-item:last-child { border-bottom: 0; }

/* today's classes */
.class-card { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--surface); cursor: pointer; position: relative; overflow: hidden; }
.class-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--primary)); }
.class-card:hover { background: var(--gray-50); }
.class-card .time { min-width: 64px; padding-right: 14px; border-right: 1px solid var(--gray-200); }
.class-card .time b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.class-card .time span { font-size: 12px; color: var(--gray-500); }

/* ============================================================ timetable */
.tt { display: grid; gap: 6px; min-width: 760px; }
.tt-head { font-size: 12px; font-weight: 600; color: var(--gray-600); padding: 6px 8px; text-align: center; }
.tt-head small { display: block; font-weight: 500; color: var(--gray-500); font-variant-numeric: tabular-nums; }
.tt-day { font-weight: 600; display: flex; align-items: center; padding: 0 10px; font-size: 13px; color: var(--gray-700); }
.tt-day.today { color: var(--primary-700); }
.tt-cell { min-height: 76px; border-radius: 8px; border: 1px dashed var(--gray-300); padding: 8px 10px; font-size: 12px; position: relative; background: var(--surface); }
.tt-cell.editable { cursor: pointer; } .tt-cell.editable:hover { border-color: var(--primary); background: var(--primary-50); }
.tt-cell.filled { border: 1px solid transparent; border-left: 3px solid var(--c-fg, var(--primary)); background: var(--c-bg, var(--primary-50)); }
.tt-cell.filled .s { font-weight: 700; font-size: 13px; color: var(--c-fg, var(--primary)); }
.tt-cell .f, .tt-cell .r { color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-cell.break { background: var(--gray-50); border: 1px solid var(--gray-200); display: grid; place-items: center; color: var(--gray-400); font-weight: 600; min-height: 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.tt-cell.free { background: var(--gray-50); border-style: solid; border-color: var(--gray-100); }
.tt-cell .pill { position: absolute; right: 6px; bottom: 6px; }
.tt-cell.clash { border: 2px solid var(--error) !important; }

/* ============================================================ attendance roster */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.stu { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gray-200); background: var(--surface); cursor: pointer; user-select: none; }
.stu:hover { border-color: var(--gray-300); }
.stu .no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-100); color: var(--primary-700); font-weight: 700; font-size: 12px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.stu .nm { font-weight: 600; font-size: 13px; line-height: 17px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stu .rn { font-size: 12px; color: var(--gray-500); }
.stu.absent { border-color: var(--error-300); background: var(--error-50); }
.stu.absent .no { background: var(--error); color: #fff; }
.stu.disabled { cursor: default; }
.counter-bar { position: sticky; bottom: 12px; z-index: 5; margin-top: 18px; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--gray-200); box-shadow: var(--shadow-pop); }
.counter { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.counter span { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 12px; }
.tile .tl { font-size: 12px; color: var(--gray-500); } .tile .tv { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================ drawer / modal / toast */
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 40, .4); animation: fade .15s; }
.drawer { position: fixed; z-index: 101; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); box-shadow: var(--shadow-drawer); display: flex; flex-direction: column; animation: slideIn .2s ease; }
.drawer.wide { width: min(980px, 100%); }
.drawer-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--gray-200); }
.drawer-h h3 { font-size: 18px; line-height: 26px; font-weight: 700; }
.drawer-h .sub { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.drawer-b { flex: 1; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-f { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--gray-200); background: var(--surface); }
.drawer-f .help { flex: 1; font-size: 12px; color: var(--gray-500); }
@media (max-width: 560px) { .drawer-f .help { display: none; } .drawer-f { justify-content: flex-end; } }
.modal-backdrop { position: fixed; inset: 0; z-index: 110; background: rgba(16, 24, 40, .4); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop); border: 1px solid var(--gray-200); }
.modal.lg { max-width: 820px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal-h h3 { font-size: 18px; font-weight: 700; }
.modal-b { padding: 14px 20px 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
#toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 300px; max-width: 420px; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--gray-200); box-shadow: var(--shadow-pop); animation: slideUp .2s; }
.toast .ti { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.toast.ok .ti { background: var(--success-50); color: var(--success-700); } .toast.err .ti { background: var(--error-50); color: var(--error-700); } .toast.info .ti { background: var(--primary-50); color: var(--primary-700); }
.toast b { display: block; font-size: 14px; } .toast .tm { font-size: 12px; color: var(--gray-500); }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-height: 480px; overflow: auto; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow-pop); z-index: 60; }
@media (max-width: 767px) { .dropdown { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-height: calc(100vh - 90px); } }
.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--gray-200); cursor: pointer; }
.notif:hover { background: var(--gray-50); } .notif.unread { background: var(--primary-50); }
.notif .ni { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--gray-200); color: var(--gray-600); flex-shrink: 0; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.btn.primary .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.loading { display: grid; place-items: center; padding: 48px; }
.skeleton { background: var(--gray-100); border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 20px; border: 1px solid transparent; }
.alert.warn { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-100); }
.alert.err { background: var(--error-50); color: var(--error-700); border-color: var(--error-100); }
.alert.info { background: var(--primary-50); color: var(--primary-700); border-color: #D1E0FF; }
.alert.ok { background: var(--success-50); color: var(--success-700); border-color: var(--success-100); }
.kbd { font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--gray-300); background: var(--gray-50); color: var(--gray-500); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--gray-200); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.tl-item.APPROVE::before { border-color: var(--success); } .tl-item.REJECT::before { border-color: var(--error); } .tl-item.CANCEL::before { border-color: var(--gray-400); }

.unit { border: 1px solid var(--gray-200); border-radius: 10px; margin-bottom: 12px; overflow: hidden; background: var(--surface); }
.unit-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--gray-50); font-weight: 600; border-bottom: 1px solid var(--gray-200); }
.topic { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--gray-200); }
.unit-h + .topic { border-top: 0; }
.topic.covered .tt-title { color: var(--gray-500); text-decoration: line-through; }

.heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.heat div { aspect-ratio: 1; border-radius: 8px; font-size: 11px; display: grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.heat div.today { box-shadow: 0 0 0 2px var(--primary); }
.st-PRESENT { background: var(--success-100); color: var(--success-900); } .st-LATE { background: var(--warning-100); color: var(--warning-900); }
.st-HALF_DAY { background: #FDEAD7; color: #93370D; } .st-ABSENT { background: var(--error-100); color: var(--error-700); }
.st-ON_LEAVE { background: var(--primary-100); color: var(--primary-700); } .st-HOLIDAY { background: var(--gray-100); color: var(--gray-500); }
.chart-box { position: relative; height: 240px; } .chart-box.sm { height: 180px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--gray-600); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ============================================================ letterhead (A4 preview) */
.letter-stage { background: var(--gray-100); border-radius: 12px; padding: 20px; overflow: auto; }
.letter { width: 794px; min-height: 1123px; margin: 0 auto; background: #fff; box-shadow: 0 4px 16px rgba(16, 24, 40, .12); padding: 47px 96px 96px; font-family: "Cambria", "Times New Roman", serif; font-size: 15px; line-height: 1.5; color: #000; position: relative; transform-origin: top center; }
.letter .lh { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; padding-bottom: 6px; border-bottom: 2px solid #000; }
.letter .lh img { width: 74px; height: 74px; object-fit: contain; }
.letter .lh .lt { text-align: center; }
.letter .lh .lt .n { font-weight: 700; font-size: 22px; letter-spacing: .06em; }
.letter .lh .lt .a:empty { display: none; }
.letter .lh .lt .a { font-weight: 700; font-size: 14px; margin-top: 6px; }
.letter .lh .lt .p { font-size: 14px; margin-top: 4px; }
.letter .ltitle { text-align: center; font-weight: 700; text-decoration: underline; margin: 18px 0 6px; }
.letter .ldate { text-align: right; font-weight: 700; margin-bottom: 18px; }
.letter .lmeta { margin-bottom: 14px; }
.letter .lbody { text-align: justify; }
.letter .lbody p { margin: 0 0 12px; }
.letter .lbody table { border-collapse: collapse; width: 100%; margin: 10px 0 14px; }
.letter .lbody td, .letter .lbody th { border: 1px solid #000; padding: 4px 6px; vertical-align: top; text-align: left; }
.letter .lbody ul, .letter .lbody ol { margin: 6px 0 12px; padding-left: 28px; }
.letter .lsign { position: relative; height: 150px; margin-top: 28px; }
.letter .sigbox { position: absolute; text-align: center; width: 260px; cursor: grab; border: 1px dashed transparent; border-radius: 6px; padding: 4px; }
.letter .sigbox.editable { border-color: var(--primary-200); background: rgba(238, 244, 255, .5); }
.letter .sigbox.editable:active { cursor: grabbing; }
.letter .sigbox img { max-width: 180px; max-height: 60px; display: block; margin: 0 auto 2px; }
.letter .sigbox .sn { font-weight: 700; } .letter .sigbox .sd { font-weight: 700; }
.letter .lextra { margin-top: 16px; font-size: 14px; }
@media print {
  body * { visibility: hidden !important; }
  .print-root, .print-root * { visibility: visible !important; }
  .print-root { position: absolute; left: 0; top: 0; }
  .letter { box-shadow: none; transform: none !important; }
  .sigbox { border-color: transparent !important; background: none !important; }
}

/* rich text editor */
.rte { border: 1px solid var(--gray-300); border-radius: 8px; background: var(--surface); }
.rte:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.rte-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 8px 8px 0 0; }
.rte-tools button { width: 32px; height: 30px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--gray-700); font-weight: 700; display: grid; place-items: center; }
.rte-tools button:hover { background: var(--gray-200); }
.rte-tools .sep { width: 1px; background: var(--gray-200); margin: 4px 4px; }
.rte-area { min-height: 220px; max-height: 420px; overflow: auto; padding: 12px 14px; outline: none; line-height: 22px; font-family: "Cambria", "Times New Roman", serif; font-size: 15px; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--gray-400); }
.rte-area table { border-collapse: collapse; width: 100%; margin: 6px 0; }
.rte-area td, .rte-area th { border: 1px solid var(--gray-400); padding: 4px 6px; min-width: 40px; }
.rte-area p { margin: 0 0 8px; }

/* student profile */
.profile-head { display: flex; gap: 16px; align-items: center; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--gray-500); } .kv dd { margin: 0; font-weight: 500; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slideIn { from { transform: translateX(32px); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .55; } }
.fade-in { animation: fade .2s ease; }

/* faculty week timetable */
.tt-cell.tt-holiday { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--gray-50); border: 1px solid var(--gray-200); color: var(--gray-500); font-weight: 600; font-size: 13px; }
.tt-cell.covering { border: 1px dashed var(--violet-700); border-left: 3px solid var(--violet-700); background: var(--violet-50); }
.tt-cell.covering .s { color: var(--violet-700); }
.tt-cell.handed { background: var(--gray-100); border-left-color: var(--gray-400); opacity: .75; }
.tt-cell.handed .s { color: var(--gray-500); text-decoration: line-through; }
.tt-cell .pill .icon { color: var(--success-700); }
.dot-warn { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px var(--warning-50); }

.tint-teal { background: #F0FDF9; color: #0E9384; }

/* ---------------------------------------------------------------- internal marks */
.mk-cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.mk-card { display: flex; flex-direction: column; overflow: hidden; }
.mk-card-h { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 4px; border-top: 3px solid var(--c, var(--primary)); }
.mk-asmts { display: flex; flex-direction: column; border-top: 1px solid var(--gray-100); }
.mk-asmt { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: none; border: 0; border-bottom: 1px solid var(--gray-100); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mk-asmt:hover { background: var(--gray-50); }
.mk-asmt .nm { width: 48px; font-weight: 700; font-size: 13px; color: var(--gray-700); flex: none; }
.mk-asmt > svg { color: var(--gray-400); flex: none; }
.mk-card-f { padding: 8px 12px; margin-top: auto; }
.mk-opt { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.mk-opt:hover { border-color: var(--primary); }
.mk-opt.on { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px var(--primary-50); }
.mk-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: none; border: 0; padding: 4px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.mk-cell:hover { background: var(--gray-50); }
.seg .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; background: var(--gray-400); vertical-align: 1px; }
.seg .dot.APPROVED { background: var(--success); } .seg .dot.SUBMITTED { background: var(--warning); } .seg .dot.RETURNED { background: var(--error); }
.mk-flow { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.mk-flow .st { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 130px; font-size: 13px; color: var(--gray-500); font-weight: 600; white-space: nowrap; }
.mk-flow .st:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--gray-200); border-radius: 2px; min-width: 16px; }
.mk-flow .st i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-100); color: var(--gray-500); font-size: 12px; flex: none; }
.mk-flow .st.done { color: var(--gray-700); } .mk-flow .st.done i { background: var(--success); color: #fff; } .mk-flow .st.done::after { background: var(--success); }
.mk-flow .st.now { color: var(--primary-700); } .mk-flow .st.now i { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-50); }
.mk-builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.mk-side { position: sticky; top: 84px; }
@media (max-width: 1100px) { .mk-builder { grid-template-columns: 1fr; } .mk-side { position: static; } }
.mk-part-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; }
.mk-ptitle { font-weight: 700; width: 160px; }
.mk-pmax { margin-left: auto; font-weight: 700; color: var(--primary-700); background: var(--primary-50); padding: 4px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.mk-qtable td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.mk-qtable .input { height: 36px; }
.mk-qtable textarea.mk-qtext { height: 36px; min-height: 36px; resize: vertical; padding-top: 7px; line-height: 20px; }
.mk-no { font-weight: 700; color: var(--gray-700); padding-top: 16px !important; }
.mk-grp td:first-child { border-left: 3px solid var(--violet); }
.mk-or-row td { padding: 0 !important; border: 0 !important; text-align: center; height: 0; }
.mk-or-row span { position: relative; top: -2px; display: inline-block; font-size: 11px; font-weight: 700; color: var(--violet-700); background: var(--violet-50); padding: 1px 10px; border-radius: 999px; letter-spacing: .06em; }
.btn.mk-or-on { background: var(--violet-50); color: var(--violet-700); border-color: var(--violet-700); }
.mk-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 18px; border-top: 1px dashed var(--gray-200); }
.mk-addpart { border-style: dashed; justify-content: center; padding: 14px; }
.mk-max { font-size: 36px; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.mk-pline { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--gray-50); font-size: 13px; }
.mk-bar { display: flex; align-items: center; gap: 8px; } .mk-bar .k { width: 34px; font-size: 12px; font-weight: 600; color: var(--gray-600); }
.mk-save { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-500); }
.mk-save.ok { color: var(--success-700); } .mk-save.err { color: var(--error-700); }
.spin-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gray-300); border-top-color: var(--primary); animation: mkspin .8s linear infinite; display: inline-block; }
@keyframes mkspin { to { transform: rotate(360deg); } }
.mk-hint { display: flex; align-items: center; gap: 6px; padding: 0 18px 10px; }
.mk-gridwrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 320px; border-top: 1px solid var(--gray-200); }
.mk-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.mk-grid th, .mk-grid td { border-bottom: 1px solid var(--gray-100); padding: 0; background: var(--surface); white-space: nowrap; }
.mk-grid thead th { position: sticky; z-index: 2; background: var(--gray-50); color: var(--gray-600); font-weight: 600; font-size: 12px; text-align: center; padding: 6px 8px; }
.mk-grid thead tr.mk-h1 th { top: 0; height: 34px; } .mk-grid thead tr.mk-h2 th { top: 34px; }
.mk-grid th small { display: block; font-weight: 500; color: var(--gray-400); font-size: 11px; }
.mk-grid .mk-ph { border-left: 2px solid var(--gray-200); color: var(--gray-800); }
.mk-grid .mk-qh.first { border-left: 2px solid var(--gray-200); }
.mk-grid .mk-qh.or { color: var(--violet-700); }
.mk-grid .mk-sticky { position: sticky; z-index: 1; text-align: left; padding: 0 12px; }
.mk-grid thead .mk-sticky { z-index: 3; }
.mk-grid .mk-roll { left: 0; width: 104px; min-width: 104px; font-variant-numeric: tabular-nums; color: var(--gray-600); }
.mk-grid .mk-name { left: 104px; width: 210px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; box-shadow: 2px 0 0 var(--gray-200); }
.mk-grid .mk-ab { width: 44px; text-align: center; }
.mk-grid td.mk-c { width: 58px; text-align: center; }
.mk-grid td.mk-c.ro { padding: 9px 6px; font-variant-numeric: tabular-nums; }
.mk-in { width: 56px; height: 38px; border: 0; background: transparent; text-align: center; font: inherit; font-variant-numeric: tabular-nums; color: var(--ink); outline: none; }
.mk-in:focus { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); border-radius: 4px; }
.mk-in.bad { background: var(--error-50); box-shadow: inset 0 0 0 2px var(--error); color: var(--error-700); border-radius: 4px; }
.mk-in:disabled { background: repeating-linear-gradient(135deg, var(--gray-50), var(--gray-50) 4px, var(--surface) 4px, var(--surface) 8px); }
.mk-grid tbody tr:hover td { background: var(--gray-50); }
.mk-grid td.mk-total { width: 72px; text-align: center; font-weight: 800; font-size: 14px; color: var(--ink); border-left: 2px solid var(--gray-200); }
.mk-grid tr.is-low td.mk-total { color: var(--error-700); }
.mk-grid tr.is-absent td.mk-total { color: var(--gray-400); }
.mk-grid td.mk-warn { width: 36px; text-align: center; color: var(--gray-300); }
.mk-warn.w { color: var(--warning) !important; cursor: help; } .mk-warn.ok { color: var(--success) !important; }
.mk-sumbar { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 14px 18px; border-top: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 0 0 12px 12px; }
.mk-sumbar .it { display: flex; flex-direction: column; } .mk-sumbar .it span { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; } .mk-sumbar .it b { font-size: 15px; font-variant-numeric: tabular-nums; }
.mk-qtable { table-layout: fixed; width: 100%; min-width: 760px; }
.mk-qtable textarea.mk-qtext { width: 100%; }
.mk-qtable select.input, .mk-qtable input.input { width: 100% !important; padding-left: 8px; padding-right: 4px; }
.mk-qtable th, .mk-qtable td { padding-left: 6px; padding-right: 6px; }
.mk-qtable th:first-child, .mk-qtable td:first-child { padding-left: 18px; }

/* internal marks v2 — lighter faculty screens */
.mk-todo { padding: 6px 6px 8px; }
.mk-todo-h { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px 6px; }
.mk-todo-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 14px; color: var(--gray-700); text-align: left; cursor: pointer; }
.mk-todo-i:hover { background: var(--gray-50); }
.mk-todo-i > svg:first-child { flex: none; }
.mk-todo-i.err > svg:first-child { color: var(--error); } .mk-todo-i.warn > svg:first-child { color: var(--warning); }
.mk-todo-i.ok > svg:first-child { color: var(--success); } .mk-todo-i.info > svg:first-child { color: var(--primary); }
.mk-list { overflow: hidden; }
.mk-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.mk-row:last-child { border-bottom: 0; }
.mk-row-l { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 0; }
.mk-row-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--gray-200); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-700); cursor: pointer; white-space: nowrap; }
.mk-chip:hover { border-color: var(--primary); }
.mk-chip.cur { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.mk-chip.APPROVED { border-color: var(--success-200, #abefc6); }
.mk-chip.SUBMITTED { border-color: var(--warning-200, #fedf89); }
.mk-chip.RETURNED { border-color: var(--error-200, #fecdca); }
.mk-chip.add { border-style: dashed; color: var(--primary-700); font-weight: 600; }
.mk-chip-s { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--gray-500); }
.mk-chip-s.ok { color: var(--success-700); } .mk-chip-s.warn { color: var(--warning-700); } .mk-chip-s.err { color: var(--error-700); }
.mk-sug { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--gray-200); background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--gray-700); }
.mk-sug:hover { border-color: var(--primary); } .mk-sug.on { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); font-weight: 600; }
.mk-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--gray-50); }
.mk-quick b { width: 52px; font-size: 13px; }
.mk-quick .input { height: 36px; }
.mk-qtotal { display: inline-flex; align-items: baseline; gap: 6px; } .mk-qtotal b { font-size: 22px; }
.mk-step { display: inline-flex; align-items: center; gap: 8px; }
.mk-step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--gray-100); color: var(--gray-500); }
.mk-step i.ok { background: var(--success); color: #fff; }
.tab.active .mk-step i:not(.ok) { background: var(--primary); color: #fff; }
.mk-details { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)) auto; gap: 14px; align-items: end; }
@media (max-width: 700px) { .mk-details { grid-template-columns: 1fr 1fr; } }
.mk-part-l { padding-bottom: 4px; }
.mk-part-l .mk-part-h { gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.mk-ptitle-l { border: 0; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); width: 120px; padding: 4px 6px; border-radius: 6px; background: transparent; }
.mk-ptitle-l:hover, .mk-ptitle-l:focus { background: var(--gray-50); outline: none; }
.mk-psel { height: 32px; border: 1px solid var(--gray-200); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: var(--surface); color: var(--gray-700); }
.mk-qs { padding: 6px 8px; }
.mk-q { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.mk-q:hover { background: var(--gray-50); }
.mk-q.grp { box-shadow: inset 3px 0 0 var(--violet); }
.mk-qno { width: 30px; flex: none; font-weight: 700; font-size: 13px; color: var(--gray-600); padding-top: 8px; }
.mk-qtext-l { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; line-height: 20px; resize: none; background: transparent; color: var(--ink); min-height: 36px; }
.mk-qtext-l:hover { border-color: var(--gray-200); background: var(--surface); }
.mk-qtext-l:focus { border-color: var(--primary); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--primary-50); }
.mk-qtext-l::placeholder { color: var(--gray-400); }
.mk-qm { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.mk-qm small { font-size: 12px; color: var(--gray-500); }
.mk-qmarks { width: 58px; height: 36px; border: 1px solid var(--gray-200); border-radius: 8px; text-align: center; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface); }
.mk-qmarks:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-50); }
.mk-qsel { height: 36px; border: 1px solid var(--gray-200); border-radius: 8px; padding: 0 6px; font: inherit; font-size: 12px; background: var(--surface); color: var(--gray-700); width: 92px; flex: none; }
.mk-orbtn { height: 30px; margin-top: 3px; padding: 0 8px; border-radius: 6px; border: 1px dashed var(--gray-300); background: none; font: inherit; font-size: 11px; font-weight: 700; color: var(--gray-500); cursor: pointer; flex: none; opacity: .55; }
.mk-q:hover .mk-orbtn { opacity: 1; }
.mk-orbtn.on { opacity: 1; border: 1px solid var(--violet-700); background: var(--violet-50); color: var(--violet-700); }
.mk-orspace { width: 38px; flex: none; }
.mk-del { width: 30px; height: 30px; margin-top: 3px; border: 0; border-radius: 6px; background: none; color: var(--gray-400); cursor: pointer; display: grid; place-items: center; flex: none; }
.mk-del:hover { background: var(--error-50); color: var(--error-700); }
.mk-or-sep { text-align: center; margin: -2px 0; } .mk-or-sep span { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--violet-700); background: var(--violet-50); padding: 1px 10px; border-radius: 999px; }
.mk-add-l { display: flex; align-items: center; gap: 8px; padding: 8px 16px 12px; flex-wrap: wrap; }
.mk-add-l .mk-qmarks { height: 32px; }
.mk-summary .mk-max { font-size: 40px; }
.mk-todo-a { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--primary-700); }
.mk-orbtn, .mk-orspace { width: 38px; }
.mk-quick { gap: 6px; }

/* university setup */
/* student portal */
.grid > * { min-width: 0; }
.sp-hero { display: flex; gap: 16px; align-items: center; padding: 20px; background: linear-gradient(120deg, var(--primary-50), var(--surface) 60%); }
.sp-name { font-size: 20px; font-weight: 700; }
.sp-slot { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--surface); }
.sp-time { display: flex; flex-direction: column; min-width: 78px; font-size: 12px; color: var(--gray-500); }
.sp-time b { color: var(--primary-700); font-size: 13px; }
.sp-week { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sp-day { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sp-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); }
.sp-day-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 4px; }
.sp-holiday { display: flex; gap: 8px; align-items: center; padding: 12px; border-radius: 10px; background: var(--gray-50); color: var(--gray-600); font-size: 13px; }
.sp-date { width: 44px; height: 46px; border-radius: 10px; background: var(--primary-50); color: var(--primary-700); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1.1; }
.sp-date b { font-size: 17px; } .sp-date span { font-size: 11px; text-transform: uppercase; }
.sp-ring { display: flex; gap: 20px; align-items: center; }
.sp-unread { background: #25D366; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.sp-internal { color: var(--primary-700); }
.sp-cancelled td { opacity: .6; } .sp-cancelled td b { text-decoration: line-through; }
.table th.center, .table td.center { text-align: center; }
@media (max-width: 767px) { .sp-hero { flex-direction: column; align-items: flex-start; } .kv { grid-template-columns: 120px 1fr; } }
.sp-quick { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.sp-q { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--surface); color: var(--gray-800); font-weight: 600; font-size: 13px; white-space: nowrap; flex: 1 0 auto; }
.sp-q:hover { border-color: var(--primary); color: var(--primary-700); }
.sp-q-i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.sp-subj { cursor: pointer; } .sp-subj:hover { border-color: var(--primary); }
.sp-subj-n { font-weight: 700; font-size: 16px; margin: 10px 0 4px; }
.sp-unit { border: 1px solid var(--gray-200); border-radius: 12px; margin-bottom: 12px; overflow: hidden; flex: none; }
.sp-unit-h { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); font-size: 14px; }
.sp-topic { display: flex; gap: 10px; align-items: center; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--gray-100); color: var(--gray-600); }
.sp-topic:last-child { border-bottom: 0; } .sp-topic.done { color: var(--gray-900); } .sp-topic.done svg { color: var(--success); }
.sp-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sp-cal-h { text-align: center; font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; }
.sp-cal-d { border: 1px solid var(--gray-200); background: var(--surface); border-radius: 10px; min-height: 54px; padding: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer; font: inherit; }
.sp-cal-d:hover { border-color: var(--primary); }
.sp-cal-d .n { font-size: 12px; font-weight: 600; color: var(--gray-700); }
.sp-cal-d.today { box-shadow: 0 0 0 2px var(--primary); }
.sp-cal-d.hol { background: var(--gray-50); } .sp-cal-d.lv { background: var(--primary-50); } .sp-cal-d.abs { border-color: #FDA29B; }
.sp-cal-d .dots { display: flex; flex-wrap: wrap; gap: 3px; } .sp-cal-d .dots i, .sp-key { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dots i.p, .sp-key.p { background: var(--success); } .dots i.a, .sp-key.a { background: var(--error); }
.sp-key { margin-right: 5px; } .sp-key.hol { background: var(--gray-300); border-radius: 2px; } .sp-key.lv { background: var(--primary-50); border: 1px solid var(--primary); border-radius: 2px; }
.sp-cal-detail { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--gray-50); min-height: 20px; }
.sp-cal-detail:empty { display: none; }
.sp-calc { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; }
.sp-calc.ok { background: #ECFDF3; color: #05603A; } .sp-calc.bad { background: #FEF3F2; color: #912018; }
.sp-calc-n { font-size: 32px; font-weight: 800; line-height: 1; }
.sp-today-row td { background: var(--primary-50); }
@media (max-width: 767px) { .sp-cal { gap: 3px; } .sp-cal-d { min-height: 44px; padding: 4px; } .sp-cal-d .dots i { width: 5px; height: 5px; } }
.su-step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--surface); }
.su-step > i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); font-weight: 700; flex: none; }
.su-step.done > i { background: var(--success); color: #fff; }
.su-step.done { background: var(--gray-50); }
.su-batches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.su-batch { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.su-batch:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.su-batch.COMPLETED { opacity: .7; }
.su-prog { display: flex; gap: 3px; margin: 4px 0; }
.su-prog span { flex: 1; height: 6px; border-radius: 3px; background: var(--gray-200); }
.su-prog span.done { background: var(--success); } .su-prog span.now { background: var(--primary); }
.su-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.su-year { padding: 12px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--gray-50); }
.su-sem { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--gray-200); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--gray-700); }
.su-sem small { font-size: 10px; font-weight: 700; color: var(--primary-700); text-transform: uppercase; }
.su-sem.done { color: var(--success-700); border-color: var(--success-200, #abefc6); }
.su-sem.cur { border-color: var(--primary); }
.su-sem.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.su-sem.sel small { color: #fff; }
.su-plan td { vertical-align: middle; }
.su-plan .input { height: 36px; }
.su-promo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.su-promo b { font-size: 17px; display: block; }
.mk-chip.off { cursor: default; opacity: .65; border-style: dashed; }
.mk-chip.off:hover { border-color: var(--gray-200); }
.mk-chip-w { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); }
.mk-chip-w.OPEN { background: var(--success-50); color: var(--success-700); }
.mk-chip-w.UPCOMING { background: var(--primary-50); color: var(--primary-700); }
.mk-chip-w.CLOSED { background: var(--error-50); color: var(--error-700); }
/* marks grid: a full sheet — a line around every cell */
.mk-grid th, .mk-grid td { border-right: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.mk-grid thead th { border-bottom: 1px solid var(--gray-300); }
.mk-grid tr.mk-h1 th { border-bottom: 1px solid var(--gray-200); }
.mk-grid td.mk-c { padding: 0; }
.mk-grid tbody tr:nth-child(even) td { background: #fcfcfd; }
.mk-grid tbody tr:hover td { background: var(--primary-50); }
/* marks sheet: clear, spreadsheet-like lines */
.mk-gridwrap { border-top: 2px solid #98A2B3; }
.mk-grid th, .mk-grid td { border-right: 1px solid #C3C9D3; border-bottom: 1px solid #C3C9D3; }
.mk-grid thead th { background: #EDF0F5; color: var(--gray-700); font-weight: 700; }
.mk-grid thead tr.mk-h1 th { border-bottom: 1px solid #B4BBC7; }
.mk-grid thead tr.mk-h2 th, .mk-grid thead tr.mk-h1 th[rowspan] { border-bottom: 2px solid #8A94A6; }
.mk-grid th small { color: var(--gray-500); }
.mk-grid .mk-ph, .mk-grid .mk-qh.first, .mk-grid td.mk-c.pstart { border-left: 2px solid #8A94A6; }
.mk-grid th.mk-ab, .mk-grid td.mk-ab { border-left: 2px solid #8A94A6; }
.mk-grid th.mk-total, .mk-grid td.mk-total { border-left: 2px solid #8A94A6; border-right: 2px solid #8A94A6; background: #F5F7FA; }
.mk-grid .mk-name { box-shadow: none; }
.mk-grid .mk-roll { color: var(--gray-700); font-weight: 500; }
.mk-grid tbody tr:nth-child(even) td { background: #F8F9FB; }
.mk-grid tbody tr:nth-child(even) td.mk-total { background: #F0F3F7; }
.mk-grid tbody tr:hover td, .mk-grid tbody tr:focus-within td { background: #EEF2FF; }
.mk-grid tbody tr:focus-within td.mk-roll, .mk-grid tbody tr:focus-within td.mk-name { color: var(--primary-700); box-shadow: inset 3px 0 0 var(--primary); }
.mk-grid tbody tr:focus-within td.mk-name { box-shadow: none; }
.mk-in { height: 40px; font-size: 14px; font-weight: 500; }
.mk-in:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); border-radius: 0; }
/* other marks tables: same clear lines */
.table.grid-lines { border-collapse: collapse; }
.table.grid-lines th, .table.grid-lines td { border: 1px solid #C3C9D3; }
.table.grid-lines thead th { background: #EDF0F5; color: var(--gray-700); font-weight: 700; border-bottom: 2px solid #8A94A6; }
/* examinations */
.ex-sem { padding: 14px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--gray-50); display: flex; flex-direction: column; gap: 12px; }
.ex-sem .table-wrap { background: var(--surface); border-radius: 10px; border: 1px solid var(--gray-200); }
.ex-matrix td { vertical-align: top; }
.ex-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: none; border: 0; padding: 4px 6px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.ex-cell:hover { background: var(--primary-50); }

/* ============================================================ phones: bottom navigation + touch-friendly shell */
.bnav { display: none; }
.sidebar-scrim { display: none; }
@media (max-width: 767px) {
  :root { --bottom-nav: calc(80px + env(safe-area-inset-bottom, 0px)); }
  /* a floating bar: rounded, frosted glass, the open page in a tinted pill */
  .bnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; z-index: 60;
    left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    height: 64px; padding: 0 4px; border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
    border: 1px solid color-mix(in srgb, var(--gray-200) 80%, transparent); box-shadow: 0 10px 30px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06); }
  .bnav a, .bnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; font: inherit;
    color: var(--gray-500); cursor: pointer; min-width: 0; padding: 6px 2px; -webkit-tap-highlight-color: transparent; transition: color .15s; }
  .bnav .bi { position: relative; width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s, transform .15s; }
  .bnav a:active .bi, .bnav button:active .bi { transform: scale(.9); }
  .bnav .bl { font-size: 11px; font-weight: 600; line-height: 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bnav a.on { color: var(--primary-700); } .bnav a.on .bi { background: var(--primary-100); } .bnav a.on .bl { font-weight: 800; }
  .bnav a.on .bi svg { stroke-width: 2.3; }
  .bnav .bc { position: absolute; top: -4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warning); color: #fff;
    font-size: 10.5px; font-weight: 700; font-style: normal; display: grid; place-items: center; border: 2px solid var(--surface); }
  .bnav .bc.green { background: #25D366; }
  .bnav .bdot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: #F0284A; border: 2px solid var(--surface); }
  /* the student's Feed: a raised gradient button in the middle */
  .bnav a.center { justify-content: flex-end; padding-bottom: 7px; }
  .bnav a.center .bi { width: 52px; height: 52px; border-radius: 18px; margin-top: -26px; color: #fff; transform: rotate(0);
    background: linear-gradient(135deg, #F79009, #DD2590 50%, #7A5AF8); box-shadow: 0 8px 18px rgba(221, 37, 144, .35), 0 0 0 4px var(--surface); }
  .bnav a.center .bi svg { width: 24px; height: 24px; }
  .bnav a.center.on .bi { background: linear-gradient(135deg, #7A5AF8, #DD2590 50%, #F79009); }
  .bnav a.center .bdot { top: -3px; right: -3px; }
  .content { padding-bottom: calc(var(--bottom-nav) + 16px); }
  #toasts { bottom: calc(var(--bottom-nav) + 12px); right: 12px; left: 12px; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(16, 24, 40, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar.open + .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .topbar { gap: 8px; padding-top: env(safe-area-inset-top, 0px); height: calc(64px + env(safe-area-inset-top, 0px)); }
  .search .kbd { display: none; }
  .search input { padding-right: 12px; }
  .icon-btn { width: 40px; height: 40px; }
  .page-header h1 { font-size: 21px; line-height: 28px; }
  .page-actions { width: 100%; }
}

/* ============================================================ phones: tables */
@media (max-width: 767px) {
  /* list tables (dataTable) become one card per row: "Label  value" lines */
  .table.rtable thead { display: none; }
  .table.rtable, .table.rtable tbody { display: block; width: 100%; }
  .table.rtable tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--gray-200); }
  .table.rtable tr:last-child { border-bottom: 0; }
  .table.rtable td { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 4px 0; border: 0; text-align: right; min-height: 0; }
  .table.rtable td > * { min-width: 0; }
  .table.rtable td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-size: 12px; font-weight: 600; color: var(--gray-500); padding-top: 1px; }
  .table.rtable td[data-label=""]::before { content: none; }
  .table.rtable td[data-label=""] { justify-content: flex-end; }
  .table.rtable td:first-child { text-align: left; justify-content: flex-start; font-weight: 600; padding-bottom: 6px; }
  .table.rtable td:first-child::before { content: none; }
  .table.rtable td[colspan] { display: block; text-align: center; }
  .table.rtable td[colspan]::before { content: none; }
  /* other tables keep a readable width and scroll sideways inside their box */
  .table-wrap > .table:not(.rtable):not(.mk-grid) { min-width: 560px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  /* top bar: the search box gets the free space */
  .topbar > .grow { display: none; }
  .search { min-width: 0; }
  /* marks: exam chips start on the left under the subject */
  .mk-row-r { justify-content: flex-start; }
  /* toolbars wrap neatly */
  .toolbar { flex-wrap: wrap; }
  .toolbar .input { max-width: 100%; }
}
.datebar { display: inline-flex; align-items: center; gap: 6px; }
.datebar .input { min-width: 0; }
@media (max-width: 767px) { .datebar { flex: 1; } .datebar .input { flex: 1; width: auto !important; } }
@media (max-width: 767px) {
  /* mark attendance: the save bar wraps and sits just above the bottom navigation */
  .counter-bar { flex-wrap: wrap; gap: 8px 14px; bottom: calc(var(--bottom-nav) + 8px); padding: 10px 12px; }
  .counter-bar > .grow { order: 5; flex-basis: 100%; font-size: 12px; }
  .counter-bar > .btn { flex: 0 0 auto; }
  .counter-bar > .btn.primary { flex: 1 1 auto; min-width: 0; }
  .counter { font-size: 19px; }
}
@media (max-width: 767px) {
  /* opened menu: brand on two lines, left aligned */
  .sidebar.open .brand { justify-content: flex-start; padding: 12px 16px; }
  .sidebar.open .bt, .sidebar.open .bs { display: block; }
  /* marks sheet: narrower frozen columns so there is room to type marks */
  .mk-grid .mk-roll { width: 76px; min-width: 76px; padding: 0 8px; font-size: 12px; }
  .mk-grid .mk-name { left: 76px; width: 118px; max-width: 118px; padding: 0 8px; font-size: 12.5px; }
  .mk-grid .mk-ab { width: 38px; }
  .mk-gridwrap { max-height: calc(100dvh - 210px - var(--bottom-nav)); }
}

/* ============================================================ student pages on phones: simple lists instead of wide tables */
.only-narrow { display: none; }
@media (max-width: 767px) {
  .only-wide { display: none; }
  .only-narrow { display: block; }
  .sp-slot .truncate { white-space: normal; overflow: visible; }   /* timetable: full subject names */
}
.nowrap { white-space: nowrap; }
.ms-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ms { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ms b { font-size: clamp(13.5px, 4.1vw, 17px); line-height: 22px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms span { font-size: 11.5px; color: var(--gray-500); font-weight: 600; }
.ms.good b { color: var(--success-700); } .ms.bad b { color: var(--error-700); }
.ms-note { margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600; background: var(--warning-50); color: var(--warning-700); }
.ms-note.bad { background: var(--error-50); color: var(--error-700); }
/* marks bars (phone results list) */
.mm-bar { display: block; height: 6px; border-radius: 3px; background: var(--gray-100); overflow: hidden; }
.mm-bar i { display: block; height: 100%; border-radius: 3px; background: var(--success); }
.mm-bar i.mid { background: var(--warning); } .mm-bar i.low { background: var(--error); }
/* exam timetable: one row per paper */
.et-list { display: flex; flex-direction: column; gap: 8px; }
.et { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1px solid var(--gray-200); }
.et.today { border-color: var(--primary); background: var(--primary-50); }
.et-date { flex: none; width: 52px; text-align: center; border-radius: 10px; background: var(--gray-50); border: 1px solid var(--gray-200); padding: 4px 0; display: flex; flex-direction: column; }
.et-date span { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--primary-700); }
.et-date b { font-size: 19px; line-height: 21px; color: var(--ink); } .et-date small { font-size: 10.5px; color: var(--gray-500); }
.et-date.nf { font-size: 11px; font-weight: 700; color: var(--gray-500); padding: 10px 0; display: block; }
.et .grow b { display: block; font-size: 14px; line-height: 19px; color: var(--ink); } .et .grow small { font-size: 12px; color: var(--gray-500); }
/* fees: year cards and receipt cards */
.fy-list, .fp-list { display: flex; flex-direction: column; gap: 10px; }
.fy, .fp { border: 1px solid var(--gray-200); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.fy-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fy-nums div { display: flex; flex-direction: column; min-width: 0; } .fy-nums span { font-size: 11.5px; color: var(--gray-500); font-weight: 600; }
.fy-nums b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp b.amt { font-size: 18px; display: block; } .fp small { display: block; font-size: 12px; color: var(--gray-500); }
.fp.cancelled { opacity: .7; } .fp.cancelled b.amt { text-decoration: line-through; }

/* exam / section buttons that wrap (no sideways scrolling) */
.xm-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.xm-tabs button { border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--gray-600); cursor: pointer; }
.xm-tabs button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.xm-tabs.fill { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--gray-100); }
.xm-tabs.fill button { border: 0; background: none; border-radius: 9px; padding: 8px 2px; font-size: 12.5px; white-space: nowrap; }
.xm-tabs.fill button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-seg); }
.xm-sum { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 12px 14px; border-radius: 14px; background: var(--primary-50); }
.xm-sum span { display: block; font-size: 12px; font-weight: 700; color: var(--primary-700); }
.xm-sum b { display: block; font-size: 20px; line-height: 26px; color: var(--ink); } .xm-sum small { font-size: 12px; color: var(--gray-500); }
.xm-sum.empty { gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--gray-600); background: var(--gray-50); }
.xm-pct { flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--success-700);
  background: var(--surface); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--success) 45%, transparent); }
.xm-pct.mid { color: var(--warning-700); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--warning) 50%, transparent); }
.xm-pct.low { color: var(--error-700); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--error) 45%, transparent); }
.xm-list { display: flex; flex-direction: column; }
.xm { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--gray-200); }
.xm:last-child { border-bottom: 0; }
.xm .grow b { display: block; font-size: 14px; line-height: 19px; color: var(--ink); } .xm .grow small { display: block; font-size: 12px; color: var(--gray-500); margin-bottom: 6px; }
.xm .mm-bar { max-width: 180px; }
.xm-v { flex: none; text-align: right; white-space: nowrap; font-size: 13px; } .xm-v b { font-size: 17px; } .xm-v b.low { color: var(--error-700); } .xm-v b.mid { color: var(--warning-700); }
/* timetable on phones: week strip + one day */
.tt-week { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tt-week .grow { text-align: center; display: flex; flex-direction: column; } .tt-week .grow b { font-size: 15px; } .tt-week .grow span { font-size: 12px; color: var(--gray-500); }
.tt-back { border: 0; background: none; color: var(--primary); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.tt-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 14px; }
.tt-days button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 14px; border: 1px solid var(--gray-200); background: var(--surface);
  font: inherit; color: var(--ink); cursor: pointer; }
.tt-days button span { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; }
.tt-days button b { font-size: 17px; line-height: 20px; }
.tt-days button i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.tt-days button.today i { background: var(--primary); }
.tt-days button.hol b { color: var(--gray-400); }
.tt-days button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.tt-days button.on span { color: color-mix(in srgb, var(--on-primary, #fff) 80%, transparent); } .tt-days button.on.today i { background: #fff; }
.tt-dayh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tt-dayh b { font-size: 18px; } .tt-dayh span { font-size: 13px; color: var(--gray-500); } .tt-dayh em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--primary-700); }
.tt-list { display: flex; flex-direction: column; gap: 8px; }
.tt-row { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--gray-200); border-left: 4px solid var(--primary-200); }
.tt-row.now { border-color: var(--primary); border-left-color: var(--primary); background: var(--primary-50); }
.tt-time { flex: none; width: 48px; display: flex; flex-direction: column; } .tt-time b { font-size: 14px; } .tt-time span { font-size: 12px; color: var(--gray-500); }
.tt-body { min-width: 0; flex: 1; } .tt-body b { display: block; font-size: 14.5px; line-height: 19px; margin: 2px 0; color: var(--ink); } .tt-body small { font-size: 12px; color: var(--gray-500); }
.tt-top { display: flex; align-items: center; gap: 6px; }
.tt-p { font-size: 11px; font-weight: 800; color: var(--primary-700); } .tt-now { font-size: 10.5px; font-weight: 800; color: #fff; background: var(--primary); border-radius: 999px; padding: 1px 8px; }
/* attendance on phones */
.at-hero { display: flex; align-items: center; gap: 16px; }
.at-hero .grow > b { display: block; font-size: 18px; line-height: 24px; }

/* ============================================================ eSSL device data page */
.dd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dd-chips button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--gray-700); cursor: pointer; }
.dd-chips button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.dd-warn { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--error); color: #fff; font-size: 11px; font-weight: 800; }
.dd-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dd-date .input { width: auto; }
.dd-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.dd-health { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dd-dev { display: flex; flex-direction: column; gap: 6px; }
.dd-store { margin-top: 4px; } .dd-store b.bad, .dd-dev b.bad { color: var(--error-700); }
.dd-bar { height: 7px; border-radius: 4px; background: var(--gray-100); overflow: hidden; margin-top: 4px; }
.dd-bar i { display: block; height: 100%; background: var(--success); border-radius: 4px; } .dd-bar i.mid { background: var(--warning); } .dd-bar i.bad { background: var(--error); }
.dd-note { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; background: var(--warning-50); color: var(--warning-700); }
.dd-note.bad { background: var(--error-50); color: var(--error-700); }
.dd-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--gray-600); cursor: pointer; }
.dd-tab b { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--gray-100); color: var(--ink); }
.dd-tab.on { border-color: var(--primary); color: var(--primary-700); background: var(--primary-50); }
.dd-tag { margin-left: 6px; font-size: 10.5px; }
.dd-table tr.clickable { cursor: pointer; } .dd-table tr.clickable:hover td { background: var(--gray-50); }
.dd-days { display: flex; flex-direction: column; gap: 6px; }
.dd-day { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 12px; }
.dd-day.off { background: var(--gray-50); }
.dd-dd { width: 66px; flex: none; display: flex; flex-direction: column; } .dd-dd b { font-size: 16px; } .dd-dd span { font-size: 11px; color: var(--gray-500); }
@media (max-width: 1200px) { .dd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .dd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.pdf-native { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--gray-50); }
.pdf-native small { color: var(--gray-500); }

/* leave: class arrangement, one card per class */
.arr-list { display: flex; flex-direction: column; gap: 10px; }
.arr-card { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(140px, 1fr) minmax(240px, 1.4fr); gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--gray-200); border-left: 4px solid var(--warning-500, #F79009); border-radius: 12px; background: var(--surface); }
.arr-card.done { border-left-color: var(--success-500, #12B76A); }
.arr-when { display: flex; gap: 10px; align-items: center; }
.arr-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--gray-100); color: var(--gray-600); flex: none; }
.arr-card.done .arr-n { background: var(--success-50, #ECFDF3); color: var(--success-700, #027A48); }
.arr-state { margin-top: 6px; font-size: 12px; }
.arr-state span { display: inline-flex; gap: 4px; align-items: center; }
.arr-state .ok { color: var(--success-700, #027A48); }
.arr-state .busy { color: var(--error-700, #B42318); }
@media (max-width: 720px) { .arr-card { grid-template-columns: 1fr 1fr; } .arr-who { grid-column: 1 / -1; } }
@media (max-width: 420px) { .arr-card { grid-template-columns: 1fr; } }
