/* ============================================================
   MEETING HELPER — USAFA Panel Scheduler
   Design System: Dark, modern, USAFA Navy + AF Gold
   ============================================================ */

/* --- TOKENS --- */
:root {
  --color-primary: #003087;
  --color-primary-light: #0047C0;
  --color-primary-glow: rgba(0, 48, 135, 0.4);
  --color-accent: #8B9DC3;
  --color-gold: #C5A028;
  --color-gold-dim: rgba(197, 160, 40, 0.15);
  --color-bg: #0B0F1A;
  --color-surface: #111827;
  --color-surface-2: #1A2235;
  --color-surface-3: #222D42;
  --color-border: rgba(139, 157, 195, 0.12);
  --color-border-strong: rgba(139, 157, 195, 0.25);
  --color-text: #E8EDF5;
  --color-text-muted: #7A8BA6;
  --color-text-dim: #4A5568;
  --color-green: #22C55E;
  --color-green-bg: rgba(34, 197, 94, 0.12);
  --color-green-glow: rgba(34, 197, 94, 0.25);
  --color-yellow: #EAB308;
  --color-yellow-bg: rgba(234, 179, 8, 0.12);
  --color-yellow-glow: rgba(234, 179, 8, 0.25);
  --color-red: #EF4444;
  --color-red-bg: rgba(239, 68, 68, 0.12);
  --color-red-glow: rgba(239, 68, 68, 0.25);
  --color-purple: #7B5EA7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-glow: 0 0 0 1px var(--color-border), var(--shadow-card);
  --transition: 0.18s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,48,135,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(197,160,40,0.06) 0%, transparent 50%);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, textarea, select { font-family: var(--font); }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface); }
::-webkit-scrollbar-thumb { background: var(--color-surface-3); border-radius: 3px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 68px;
  min-height: 68px;   /* prevent child elements from expanding the bar */
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;  /* never push children onto a second row */
  flex-shrink: 0;
}

