.floorplan-root {
  --fp-w: 960px;
  --fp-h: 540px;
  --fp-free: #22c55e;
  --fp-occupied: #f59e0b;
  --fp-billing: #a855f7;
  --fp-reserved: #3b82f6;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.floorplan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.floorplan-toolbar .fp-hint {
  font-size: 0.8125rem;
  opacity: 0.75;
  margin-left: auto;
}

.floorplan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.floorplan-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.floorplan-legend i {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  display: inline-block;
}

.floorplan-viewport {
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.floorplan-canvas {
  position: relative;
  width: var(--fp-w);
  min-width: var(--fp-w);
  height: var(--fp-h);
  min-height: var(--fp-h);
  margin: 0 auto;
  background-color: #1e293b;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  touch-action: none;
  user-select: none;
}

.fp-zone-label {
  position: absolute;
  left: 12px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  pointer-events: none;
  z-index: 1;
}

.fp-table {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.35rem;
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.fp-table:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.fp-table.selected {
  outline: 3px solid #fff;
  outline-offset: 2px;
  z-index: 4;
}

.fp-table.active-table {
  outline: 3px solid #6366f1;
  outline-offset: 2px;
}

.fp-table.fp-status-FREE { background: var(--fp-free); }
.fp-table.fp-status-OCCUPIED { background: var(--fp-occupied); color: #1e293b; }
.fp-table.fp-status-BILLING { background: var(--fp-billing); }
.fp-table.fp-status-RESERVED { background: var(--fp-reserved); }

.fp-table.fp-shape-ROUND { border-radius: 999px; }
.fp-table.fp-shape-SQUARE { border-radius: 0.75rem; }
.fp-table.fp-shape-RECTANGLE { border-radius: 0.65rem; }
.fp-table.fp-shape-BOOTH { border-radius: 1rem 1rem 0.35rem 0.35rem; }
.fp-table.fp-shape-BAR { border-radius: 0.5rem; }

.fp-code {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.fp-name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-meta {
  font-size: 0.625rem;
  opacity: 0.85;
}

.fp-total {
  font-size: 0.75rem;
  font-weight: 800;
}

.fp-rotate-handle {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 5;
}

.fp-rotate-handle:active {
  cursor: grabbing;
}

.floorplan-editor-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
}

.floorplan-editor-panel .btn {
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.95);
  color: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.floorplan-editor-panel .btn:hover {
  background: rgba(51, 65, 85, 1);
}

.floorplan-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.floorplan-quick-actions .fp-quick-btn {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.9);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}

.floorplan-quick-actions .fp-quick-btn:hover {
  background: rgba(51, 65, 85, 0.95);
}

.floorplan-quick-actions .fp-quick-btn.takeaway {
  border-color: rgba(34, 197, 94, 0.45);
}

.floorplan-quick-actions .fp-quick-btn.delivery {
  border-color: rgba(59, 130, 246, 0.45);
}

@media (max-width: 1024px) {
  .floorplan-root {
    --fp-w: 100%;
    --fp-h: min(62vw, 420px);
  }

  .floorplan-canvas {
    min-width: 100%;
  }
}
