/* Odeh and Jamileh Akkawi Foundation — dashboard styles (light theme) */
:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --good: #0ca30c;
  --good-text: #006300;
  --critical: #d03b3b;
  --warning: #fab219;
  --accent: #1c5cab;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- wordmark ---------- */
.wordmark { text-align: center; user-select: none; }
.wordmark .line1 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.06em;
  font-size: 22px;
}
.wordmark .line1 .amp { font-style: italic; font-weight: 400; text-transform: lowercase; font-size: 0.85em; }
.wordmark .line1 .caps { text-transform: uppercase; }
.wordmark .line2 {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 2px;
}
.wordmark .line2::before, .wordmark .line2::after { content: "\2014"; color: var(--baseline); margin: 0 6px; }

/* ---------- login / setup ---------- */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--page); padding: 24px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px 36px; width: 380px; max-width: 100%;
  box-shadow: 0 4px 24px rgba(11,11,11,0.06);
}
.auth-card .wordmark { margin-bottom: 26px; }
.auth-card h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; text-align: center; color: var(--ink-2); }
.auth-error { color: var(--critical); font-size: 13px; margin: 8px 0 0; min-height: 18px; }
.auth-note { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--grid); padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .wordmark { margin: 4px 0 18px; }
.sidebar .wordmark .line1 { font-size: 17px; }
.sidebar .wordmark .line2 { font-size: 8.5px; letter-spacing: 0.28em; }
/* ---------- global year filter ---------- */
.year-filter-wrap { margin: 0 4px 14px; }
.year-filter {
  width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--grid);
  background: var(--page); font-weight: 600; color: var(--accent); cursor: pointer;
}
.year-filter:hover { border-color: var(--baseline); }

.nav-link {
  display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2);
  text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--page); color: var(--ink); }
.nav-link.active { background: #eaf1fb; color: var(--accent); }
.sidebar .spacer { flex: 1; }
.sidebar .whoami { font-size: 12px; color: var(--muted); padding: 8px 12px; border-top: 1px solid var(--grid); }
.main { flex: 1; padding: 28px 32px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 650; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
.kpi .label { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
.kpi .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- cards / charts ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px; overflow-x: auto;
}
.card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.card .card-sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.chart-box { position: relative; height: 260px; }

/* ---------- tables ---------- */
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--ink-2); padding: 7px 10px;
  border-bottom: 1px solid var(--baseline); white-space: nowrap;
  position: sticky; top: 0; background: var(--surface);
}
table.data td { padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data tr:hover td { background: #f4f6f9; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-link { color: var(--accent); cursor: pointer; text-decoration: none; font-weight: 500; }
table.data .row-link:hover { text-decoration: underline; }

/* ---------- pills / status ---------- */
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px;
  font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.pill.active { background: #e8f6e8; color: var(--good-text); }
.pill.graduated { background: #eaf1fb; color: var(--accent); }
.pill.inactive, .pill.withdrawn, .pill.retired { background: #f2f1ee; color: var(--ink-2); }
.pill.attended { background: #e8f6e8; color: var(--good-text); }
.pill.attended_late, .pill.left_early, .pill.extension { background: #fdf3dd; color: #8a6100; }
.pill.absent { background: #fbe9e9; color: var(--critical); }
.pill.absent_notified, .pill.excused { background: #f2f1ee; color: var(--ink-2); }
.pill.submitted { background: #e8f6e8; color: var(--good-text); }
.pill.not_submitted { background: #fbe9e9; color: var(--critical); }
.pill.na { background: #f2f1ee; color: var(--muted); }
.pill.assigned { background: #eaf1fb; color: var(--accent); }
.pill.returned, .pill.in_inventory { background: #f2f1ee; color: var(--ink-2); }
.pill.winner { background: #fdf3dd; color: #8a6100; }

/* ---------- controls ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
input, select, textarea, button {
  font-family: inherit; font-size: 13px; color: var(--ink);
}
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
  padding: 7px 10px; border: 1px solid var(--baseline); border-radius: 7px;
  background: #fff; width: 100%;
}
.toolbar input[type=text], .toolbar select { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9ec5f4; outline-offset: 0; border-color: var(--series-1); }
button {
  padding: 7px 14px; border-radius: 7px; border: 1px solid var(--baseline);
  background: #fff; cursor: pointer; font-weight: 550;
}
button:hover { background: var(--page); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #164a89; }
button.danger { color: var(--critical); border-color: #e9b5b5; }
button.danger:hover { background: #fbe9e9; }
button.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: default; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,11,11,0.35); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 12px; padding: 22px 24px;
  width: 640px; max-width: 100%; box-shadow: 0 12px 48px rgba(11,11,11,0.22);
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .form-error { color: var(--critical); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--grid); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; cursor: pointer; color: var(--ink-2); font-weight: 550;
  border: none; background: none; border-bottom: 2px solid transparent; border-radius: 0;
}
.tab:hover { color: var(--ink); background: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- attendance matrix ---------- */
.matrix-cell { text-align: center; font-size: 11px; cursor: pointer; }
.matrix-cell .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.dot.attended { background: var(--series-3); }
.dot.attended_late, .dot.left_early { background: var(--series-4); }
.dot.absent { background: var(--critical); }
.dot.absent_notified, .dot.excused { background: var(--baseline); }
.dot.none { background: transparent; border: 1px dashed var(--baseline); }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend-row span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- public application page ---------- */
.apply-page { min-height: 100vh; background: var(--page); padding: 36px 16px; }
.apply-inner { max-width: 760px; margin: 0 auto; }
.apply-inner .card { margin-bottom: 18px; }
.apply-inner .card h3 {
  font-family: var(--serif); font-size: 17px; letter-spacing: 0.02em;
  border-bottom: 1px solid var(--grid); padding-bottom: 8px; margin-bottom: 14px;
}
@media (max-width: 640px) { .apply-inner .form-grid { grid-template-columns: 1fr; } }

.asg-slot { border: 1px solid var(--grid); border-radius: 8px; padding: 12px 14px; }
.submission-reading {
  background: var(--page); border: 1px solid var(--grid); border-radius: 8px;
  padding: 12px 16px; margin: 4px 0;
}

.empty { color: var(--muted); padding: 24px; text-align: center; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

@media print {
  .sidebar, .toolbar, button { display: none !important; }
  .main { padding: 0; }
  .card { border: none; box-shadow: none; }
}
