:root {
  --bg-color: #0d0f14;
  --panel-bg: rgba(22, 27, 34, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-color: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --free-color: #10b981;
  --taken-color: #ef4444;
  --seat-size: 52px;
  --gap: 10px;
  --group-gap: 24px;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.dashboard {
  display: grid;
  grid-template-areas: 
    "header header"
    "stats stats"
    "main sidebar";
  grid-template-columns: 1fr 350px;
  grid-template-rows: auto auto 1fr;
  min-height: 100vh;
  padding: 32px;
  gap: 24px;
}

/* Glassmorphism utility */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Header */
.header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.select-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

select {
  background: #1e293b;
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  min-width: 250px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

select:hover {
  border-color: var(--accent-color);
}

/* Stats Bar */
.stats-bar {
  grid-area: stats;
  display: flex;
  gap: 16px;
}

.badge {
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge span {
  color: var(--accent-color);
  font-size: 18px;
  font-weight: 800;
}

/* Main Content (Seat Map) */
.main-content {
  grid-area: main;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-state {
  margin: auto;
  text-align: center;
  color: var(--text-secondary);
}

.spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Grid Layout */
.grid-container {
  display: grid;
  gap: 32px;
  padding: 40px 40px 40px 80px;
  overflow-x: auto;
  max-width: 100%;
  position: relative;
}

.column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  align-items: center;
}

.column-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

/* Seats */
.seat {
  width: var(--seat-size);
  height: var(--seat-size);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  user-select: none;
}

.seat.free {
  background: rgba(16, 185, 129, 0.15);
  color: var(--free-color);
  border-color: rgba(16, 185, 129, 0.3);
}

.seat.taken {
  background: rgba(239, 68, 68, 0.15);
  color: var(--taken-color);
  border-color: rgba(239, 68, 68, 0.3);
}

.seat:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.seat.selected {
  border-color: #fff;
  background: var(--accent-color);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.screen {
  position: absolute;
  left: 15px;
  width: 55px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.5), inset 0 0 20px rgba(56, 189, 248, 0.2);
  pointer-events: none;
  text-shadow: 0 0 8px var(--accent-color);
  z-index: 100;
  padding: 15px 0;
  line-height: 1;
}

.group-separator {
  height: var(--group-gap);
}

/* Sidebar Info */
.sidebar {
  grid-row: stats / span 2;
  grid-column: sidebar;
  padding: 32px;
  display: none;
  flex-direction: column;
  position: sticky;
  top: 32px;
  height: calc(100vh - 64px);
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.seat-badge {
  background: var(--accent-color);
  color: #000;
  padding: 6px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 16px;
}

.sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-item label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.highlight {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.info-item p {
  font-weight: 500;
  color: var(--text-primary);
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Legend Floating */
.legend-floating {
  position: fixed;
  bottom: 32px;
  left: 32px;
  display: flex;
  gap: 20px;
  padding: 12px 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.dot-free { background: var(--free-color); box-shadow: 0 0 8px var(--free-color); }
.dot-taken { background: var(--taken-color); box-shadow: 0 0 8px var(--taken-color); }

/* Responsive */
@media (max-width: 1100px) {
  .dashboard {
    grid-template-areas: 
      "header"
      "stats"
      "main"
      "sidebar";
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .sidebar {
    grid-row: auto;
    grid-column: auto;
    position: static;
    height: auto;
    margin-top: 24px;
  }
}
