:root {
  --bg: #f5f6fc;
  --surface: #ffffff;
  --ink: #1c1c1e;
  --muted: #6b6f80;
  --accent: #384ad3;
  --accent-ink: #ffffff;
  --border: #e3e5f2;
  --ok: #2f9e5c;
  --warn: #c98a1f;
  --live: #1b9c8f;
  --planned: #8a6dbb;
  --radius: 10px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

#app { max-width: 960px; margin: 0 auto; padding: 0 0 3rem; }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar h1 { font-size: 1.05rem; margin: 0; font-weight: 700; }
header.topbar .who { font-size: 0.8rem; color: var(--muted); }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem 0.85rem;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
button:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 360px;
}
.login-card h1 { font-size: 1.2rem; margin-top: 0; }
.login-card .field { margin-bottom: 0.9rem; }
.login-card label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.error-text { color: var(--accent); font-size: 0.85rem; margin-top: 0.5rem; }

nav.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem 0;
  overflow-x: auto;
}
nav.tabs button {
  border: none;
  background: transparent;
  padding: 0.55rem 1rem;
  color: var(--ink);
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
}
nav.tabs button.active { color: var(--accent-ink); background: var(--accent); }

main.panel { padding: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.event-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.event-main { flex: 1 1 260px; min-width: 0; }
.event-title { font-weight: 600; }
.event-meta { color: var(--muted); font-size: 0.85rem; }
.event-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  color: #fff;
}
.badge.live { background: var(--live); }
.badge.planned { background: var(--planned); }
.badge.available { background: var(--ok); }
.badge.assigned { background: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }

.section-title { font-size: 0.95rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.section-title:first-child { margin-top: 0; }

.muted { color: var(--muted); }
.help-panel h3 { margin-top: 1.2rem; }
.help-panel h3:first-child { margin-top: 0; }

.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 100;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 1.25rem;
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-top: 0; font-size: 1.05rem; }

@media (max-width: 560px) {
  main.panel { padding: 0.9rem; }
  header.topbar { padding: 0.8rem; }
}
