/* School attendance - "the register" design.
   Navy cover, paper page, ruled tables, one marigold accent for "today". */
[hidden] { display: none !important; }

:root {
  --navy: #142b4c;        /* sidebar, the register cover */
  --navy-2: #1d3a63;
  --navy-ink: #c9d5e6;
  --paper: #f3f5f4;       /* page */
  --card: #ffffff;
  --ink: #17202b;         /* text primary */
  --ink-2: #4a5563;       /* text secondary */
  --muted: #6b7684;
  --rule: #e3e7ea;        /* table rules */
  --rule-2: #d3d9de;
  --green: #11604b;       /* actions, uniform green */
  --green-2: #0c4a3a;
  --green-soft: #e3f1ec;
  --today: #f2a93b;       /* marigold: marks today only */
  --today-soft: #fdf1dc;
  /* Chart series (validated: blue, orange, aqua) */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --track: #dde9f8; --grid: #edf0f2;
  /* Status */
  --good: #13794f; --good-soft: #e3f4ea;
  --warn: #a65f00; --warn-soft: #fdf1dc;
  --bad: #b42318; --bad-soft: #fde9e7;
  --radius: 12px; --radius-s: 8px;
  --shadow: 0 1px 2px rgba(20, 43, 76, .06), 0 4px 16px rgba(20, 43, 76, .05);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--green); text-underline-offset: 2px; }
a:hover { color: var(--green-2); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c1) 60%, white); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.page-sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- App frame: sidebar on desktop ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: var(--navy-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 4px 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.brand img { width: 42px; height: 42px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; flex: none; }
.brand b { display: block; font-size: 15px; line-height: 1.25; }
.brand small { color: var(--navy-ink); font-size: 12px; }
.sidenav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidenav a { display: flex; align-items: center; gap: 12px; color: var(--navy-ink); text-decoration: none; padding: 10px 12px; border-radius: 9px; font-weight: 500; font-size: 14.5px; }
.sidenav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidenav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--today); }
.side-user { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 8px 0; font-size: 13px; }
.side-user b { color: #fff; display: block; font-size: 14px; }
.side-user a { color: var(--navy-ink); }
.main { min-width: 0; }
.topbar { display: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .page-sub { margin: 0; }
.bottomnav { display: none; }

/* ---------- Cards and grids ---------- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .muted { font-size: 13px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 20px; }
.grid > .card, .split > .card, .split > div > .card { margin-bottom: 0; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; margin-bottom: 20px; }
.split > div { display: grid; gap: 20px; }
.stack { display: grid; gap: 20px; margin-bottom: 20px; }

/* Stat tiles */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.good b { color: var(--good); } .stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); }
.gender-row { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.stat .gender-row b { display: inline; font-size: 14px; color: var(--ink); line-height: 1.4; }

/* ---------- The register hero (dashboard) ---------- */
.register { background: var(--navy); color: #fff; border-radius: 16px; padding: 26px 28px; margin-bottom: 20px; display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 28px; align-items: center; position: relative; overflow: hidden; }
.register::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--today); }
.register .hero-label { color: var(--navy-ink); font-size: 14px; margin: 0 0 6px; }
.register .hero-num { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: proportional-nums; }
.register .hero-num small { font-size: 22px; font-weight: 500; color: var(--navy-ink); letter-spacing: 0; }
.register .hero-pct { margin-top: 8px; color: var(--navy-ink); font-size: 14px; }
.register .hero-pct b { color: #fff; }
.hero-strip { display: grid; gap: 12px; }
.hero-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(255,255,255,.12); gap: 2px; }
.hero-bar span { display: block; height: 100%; }
.hero-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--navy-ink); }
.hero-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hero-legend b { color: #fff; }
.hero-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.hero-facts div { background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 12px; }
.hero-facts b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.hero-facts span { font-size: 12.5px; color: var(--navy-ink); }

/* ---------- Charts ---------- */
.chart-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
@media (max-width: 640px) { .chart { min-width: 560px; } }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--rule-2); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .tick.strong { fill: var(--ink); font-weight: 700; }
.chart .hit { fill: transparent; }
.chart .mark:hover path { filter: brightness(0.9); }
.chart .mark:hover .hit { fill: rgba(20, 43, 76, .04); }
.chart-empty { color: var(--muted); text-align: center; padding: 30px 10px; margin: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--navy); color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: 260px; transform: translate(-50%, calc(-100% - 12px)); }
.meters { display: grid; gap: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.meter-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.meter-fig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-track { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 5px; min-width: 2px; }
.meter-row { cursor: default; }

/* ---------- Tables: ruled like a register ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; background: #f8faf9; border-bottom: 1px solid var(--rule-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fafbfb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef1f3; color: var(--ink-2); white-space: nowrap; }
.badge.in, .badge.sent, .badge.done, .badge.online { background: var(--good-soft); color: var(--good); }
.badge.out, .badge.queued, .badge.pending, .badge.sending { background: var(--warn-soft); color: var(--warn); }
.badge.failed, .badge.offline { background: var(--bad-soft); color: var(--bad); }
.badge.role { background: #eef1f3; color: var(--ink); font-weight: 600; }
.badge.role i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.badge.dept { background: #fff; border: 1px solid var(--rule-2); color: var(--ink-2); font-weight: 500; }
.badge.access-admin { background: #fdebe3; color: #a8431a; }
.badge.access-viewer { background: #e3eefb; color: #1c5cab; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=month], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius-s); font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
input[type=file] { font: inherit; font-size: 14px; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { margin-bottom: 14px; }
.fields .field { margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); font-size: 14px; margin: 8px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.filters > div { min-width: 140px; flex: 1; }
.filters > div.grow { flex: 2; min-width: 200px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--green); background: var(--green); color: #fff; font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.btn.ghost { background: #fff; color: var(--green); border-color: var(--rule-2); }
.btn.ghost:hover { background: var(--green-soft); border-color: var(--green); color: var(--green-2); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f1c4bf; }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--good-soft); color: #0d5236; border: 1px solid #bfe3cf; }
.flash.err { background: var(--bad-soft); color: #7a1a12; border-color: #f3c3be; }
.flash.warn { background: var(--warn-soft); color: #6b3d00; border-color: #f2d6a8; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.tabs { display: inline-flex; gap: 4px; margin-bottom: 18px; background: #e6eae9; padding: 4px; border-radius: 11px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,43,76,.12); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c2cbc8; margin-right: 6px; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
details summary { cursor: pointer; font-weight: 600; }
code { background: #eef2f1; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
pre { background: var(--navy); color: #d8e3f2; padding: 12px; border-radius: 8px; overflow: auto; font-size: 12.5px; max-height: 420px; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; background: var(--navy-2); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--today); }
.login-art .rules { position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(255,255,255,.05) 39px 40px); pointer-events: none; }
.login-art h2 { font-size: 34px; line-height: 1.15; max-width: 420px; margin: 0 0 12px; position: relative; }
.login-art p { color: var(--navy-ink); max-width: 420px; position: relative; margin: 0; }
.login-art .brand { border: 0; padding: 0; margin: 0; position: relative; }
.login { width: 100%; max-width: 400px; margin: auto; padding: 32px 24px; }
.login .logo { display: block; width: 64px; height: 64px; border-radius: 14px; margin: 0 0 18px; object-fit: contain; background: #fff; border: 1px solid var(--rule); padding: 4px; }
.login h1 { margin-bottom: 4px; }
.login .card { margin-top: 20px; }

/* Install banner */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(20,43,76,.18); max-width: 520px; margin: 0 auto; }
.install-banner img { width: 42px; height: 42px; border-radius: 10px; }
.install-text { flex: 1; font-size: 13.5px; line-height: 1.4; }
.install-text b { display: block; font-size: 14.5px; }
.install-banner .ios-only, .install-banner .android-only { display: none; }
.install-banner.ios .ios-only, .install-banner.android .android-only { display: inline; }
.install-banner.android .btn.android-only { display: inline-flex; }
.install-close { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }

