/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:           #f2f2f7;
  --bg-2:         #f5f5f7;
  --bg-3:         #e5e5ea;
  --surface:      #ffffff;

  --label:        #000000;
  --label-2:      #6c6c70;
  --label-3:      #aeaeb2;

  --accent:       #0d95f9;
  --accent-light: rgba(13,149,249,0.12);
  --accent-hover: #0b82dc;

  --green:        #34c759;
  --green-light:  rgba(52,199,89,0.14);
  --red:          #ff3b30;
  --red-light:    rgba(255,59,48,0.12);
  --orange:       #d97757;
  --orange-light: rgba(217,119,87,0.13);

  --border:       rgba(60,60,67,0.13);
  --border-focus: #0d95f9;

  --font:         -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   22px;
  --r-full: 100px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-panel: -2px 0 40px rgba(0,0,0,0.10);

  --nav-h: 58px;
  --panel-w: 480px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #000000;
    --bg-2:         #2c2c2e;
    --bg-3:         #3a3a3c;
    --surface:      #1c1c1e;
    --label:        #ffffff;
    --label-2:      rgba(235,235,245,0.6);
    --label-3:      rgba(235,235,245,0.3);
    --accent:       #38bdf8;
    --accent-light: rgba(56,189,248,0.18);
    --accent-hover: #7dd3fc;
    --green:        #30d158;
    --green-light:  rgba(48,209,88,0.16);
    --red:          #ff453a;
    --red-light:    rgba(255,69,58,0.15);
    --orange:       #e8865a;
    --orange-light: rgba(232,134,90,0.16);
    --border:       rgba(255,255,255,0.10);
    --border-focus: #38bdf8;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);
    --shadow-panel: -2px 0 40px rgba(0,0,0,0.5);
  }
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ─── Splash ──────────────────────────────────────────────────────────────── */
.splash { display: flex; align-items: center; justify-content: center; height: 100vh; }
.splash-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── App Shell ───────────────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; }

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(242,242,247,0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 10px;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.nav-home-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  border-radius: 10px; display: flex; align-items: center;
  transition: opacity 0.15s, transform 0.15s;
}
.nav-home-btn:hover { opacity: 0.82; transform: scale(1.06); }
.nav-home-btn:active { transform: scale(0.95); opacity: 0.65; }
.nav-brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  overflow: hidden;
}
.nav-brand-icon img { width: 100%; height: 100%; display: block; }
.nav-brand-name { font-size: 16px; font-weight: 600; color: var(--label); letter-spacing: -0.01em; }
.nav-school { font-size: 13px; color: var(--label-2); margin-left: 4px; }
.nav-school-logo {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 4px; flex-shrink: 0;
}
.nav-school-logo img { width: 100%; height: 100%; object-fit: contain; }
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.nav-user-name { font-size: 13px; font-weight: 500; }
.nav-user-role { font-size: 11px; color: var(--label-2); text-transform: capitalize; }
.settings-menu { position: relative; }
.nav-user-trigger {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  padding: 4px 6px; border-radius: var(--r-sm);
  font-family: var(--font); color: inherit;
  transition: background 0.15s;
}
.nav-user-trigger:hover { background: var(--bg-2); }
.settings-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  min-width: 200px; overflow: hidden; z-index: 200;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.dropdown-item {
  display: block; padding: 10px 16px; font-size: 14px;
  color: var(--label); cursor: pointer; transition: background 0.12s;
  border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item.danger { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Main Content ────────────────────────────────────────────────────────── */
.main {
  padding-top: calc(var(--nav-h) + 28px);
  padding-bottom: 40px;
  padding-left: 28px;
  padding-right: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Login ───────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 40px 36px; width: 100%; max-width: 360px;
  box-shadow: var(--shadow-lg); text-align: center;
  animation: scaleIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.login-logo-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  overflow: hidden;
  margin: 0 auto 18px;
}
.login-logo-icon img { width: 100%; height: 100%; display: block; }
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; color: var(--label); }
.login-subtitle { font-size: 14px; color: var(--label-2); line-height: 1.5; margin-bottom: 24px; }
.login-back { font-size: 12px; color: var(--label-3); margin-top: 14px; }
.form-error {
  padding: 10px 14px; background: var(--red-light); color: var(--red);
  border-radius: var(--r-md); font-size: 13px; margin-bottom: 16px;
}
.login-card .btn--primary { border-radius: var(--r-full); font-weight: 600; letter-spacing: -0.01em; }

/* ─── Login Entrance Animations ──────────────────────────────────────────── */
@keyframes login-icon-pop {
  0%   { opacity: 0; transform: scale(0.4) rotate(-10deg); }
  65%  { opacity: 1; transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.login-logo-icon {
  animation: login-icon-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.10s both;
}

.login-title {
  animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

.login-subtitle {
  animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.30s both;
}

.login-card form > .form-group {
  animation: fadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card form > .form-group:nth-child(2) { animation-delay: 0.36s; }
.login-card form > .form-group:nth-child(3) { animation-delay: 0.42s; }
.login-card form > .form-group:nth-child(4) { animation-delay: 0.48s; }

.login-card form > .btn {
  animation: fadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.54s both;
}

/* ─── Stats Row ───────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-count { font-size: 14px; color: var(--label-2); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 24px;
  animation: fadeSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.stats-row--sm {
  grid-template-columns: repeat(auto-fit, minmax(100px, 160px));
  margin-top: -16px; margin-bottom: 20px;
}
.stats-row--sm .stat-card { padding: 12px 16px; }
.stats-row--sm .stat-value { font-size: 22px; }
.stat-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
  will-change: transform;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card--clickable { cursor: pointer; }
.stat-card--clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card--clickable:active { transform: scale(0.97); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.orange { color: var(--orange); }

/* ─── Controls ────────────────────────────────────────────────────────────── */
.controls {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 260px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--label-3); pointer-events: none; transition: color 0.15s; }
.search-input {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1.5px solid transparent; border-radius: var(--r-md);
  font-size: 14px; color: var(--label); background: var(--bg-2);
  outline: none; transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.search-input:hover { border-color: var(--border); }
.search-input:focus {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.search-input:focus + svg,
.search-wrap:focus-within svg { color: var(--accent); }
.controls-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* ─── Table ───────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--label-2);
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.table th:hover { color: var(--label); }
.table th.active { color: var(--accent); }
.sort-icon { display: inline-block; margin-left: 4px; opacity: 0.6; font-size: 10px; }
.table td {
  padding: 12px 16px; font-size: 14px; color: var(--label);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; transition: background 0.12s; animation: fadeIn 0.2s ease both; }
.table tbody tr.clickable:nth-child(1)  { animation-delay: 0.03s; }
.table tbody tr.clickable:nth-child(2)  { animation-delay: 0.06s; }
.table tbody tr.clickable:nth-child(3)  { animation-delay: 0.09s; }
.table tbody tr.clickable:nth-child(4)  { animation-delay: 0.12s; }
.table tbody tr.clickable:nth-child(5)  { animation-delay: 0.15s; }
.table tbody tr.clickable:nth-child(6)  { animation-delay: 0.17s; }
.table tbody tr.clickable:nth-child(7)  { animation-delay: 0.19s; }
.table tbody tr.clickable:nth-child(8)  { animation-delay: 0.21s; }
.table tbody tr.clickable:nth-child(n+9) { animation-delay: 0.23s; }
.table tr.clickable:hover td { background: var(--bg-2); }

/* ─── Trash / Edit Row Buttons ────────────────────────────────────────────── */
.trash-col-th { width: 44px; padding: 0 !important; }
.trash-col    { width: 44px; padding: 6px 0 6px 12px !important; }
.edit-col-th  { width: 44px; padding: 0 !important; }
.edit-col     { width: 44px; padding: 6px 12px 6px 0 !important; }

.trash-row-btn, .edit-row-btn {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-3); opacity: 0.4;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
}
.table tr.clickable:hover .trash-row-btn,
.table tr.clickable:hover .edit-row-btn { opacity: 1; }
.trash-row-btn:hover { background: var(--red-light); color: var(--red); opacity: 1; }
.edit-row-btn:hover  { background: var(--accent-light); color: var(--accent); opacity: 1; }

/* ─── Row Delete Popover ──────────────────────────────────────────────────── */
.delete-popover {
  position: fixed;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  min-width: 210px;
  animation: scaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: top left;
}
.delete-popover.hidden { display: none; }
.delete-popover-text {
  font-size: 14px; font-weight: 600; color: var(--label); margin-bottom: 3px;
}
.delete-popover-hint {
  font-size: 12px; color: var(--label-2); margin-bottom: 12px;
}
.delete-popover-btns {
  display: flex; gap: 8px; justify-content: flex-end;
}
.player-cell { display: flex; align-items: center; gap: 10px; }
.player-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.player-name-text { font-size: 14px; font-weight: 500; }
.player-school-text { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.stars-display { color: #f4a300; letter-spacing: -1px; font-size: 13px; }
.text-muted { color: var(--label-2); font-size: 13px; }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; white-space: nowrap;
}
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600;
}
.role-badge.admin { background: var(--accent-light); color: var(--accent); }
.role-badge.standard { background: var(--bg-2); color: var(--label-2); }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  padding: 64px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-icon { font-size: 40px; opacity: 0.3; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--label); }
.empty-desc { font-size: 14px; color: var(--label-2); max-width: 320px; line-height: 1.5; }

/* ─── Side Panel ──────────────────────────────────────────────────────────── */
.panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.28);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.panel-overlay.open { opacity: 1; pointer-events: auto; }
.panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: var(--panel-w); background: var(--surface);
  box-shadow: var(--shadow-panel); overflow-y: auto;
  transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}
.panel.open { transform: translateX(0); }
.panel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.panel-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-2); flex-shrink: 0; transition: background 0.12s;
}
.panel-close:hover { background: var(--bg-3); color: var(--label); }
.panel-header-info { flex: 1; min-width: 0; }
.panel-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-meta { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.panel-body { padding: 24px; flex: 1; }
.panel-actions {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
  position: sticky; bottom: 0; background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.panel-actions .spacer { flex: 1; }

/* ─── Form Sections ───────────────────────────────────────────────────────── */
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 11px; font-weight: 600; color: var(--label-2);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ─── Status Selector ─────────────────────────────────────────────────────── */
.status-selector { margin-bottom: 24px; }
.status-selector-label { font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; }
.status-options { display: flex; flex-wrap: wrap; gap: 6px; }
.status-option {
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer;
  background: var(--bg-2); color: var(--label-2);
  transition: all 0.13s ease;
}
.status-option:hover { border-color: currentColor; }
.status-option.active { border-color: var(--s-color, var(--accent)); background: var(--s-bg, var(--accent-light)); color: var(--s-color, var(--accent)); }

/* ─── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.28);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  padding: 24px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.97); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex; align-items: center; padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; flex: 1; }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-2); transition: background 0.12s;
}
.modal-close:hover { background: var(--bg-3); color: var(--label); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ─── File Drop ───────────────────────────────────────────────────────────── */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--r-lg);
  padding: 40px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: var(--accent-light); }
