/* Morning Report Attendance · shared design system */
:root {
  --bg: #EEF3F6;
  --surface: #FFFFFF;
  --surface-2: #F6F9FA;
  --ink: #0F2A37;
  --ink-2: #3B5563;
  --mute: #6B808C;
  --line: #E1E9ED;
  --teal: #1F9AA3;
  --teal-d: #0E5F68;
  --teal-dd: #08414A;
  --teal-soft: #E3F4F5;
  --gold: #BF9D68;
  --gold-soft: #F7F0E4;
  --ok: #12805C;
  --ok-soft: #E3F5EE;
  --warn: #A86A10;
  --warn-soft: #FDF3E1;
  --bad: #C0392B;
  --bad-soft: #FCEBE9;
  --shadow: 0 1px 2px rgba(15, 42, 55, .06), 0 8px 24px rgba(15, 42, 55, .06);
  --shadow-lg: 0 2px 4px rgba(15, 42, 55, .06), 0 18px 48px rgba(15, 42, 55, .12);
  --r: 16px;
  --r-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A171D; --surface: #10232B; --surface-2: #0D1E25; --ink: #E7F0F3; --ink-2: #B8CAD2; --mute: #8AA0AB;
    --line: #1D3943; --teal: #34B5BE; --teal-d: #7FD3D9; --teal-dd: #0A3F47; --teal-soft: #11343B;
    --gold-soft: #2A2418; --ok: #3DCB97; --ok-soft: #0F3127; --warn: #F0B455; --warn-soft: #33270F;
    --bad: #F2867A; --bad-soft: #3A1915; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 18px 48px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A171D; --surface: #10232B; --surface-2: #0D1E25; --ink: #E7F0F3; --ink-2: #B8CAD2; --mute: #8AA0AB;
  --line: #1D3943; --teal: #34B5BE; --teal-d: #7FD3D9; --teal-dd: #0A3F47; --teal-soft: #11343B;
  --gold-soft: #2A2418; --ok: #3DCB97; --ok-soft: #0F3127; --warn: #F0B455; --warn-soft: #33270F;
  --bad: #F2867A; --bad-soft: #3A1915; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-d); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, #23A8B1, var(--teal-d)); color: #fff; box-shadow: 0 6px 18px rgba(14, 95, 104, .28); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(14, 95, 104, .36); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-soft { background: var(--teal-soft); color: var(--teal-d); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-lg { min-height: 56px; font-size: 17px; border-radius: 14px; padding: 0 22px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-ghost .spin, .btn-soft .spin { border-color: var(--line); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.muted { color: var(--mute); }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- Pills / chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--teal-soft); color: var(--teal-d); }
.pill-mute { background: var(--surface-2); color: var(--mute); border: 1px solid var(--line); }
.pulse .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; } 50% { box-shadow: 0 0 0 5px transparent; opacity: .55; } }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(31, 154, 163, .15); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }
.hint { font-size: 12.5px; color: var(--mute); margin-top: 6px; }
.err-text { font-size: 12.5px; color: var(--bad); margin-top: 6px; font-weight: 500; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 10px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: center; line-height: 1.2;
  transition: all .12s ease; -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: #BFD3DA; }
.chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-d); box-shadow: inset 0 0 0 1px var(--teal); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); }

/* ---------- Brand bar ---------- */
.brandbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.brandbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 52px; width: auto; border-radius: 8px; background: #fff; }
.dark-logo { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .light-logo { display: none; } :root:not([data-theme="light"]) .dark-logo { display: block; } }
:root[data-theme="dark"] .light-logo { display: none; }
:root[data-theme="dark"] .dark-logo { display: block; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; pointer-events: none; z-index: 100; padding: 0 16px; }
.toast { pointer-events: auto; background: #0F2A37; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 520px; animation: rise .25s ease; }
.toast.ok { background: #0F5E47; } .toast.bad { background: #8E2A20; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 24, 31, .5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-h { padding: 18px 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 8px 20px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--mute); cursor: pointer; padding: 6px; border-radius: 8px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-bad { background: var(--bad-soft); color: var(--bad); }
.notice-info { background: var(--teal-soft); color: var(--teal-d); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Credit footer ---------- */
.credit { text-align: center; font-size: 12px; line-height: 1.7; color: var(--mute); padding: 18px 16px 6px; }
.credit b { color: var(--ink-2); font-weight: 650; }
.credit a { color: var(--teal-d); text-decoration: none; font-weight: 600; }
.credit a:hover { text-decoration: underline; }
.credit .sep { opacity: .5; margin: 0 6px; }

/* ---------- Demo ribbon ---------- */
.demo-ribbon { position: fixed; top: 10px; right: -34px; transform: rotate(45deg); background: var(--gold); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 4px 40px; z-index: 200; box-shadow: var(--shadow); pointer-events: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
