/* Live Class Tracking — design system (spec §11).
   Deep Teal #0B5F57 / Teal Ink #0B3D38 / Warm White #F7F5F0 /
   Green #067647 / Red #B42318 / Amber #B54708 / Muted Gold #B98A1E.
   Bangla UI (Noto Sans Bengali), serif titles (Noto Serif Bengali).
   No gradients, no purple-blue, no emoji tiles. Colour is never the
   only signal: every status has a colour AND a text label. */
:root {
  --teal: #0B5F57;
  --ink: #0B3D38;
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --green: #067647;
  --red: #B42318;
  --amber: #B54708;
  --gold: #B98A1E;
  --border: #E3DED2;
  --muted: #5C6B66;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Bengali", "Hind Siliguri", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3 { font-family: "Noto Serif Bengali", "Noto Sans Bengali", serif; color: var(--ink); margin: 0 0 8px; }
h1 { font-size: 22px; } h2 { font-size: 19px; } h3 { font-size: 17px; }
p { margin: 0 0 10px; }
a { color: var(--teal); }
small, .muted { color: var(--muted); font-size: 13px; }

.app-header {
  background: var(--teal);
  color: #fff;
  padding: 12px 16px 0;
}
.app-header h1 { color: #fff; margin-bottom: 2px; }
.app-header .subtitle { color: #D8EDE9; font-size: 13px; margin: 0 0 10px; }
.app-nav {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.nav-link {
  color: #D8EDE9; text-decoration: none; white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; font-size: 14px; min-height: 36px;
  display: inline-flex; align-items: center;
}
.nav-link.active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 700; }
.app-user {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 16px; background: #EAF2EF; border-bottom: 1px solid var(--border);
}
.user-chip { font-size: 13px; }
main { max-width: 720px; margin: 0 auto; padding: 16px 12px 96px; }
.page-head { margin-bottom: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid #9AA5A0;
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(11, 61, 56, 0.06);
}
.card.st-started { border-left-color: var(--green); }
.card.st-absent, .card.st-cancelled { border-left-color: var(--red); }
.card.st-late { border-left-color: var(--amber); }
.card.st-scheduled { border-left-color: #9AA5A0; }
.card-top { display: flex; gap: 12px; }
.card-time { min-width: 64px; font-weight: 700; font-size: 15px; }
.card-body { flex: 1; min-width: 0; }
.card-dept { font-size: 19px; font-weight: 700; line-height: 1.3; }
.card-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.status-strip { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent;
}
.status-chip.st-scheduled { color: #47564F; background: #EEF0EE; border-color: #D5DAD5; }
.status-chip.st-started { color: var(--green); background: #E6F4EC; border-color: #BFE3CC; }
.status-chip.st-absent, .status-chip.st-cancelled { color: var(--red); background: #FDECEA; border-color: #F5C6C0; }
.status-chip.st-late { color: var(--amber); background: #FEF3E2; border-color: #F3D9A8; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}
.badge-amber { color: var(--amber); background: #FEF3E2; border: 1px solid #F3D9A8; }
.badge-gold { color: #7A5C10; background: #FBF3DC; border: 1px solid #EAD9A0; }
.badge-grey { color: #47564F; background: #EEF0EE; border: 1px solid #D5DAD5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid transparent;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none; background: #fff; color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline { border-color: var(--teal); color: var(--teal); background: #fff; }
.btn-danger-outline { border-color: var(--red); color: var(--red); background: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn-sm { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1 1 auto; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.field textarea { min-height: 88px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-family: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}
.chip.selected { background: var(--teal); color: #fff; border-color: var(--teal); }

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(11, 61, 56, 0.45);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet-backdrop.open { display: flex; }
.sheet {
  background: var(--surface); width: 100%; max-width: 720px;
  border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
.sheet h2 { margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 15px; font-weight: 700; z-index: 80; opacity: 0;
  transition: transform 0.25s, opacity 0.25s; pointer-events: none;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.undo-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 12px 10px 16px; border-radius: 10px;
  z-index: 80; display: none; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
}
.undo-toast.open { display: flex; }
.undo-toast button {
  background: var(--gold); color: #fff; border: none; border-radius: 8px;
  min-height: 36px; padding: 6px 12px; font-family: inherit; font-weight: 700; cursor: pointer;
}

table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.data th, table.data td { border: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
table.data th { background: #EAF2EF; }
.kpi-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.kpi { flex: 1 1 30%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.kpi .num { font-size: 26px; font-weight: 700; }
.kpi .lbl { font-size: 13px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.loading { text-align: center; color: var(--muted); padding: 32px 16px; }

@media (max-width: 380px) {
  main { padding-left: 10px; padding-right: 10px; }
  .card-dept { font-size: 18px; }
  .kpi { flex-basis: 44%; }
}

/* ---- Print (reports → PDF via browser print, spec §8) ---- */
@media print {
  .app-header, .app-nav, .app-user, .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .card, table.data { break-inside: avoid; }
}