/* Export dropdown */
.export-menu-wrap {
  position: relative;
}
.export-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 300;
  overflow: hidden;
  animation: dropIn 0.15s ease;
}
.export-dropdown.open { display: block; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.export-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition);
}
.export-item:last-child { border-bottom: none; }
.export-item:hover { background: var(--color-surface-2); }
.export-item svg { flex-shrink: 0; color: var(--color-text-muted); }
.export-item-title { font-size: 13px; font-weight: 600; }
.export-item-sub   { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-logo {
  height: 44px;
  width: auto;
  filter: brightness(1) drop-shadow(0 0 8px rgba(0,80,200,0.3));
}
.nav-title-group { display: flex; flex-direction: column; }
.nav-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.nav-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: #fff;
  box-shadow: 0 2px 12px var(--color-primary-glow), 0 1px 0 rgba(255,255,255,0.1) inset;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #005AE8, #0047C0);
  box-shadow: 0 4px 20px rgba(0,71,192,0.5), 0 1px 0 rgba(255,255,255,0.15) inset;
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
.btn-ghost:hover {
  background: var(--color-surface-3);
  border-color: var(--color-accent);
  color: var(--color-text);
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-gold {
  background: linear-gradient(135deg, #D4A820, #B8901A);
  color: #0B0F1A;
  box-shadow: 0 2px 12px rgba(197,160,40,0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #E0B830, #C5A028);
  transform: translateY(-1px);
}
.btn-danger {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: all var(--transition);
  background: transparent;
  border: 1px solid transparent;
}
.icon-btn:hover {
  background: var(--color-surface-3);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 36px;
}
.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.header-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}
.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 0;
  gap: 2px;
  width: 110px;   /* fixed width — all chips identical regardless of label */
}
.stat-num { font-size: 22px; font-weight: 800; color: var(--color-text); line-height: 1; }
.stat-lbl { font-size: 11px; font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   EVENT CARDS
   ============================================================ */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.event-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}
.event-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,157,195,0.15);
  transform: translateY(-2px);
}
.event-card--scheduled { opacity: 0.75; }
.event-card--scheduled:hover { opacity: 1; }
.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.event-actions { display: flex; gap: 4px; flex-shrink: 0; }
.event-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 6px;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.event-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-open {
  background: rgba(34,197,94,0.12);
  color: var(--color-green);
  border: 1px solid rgba(34,197,94,0.25);
}
.status-scheduled {
  background: rgba(0,71,192,0.15);
  color: #60A5FA;
  border: 1px solid rgba(0,71,192,0.3);
}
.status-closed {
  background: rgba(122,139,166,0.12);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Progress */
.event-progress { display: flex; flex-direction: column; gap: 6px; }
.progress-row { display: flex; justify-content: space-between; align-items: center; }
.progress-label { font-size: 12px; color: var(--color-text-muted); font-weight: 500; }
.progress-value { font-size: 12px; color: var(--color-text); font-weight: 600; }
.progress-bar-track {
  height: 4px;
  background: var(--color-surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Panel list */
.panel-list { display: flex; flex-direction: column; gap: 8px; }
.panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
.panel-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.panel-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--color-text); }
.panel-count { font-size: 12px; color: var(--color-text-muted); }
.panel-resp { font-size: 12px; font-weight: 700; margin-left: auto; }
.resp-ok { color: var(--color-green); }
.resp-warn { color: var(--color-yellow); }
.resp-low { color: var(--color-red); }

/* Scheduled slots */
.scheduled-slots { display: flex; flex-direction: column; gap: 8px; }
.scheduled-slot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 13px;
}
.slot-assigned {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #60A5FA;
  background: rgba(0,71,192,0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Event footer */
.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.slot-info { font-size: 12px; color: var(--color-text-dim); white-space: nowrap; flex-shrink: 0; }
.footer-btns { display: flex; gap: 8px; flex-shrink: 0; }

/* Loading state */
.events-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--color-text-muted);
  font-size: 14px;
}
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-primary-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  animation: slideUp 0.2s ease;
  overflow: hidden;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--color-border);
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-footer {
  padding: 18px 24px;
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.form-input {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.form-input::placeholder { color: var(--color-text-dim); }
.form-input option { background: var(--color-surface-2); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--color-text-muted); font-style: italic; }
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.radio-option:hover { color: var(--color-text); }
.radio-option input[type="radio"] { accent-color: var(--color-primary-light); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPOND PAGE — Member Availability Portal
   ============================================================ */
.respond-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.respond-hero {
  text-align: center;
  margin-bottom: 40px;
  padding: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.respond-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,48,135,0.3) 0%, transparent 70%);
  pointer-events: none;
}
.respond-hero-logo { height: 60px; margin-bottom: 16px; }
.respond-event-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.respond-event-sub { font-size: 14px; color: var(--color-text-muted); }

