:root {
  --bg: #0a0a0a;
  --card: #141414;
  --card-2: #1e1e1e;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --muted: #888;
  --red: #e63946;
  --red-dim: rgba(230, 57, 70, 0.15);
  --red-glow: rgba(230, 57, 70, 0.4);
  --green: #2dc653;
  --green-dim: rgba(45, 198, 83, 0.15);
  --green-glow: rgba(45, 198, 83, 0.4);
  --accent: #f4a261;
  --orange: #f4a261;
  --orange-dim: rgba(244, 162, 97, 0.15);
  --orange-glow: rgba(244, 162, 97, 0.4);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  line-height: 1.4;
}

/* ── HEADER ── */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}

.site-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.stats-bar {
  display: flex;
  gap: 20px;
  flex: 1;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 16px;
  min-width: 80px;
}

.stat-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 1.3rem; font-weight: 700; }

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-link:hover { color: var(--text); border-color: var(--muted); }

.btn-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-reset:hover { border-color: var(--red); color: var(--red); }

/* ── MAIN LAYOUT ── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── DRAW BUTTON ── */
.draw-section { display: flex; justify-content: center; }

.btn-draw {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #f4a261, #e76f51);
  border: none;
  border-radius: var(--radius);
  padding: 18px 36px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(244, 162, 97, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
  max-width: 480px;
  justify-content: center;
}
.btn-draw:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(244, 162, 97, 0.45); }
.btn-draw:active { transform: translateY(0); }

.draw-icon { font-size: 1.6rem; }

.next-badge {
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ── STATIONS ── */
.stations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.station-card {
  border-radius: var(--radius);
  padding: 24px 20px;
  border: 2px solid var(--border);
  background: var(--card);
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.station-card.free {
  border-color: var(--green);
  background: var(--green-dim);
  box-shadow: 0 0 24px var(--green-glow);
}

.station-card.busy {
  border-color: var(--red);
  background: var(--red-dim);
  box-shadow: 0 0 24px var(--red-glow);
}

.station-card.pause {
  border-color: var(--orange);
  background: var(--orange-dim);
  box-shadow: 0 0 24px var(--orange-glow);
}

.station-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}

.station-status-label {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 3px;
}

.station-card.free .station-status-label  { color: var(--green); }
.station-card.busy .station-status-label  { color: var(--red); }
.station-card.pause .station-status-label { color: var(--orange); }

.station-customer-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.station-time {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--card-2);
  border-radius: 4px;
  padding: 2px 10px;
}

.btn-assign {
  margin-top: 8px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-assign:hover { opacity: 0.9; transform: scale(1.02); }

.no-queue { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ── QUEUE ── */
.queue-section h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-count { color: var(--accent); font-size: 0.85rem; letter-spacing: 0; text-transform: none; }

.queue-list { display: flex; flex-direction: column; gap: 6px; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.queue-row {
  display: grid;
  grid-template-columns: 60px 80px 1fr 120px 36px;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.2s;
}

.queue-row.assigned {
  border-color: #444;
  opacity: 0.75;
}

.queue-num {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
}

.queue-time-drawn {
  font-size: 0.8rem;
  color: var(--muted);
}

.queue-wait {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.queue-row.waiting .queue-wait { color: var(--accent); }
.queue-row.assigned .queue-wait { color: var(--muted); }

.queue-status { display: flex; justify-content: flex-end; }

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.badge.waiting { background: rgba(244,162,97,0.15); color: var(--accent); border: 1px solid rgba(244,162,97,0.3); }
.badge.assigned { background: rgba(230,57,70,0.15); color: var(--red); border: 1px solid rgba(230,57,70,0.3); }

.btn-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-remove:hover { border-color: var(--red); color: var(--red); }

/* ── STATION PAGE ── */
body.station-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.station-full {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: background 0.4s;
  padding: 40px 20px 120px;
  text-align: center;
}

.station-full.free  { background: linear-gradient(160deg, #0a2e14, #0a0a0a); }
.station-full.busy  { background: linear-gradient(160deg, #2e0a0a, #0a0a0a); }
.station-full.pause { background: linear-gradient(160deg, #2e1e0a, #0a0a0a); }

.station-full .station-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--muted);
}

.station-full .big-status {
  font-size: clamp(3rem, 15vw, 6rem);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1;
}

.station-full.free .big-status  { color: var(--green);  text-shadow: 0 0 40px var(--green-glow); }
.station-full.busy .big-status  { color: var(--red);    text-shadow: 0 0 40px var(--red-glow); }
.station-full.pause .big-status { color: var(--orange); text-shadow: 0 0 40px var(--orange-glow); }

.station-full .customer-number {
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.station-full .customer-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.station-full .sitting-time {
  font-size: 1rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.btn-free {
  margin-top: 20px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 16px;
  padding: 24px 48px;
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  font-weight: 900;
  cursor: pointer;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 30px var(--green-glow);
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 1px;
}
.btn-free:hover { opacity: 0.9; transform: scale(1.02); }
.btn-free:active { transform: scale(0.98); }
.btn-free:disabled { background: var(--border); color: var(--muted); box-shadow: none; cursor: default; transform: none; }

/* ── PAUSE AREA (klein, unten) ── */
.pause-area {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-pause,
.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-pause:hover  { background: var(--orange-dim); border-color: var(--orange); color: var(--orange); }
.btn-resume:hover { background: var(--green-dim);  border-color: var(--green);  color: var(--green); }

.nfc-indicator {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
  text-align: center;
  max-width: 260px;
}

.station-nav {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: center;
}
.station-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.station-nav a:hover { color: var(--text); }

/* ── STATS PAGE ── */
.stats-page main {
  max-width: 900px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stats-card .value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  display: block;
}

.stats-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.station-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.station-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.station-stat .svalue { font-size: 2rem; font-weight: 900; }
.station-stat.s1 .svalue { color: #60a5fa; }
.station-stat.s2 .svalue { color: #a78bfa; }
.station-stat.s3 .svalue { color: #f472b6; }
.station-stat .slabel { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 12px 16px; }
  .header-inner { gap: 12px; }
  h1 { font-size: 1.1rem; }
  .stats-bar { gap: 8px; }
  .stat { padding: 4px 10px; min-width: 65px; }
  .stat-value { font-size: 1.1rem; }

  main { padding: 16px; gap: 16px; }

  .stations { grid-template-columns: 1fr; }
  .station-card { padding: 20px; }

  .queue-row {
    grid-template-columns: 50px 70px 1fr 100px 30px;
    gap: 8px;
    padding: 10px 12px;
  }

  .station-stats { grid-template-columns: repeat(3, 1fr); }
}
