/* ============================================================
   ClassScan — Theme layer (modern / clean / minimal)
   Loaded AFTER each page's inline <style> so it refines the
   shared design tokens without changing any markup or logic.
   Only visual: colors, typography, shadows, radii, focus.
   ============================================================ */

:root {
  /* Brand accents kept (KUMON identity) */
  --navy:    #1a4a6e;
  --primary: #f97316;
  --gold:    #c9a227;
  --blue:    #5ba4cf;

  /* Modernised neutrals — softer bg, neutral (de-blued) borders & text */
  --bg:      #f5f7fb;
  --card:    #ffffff;
  --text:    #0f172a;
  --muted:   #64748b;
  --border:  #e8edf3;

  /* Reusable soft elevation + radius (used by overrides below) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow:    0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -10px rgba(15, 23, 42, .12);
  --shadow-lg: 0 8px 40px -12px rgba(15, 23, 42, .18);
  --radius:    16px;
}

/* ── Global typography & rendering ───────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Sarabun', Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: .1px;
}

::selection { background: rgba(249, 115, 22, .22); }

/* Subtle, modern scrollbar (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ── Soft, unified elevation on card-like containers ─────── */
.card, .menu-card, .summary-box, .student-row, .student-card,
.write-card, .filter-bar, .note-card, .child-card, .perm-card,
.user-card, .notif-bar, .connected-box, .leave-panel, .empty-state,
.history-card, .result, .stat-box, .kpi, .panel {
  box-shadow: var(--shadow);
}

/* Slightly larger, smoother corners for the main cards */
.card, .menu-card, .write-card, .user-card, .perm-card,
.child-card, .note-card, .filter-bar, .notif-bar {
  border-radius: var(--radius);
}

/* Smooth hover/press feedback on interactive cards & buttons */
.menu-card, .student-row, .child-card {
  transition: transform .16s ease, box-shadow .16s ease;
}
.menu-card:hover { box-shadow: var(--shadow-lg); }

button, .btn, a[class*="btn"] { transition: background .15s ease, box-shadow .15s ease, transform .08s ease, opacity .15s ease; }
button:active, .btn:active { transform: translateY(1px); }

/* Cleaner keyboard focus ring (accessibility + modern feel) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(91, 164, 207, .6);
  outline-offset: 2px;
}

/* Inputs/selects: neutral borders + soft focus */
input, select, textarea { transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(91, 164, 207, .15);
}

/* ============================================================
   Component redesign — nav, menu cards, cards, buttons, pills
   (all shared class hooks; refines every page at once)
   ============================================================ */

/* ── Top navigation: refined navy bar + ghost-pill actions ── */
nav {
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, .45);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.nav-brand span { letter-spacing: .2px; }
.nav-brand img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }
.nav-logout, .nav-back, .nav-link {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 7px 14px;
  font-weight: 600;
}
.nav-logout:hover, .nav-back:hover, .nav-link:hover {
  background: rgba(255, 255, 255, .14);
  color: #ffffff;
}

/* ── Home menu cards: minimal icon badge + neutral frame ──── */
.menu-card {
  border: 1px solid var(--border);
  border-bottom-width: 3px;          /* keeps the per-card colour accent */
  padding: 26px 18px;
}
.menu-card .icon {
  width: 54px; height: 54px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(26, 74, 110, .07);
  font-size: 1.7rem;
  margin: 0 auto 14px;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
@media (max-width: 640px) {
  .menu-card .icon { margin: 0; }   /* row layout on mobile */
}

/* ── Generic cards: hairline border for crisp minimal edges ── */
.card, .write-card, .user-card, .perm-card, .child-card, .note-card,
.filter-bar, .notif-bar, .summary-box, .student-row, .student-card {
  border: 1px solid var(--border);
}

/* ── Buttons: unified radius + weight ─────────────────────── */
.btn, .btn-primary, .btn-enable, .btn-line, .btn-notif, .btn-add,
.btn-disconnect, .btn-note-submit, .btn-note-cancel {
  border-radius: 10px;
  font-weight: 700;
}

/* ── Pills & badges: fully rounded, modern ────────────────── */
.role-badge, .status-pill, .subject-badge, .leave-chip,
.badge, .bell-badge { border-radius: 999px; }