.file-drop-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }
.file-drop-title { font-size: 15px; font-weight: 500; color: var(--label); margin-bottom: 4px; }
.file-drop-sub { font-size: 13px; color: var(--label-2); }

/* ─── Import Mapping Table ────────────────────────────────────────────────── */
.mapping-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 20px; }
.mapping-table th { padding: 8px 12px; background: var(--bg-2); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.05em; text-align: left; }
.mapping-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mapping-table tr:last-child td { border-bottom: none; }
.sample-text { font-size: 11px; color: var(--label-3); }

/* ─── User List ───────────────────────────────────────────────────────────── */
.user-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.user-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-2); border-radius: var(--r-md); border: 1px solid var(--border);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 14px; font-weight: 500; }
.user-email { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.user-item-actions { margin-left: auto; }

/* ─── Field List ──────────────────────────────────────────────────────────── */
.field-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.field-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-2); border-radius: var(--r-md); border: 1px solid var(--border);
}
.field-item-label { font-size: 14px; font-weight: 500; flex: 1; }
.field-item-type { font-size: 11px; color: var(--label-3); background: var(--bg-3); padding: 2px 7px; border-radius: var(--r-full); }
.field-item-meta { font-size: 12px; color: var(--label-2); }
.field-item.builtin { opacity: 0.65; }
.toggle-wrap { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--label-2); }
.toggle {
  position: relative; width: 36px; height: 22px; cursor: pointer;
  background: var(--bg-3); border-radius: var(--r-full);
  transition: background 0.2s; border: none;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle.on::after { transform: translateX(14px); }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--label); margin-bottom: 5px; }
