/* AMS — «mono» design system. Black & white, one accent (the academy's), nothing else.
   Tokens → base → layout (panel shell) → components → utilities. Dark mode = inverted tokens. */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-2: #3a3a3a;
  --muted: #6e6e6e;
  --line: #e7e7e7;
  --line-2: #d4d4d4;
  --soft: #f6f6f6;
  --soft-2: #efefef;
  --accent: var(--academy-accent, #0a0a0a);
  --on-accent: #ffffff;
  --ok: #0a7d36;
  --warn: #9a5b00;
  --bad: #b3261e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --side: 256px;
  color-scheme: light;
}

:root[data-mode="dark"] {
  --bg: #0b0b0b;
  --fg: #f2f2f2;
  --fg-2: #cfcfcf;
  --muted: #9a9a9a;
  --line: #222;
  --line-2: #333;
  --soft: #151515;
  --soft-2: #1d1d1d;
  --accent: var(--academy-accent-dark, #f2f2f2);
  --on-accent: #0b0b0b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow: auto; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 32px; height: 32px; stroke-width: 1.5; }

/* ── panel shell ───────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; border-inline-end: 1px solid var(--line); background: var(--bg);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 6px; z-index: 40; overscroll-behavior: contain; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; text-decoration: none; font-weight: 700; font-size: 1.02rem; }
.brand img { height: 30px; width: auto; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.nav-sec { margin-top: 10px; }
.nav-sec > span { display: block; padding: 6px 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.nav-a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--fg-2); font-weight: 500; }
.nav-a:hover { background: var(--soft); color: var(--fg); }
button.nav-a { border: 0; background: none; font: inherit; cursor: pointer; width: 100%; text-align: start; }
.nav-a.on { background: var(--fg); color: var(--bg); }
.nav-a .ic { width: 17px; height: 17px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .sp { flex: 1; }
.btn.menu-btn { display: none; }
.page { padding: 28px 24px 80px; width: 100%; max-width: 1240px; margin: 0 auto; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.scrim { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-inline-start: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 0 12px; }
  .page { padding: 20px 14px 90px; }
}

/* ── buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg); font: 600 .92rem/1 var(--font); text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: transform .06s ease, background .15s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--fg-2); border-color: var(--fg-2); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--fg); background: var(--soft); }
.btn.flat { background: transparent; color: var(--fg); border-color: transparent; }
.btn.flat:hover { background: var(--soft); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: .84rem; }
.btn.xs { height: 26px; padding: 0 9px; font-size: .78rem; gap: 5px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 1rem; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn .count { background: var(--bg); color: var(--fg); border-radius: 999px; padding: 1px 7px; font-size: .75rem; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--fg); color: var(--bg);
  font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── cards & layout ────────────────────────────────────────── */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.soft { background: var(--soft); border-color: transparent; }
.card.dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.card.dark .muted { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { margin: 0; }
.card-h a.more { font-size: .85rem; color: var(--muted); text-decoration: none; }
.card-h a.more:hover { color: var(--fg); }
.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)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.auto-s { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.span-2 { grid-column: span 2; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .kpis.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font-size: clamp(1.2rem, 4.6vw, 1.75rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi .d { font-size: .8rem; }

/* ── lists & tables ────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list > li, .li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.li-main { flex: 1; min-width: 0; }
.li-main b, .li-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.li-main small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.li { text-decoration: none; }
a.li:hover .li-main b { text-decoration: underline; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--soft); }
.tbl .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { text-decoration: none; font-weight: 550; }
.tbl a:hover { text-decoration: underline; }
.tbl.compact td, .tbl.compact th { padding: 7px 8px; }
.tbl.sticky-first td:first-child, .tbl.sticky-first th:first-child { position: sticky; inset-inline-start: 0; background: var(--bg); z-index: 1; }

/* ── badges, chips, avatars ────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--fg-2); background: var(--bg); white-space: nowrap; }
.badge.solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.badge .sw { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  text-decoration: none; font-size: .87rem; font-weight: 550; background: var(--bg); cursor: pointer; white-space: nowrap; color: var(--fg-2); }
.chip:hover { border-color: var(--fg); color: var(--fg); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .n { font-size: .75rem; opacity: .7; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--soft-2); color: var(--fg-2); display: inline-grid; place-items: center; font-weight: 700;
  font-size: .82rem; flex: none; overflow: hidden; position: relative; border: 1px solid var(--line); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 28px; height: 28px; font-size: .7rem; }
.av.lg { width: 84px; height: 84px; font-size: 1.6rem; }
.av-wrap { position: relative; display: inline-flex; }
.online { position: absolute; inset-inline-end: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--bg); }
.av.lg + .online { width: 18px; height: 18px; inset-inline-end: 4px; bottom: 4px; border-width: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.dot.live { background: var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── forms ─────────────────────────────────────────────────── */
.form { display: grid; gap: 16px; }
.form.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.cols .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form.cols { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-weight: 600; font-size: .86rem; }
.field .help { color: var(--muted); font-size: .8rem; }
.field .err, .errorlist { color: var(--bad); font-size: .82rem; margin: 0; padding: 0; list-style: none; }
.in, .sel, textarea.in { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg);
  color: var(--fg); font: inherit; transition: border-color .15s, box-shadow .15s; }
textarea.in { min-height: 90px; resize: vertical; line-height: 1.5; }
.in:focus, .sel:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 12%, transparent); }
.in[type="color"] { padding: 4px; height: 42px; width: 72px; }
.in[type="file"] { padding: 8px; }
.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 32px; }
select[multiple].sel { background-image: none; min-height: 120px; padding-inline-end: 12px; }
.chk { width: 18px; height: 18px; accent-color: var(--fg); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks > div, .checks label { display: inline-flex; }
.checks label, label.opt { gap: 8px; align-items: center; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-weight: 500; font-size: .88rem; }
.checks label:has(input:checked), label.opt:has(input:checked) { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.checks input, label.opt input { accent-color: var(--fg); margin: 0; }
.field ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.field ul li label { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: .88rem; }
.field ul li label:has(input:checked) { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; inset-inline-start: 3px; top: 3px; border-radius: 50%; background: var(--bg); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--fg); }
.switch input:checked + span::after { transform: translateX(18px); }
.search { position: relative; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .in { padding-inline-start: 38px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .search { flex: 1 1 220px; max-width: 360px; }

/* ── tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; background: none; font: 600 .9rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 7px; align-items: center; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); border-bottom-color: var(--fg); }

/* ── messages, empty states, misc ──────────────────────────── */
.toasts { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--fg); color: var(--bg); border-radius: 12px; padding: 12px 40px 12px 14px; box-shadow: var(--shadow); position: relative; font-size: .92rem; animation: in .2s ease; }
.toast.error { background: var(--bad); color: #fff; }
.toast.warning { background: #3b2a00; color: #fff; }
.toast button { position: absolute; inset-inline-end: 6px; top: 6px; background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; opacity: .8; }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
.note { border: 1px solid var(--line); background: var(--soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; display: flex; gap: 10px; }
.note.dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; stroke-width: 1.4; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: end; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
.mb { margin-bottom: 16px; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.flex.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.bar { height: 6px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--fg); border-radius: 99px; }
.pct { font-variant-numeric: tabular-nums; font-weight: 650; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.copy-row { display: flex; gap: 6px; }
.copy-row .in { font-family: var(--mono); font-size: .82rem; }
details.more > summary { cursor: pointer; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }

/* menus */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 220px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; z-index: 60; display: flex; flex-direction: column; }
.menu-pop a, .menu-pop button { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; background: none; border: 0;
  font: inherit; color: var(--fg); cursor: pointer; text-align: start; width: 100%; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--soft); }
.menu-pop hr { margin: 4px 0; }

/* dialog */
dialog.dlg { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: min(440px, calc(100vw - 32px)); background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .4); }

/* attendance marks */
.att { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-size: .72rem; font-weight: 700; border: 1px solid var(--line); }
.att.present { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.att.late { background: var(--soft-2); color: var(--fg); }
.att.absent { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.att.excused { color: var(--muted); border-style: dashed; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; gap: 2px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--fg); color: var(--bg); }

/* calendar */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { border: 1px solid var(--line); border-radius: 12px; min-height: 160px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.day h4 { font-size: .8rem; color: var(--muted); margin: 0 0 4px; display: flex; justify-content: space-between; }
.day.today h4 { color: var(--fg); }
.ev { display: block; text-decoration: none; padding: 7px 8px; border-radius: 8px; background: var(--soft); font-size: .8rem; line-height: 1.3; border-inline-start: 3px solid var(--fg); }
.ev:hover { background: var(--soft-2); }
.ev.cancelled { opacity: .5; text-decoration: line-through; }
.ev.live { background: var(--fg); color: var(--bg); }
.ev b { display: block; font-weight: 650; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* plugin cards */
.plug { display: flex; flex-direction: column; gap: 10px; }
.plug-h { display: flex; gap: 12px; align-items: flex-start; }
.plug-ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); flex: none; }
.plug.on .plug-ic { background: var(--fg); color: var(--bg); }
.plug ul { margin: 0; padding-inline-start: 18px; color: var(--fg-2); font-size: .86rem; }

/* profile */
.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero h1 { margin: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-strip > div { padding: 14px 16px; border-inline-end: 1px solid var(--line); }
.stat-strip > div:last-child { border-inline-end: 0; }
.stat-strip .v { font-size: 1.35rem; font-weight: 700; }
.stat-strip .l { color: var(--muted); font-size: .78rem; }

/* auth */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--soft); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; padding-bottom: 18px; }
.auth-card h1 { font-size: 1.4rem; text-align: center; }
.auth-foot { text-align: center; margin-top: 16px; font-size: .9rem; color: var(--muted); }

/* pagination */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; align-items: center; }

/* print */
@media print {
  .side, .top, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .card { border-color: #bbb; break-inside: avoid; }
}

/* ── right-to-left (Arabic, Persian): what logical properties can't flip ── */
@media (max-width: 960px) { [dir="rtl"] .side { transform: translateX(102%); } }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }
[dir="rtl"] .sel { background-position: 12px 50%, 17px 50%; }
[dir="rtl"] .tbl .num, [dir="rtl"] .ltr, [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"] { direction: ltr; }
[dir="rtl"] .tbl .num { text-align: end; }
[dir="rtl"] .fwd { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .ic:has(use[href$="#arrow-right"], use[href$="#arrow-left"], use[href$="#chevron-right"], use[href$="#chevron-left"], use[href$="#arrow-up-right"]) { transform: scaleX(-1); }

/* ── self-service demo: deletion notice ── */
.demo-bar { background: var(--fg); color: var(--bg); font-size: .8rem; text-align: center; padding: 6px 12px; position: relative; z-index: 50; }
.demo-bar a { color: inherit; font-weight: 600; text-decoration: underline; }

/* phones: a row of link chips is section navigation — one scrollable line instead of four wrapped rows */
@media (max-width: 640px) {
  .chips:has(> a.chip) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; padding-bottom: 2px; }
  .chips:has(> a.chip)::-webkit-scrollbar { display: none; }
  .chips:has(> a.chip) > a.chip { flex: none; }
}
