/* "Addis Road" identity (spec section 7), translated to a plain web admin
   panel: flat, 4px corners, 1px outlines instead of shadows, no gradients. */
:root {
  --taxi-blue: #2A5DA8;
  --lane-yellow: #E8B530;
  --asphalt: #22211F;
  --chalk: #F3EFE6;
  --concrete: #FBF9F4;
  --kerb: #D9D3C7;
  --dust: #8C8374;
  --verge: #3C7A4E;
  --sign-red: #C7372F;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans Ethiopic", "Noto Sans", system-ui, sans-serif;
  background: var(--chalk);
  color: var(--asphalt);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--kerb);
  background: var(--concrete);
}

header h1 { font-size: 20px; margin: 0; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--concrete);
  border: 1px solid var(--kerb);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; }
.stat .value { font-size: 32px; font-weight: 600; color: var(--taxi-blue); }
.stat .label { color: var(--dust); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--kerb); }
th { color: var(--dust); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge.assigned { background: rgba(42,93,168,0.12); color: var(--taxi-blue); }
.badge.activated { background: rgba(60,122,78,0.12); color: var(--verge); }
.badge.revoked { background: rgba(199,55,47,0.12); color: var(--sign-red); }

input, button {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--kerb);
}

input { background: white; width: 100%; }

button {
  background: var(--taxi-blue);
  color: var(--chalk);
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button:hover { opacity: 0.92; }
button.secondary { background: transparent; color: var(--taxi-blue); border: 1px solid var(--taxi-blue); }
button.danger { background: var(--sign-red); }

.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row input { flex: 1; }

.error { color: var(--sign-red); font-size: 13px; margin-top: 8px; }
.muted { color: var(--dust); font-size: 13px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 320px; }
.login-card h1 { text-align: center; margin-bottom: 24px; }
.login-card input { margin-bottom: 12px; }

.brand { font-weight: 800; color: var(--taxi-blue); letter-spacing: 0.5px; }
.muted-title { font-weight: 500; color: var(--dust); }
.school-name { font-weight: 600; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--kerb); }
.header-right { display: flex; gap: 12px; align-items: center; }
h2 { margin: 0 0 8px; font-size: 18px; }
h3 { margin: 16px 0 8px; font-size: 15px; }
textarea { width: 100%; font-family: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--kerb); border-radius: 4px; margin-bottom: 12px; resize: vertical; }
select { font-family: inherit; font-size: 14px; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--kerb); background: white; }
.form-row { flex-wrap: wrap; }
.notice { border-color: var(--lane-yellow); background: #FFF8E1; }
.result { background: #EEF6F0; border: 1px solid var(--verge); border-radius: 4px; padding: 12px; margin-top: 8px; word-break: break-all; }
.ok { color: var(--verge); font-size: 13px; margin-top: 8px; }
code { font-family: ui-monospace, monospace; font-weight: 600; letter-spacing: 1px; }
.badge.unused { background: rgba(42,93,168,0.12); color: var(--taxi-blue); }
.badge.expired { background: rgba(140,131,116,0.18); color: var(--dust); }
button:disabled { opacity: 0.5; cursor: default; }
a { color: var(--taxi-blue); }

/* ---- layout helpers ---- */
.narrow { max-width: 110px; }
.hint-inline { align-self: center; flex: 1 1 220px; }
.push-right { margin-left: auto; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
td.actions { white-space: nowrap; }
td.actions button { margin: 2px 4px 2px 0; }
header h1 { min-width: 0; }
.school-name { display: inline-block; }

/* ---- phones and small tablets ---- */
@media (max-width: 720px) {
  header { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  header h1 { font-size: 18px; flex: 1 1 100%; }
  .school-name { display: block; margin: 4px 0 0; padding: 0; border: 0; font-size: 15px; }
  .header-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  #userEmail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

  main { padding: 12px; }
  .card { padding: 14px; margin-bottom: 14px; }

  .stat-row { gap: 10px; }
  .stat { min-width: 0; flex: 1 1 0; }
  .stat .value { font-size: 24px; }
  .stat .label { font-size: 12px; }

  /* forms: one control per line, big tap targets, 16px text so iOS does not zoom in on focus */
  .form-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .form-row > * { width: 100%; max-width: none; }
  .narrow { max-width: none; }
  .push-right { margin-left: 0; }
  input, select, textarea, button { font-size: 16px; min-height: 44px; }
  textarea { min-height: 120px; }
  button { padding: 12px 14px; }

  /* tables become stacked cards: each row is a card, each cell a "Label  value" line */
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border: 1px solid var(--kerb); border-radius: 4px; background: white; padding: 6px 10px; margin-bottom: 10px; }
  table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 6px 0; text-align: right; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--dust); font-size: 12px; font-weight: 600; text-transform: uppercase; text-align: left; flex: none; }
  table.stack td[colspan] { display: block; text-align: left; }
  table.stack td.actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--kerb); margin-top: 4px; }
  table.stack td.actions:empty { display: none; }
  code { font-size: 16px; }

  .result { font-size: 13px; }
  .login-card { width: 100%; max-width: 360px; }
  .login-wrap { padding: 16px; align-items: flex-start; padding-top: 12vh; }
}

@media (max-width: 380px) {
  h2 { font-size: 16px; }
  .stat .value { font-size: 20px; }
}