/* Report header */
.report-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.report-head img { height: 56px; width: auto; max-width: 140px; object-fit: contain; }
.report-school { font-weight: 700; font-size: 18px; }
.report-title { font-size: 15px; color: var(--ink-2); }
.logo-preview { max-height: 70px; max-width: 200px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 6px; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 10; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--navy); color: #fff; }
  .topbar .brand { padding: 0; margin: 0; border: 0; }
  .topbar .brand img { width: 34px; height: 34px; }
  .topbar a.out { color: var(--navy-ink); font-size: 14px; }
  body { padding-bottom: 76px; }
  .wrap { padding: 18px 16px 28px; }
  h1 { font-size: 22px; }
  .split { grid-template-columns: 1fr; }
  .register { grid-template-columns: 1fr; gap: 18px; padding: 22px 20px; }
  .register .hero-num { font-size: 48px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: #fff; border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 600; }
  .bottomnav a.on { color: var(--green); }
  .hide-sm { display: none; }
  th, td { padding: 9px 8px; }
  .install-banner { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .side, .topbar, .bottomnav, .filters, .btns, .noprint, .tabs, .install-banner { display: none !important; }
  .app { display: block; }
  body { background: #fff; padding: 0; }
  .card, .stat { border: 0; padding: 0; box-shadow: none; }
  .wrap { padding: 0; }
  .register { background: #fff; color: var(--ink); border: 1px solid var(--rule); }
  .report-head img { height: 64px; }
  table { font-size: 12px; }
  a { color: inherit; text-decoration: none; }
}

/* Bulk action bar on People */
.bulkbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px; margin: -4px -4px 14px; border-radius: 10px; background: #f6f8f7; border: 1px solid var(--rule); }
.bulkbar > div { min-width: 160px; }
.bulkbar .bulk-count { min-width: auto; align-self: center; font-size: 14px; color: var(--ink-2); padding-right: 6px; border-right: 1px solid var(--rule-2); margin-right: 2px; }
.bulkbar .bulk-count b { font-size: 18px; color: var(--ink); }
.bulkbar.has-selection { background: var(--green-soft); border-color: #bfe3cf; }
.bulkbar .bulk-go { min-width: auto; }
.bulkbar .bulk-all { flex-basis: 100%; margin: 0; font-size: 13.5px; }
tr.selected td { background: #f0f7f4; }

/* Roles and departments page */
.inline-edit { display: inline-block; position: relative; margin-left: 6px; vertical-align: middle; }
.inline-edit summary { list-style: none; color: var(--green); font-weight: 600; padding: 6px 4px; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit[open] summary { color: var(--ink); }
.edit-pop { text-align: left; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 14px; margin-top: 8px; min-width: 260px; box-shadow: var(--shadow); white-space: normal; }
.inline-edit[open] { display: block; margin: 8px 0 0; }
.add-row { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 16px; }
.add-row .btn { margin-top: 6px; }
.btn[disabled] { opacity: .4; cursor: default; }
.period-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 14px; }
.period-nav strong { font-size: 16px; color: var(--ink); min-width: 0; }
.period-nav .quick { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; font-size: 13.5px; font-weight: 600; }
@media (max-width: 640px) { .tabs a { padding: 7px 11px; font-size: 13px; } .period-nav .quick { margin-left: 0; width: 100%; } }
.badge.warn { background: #fdf0d5; color: #8a5a00; }
.warn-card { border-left: 4px solid var(--marigold, #f2a93b); }
.lockline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.seclist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.seclist li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.seclist li::before { content: ''; }
.seclist li { font-weight: 700; }
.seclist li span { font-weight: 400; }
.seclist li.ok { color: #11604b; }
.seclist li.bad { color: #b42318; }
.seclist li.ok span, .seclist li.bad span { color: var(--ink); }
.login-art.has-photo { background-color: var(--navy); background-size: cover; background-position: center; }
.login-art.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20,43,76,.6) 0%, rgba(20,43,76,0) 22%, rgba(20,43,76,0) 55%, rgba(20,43,76,.85) 100%); pointer-events: none; }
.login-art.has-fit { gap: 24px; }
.art-photo { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.art-photo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.login-art.has-photo > * { z-index: 1; }
.login-art.has-photo::before { z-index: 2; }
.login-art.has-photo p { color: #e8eef7; }
.login-preview { max-width: 260px; max-height: 160px; border-radius: 8px; border: 1px solid var(--rule); object-fit: cover; }
.preview-box { background: #f4f7f6; border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.preview-box .sample { margin: 8px 0 0; padding: 10px 12px; background: #fff; border-left: 3px solid #11604b; border-radius: 6px; }

/* Attendance register: one column per day */
.reg-wrap { overflow-x: auto; }
table.regtable { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
table.regtable th, table.regtable td { padding: 5px 6px; border-bottom: 1px solid var(--rule); text-align: center; white-space: nowrap; }
table.regtable th.who, table.regtable td.who { position: sticky; left: 0; background: #fff; text-align: left; z-index: 1; min-width: 150px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--rule); }
table.regtable td.who small { display: block; color: var(--muted, #6b7280); font-size: 11px; }
table.regtable th.day { font-weight: 500; font-size: 11.5px; color: var(--muted, #6b7280); line-height: 1.2; min-width: 46px; }
table.regtable th.day b { font-size: 14px; color: var(--ink, #142b4c); }
table.regtable .we { background: #f6f7f9; }
table.regtable th.off { opacity: .55; }
table.regtable tr.grp td { background: #eef2f6; font-weight: 700; color: var(--ink, #142b4c); text-align: left; font-size: 12.5px; letter-spacing: .02em; }
table.regtable td.c { line-height: 1.15; }
table.regtable td.p b { display: block; font-weight: 700; color: #11604b; }
table.regtable td.p small { display: block; color: #142b4c; font-size: 12px; }
table.regtable td.late b { color: #b45309; }
table.regtable td.late { background: #fff7e8; }
table.regtable td.abs { color: #b42318; font-weight: 700; background: #fdecea; }
table.regtable td.off { color: #c2c7cf; }
table.regtable .bad-t { color: #b42318; font-weight: 700; }
table.regtable .warn-t { color: #b45309; font-weight: 700; }
.reg-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted, #6b7280); }
.cell-demo { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; padding: 3px 6px; border: 1px solid var(--rule); border-radius: 6px; line-height: 1.1; font-size: 12px; background: #fff; }
.cell-demo b { color: #11604b; } .cell-demo small { color: #142b4c; }
.cell-demo.late { background: #fff7e8; } .cell-demo.late b { color: #b45309; }
.cell-demo.abs { background: #fdecea; color: #b42318; font-weight: 700; min-height: 32px; }
.cell-demo.off { color: #9aa1ab; min-height: 32px; }
@media print {
  table.regtable { font-size: 9.5px; }
  table.regtable th, table.regtable td { padding: 2px 3px; }
  table.regtable th.who, table.regtable td.who { position: static; min-width: 110px; }
  table.regtable td.late, table.regtable td.abs, table.regtable .we, table.regtable tr.grp td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .reg-wrap { overflow: visible; }
}
