/* ==========================================================================
   Preschool Pickup — shared styles
   Visual language: crossing-guard / dispatch-board. Navy + amber + white.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;900&family=Inter:wght@500;600;700;800&display=swap');

:root {
  --navy: #16233D;
  --navy-light: #223357;
  --navy-lighter: #2E4370;
  --amber: #F5A623;
  --amber-dark: #C97F0E;
  --bg: #E7E9ED;
  --white: #FFFFFF;
  --success: #2E7D46;
  --success-bg: #E3F0E7;
  --orange-bg: #FDECD3;
  --danger: #B3261E;
  --danger-bg: #FBEAE9;
  --text: #16233D;
  --text-muted: #5B6472;
  --border: #CBD1DA;

  --font-display: 'Big Shoulders Display', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius: 10px;
  --shadow: 0 2px 6px rgba(22, 35, 61, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.01em;
  margin: 0;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber-dark);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Top bar (shared across staff-facing pages) ---------- */

.topbar {
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: clamp(22px, 3vw, 30px);
  color: var(--white);
}

.topbar .stripe {
  color: var(--amber);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #C9D2E3;
}

.btn {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

.btn-amber {
  background: var(--amber);
  color: var(--navy);
}
.btn-amber:hover { background: var(--amber-dark); }

.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--navy); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1.5px solid #f0c7c4;
}
.btn-danger:hover { background: #f6dad8; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.page-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.login-card .eyebrow {
  color: var(--amber-dark);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
}

.login-card h1 {
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: var(--font-body);
}
.field input:focus { border-color: var(--navy); outline: none; }

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

.login-submit {
  width: 100%;
  padding: 13px;
  font-size: 16px;
}

/* ---------- Search ---------- */

.search-row {
  margin: 18px 0;
}

.search-row input {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: var(--font-body);
}
.search-row input:focus { border-color: var(--navy); outline: none; }

/* ---------- Pickup grid ---------- */

.hint {
  font-size: 13px;
  color: var(--text-muted);
}

.grade-tabs {
  display: inline-flex;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}

.grade-tab {
  padding: 9px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  background: transparent;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.grade-tab.active {
  background: var(--navy);
  color: var(--white);
}

.grade-tab:hover:not(.active) {
  background: var(--bg);
}

.grade-choice {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  color: var(--text);
  padding: 0 4px;
}

.grade-choice label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.grade-choice input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

#addNameInput {
  flex: 0 1 260px;
}

.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.child-btn {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 22px 16px;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform 0.05s ease, border-color 0.15s ease, background 0.15s ease;
}

.child-btn:hover { border-color: var(--navy); }
.child-btn:active { transform: scale(0.97); }

.child-btn.called.called-green {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.child-btn.called.called-orange {
  background: var(--orange-bg);
  border-color: var(--amber-dark);
  color: var(--amber-dark);
}

.child-btn.called::after {
  content: "✓";
  margin-left: 8px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h2 {
  color: var(--text-muted);
  font-size: 22px;
  margin-bottom: 8px;
}

/* ---------- Recently called ---------- */

.recent-panel {
  margin-top: 30px;
  background: var(--white);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.recent-panel h2 {
  font-size: 15px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-weight: 800;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-list li {
  list-style: none;
}

.recent-chip {
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.recent-chip-green {
  background: var(--success-bg);
  color: var(--success);
}

.recent-chip-green:hover {
  background: #D3ECD9;
}

.recent-chip-orange {
  background: var(--orange-bg);
  color: var(--amber-dark);
}

.recent-chip-orange:hover {
  background: #FBE0B4;
}

.recent-chip:active {
  transform: scale(0.97);
}

.recent-empty {
  color: var(--text-muted);
  font-size: 14px;
}

.reset-row {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

/* ---------- Smart board / display ---------- */

.board {
  min-height: 100vh;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  position: relative;
}

.board.flash {
  animation: flashBg 0.6s ease;
}
@keyframes flashBg {
  0% { background: var(--amber); }
  100% { background: var(--navy); }
}

.board-idle .idle-label {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  color: #7C8AAD;
  font-weight: 900;
}

.board-idle .idle-sub {
  margin-top: 12px;
  font-size: clamp(16px, 2vw, 22px);
  color: #4E5D80;
}

.board-call .siren {
  font-size: clamp(28px, 4vw, 44px);
  color: var(--amber);
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.board-call .names {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 130px);
  line-height: 1.05;
  font-weight: 900;
  color: var(--white);
}

.board-call .instruction {
  margin-top: 20px;
  font-size: clamp(18px, 2.6vw, 32px);
  color: #C9D2E3;
  font-weight: 600;
}

.board-footer {
  position: absolute;
  bottom: 22px;
  font-size: 14px;
  color: #4E5D80;
}

/* ---------- Admin ---------- */

.admin-section {
  background: var(--white);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.admin-section h2 {
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 800;
  margin-bottom: 16px;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
}

.bulk-area textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  resize: vertical;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
}

.student-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}

.student-table td {
  padding: 10px;
  border-bottom: 1px solid #EEF0F3;
  font-size: 15px;
}

.class-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.class-badge-green {
  background: var(--success-bg);
  color: var(--success);
}

.class-badge-orange {
  background: var(--orange-bg);
  color: var(--amber-dark);
}

.student-table input.edit-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--font-body);
}

.row-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.row-actions .btn {
  padding: 6px 10px;
  font-size: 13px;
}

.status-msg {
  font-size: 14px;
  margin-top: 10px;
  min-height: 18px;
}
.status-msg.ok { color: var(--success); }
.status-msg.err { color: var(--danger); }

.loading-note {
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px 0;
}