/* Name picker */
.name-picker-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.name-picker-card h2 { font-size: 16px; font-weight: 700; }
.name-picker-inner {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.name-select-wrap { flex: 1; }
.name-confirm-btn { flex-shrink: 0; }
.member-greeting {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.member-greeting.visible { display: flex; }
.member-greeting-icon { font-size: 20px; }

/* Legend */
.legend-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.legend-dot--green { background: var(--color-green); }
.legend-dot--yellow { background: var(--color-yellow); }
.legend-dot--red { background: var(--color-red); }
.legend-dot--skip { background: var(--color-surface-3); border: 1px dashed var(--color-border-strong); }
.legend-tip { margin-left: auto; font-size: 12px; color: var(--color-text-dim); font-style: italic; }

/* Day column layout */
.days-layout { display: flex; flex-direction: column; gap: 24px; }
.day-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.day-header {
  padding: 14px 20px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.day-label { font-size: 15px; font-weight: 700; }
.day-period { font-size: 12px; color: var(--color-text-muted); background: var(--color-surface-3); padding: 2px 10px; border-radius: 20px; }
.slot-rows { display: flex; flex-direction: column; }
.slot-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.slot-row:last-child { border-bottom: none; }
.slot-row:hover { background: var(--color-surface-2); }
.slot-row.skip-slot { opacity: 0.4; pointer-events: none; }
.slot-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.slot-name { font-size: 12px; color: var(--color-accent); font-weight: 500; }
.slot-note-input {
  font-size: 12px;
  max-width: 180px;
}
.slot-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  min-width: 108px;
  letter-spacing: 0.02em;
}
.slot-toggle--green {
  background: var(--color-green-bg);
  color: var(--color-green);
  border-color: rgba(34,197,94,0.3);
  box-shadow: 0 0 10px rgba(34,197,94,0.1);
}
.slot-toggle--green:hover { box-shadow: 0 0 16px rgba(34,197,94,0.25); background: rgba(34,197,94,0.18); }
.slot-toggle--yellow {
  background: var(--color-yellow-bg);
  color: var(--color-yellow);
  border-color: rgba(234,179,8,0.3);
  box-shadow: 0 0 10px rgba(234,179,8,0.1);
}
.slot-toggle--yellow:hover { box-shadow: 0 0 16px rgba(234,179,8,0.25); background: rgba(234,179,8,0.18); }
.slot-toggle--red {
  background: var(--color-red-bg);
  color: var(--color-red);
  border-color: rgba(239,68,68,0.3);
  box-shadow: 0 0 10px rgba(239,68,68,0.1);
}
.slot-toggle--red:hover { box-shadow: 0 0 16px rgba(239,68,68,0.25); background: rgba(239,68,68,0.18); }

.skip-label {
  font-size: 11px;
  color: var(--color-text-dim);
  font-style: italic;
  text-align: right;
  min-width: 108px;
}

/* Submit area */
.submit-section {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.submit-status { font-size: 13px; color: var(--color-text-muted); }
.submit-btn { padding: 13px 32px; font-size: 15px; }

/* ============================================================
   SCHEDULE VIEW — Member Published Schedule Card
   ============================================================ */
.schedule-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  max-width: 540px;
  margin: 40px auto;
  text-align: center;
  box-shadow: 0 8px 48px rgba(0,0,0,0.35);
}
.schedule-confirmed-icon { font-size: 56px; line-height: 1; margin-bottom: 18px; }
.schedule-title { font-size: 24px; font-weight: 800; color: var(--color-text); margin: 0 0 6px; }
.schedule-event-name { font-size: 14px; color: var(--color-text-muted); margin: 0 0 28px; }
.schedule-slot-block {
  background: rgba(79,140,255,0.06);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 24px;
}
.schedule-slot-panel { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.schedule-slot-date { font-size: 14px; color: var(--color-text-muted); margin-bottom: 10px; }
.schedule-slot-time { font-size: 40px; font-weight: 900; color: var(--color-text); letter-spacing: 0.02em; line-height: 1; margin-bottom: 6px; }
.schedule-slot-name { font-size: 13px; color: var(--color-text-dim); font-weight: 600; }
.schedule-slot-location { font-size: 13px; color: var(--color-text-muted); margin-top: 8px; }
.schedule-members { margin-bottom: 28px; }
.schedule-members-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-text-muted); margin-bottom: 12px; }
.schedule-member-chip {
  display: inline-block;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 13px;
  margin: 4px;
  color: var(--color-text);
}
.schedule-ics-btn { width: 100%; justify-content: center; gap: 10px; padding: 15px; font-size: 15px; }
.schedule-pending h2 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.schedule-pending p  { color: var(--color-text-muted); font-size: 14px; margin: 0; }

/* ============================================================
   RESULTS PAGE — Coordinator Results View
   ============================================================ */
.results-container {
  max-width: min(95vw, 1800px);
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--color-text); }
.results-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.results-meta { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

/* Tabs */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 28px;
  width: fit-content;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  background: none;
  border: none;
}
.tab-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.tab-btn:hover:not(.active) { color: var(--color-text); background: rgba(255,255,255,0.04); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Panel result cards */
.panel-results-grid { display: flex; flex-direction: column; gap: 20px; }
.panel-result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.panel-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.panel-result-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.panel-member-count { font-size: 12px; color: var(--color-text-muted); font-weight: 400; }
.reco-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.reco-badge--best { background: var(--color-green-bg); color: var(--color-green); border: 1px solid rgba(34,197,94,0.25); }
.reco-badge--good { background: var(--color-yellow-bg); color: var(--color-yellow); border: 1px solid rgba(234,179,8,0.25); }

/* Heatmap grid */
.heatmap-scroll { overflow-x: auto; padding: 18px 22px; }
.heatmap-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  min-width: 1200px;   /* member-col(130) + 18 slots×88px + 1 separator(12) = 1726px; scroll handles the rest */
}
.heatmap-table th {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 6px 4px;
  vertical-align: bottom;  /* all headers share the same baseline regardless of line count */
  white-space: normal;
  word-break: keep-all;    /* only break at spaces, not mid-word */
  width: 50px;
}
.heatmap-table .member-col { text-align: left; padding-right: 8px; width: 130px; min-width: 130px; }
.heatmap-table td { padding: 2px 1px; text-align: center; width: 50px; }
.heatmap-cell {
  width: 28px;
  height: 26px;
  border-radius: 4px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  cursor: default;
  transition: transform 0.1s;
  position: relative;
}
.heatmap-cell:hover { transform: scale(1.25); z-index: 10; }
.heatmap-cell--green { background: var(--color-green-bg); color: var(--color-green); border: 1px solid rgba(34,197,94,0.3); }
.heatmap-cell--yellow { background: var(--color-yellow-bg); color: var(--color-yellow); border: 1px solid rgba(234,179,8,0.3); }
.heatmap-cell--red { background: var(--color-red-bg); color: var(--color-red); border: 1px solid rgba(239,68,68,0.3); }
.heatmap-cell--skip { background: var(--color-surface-3); color: var(--color-text-dim); font-size: 9px; }
.heatmap-cell--empty { background: var(--color-surface-3); opacity: 0.4; }
.member-name-cell { font-size: 12px; font-weight: 600; color: var(--color-text); white-space: nowrap; }
.note-indicator { font-size: 9px; }

