:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --text: #172b4d;
  --muted: #5e6c84;
  --accent: #0c66e4;
  --border: #dfe1e6;
  --bad: #de350b;
  --ok: #22c55e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); }
.login-body { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border); }
.login-card input { width: 100%; margin-top: 4px; padding: 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 16px; }
.login-card label { display: block; margin-top: 12px; font-size: 14px; }
.err { color: var(--bad); margin-top: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 12px; }

.app-shell { display: flex; min-height: 100dvh; }
.nav-rail {
  width: 52px; flex-shrink: 0; background: #0f172a; color: #e2e8f0;
  display: flex; flex-direction: column; align-items: stretch; padding: 8px 0; gap: 8px;
}
.nav-rail a {
  text-align: center; font-size: 10px; font-weight: 700; padding: 10px 4px; color: #94a3b8;
  text-decoration: none; border-left: 3px solid transparent;
}
.nav-rail a:hover, .nav-rail a.active { color: #fff; background: rgba(255,255,255,.08); border-left-color: var(--accent); }
.nav-logout { margin-top: auto; font-size: 10px; text-align: center; color: #fca5a5 !important; }
main { flex: 1; overflow: auto; padding: 12px 14px 80px; max-width: 1100px; margin: 0 auto; width: 100%; }
section { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
section:target, section.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.btn { border: none; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #de350b; color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 12px; font-weight: 600; }
table .btn-sm { margin: 0 2px 0 0; }
.tasks-layout { display: flex; flex-direction: column; gap: 12px; }
.day-block h3 { margin: 0 0 8px; font-size: 15px; }
.task-row { display: grid; grid-template-columns: 88px 72px 1fr 160px; gap: 6px; align-items: center; margin-bottom: 6px; }
.task-row select, .task-row input { width: 100%; padding: 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 14px; }
.task-row .mc { font-size: 11px; }
@media (max-width: 720px) {
  .task-row { grid-template-columns: 1fr; }
}
.timer-wrap .timer-main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .timer-wrap .timer-main-grid { grid-template-columns: 1fr; } }
.timer-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timer-clock { font: 700 28px ui-monospace, monospace; margin: 8px 0; }
.log-box { max-height: 200px; overflow: auto; font-size: 12px; background: #f8fafc; padding: 8px; border-radius: 8px; margin-top: 8px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.note-card textarea { width: 100%; min-height: 100px; border: none; background: transparent; resize: vertical; font-size: 14px; }
.note-card { border-radius: 10px; padding: 8px; border: 1px solid var(--border); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.modal.show { display: flex; }
.modal-card { background: #fff; border-radius: 12px; max-width: 520px; width: 100%; padding: 14px; max-height: 90dvh; overflow: auto; }
#camVideo { width: 100%; max-height: 240px; background: #000; border-radius: 8px; }
.admin-grid { display: grid; gap: 10px; }
.admin-grid input, .admin-grid select { width: 100%; padding: 8px; border-radius: 6px; border: 1px solid var(--border); }
.table-scroll { overflow: auto; max-height: 240px; font-size: 13px; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--border); padding: 6px; text-align: left; }
.admin-source-hint { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0 0 8px; padding: 10px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--border); }
.admin-source-hint code { font-size: 12px; color: #0f172a; }
.admin-banner { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; border: 1px solid var(--border); }
.admin-banner.ok { background: #ecfdf5; border-color: #6ee7b7; color: #14532d; }
.admin-banner.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.admin-banner:not([hidden]) { display: block; }
