/* WWAF 2026 schedule — mobile-first responsive styles */
:root {
  --navy: #2a3b4d;
  --navy-dark: #1f2c3a;
  --accent: #b5552e;
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #23282d;
  --muted: #6b7280;
  --line: #e2ddd4;
  --music: #3f6f8f;
  --literary: #7a5a8c;
  --operations: #9a7b3f;
  --ok: #2f7d4f;
  --danger: #b23b3b;
  --radius: 12px;
  --maxw: 760px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- Login ---------- */
.login {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy), var(--navy-dark));
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.login-card h1 { font-size: 1.35rem; color: var(--navy); line-height: 1.2; }
.login-sub { color: var(--accent); font-weight: 600; margin-bottom: 20px; }
.login-card label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}
.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
}
.login-card button:disabled { opacity: 0.6; }
.login-hint { font-size: 0.8rem; color: var(--muted); margin-top: 16px; }
.error { color: var(--danger); font-size: 0.85rem; margin-top: 10px; }

/* ---------- App shell ---------- */
.app { max-width: var(--maxw); margin: 0 auto; min-height: 100%; padding-bottom: 90px; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.app-title { display: flex; align-items: center; gap: 10px; }
.app-title strong { font-size: 1.05rem; letter-spacing: 0.3px; }
.role-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: 999px;
}
.role-badge.editor { background: var(--accent); }
.icon-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
}
.menu {
  position: absolute;
  right: 12px;
  top: 56px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  min-width: 200px;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  padding: 13px 16px;
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.menu button:last-child { border-bottom: 0; color: var(--danger); }

/* ---------- Tabs ---------- */
.tabs {
  position: sticky;
  top: 62px;
  z-index: 15;
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1;
  background: none;
  border: 0;
  padding: 13px 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--navy); font-weight: 700; border-bottom-color: var(--accent); }

/* ---------- Content / filters ---------- */
.content { padding: 14px 12px 0; }
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.search-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.filter-row { display: flex; gap: 8px; }
.filter-row select {
  flex: 1;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.result-count { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }

/* ---------- Day groups ---------- */
.day-group { margin-bottom: 16px; }
.day-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navy);
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.98rem;
  font-weight: 600;
}
.day-header .count { font-size: 0.78rem; opacity: 0.8; font-weight: 400; }
.day-body { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Cards ---------- */
.card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.card.cat-music { border-left-color: var(--music); }
.card.cat-literary { border-left-color: var(--literary); }
.card.cat-operations { border-left-color: var(--operations); }
.card-time { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.card-title { font-size: 1rem; font-weight: 600; margin: 2px 0 4px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.card-venue { font-size: 0.85rem; color: var(--navy); font-weight: 500; }
.card-sub { font-size: 0.83rem; color: var(--muted); margin-top: 4px; }
.badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
}
.badge.cat-music { background: var(--music); }
.badge.cat-literary { background: var(--literary); }
.badge.cat-operations { background: var(--operations); }

/* ---------- Section groups (requirements / volunteers) ---------- */
.section-head {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--line);
}
.section-head:first-child { margin-top: 0; }
.kv { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.kv strong { color: var(--ink); font-weight: 600; }

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  right: max(16px, calc((100vw - var(--maxw)) / 2 + 16px));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 0;
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 25;
}

/* ---------- Overlay (detail / form) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  overflow-y: auto;
}
.overlay-inner { max-width: var(--maxw); margin: 0 auto; }
.overlay-header {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.overlay-header h2 { font-size: 1.02rem; flex: 1; }
.overlay-header button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}
.overlay-body { padding: 16px 14px 40px; }

.detail-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.detail-value { font-size: 0.98rem; white-space: pre-wrap; }
.detail-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn {
  flex: 1;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 80px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ---------- Timeline (per-venue Gantt) ---------- */
.timeline-day { margin-bottom: 26px; }
.timeline-grid {
  position: relative;
  margin-left: 48px;
  border-left: 2px solid var(--line);
}
.tl-hour {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--line);
}
.tl-hour-label {
  position: absolute;
  left: -48px;
  top: -8px;
  width: 42px;
  text-align: right;
  font-size: 0.66rem;
  color: var(--muted);
}
.tl-event {
  position: absolute;
  border: 0;
  border-radius: 6px;
  padding: 3px 6px;
  text-align: left;
  color: #fff;
  background: var(--muted);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.tl-event.cat-music { background: var(--music); }
.tl-event.cat-literary { background: var(--literary); }
.tl-event.cat-operations { background: var(--operations); }
.tl-event .tl-time { font-size: 0.6rem; opacity: 0.92; font-weight: 600; display: block; }
.tl-event .tl-title { font-size: 0.71rem; line-height: 1.15; font-weight: 600; display: block; }
.tl-untimed-head {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 14px 0 8px;
}
.tl-untimed-head + .card { margin-bottom: 8px; }
.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 4px 2px 14px;
}
.tl-legend span { display: flex; align-items: center; gap: 5px; }
.tl-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 0.95rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--navy-dark);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 60;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

@media (min-width: 620px) {
  .filters { flex-direction: row; flex-wrap: wrap; }
  .search-input { flex: 2 1 240px; }
  .filter-row { flex: 1 1 240px; }
}