/* Score row */
.score-row td { padding-top: 8px; }
.score-bar-cell { padding: 3px 2px; }
.score-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}
.score-pill--best { background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(34,197,94,0.15)); color: var(--color-green); border: 1px solid rgba(34,197,94,0.4); }
.score-pill--good { background: rgba(234,179,8,0.15); color: var(--color-yellow); border: 1px solid rgba(234,179,8,0.3); }
.score-pill--ok { background: rgba(139,157,195,0.08); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.score-pill--blocked { background: var(--color-red-bg); color: var(--color-red); border: 1px solid rgba(239,68,68,0.3); }
.score-label-row th { padding-top: 4px; font-size: 9px; }

/* Assign panel */
.assign-panel {
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.assign-label { font-size: 13px; color: var(--color-text-muted); }
.assign-select { max-width: 200px; }
.assign-location { max-width: 180px; flex-shrink: 0; }
.assign-confirm { flex-shrink: 0; }
.assign-status {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: rgba(34,197,94,0.1);
  color: var(--color-green);
  border: 1px solid rgba(34,197,94,0.2);
  display: none;
}

/* Aggregate view (heatmap across all panels) */
.agg-section { margin-bottom: 28px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .main-container { padding: 24px 16px 60px; }
  .events-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 16px; }
  .results-container { padding: 24px 12px 60px; }
  .slot-row { grid-template-columns: 110px 1fr; }
  .slot-note-input { display: none; }
  .name-picker-inner { flex-direction: column; }
  .name-confirm-btn { width: 100%; justify-content: center; }
}


/* ============================================================
   SETUP PAGE
   ============================================================ */
.setup-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.setup-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.setup-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.setup-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}
.section-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.setup-section-body { padding: 22px; }
.setup-empty-hint {
  text-align: center;
  color: var(--color-text-dim);
  font-size: 13px;
  padding: 20px;
  font-style: italic;
}
.slot-empty-hint { padding: 12px; text-align: left; }
.day-edit-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.day-edit-section:last-child { margin-bottom: 0; }
.day-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.day-edit-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.day-edit-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-label-input {
  font-size: 12px;
  padding: 5px 10px;
  color: var(--color-text-muted);
  max-width: 300px;
}
.day-edit-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.slot-edit-list { padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.slot-edit-row {
  display: grid;
  grid-template-columns: 1fr 110px auto 110px auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.slot-time-sep {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
}
.slot-edit-name, .slot-edit-time { font-size: 13px; padding: 6px 10px; }
.panel-edit-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.panel-edit-section:last-child { margin-bottom: 0; }
.panel-edit-header {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.panel-color-strip { width: 6px; align-self: stretch; flex-shrink: 0; transition: background 0.2s; }
.panel-edit-meta { flex: 1; display: flex; gap: 10px; padding: 12px 14px; flex-wrap: wrap; align-items: center; }
.panel-name-input { flex: 1; min-width: 180px; }
.panel-abbr-input { width: 80px; }
.color-swatches {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch--active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 0 0 4px rgba(0,0,0,0.3);
  transform: scale(1.15);
}
.member-edit-area { padding: 14px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; min-height: 32px; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  background: var(--color-surface-3);
  border: 1px solid var(--color-border-strong);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}
.member-chip button { font-size: 16px; line-height: 1; color: var(--color-text-muted); padding: 0 2px; }
.member-chip button:hover { color: var(--color-red); }
.member-add-row { display: flex; gap: 10px; align-items: center; }
.member-add-input { flex: 1; }
.setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  gap: 16px;
  flex-wrap: wrap;
}
.save-status { font-size: 13px; color: var(--color-text-muted); font-style: italic; }

/* ============================================================
   ARCHIVE / DELETE STYLES
   ============================================================ */

/* Archived card */
.event-card--archived {
  opacity: 0.72;
  filter: grayscale(0.3);
  border-color: var(--color-border);
}
.event-card--archived:hover { opacity: 0.88; }
.status-closed {
  background: rgba(100,116,139,0.15);
  color: var(--color-text-muted);
  border: 1px solid rgba(100,116,139,0.25);
}

/* Danger icon btn */
.icon-btn--danger { color: var(--color-red); }
.icon-btn--danger:hover { background: rgba(220,53,69,0.12); color: var(--color-red); }

/* First-click warning state on delete btn */
.icon-btn--warn {
  background: rgba(220,53,69,0.15);
  color: var(--color-red);
  border-radius: var(--radius-sm);
  animation: pulse-warn 0.4s ease;
}
@keyframes pulse-warn {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Delete modal styling */
.modal--danger .modal-header { border-bottom-color: rgba(220,53,69,0.2); }
.delete-warning-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(220,53,69,0.06);
  border: 1px solid rgba(220,53,69,0.2);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-text-muted);
}
.delete-event-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text) !important;
  padding: 6px 0;
}
.delete-warning-final {
  color: var(--color-red) !important;
  font-size: 13px;
}
.btn-danger {
  background: var(--color-red);
  color: #fff;
  border: none;
}
.btn-danger:not(:disabled):hover { background: #b91c1c; }
.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#delete-countdown {
  font-size: 12px;
  opacity: 0.75;
  margin-left: 4px;
}