.form-label.req::after { content: ' *'; color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: 14px; color: var(--label); background: var(--bg-2);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.14);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236e6e73'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 20px; padding-right: 34px; cursor: pointer;
}
.form-hint { font-size: 12px; color: var(--label-2); margin-top: 4px; }
.form-note { font-size: 12px; color: var(--label-2); margin-bottom: 16px; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; border: none; cursor: pointer;
  transition: all 0.14s ease; white-space: nowrap;
  text-decoration: none; user-select: none;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:not(:disabled):active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #fff; letter-spacing: -0.01em; }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(14,165,233,0.35); }
.btn--secondary { background: var(--bg-2); color: var(--label); border: 1px solid var(--border); }
.btn--secondary:hover:not(:disabled) { background: var(--bg-3); }
.btn--ghost { background: transparent; color: var(--accent); padding: 6px 10px; }
.btn--ghost:hover:not(:disabled) { background: var(--accent-light); }
.btn--danger { background: var(--red-light); color: var(--red); }
.btn--danger:hover:not(:disabled) { background: #f5c6c4; }
.btn--icon { padding: 6px; border-radius: var(--r-sm); }
.btn--sm { padding: 5px 11px; font-size: 12px; }
.btn--lg { padding: 11px 22px; font-size: 15px; border-radius: var(--r-lg); }
.btn--full { width: 100%; justify-content: center; }

/* ─── Select Filter Chips ─────────────────────────────────────────────────── */
.filter-select {
  padding: 7px 28px 7px 11px; border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-size: 13px; color: var(--label);
  background: var(--surface); outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236e6e73'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 18px;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--border-focus); }
.filter-select.active { border-color: var(--accent); color: var(--accent); background-color: var(--accent-light); }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 92px; right: 28px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; pointer-events: auto;
  box-shadow: var(--shadow-md); animation: toastIn 0.28s ease;
  max-width: 360px; min-width: 220px;
}
.toast.success { background: #1c1c1e; color: #fff; }
.toast.error { background: var(--red); color: #fff; }
.toast.info { background: var(--accent); color: #fff; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── Date Navigator ─────────────────────────────────────────────────────── */
.date-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 20px;
}
.date-nav-center {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; justify-content: center;
}
.date-nav-label { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.date-nav-arrow { color: var(--label-2); }

/* ─── Arrival Chip (table quick-toggle) ──────────────────────────────────── */
.arrival-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  border: 1.5px dashed var(--border); cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--label-2);
  transition: all 0.16s ease; box-shadow: var(--shadow-sm);
}
.arrival-chip:hover {
  border-color: var(--green); border-style: solid;
  background: var(--green-light); color: var(--green);
  transform: scale(1.04); box-shadow: 0 2px 8px rgba(36,138,61,0.18);
}
.arrival-chip.arrived {
  background: var(--green-light); color: var(--green);
  border: 1.5px solid var(--green); border-style: solid;
}
.arrival-chip.arrived:hover { opacity: 0.8; transform: scale(0.98); box-shadow: none; }

/* ─── Arrival Section (panel) ────────────────────────────────────────────── */
.arrival-section {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.arrival-label { font-size: 15px; font-weight: 500; }
.arrival-status-text { font-size: 12px; margin-top: 3px; }
.arrival-status-text.arrived { color: var(--green); }
.arrival-status-text.not-arrived { color: var(--label-3); }

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.nav-spacer { flex: 1; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.mt-lg { margin-top: 20px; }
.hidden { display: none !important; }
.text-secondary { color: var(--label-2); }
.text-sm { font-size: 13px; }
.section-divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── Player Popup ────────────────────────────────────────────────────────── */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.30);
  z-index: 400; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 24px;
}
.popup-overlay.open { opacity: 1; pointer-events: auto; }
.player-popup {
  background: var(--surface); border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.20), 0 0 0 1px rgba(0,0,0,0.06);
  width: 100%; max-width: 360px;
  transform: scale(0.93) translateY(10px);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  opacity: 0; overflow: hidden;
}
.popup-overlay.open .player-popup { transform: scale(1) translateY(0); opacity: 1; }
.popup-header {
  padding: 18px 18px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.popup-close {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-2); transition: background 0.12s; margin-left: auto;
}
.popup-close:hover { background: var(--bg-3); color: var(--label); }
.popup-player-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; user-select: none;
}
.popup-player-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-player-school { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.popup-body { padding: 14px 18px 18px; }
.popup-grade { margin-bottom: 12px; }
.popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 4px; }
.popup-item-label {
  font-size: 10px; font-weight: 600; color: var(--label-3);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px;
}
.popup-item-value { font-size: 14px; font-weight: 500; color: var(--label); }
.popup-item-value.muted { color: var(--label-3); font-weight: 400; }
.popup-arrived-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600;
}
.popup-arrived-badge.arrived { background: var(--green-light); color: var(--green); }
.popup-arrived-badge.not-arrived { background: var(--bg-2); color: var(--label-3); }
.popup-notes {
  background: var(--bg-2); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 13px; color: var(--label-2); line-height: 1.5;
  margin-top: 12px;
}
.stat-list { display: flex; flex-direction: column; gap: 2px; }
.stat-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background 0.12s;
  margin: 0 -10px;
}
.stat-list-item:hover { background: var(--bg-2); }
.stat-list-name { font-size: 14px; font-weight: 500; }
.stat-list-meta { font-size: 12px; color: var(--label-2); margin-top: 1px; }

