/* Beyond Chalk — chalkboard-black, minimal theme */
:root {
  --bg: #0b0b0c;
  --surface: #131315;
  --surface-2: #1a1a1d;
  --surface-3: #232327;
  --border: #26262b;
  --border-strong: #34343a;
  --text: #ededea;
  --muted: #8d8d94;
  --faint: #5d5d64;
  --chalk: #f4f1e8;
  --accent: #f2d16b;          /* chalk yellow */
  --accent-ink: #1a1505;
  --ok: #5fd08f;
  --ok-bg: rgba(95, 208, 143, .1);
  --warn: #f0b45a;
  --warn-bg: rgba(240, 180, 90, .1);
  --bad: #f07a7a;
  --bad-bg: rgba(240, 122, 122, .1);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 232px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
.ic { flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.main { padding: 20px 16px 110px; max-width: 1180px; margin: 0 auto; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 11, 12, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.brand-sm img { height: 30px; width: auto; }
.topbar-title { flex: 1; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); display: flex; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--surface-2); color: var(--text); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-3); }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(14, 14, 16, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--faint); padding: 4px 0;
}
.bottomnav a.active { color: var(--chalk); }
.bottomnav .fab { color: var(--accent-ink); }
.bottomnav .fab svg {
  width: 52px; height: 52px; padding: 13px; margin-top: -26px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 6px 20px rgba(242, 209, 107, .25), 0 0 0 5px var(--bg);
}
.bottomnav .fab span { color: var(--accent); font-weight: 600; }

@media (min-width: 900px) {
  .topbar, .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    border-right: 1px solid var(--border); background: var(--bg); padding: 20px 14px;
  }
  .brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 22px; }
  .brand img { width: 120px; }
  .brand span { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted);
  }
  .sidebar nav a:hover { background: var(--surface); color: var(--text); }
  .sidebar nav a.active { background: var(--surface-2); color: var(--chalk); }
  .sidebar nav a.nav-collect { color: var(--accent); }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 0; border-top: 1px solid var(--border); }
  .main { margin-left: var(--sidebar); padding: 32px 36px 60px; max-width: none; }
  .main > * { max-width: 1120px; }
}

body.bare .main { margin: 0 auto; padding: 0; max-width: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.backlink:hover { color: var(--text); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-title h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.section-title a { font-size: 13px; color: var(--muted); }
.section-title a:hover { color: var(--text); }

/* ---------- Cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .grid-main { grid-template-columns: 1.6fr 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .foot { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat.accent { border-color: rgba(242, 209, 107, .35); background: linear-gradient(180deg, rgba(242, 209, 107, .07), transparent); }
.stat.accent .value { color: var(--accent); }

/* ---------- Lists ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
a.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .chev { color: var(--faint); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-3); color: var(--chalk); font-size: 13px; font-weight: 600; border: 1px solid var(--border-strong);
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .ic { margin: 0 auto 8px; color: var(--faint); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-top: 1px solid var(--border); white-space: nowrap; }
th { border-top: 0; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--surface); }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cancelled td { color: var(--faint); text-decoration: line-through; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border-strong); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.accent { background: rgba(242, 209, 107, .12); color: var(--accent); border-color: transparent; }

/* ---------- Buttons ---------- */
.btn, .btn-ghost, .btn-accent, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); font: 500 14px var(--font); cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn { background: var(--chalk); color: #111; }
.btn:hover { background: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(240, 122, 122, .35); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 52px; font-size: 16px; padding: 0 22px; }
.btn-block { width: 100%; }
button:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 6px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
label.field .req { color: var(--accent); }
input, select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: 15px var(--font); outline: none; transition: border-color .15s;
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--chalk); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8d94' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.hint { font-size: 12px; color: var(--faint); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > * { flex: 1 1 140px; }
.inline-form > button { flex: 0 0 auto; }

.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; }

