:root {
  --bg: #0f1115;
  --surface: #171a21;
  --border: #2a2f3a;
  --text: #fff;
  --muted: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #12151c;
}

.header h1 {
  font-size: 24px;
}

.header p {
  color: var(--muted);
  margin-top: 4px;
}

.top-controls {
  display: flex;
  gap: 12px;
  padding: 18px 24px;
  flex-wrap: wrap;
}

.top-controls input,
.top-controls select {
  background: var(--surface);
  color: white;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
}

.top-controls input {
  min-width: 280px;
}

.legend {
  display: flex;
  gap: 20px;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.l-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.l-dot.male {
  background: #3b82f6;
}

.l-dot.female {
  background: #ec4899;
}

.l-dot.unknown {
  background: #f59e0b;
}

.l-dot.free {
  background: #6b7280;
}

.stats-bar {
  display: flex;
  gap: 12px;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  min-width: 160px;
}

.stat-val {
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  margin-top: 4px;
}

.floor-tabs-bar {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}

.floor-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.floor-tab.active {
  border-color: #3b82f6;
}

.content {
  padding: 0 24px 40px;
}

.floor-panel {
  display: none;
}

.floor-panel.active {
  display: block;
}

.floor-title {
  font-size: 24px;
  margin-bottom: 20px;
}

.table-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 8px 18px 0;
}

.seat-row {
  display: flex;
  gap: 4px;
}

.table-block {
  background: #d6b77b;
  color: #4b2f00;
  border-radius: 6px;
  border: 1px solid #8b6b35;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.seat {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  transition: 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}

.seat:hover {
  transform: scale(1.18);
}

.seat.free {
  background: #4b5563;
  color: white;
}

.seat.occupied-male {
  background: #3b82f6;
  color: white;
}

.seat.occupied-female {
  background: #ec4899;
  color: white;
}

.seat.occupied-unknown {
  background: #f59e0b;
  color: black;
}

.ws-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: red;
}

.ws-dot.on {
  background: #22c55e;
}

.space-box {
  border: 2px dashed #3b4252;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 12px;
}

.misc-box {
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main {
  flex: 1;
  overflow-y: auto;
}

.sidebar {
  width: 340px;
  border-left: 1px solid var(--border);
  background: #11141a;
  overflow-y: auto;
}

.sidebar-title {
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

#results {
  padding: 12px;
}

.result-card {
  background: #1b1f27;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: 0.15s;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
}

.result-name {
  font-weight: 700;
  margin-bottom: 8px;
}

.result-meta {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.5;
}

.seat.selected {
  outline: 3px solid white;
  transform: scale(1.25);
  z-index: 999;
}

.floor-panel {
  padding: 20px;
}

#layout-G,
#layout-1,
#layout-2,
#layout-3 {
  overflow: auto;
  padding-bottom: 40px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(6px);
}

.modal-backdrop.show {
  display: flex;
}

.seat-modal {
  width: 420px;
  max-width: 92vw;
  background: #171a21;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.modal-name {
  font-size: 20px;
  font-weight: 700;
}

.modal-seat {
  margin-top: 4px;
  color: #9ca3af;
  font-size: 14px;
}

.modal-body {
  padding: 18px;
  line-height: 1.8;
  color: #e5e7eb;
}

.close-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #232834;
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: 0.15s;
}

.close-btn:hover {
  background: #2f3746;
}

.modal-body strong {
  color: white;
}