/* ─── Chat FAB ────────────────────────────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px 0 16px; height: 46px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(14,165,233,0.30), 0 0 0 1px rgba(14,165,233,0.15);
  transition: background 0.15s, box-shadow 0.15s, transform 0.2s, opacity 0.2s;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chat-fab:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(14,165,233,0.40), 0 0 0 1px rgba(14,165,233,0.20);
  transform: translateY(-2px);
}
.chat-fab:active { transform: translateY(0); }
.chat-fab.active { opacity: 0; pointer-events: none; transform: translateY(6px) scale(0.9); }
.chat-fab-label { line-height: 1; }

.chat-fab-badge {
  min-width: 18px; height: 18px; border-radius: var(--r-full);
  background: #ff3b30; color: #fff;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; margin-left: 2px; pointer-events: none;
}

.chat-overlay { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.chat-panel {
  position: absolute; right: 0; top: var(--nav-h); bottom: 0;
  width: 340px; background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-panel);
  pointer-events: all;
}
.chat-overlay.open .chat-panel { transform: translateX(0); }

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-title { font-size: 15px; font-weight: 600; }
.chat-header-sub { font-size: 12px; color: var(--label-2); margin-top: 1px; }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.chat-empty {
  text-align: center; color: var(--label-2);
  font-size: 13px; margin: auto 0; padding: 40px 0;
}

.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.own { flex-direction: row-reverse; }

.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px; user-select: none;
}

.chat-msg-body { max-width: 80%; display: flex; flex-direction: column; gap: 3px; }
.chat-msg.own .chat-msg-body { align-items: flex-end; }

.chat-msg-meta { display: flex; align-items: baseline; gap: 6px; }
.chat-msg-name { font-size: 11px; font-weight: 600; color: var(--label); }
.chat-msg-time { font-size: 10px; color: var(--label-3); }

.chat-msg-bubble {
  background: var(--bg-2); padding: 8px 12px;
  border-radius: 14px 14px 14px 4px;
  font-size: 13px; line-height: 1.45;
  word-break: break-word; color: var(--label);
}
.chat-msg.own .chat-msg-bubble {
  background: var(--accent); color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.chat-compose {
  padding: 12px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.chat-input {
  flex: 1; height: 36px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-full);
  font-size: 13px; color: var(--label); background: var(--bg-2);
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.chat-input:focus { border-color: var(--border-focus); background: var(--surface); }

.chat-send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s, transform 0.1s;
}
.chat-send-btn:hover { background: var(--accent-hover); }
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn:disabled { opacity: 0.5; cursor: default; }

/* ─── Chat Body / Slide Animations ───────────────────────────────────────── */
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

