:root {
  --bg: #f5efe6;
  --surface: #ffffff;
  --line: #e0d6c8;
  --ink: #20201e;
  --muted: #6b655c;
  --accent: #a9805c;
  --accent-dark: #8c694a;
  --green: #3d7a4a;
  --red: #b34438;
  --amber: #b3832d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.hidden { display: none !important; }
.view { min-height: 100vh; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.auth-card {
  max-width: 380px;
  margin: 12vh auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.auth-card input { text-align: start; }
h1 { margin: 0 0 4px; font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--red); min-height: 18px; margin: 0; font-size: 13px; }
input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.btn {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--red); }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav button {
  border: none;
  background: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}
.topbar nav button.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.topbar-right select { width: auto; min-width: 140px; }
#content { max-width: 980px; margin: 20px auto; padding: 0 16px 60px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.badge.present, .badge.active, .badge.submitted, .badge.graded { color: var(--green); }
.badge.absent, .badge.suspended { color: var(--red); }
.badge.late, .badge.draft, .badge.returned { color: var(--amber); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input, .row > select { width: auto; flex: 1; min-width: 120px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
ul.children { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ul.children li { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.notif { border-inline-start: 3px solid var(--accent); padding: 8px 12px; margin-bottom: 8px; background: var(--surface); border-radius: 0 8px 8px 0; }
.notif.unread { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
[dir="rtl"] .notif { border-radius: 8px 0 0 8px; }