/* Archived section */
.archived-toggle-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
}
.archived-section-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  margin-bottom: 16px;
}
#archived-section { padding-bottom: 60px; }
#archived-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ============================================================
   EMAIL GATE
   ============================================================ */
.email-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: gate-in 0.4s ease;
}
@keyframes gate-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
.gate-fade-out {
  animation: gate-out 0.35s ease forwards !important;
}
@keyframes gate-out {
  to { opacity: 0; transform: scale(0.97); }
}

.gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.gate-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.gate-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}
.gate-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 28px;
}
.gate-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}
.gate-form-group { margin-bottom: 16px; }
.gate-input {
  text-align: center;
  font-size: 15px;
  padding: 12px 16px;
}
.gate-error {
  color: var(--color-red);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.4;
}
.gate-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; }
.gate-note {
  font-size: 11px;
  color: var(--color-text-dim, var(--color-text-muted));
  margin: 16px 0 0;
  opacity: 0.65;
}

/* Nav coordinator info — plain text, no pill */
.nav-coord-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}
.nav-coord-email {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.nav-coord-info .btn-switch {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.75;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.nav-coord-info .btn-switch:hover { opacity: 1; }
.nav-coord-sep {
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.4;
  flex-shrink: 0;
}

/* Unclaimed event card */
.event-card--unclaimed {
  border-color: rgba(245,158,11,0.25);
}
.status-unclaimed {
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.25);
}

/* ============================================================
   MEMBER NAME AUTOCOMPLETE + PICKER
   ============================================================ */

/* Wrap input so dropdown is positioned relative to it */
.member-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
}
.autocomplete-item {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.1s;
  outline: none;
}
.autocomplete-item:hover,
.autocomplete-item:focus {
  background: var(--color-surface-2);
}

/* Name picker popover */
.name-picker-popover {
  position: absolute;
  z-index: 400;
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
}
.name-picker-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.name-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
}
.name-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 500;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.name-chip:hover:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.name-chip--added,
.name-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