@keyframes chat-slide-left {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes chat-slide-right {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0); }
}

.chat-slide-left  { animation: chat-slide-left  0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }
.chat-slide-right { animation: chat-slide-right 0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ─── Chat Tabs ───────────────────────────────────────────────────────────── */
.chat-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 14px; gap: 4px; flex-shrink: 0;
}
.chat-tab {
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: var(--label-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 0.15s, border-color 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.chat-tab:hover { color: var(--label); }
.chat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.chat-tab-badge {
  min-width: 16px; height: 16px; border-radius: var(--r-full);
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ─── Chat Back Button ────────────────────────────────────────────────────── */
.chat-back-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-2); flex-shrink: 0; transition: background 0.12s;
}
.chat-back-btn:hover { background: var(--bg-3); color: var(--label); }

/* ─── DM User List ────────────────────────────────────────────────────────── */
.dm-user-list { overflow-y: auto; flex: 1; }
.dm-user-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: background 0.12s; border-bottom: 1px solid var(--border);
}
.dm-user-item:hover { background: var(--bg-2); }
.dm-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.dm-user-info { flex: 1; min-width: 0; }
.dm-user-name { font-size: 14px; font-weight: 500; }
.dm-user-role { font-size: 11px; color: var(--label-2); text-transform: capitalize; margin-top: 1px; }
.dm-unread-badge {
  min-width: 20px; height: 20px; border-radius: var(--r-full);
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; flex-shrink: 0;
}