/* Segmented choice (radio chips) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted);
  cursor: pointer; font-size: 14px; user-select: none; transition: all .15s;
}
.chips input:checked + label { background: var(--chalk); color: #111; border-color: var(--chalk); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { flex: 1 1 160px; }
.filters .search { flex: 3 1 220px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap; border: 1px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface-2); color: var(--chalk); border-color: var(--border-strong); }
.tabs a.today::after { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }

/* ---------- Flash ---------- */
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.flash-ok { background: var(--ok-bg); border-color: rgba(95, 208, 143, .3); color: var(--ok); }
.flash-error { background: var(--bad-bg); border-color: rgba(240, 122, 122, .3); color: var(--bad); }
.flash-warn { background: var(--warn-bg); border-color: rgba(240, 180, 90, .3); color: var(--warn); }

/* ---------- Bar chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 18px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar .fill { width: 100%; max-width: 34px; background: var(--surface-3); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bar.current .fill { background: var(--accent); }
.bar .fill span { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar .lbl { font-size: 11px; color: var(--faint); }
.bar:not(.current):hover .fill { background: var(--border-strong); }

.hbar { display: grid; gap: 10px; }
.hbar .item { display: grid; gap: 4px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 14px; }
.hbar .track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--chalk); border-radius: 3px; }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.profile-head .grow { flex: 1; min-width: 200px; }
.balance-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.balance-card .big { font-size: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Timetable ---------- */
.week { display: grid; gap: 12px; }
@media (min-width: 1000px) { .week.cols { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } }
.day-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; padding: 0 2px; }
.day-col.today h3 { color: var(--accent); }
.session {
  display: block; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--room, var(--chalk));
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px;
}
a.session:hover { background: var(--surface-2); }
.session .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.session .n { font-weight: 500; font-size: 14px; margin: 2px 0; }
.session .r { font-size: 12px; color: var(--faint); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.session.now { border-color: var(--accent); border-left-color: var(--accent); box-shadow: 0 0 0 1px rgba(242, 209, 107, .2); }
.room-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--room, var(--chalk)); }
.room-1 { --room: #f2d16b; } .room-2 { --room: #7cc4f2; } .room-3 { --room: #c59cf2; }
.room-4 { --room: #5fd08f; } .room-5 { --room: #f09a7a; } .room-6 { --room: #ededea; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Calendar (timetable) ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg a { padding: 6px 14px; border-radius: 6px; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; }
.seg a:hover { color: var(--text); }
.seg a.active { background: var(--surface-3); color: var(--chalk); }
.seg.nav a { padding: 6px 8px; }
.cal-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .04em; }
.cal-title a { text-transform: none; letter-spacing: 0; font-weight: 400; }
.cal-filters { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.cal-filters select { height: 36px; width: auto; min-width: 140px; font-size: 14px; }
@media (max-width: 700px) {
  .cal-filters { margin-left: 0; width: 100%; }
  .cal-filters select { flex: 1; min-width: 0; }
}
.day-strip { margin-bottom: 12px; }

.cal-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.cal { --time-w: 58px; --colmin: 112px; min-width: calc(var(--time-w) + var(--cols) * var(--colmin)); }
.cal.week { --colmin: 128px; }
@media (max-width: 600px) {
  .cal { --time-w: 42px; --colmin: 90px; }
  .cal.week { --colmin: 112px; }
  .cal-time { right: 5px; font-size: 10px; }
  .cal-ev { padding: 4px 5px 4px 6px; }
  .cal-ev .ev-time .ic { display: none; }
  .cal-colhead { font-size: 12px; padding: 9px 4px; }
  .cal-colhead .small { display: none; }
}
.cal-head, .cal-body { display: grid; grid-template-columns: var(--time-w) repeat(var(--cols), minmax(var(--colmin), 1fr)); }
.cal-head { border-bottom: 1px solid var(--border-strong); background: var(--surface); }
.cal-corner { border-right: 1px solid var(--border); }
.cal-colhead {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; font-size: 13px; font-weight: 600;
  border-right: 1px solid var(--border); white-space: nowrap; color: var(--text);
}
.cal-colhead:last-child { border-right: 0; }
a.cal-colhead:hover { background: var(--surface-2); }
.cal-colhead.today { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.cal-body { position: relative; margin: 10px 0 12px; }
.cal-times { position: relative; border-right: 1px solid var(--border); }
.cal-time { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-right: 1px solid var(--border); z-index: 1; }
.cal-grid { position: absolute; top: 0; bottom: 0; left: var(--time-w); right: 0; pointer-events: none; }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.cal-line.half { border-top-color: rgba(255, 255, 255, .03); }
.cal-gap {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center;
  border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 6px, transparent 6px 12px);
  font-size: 11px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase;
}
.cal-gap span { background: var(--surface); padding: 1px 8px; border-radius: 4px; }
.cal-col:last-child { border-right: 0; }
.cal-col.today { background-color: rgba(242, 209, 107, .025); }
.cal-free { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--faint); }

.cal-ev {
  position: absolute; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 5px 7px 5px 9px;
  border-radius: 6px; border: 1px solid color-mix(in srgb, var(--room, var(--chalk)) 30%, transparent);
  border-left: 3px solid var(--room, var(--chalk));
  background: color-mix(in srgb, var(--room, var(--chalk)) 13%, var(--surface));
  font-size: 12px; line-height: 1.3; color: var(--text); transition: background .15s, box-shadow .15s; z-index: 1;
}
.cal-ev:hover { background: color-mix(in srgb, var(--room, var(--chalk)) 22%, var(--surface)); z-index: 3; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.cal-ev .ev-time { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-ev .ev-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .ev-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.cal-ev.short .ev-time .ic { display: none; }
.cal-ev.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.cal-now { position: absolute; left: var(--time-w); right: 0; height: 0; border-top: 2px solid var(--bad); z-index: 4; pointer-events: none; }
.cal-now span { position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.cal-now.week-now {
  right: auto;
  left: calc(var(--time-w) + (100% - var(--time-w)) / var(--cols) * (var(--today-col) - 1));
  width: calc((100% - var(--time-w)) / var(--cols));
}

/* ---------- Attendance ---------- */
.att-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.att-row:first-child { border-top: 0; }
.att-row .grow { flex: 1; min-width: 0; }
.att-toggle { display: flex; gap: 4px; }
.att-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.att-toggle label {
  width: 40px; height: 36px; display: grid; place-items: center; border-radius: 8px; font-weight: 600; font-size: 13px;
  border: 1px solid var(--border-strong); color: var(--faint); cursor: pointer; user-select: none;
}
.att-toggle input[value="P"]:checked + label { background: var(--ok-bg); color: var(--ok); border-color: rgba(95, 208, 143, .5); }
.att-toggle input[value="A"]:checked + label { background: var(--bad-bg); color: var(--bad); border-color: rgba(240, 122, 122, .5); }
.att-toggle input[value="L"]:checked + label { background: var(--warn-bg); color: var(--warn); border-color: rgba(240, 180, 90, .5); }
.sticky-bar {
  position: sticky; bottom: 76px; z-index: 10; margin-top: 16px; padding: 12px; border-radius: var(--radius);
  background: rgba(19, 19, 21, .95); backdrop-filter: blur(10px); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
@media (min-width: 900px) { .sticky-bar { bottom: 16px; } }

/* ---------- Collect ---------- */
.collect-wrap { max-width: 640px; }
.pick-list { max-height: 360px; overflow-y: auto; }
.amount-input { position: relative; }
.amount-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; color: var(--muted); }
.amount-input input { height: 64px; font-size: 30px; font-weight: 600; padding-left: 40px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dues-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.dues-line:first-child { border-top: 0; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); margin: 0 auto 14px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, #18181b 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo { width: 170px; margin: 0 auto 8px; }
.auth-card .tag { text-align: center; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; }

details.disclose summary { cursor: pointer; color: var(--muted); font-size: 14px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.disclose summary::-webkit-details-marker { display: none; }
details.disclose[open] summary { margin-bottom: 12px; color: var(--text); }

.menu-panel .bad { color: var(--bad); }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar nav a.nav-site { margin-top: auto; color: var(--faint); }
.menu summary { position: relative; }
.dot-badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* =================== Public website & student portal =================== */
body.site { background: var(--bg); }
.site-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(11, 11, 12, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.site-brand { display: flex; align-items: center; gap: 10px; }
.site-brand img { height: 40px; width: auto; }
.site-brand span { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.active { color: var(--chalk); }
.site-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.site-menu { display: none; }
@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-menu { display: block; }
  .site-brand span { display: none; }
}
.site-main { min-height: 60vh; }
.site-section { padding: 56px 0; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; font-weight: 600; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section-head h2, .section-head h1 { font-size: 30px; letter-spacing: -.02em; }
.section-head p { margin-top: 8px; }

.hero { padding: 64px 0 48px; background: radial-gradient(ellipse 80% 60% at 70% 30%, rgba(242, 209, 107, .07), transparent 60%), radial-gradient(ellipse at top left, #17171a, var(--bg) 60%); border-bottom: 1px solid var(--border); }
.hero-inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .hero-inner { grid-template-columns: 1.3fr 1fr; } }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
.chalk-underline { color: var(--accent); background: linear-gradient(transparent 88%, rgba(242, 209, 107, .35) 88%); }
.hero .lead { font-size: 17px; color: var(--muted); margin: 18px 0 26px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-contact { margin-top: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(320px, 70%); opacity: .95; filter: drop-shadow(0 20px 50px rgba(0,0,0,.6)); }
@media (max-width: 859px) { .hero-art { display: none; } .hero { padding-top: 40px; } }

.service-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.service { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: border-color .2s, transform .2s; }
.service:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.service h3 { font-size: 16px; margin: 14px 0 6px; }
.service-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(242, 209, 107, .1); color: var(--accent); }

.enrol-band { padding: 0; }
.enrol-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 32px 28px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(242, 209, 107, .12), rgba(242, 209, 107, .02)); border: 1px solid rgba(242, 209, 107, .25); }
.enrol-band h2 { font-size: 24px; }

.class-groups { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.class-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.class-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.class-chip { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.class-chip:first-of-type { border-top: 0; }
.class-chip:hover span:first-child { color: var(--accent); }

.login-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.login-cards h3 { margin: 12px 0 4px; font-size: 17px; }
.login-wrap { display: grid; gap: 16px; max-width: 860px; }
@media (min-width: 800px) { .login-wrap { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.login-card { padding: 24px; }
.login-side { display: grid; gap: 12px; }
.staff-link { display: flex; align-items: center; gap: 12px; }
.staff-link > span:nth-child(2) { flex: 1; display: grid; }
.staff-link:hover { border-color: var(--border-strong); }

.enrol-classes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.enrol-class { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.enrol-class:has(input:checked) { border-color: var(--accent); background: rgba(242, 209, 107, .06); }
.enrol-class > span { display: grid; gap: 2px; font-size: 14px; }
.enrol-class input { margin-top: 2px; }

.site-footer { border-top: 1px solid var(--border); padding: 40px 0 28px; margin-top: 40px; background: #09090a; }
.site-footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.site-footer p { margin-bottom: 6px; }
.site-footer a:hover { color: var(--accent); }

/* Portal */
.portal-main { padding: 24px 0 110px; }
.portal-footer { margin-top: 0; padding: 20px 0 100px; }
.bottomnav.portal-nav { display: grid; }
@media (min-width: 761px) { .bottomnav.portal-nav { display: none; } .portal-main { padding-bottom: 40px; } .portal-footer { padding-bottom: 24px; } }
.pay-card { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.pay-step { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.qr-wrap { display: flex; gap: 16px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.qr-wrap img { border-radius: 10px; background: #fff; padding: 6px; }
@media (max-width: 600px) { .qr-wrap img { width: 150px; height: 150px; } }
.upi-btn { white-space: normal; height: auto; min-height: 52px; padding: 10px 16px; text-align: center; line-height: 1.3; }
.suggest-card { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
a.stat:hover { border-color: var(--border-strong); }
@media (max-width: 600px) { .hide-sm { display: none; } }

hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

@media print {
  .sidebar, .topbar, .bottomnav, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
}
