:root {
  --bg: #f3f0ea;
  --panel: #fffdf8;
  --ink: #1c242c;
  --muted: #5c6a76;
  --line: #d5cdc0;
  --accent: #0f5c5c;
  --accent-hover: #0a4545;
  --danger: #8b2e2e;
  --warn: #8a5a12;
  --ok: #1f6b3a;
  --shadow: 0 1px 2px rgba(28, 36, 44, 0.06);
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Source Serif 4", Georgia, serif;
}

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at top left, #e8f2f0 0%, transparent 45%),
    linear-gradient(180deg, #efeae2 0%, var(--bg) 40%);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}
.topbar nav { display: flex; gap: 0.85rem; flex-wrap: wrap; }
.topbar nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.25rem 0.1rem;
}
.topbar nav a.active, .topbar nav a:hover { color: var(--accent); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.wrap.wide { max-width: 1400px; }

h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0 0 0.75rem;
}
h1 { font-size: 1.75rem; }
.muted { color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.flash {
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.flash-ok { background: #e5f5ea; color: var(--ok); }
.flash-error { background: #f8e8e8; color: var(--danger); }
.flash-warn { background: #f8efd9; color: var(--warn); }

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-secondary { background: #4a5a66; }
.btn-secondary:hover { background: #36454f; }
.btn-danger { background: var(--danger); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #eef5f4; color: var(--accent); }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: #fff;
  margin-bottom: 0.85rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e7eee9;
  color: var(--ok);
}
.badge-waitlist { background: #f6ebd0; color: var(--warn); }
.badge-dropped { background: #f0e0e0; color: var(--danger); }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card {
  width: min(380px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.login-card h1 { text-align: center; }

/* Floor editor */
.floor-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .floor-layout { grid-template-columns: 1fr; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.toolbar .btn { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
#stage-wrap {
  background: #2a333c;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1a2128;
  min-height: 520px;
}
#stage-host { width: 100%; height: 70vh; min-height: 520px; }
.side-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.side-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font: inherit;
}
.side-list button:hover { background: #eef5f4; }
.side-list button.placed { opacity: 0.55; }
.status-bar {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media print {
  .topbar, .toolbar, .side-panel, .no-print { display: none !important; }
  body { background: #fff; }
  #stage-wrap { border: none; background: #fff; }
  #stage-host { height: auto !important; min-height: 0; }
}