/* ─── Mention Dropdown ────────────────────────────────────────────────────── */
.chat-compose-wrap { position: relative; flex-shrink: 0; }
.mention-dropdown {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md) var(--r-md) 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
}
.mention-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer; transition: background 0.12s;
}
.mention-item:hover { background: var(--accent-light); }
.mention-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mention-name { font-size: 13px; font-weight: 500; }
.mention-role { font-size: 11px; color: var(--label-2); text-transform: capitalize; }

/* ─── @mention inline highlight ──────────────────────────────────────────── */
.mention {
  color: var(--accent); font-weight: 600; background: var(--accent-light);
  padding: 0 3px; border-radius: 4px;
}
.chat-msg.own .mention { color: #cce8ff; background: rgba(255,255,255,0.18); }

/* ─── 5 Min Meeting Popup ─────────────────────────────────────────────────── */
.five-min-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.five-min-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  cursor: grab;
  transition: background 0.12s, opacity 0.15s;
  user-select: none;
  margin: 0 -10px;
}

.five-min-item:hover { background: var(--bg-2); }

.five-min-item.drag-over {
  background: var(--accent-light);
  outline: 1.5px solid var(--accent);
  border-radius: var(--r-md);
}

.five-min-item.dragging { opacity: 0.35; cursor: grabbing; }

