:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --present: #16a34a;
  --present-bg: #dcfce7;
  --sick: #d97706;
  --sick-bg: #fef3c7;
  --absent: #dc2626;
  --absent-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #1a1d23;
    --text: #eceef2;
    --muted: #9aa1ad;
    --line: #2a2e36;
    --accent: #4c8dff;
    --present: #22c55e;
    --present-bg: #12351f;
    --sick: #f59e0b;
    --sick-bg: #3a2c0d;
    --absent: #f87171;
    --absent-bg: #3d1717;
    --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--line); font-weight: 600;
}
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--absent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
textarea { min-height: 120px; resize: vertical; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.center { text-align: center; padding: 48px 16px; }
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 640px; max-height: 85vh; overflow: auto;
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet h3 { margin: 0 0 12px; }
.row-actions { display: flex; gap: 8px; margin-top: 16px; }
.row-actions .btn { flex: 1; }