.five-min-order {
  font-size: 11px;
  font-weight: 700;
  color: var(--label-3);
  width: 16px;
  text-align: right;
  flex-shrink: 0;
}

.five-min-drag-handle {
  color: var(--label-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 2px 3px;
  transition: color 0.12s;
}

.five-min-item:hover .five-min-drag-handle { color: var(--label-2); }
.five-min-item.drag-over .five-min-drag-handle { color: var(--accent); }

/* ─── Glow Effects ────────────────────────────────────────────────────────── */

.login-logo-icon {
  box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
}

.stat-card--clickable:hover { box-shadow: var(--shadow-md); }
.stat-card--clickable.stat-card--green:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(52,199,89,0.20), 0 0 24px rgba(52,199,89,0.22);
}
.stat-card--clickable.stat-card--orange:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(217,119,87,0.22), 0 0 24px rgba(217,119,87,0.22);
}
.stat-card--clickable.stat-card--default:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0,0,0,0.10), 0 0 24px rgba(0,0,0,0.10);
}

.btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(14,165,233,0.40);
}

.arrival-chip.arrived {
  box-shadow: 0 0 10px rgba(52,199,89,0.30);
}

.chat-tab.active {
  text-shadow: 0 0 8px rgba(14,165,233,0.45);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main { padding-left: 16px; padding-right: 16px; }
  .nav { padding: 0 16px; }
  .panel { width: 100%; }
  .chat-panel { width: 100%; }
  .chat-fab { bottom: 18px; right: 18px; height: 44px; padding: 0 16px 0 14px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .controls { gap: 8px; }
  .search-wrap { max-width: 100%; }
}

/* ─── Dark Mode Overrides ─────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .nav { background: rgba(28,28,30,0.85); }

  .form-input:focus, .form-select:focus, .form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(56,189,248,0.25);
  }

  .player-popup {
    box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08);
  }

  .chat-panel {
    background: rgba(28,28,30,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .toast.success { background: #ffffff; color: #000000; }

  .chat-fab { box-shadow: 0 4px 18px rgba(56,189,248,0.40), 0 0 0 1px rgba(56,189,248,0.22); }
  .chat-fab:hover { box-shadow: 0 6px 26px rgba(56,189,248,0.55), 0 0 0 1px rgba(56,189,248,0.30); }

  .nav-brand-icon {
    box-shadow: 0 0 22px rgba(56,189,248,0.65);
  }

  .login-logo-icon {
    box-shadow: 0 4px 36px rgba(56,189,248,0.65);
  }

  .stat-card--clickable:hover { box-shadow: var(--shadow-md); }
  .stat-card--clickable.stat-card--green:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(48,209,88,0.25), 0 0 30px rgba(48,209,88,0.28);
  }
  .stat-card--clickable.stat-card--orange:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(232,134,90,0.26), 0 0 30px rgba(232,134,90,0.28);
  }
  .stat-card--clickable.stat-card--default:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,255,255,0.14), 0 0 30px rgba(255,255,255,0.10);
  }

  .btn--primary:hover:not(:disabled) {
    box-shadow: 0 6px 28px rgba(56,189,248,0.55), 0 0 40px rgba(56,189,248,0.18);
  }

  .arrival-chip.arrived { box-shadow: 0 0 16px rgba(48,209,88,0.45); }

  .chat-tab.active { text-shadow: 0 0 12px rgba(56,189,248,0.65); }
}

/* ─── Itinerary Banner ────────────────────────────────────────────────────── */
.itinerary-banner {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 8px;
}
.itinerary-current {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--r-full);
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 13px; color: var(--label-2);
  box-shadow: var(--shadow-sm);
  max-width: 420px; min-width: 200px; justify-content: center;
}
.itinerary-current.has-itinerary {
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  color: var(--label);
}
.itinerary-current.has-itinerary:hover {
  background: var(--bg-2); border-color: var(--accent);
}
.itinerary-icon { color: var(--accent); flex-shrink: 0; }
.itinerary-event-label { font-weight: 600; font-size: 13px; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itinerary-event-time { font-size: 12px; color: var(--label-2); white-space: nowrap; flex-shrink: 0; }
.itinerary-no-event { font-size: 13px; color: var(--label-3); }
.itinerary-chevron { color: var(--label-3); flex-shrink: 0; }

/* ─── Itinerary Modal — Wide ──────────────────────────────────────────────── */
.modal--wide { max-width: 760px !important; }

/* ─── Itinerary Modal — Edit ──────────────────────────────────────────────── */
.itinerary-modal-columns {
  display: flex; gap: 0; min-height: 300px;
}
.itinerary-modal-left { flex: 1; padding-right: 24px; min-width: 0; }
.itinerary-modal-divider {
  width: 1px; background: var(--border); margin: 0 4px; flex-shrink: 0;
}
.itinerary-modal-right { flex: 1; padding-left: 24px; min-width: 0; }
.itinerary-event-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px;
  max-height: 340px; overflow-y: auto; padding-right: 2px;
}
.itinerary-event-row {
  display: flex; align-items: center; gap: 6px;
}
.itinerary-empty-hint {
  font-size: 13px; color: var(--label-3); padding: 20px 0;
  text-align: center;
}
.itinerary-pdf-drop { cursor: pointer; }
.itinerary-pdf-info {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg-2); border-radius: var(--r-md);
  font-size: 12px; color: var(--label-2);
}

/* ─── Itinerary Modal — View ──────────────────────────────────────────────── */
.itinerary-view-list {
  display: flex; flex-direction: column; gap: 8px;
}
.itinerary-view-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--r-lg);
  background: var(--bg-2); border: 1.5px solid var(--border);
}
.itinerary-view-card.current {
  background: var(--accent-light); border-color: var(--accent);
}
.itinerary-view-card.past { opacity: 0.45; }
.itinerary-view-time {
  font-size: 13px; font-weight: 600; color: var(--label-2);
  min-width: 72px; flex-shrink: 0;
}
.itinerary-view-card.current .itinerary-view-time { color: var(--accent); }
.itinerary-view-name {
  font-size: 15px; font-weight: 500; color: var(--label); flex: 1;
}
.itinerary-now-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 9px; border-radius: var(--r-full);
  background: var(--accent); color: #fff; flex-shrink: 0;
}
.itinerary-view-tabs {
  display: flex; gap: 2px; background: var(--bg-2);
  border-radius: var(--r-md); padding: 3px; margin-left: auto; margin-right: 8px;
}
.itinerary-view-tab {
  padding: 4px 13px; border-radius: calc(var(--r-md) - 2px);
  font-size: 12px; font-weight: 500; border: none; cursor: pointer;
  background: transparent; color: var(--label-2);
  transition: background 0.14s, color 0.14s;
}
.itinerary-view-tab.active {
  background: var(--surface); color: var(--label);
  box-shadow: var(--shadow-sm);
}
.itinerary-slider-track {
  position: relative;
  overflow: hidden;
  height: 62vh;
}
.itinerary-view-panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#itinerary-view-events { transform: translateX(0); }
#itinerary-view-pdf    { transform: translateX(100%); }
.itinerary-slider-track.show-pdf #itinerary-view-events { transform: translateX(-100%); }
.itinerary-slider-track.show-pdf #itinerary-view-pdf    { transform: translateX(0); }
.itinerary-pdf-iframe {
  width: 100%; height: 58vh; border: none; border-radius: var(--r-md);
  display: block;
}
