:root {
  --panel-bg: #0f172a;
  --panel-fg: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.12);
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Inter,
    Arial,
    sans-serif;
  background: #0b1020;
  color: #e5e7eb;
}

/* html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
} */

.app {
  display: grid;
  grid-template-columns: 360px 1fr;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.panel h1 {
  margin: 0 0 8px 0;
  font-size: 18px;
}
.panel p {
  margin: 0 0 16px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.group-title {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

label {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 6px;
}

input[type="number"],
input[type="text"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--panel-fg);
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 12px;
  line-height: 1.35;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--panel-fg);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition:
    transform 0.06s ease,
    background 0.15s ease;
  cursor: pointer;
}
button:hover {
  background: rgba(255, 255, 255, 0.1);
}
button:active {
  transform: translateY(1px);
}
button.primary {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
}
button.danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.toggle input {
  transform: scale(1.2);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.4;
}

/* Canvas area */
.stage-wrap {
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #cbd5e1;
  font-size: 13px;
}

.stage {
  position: relative;
  width: 100%;
  min-height: 600px; /* or whatever feels right */

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.map {
  position: relative;
  margin: 14px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}

.grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
}

/* Tables */
.table-item {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: move;
  user-select: none;
  transform-origin: center center;
  will-change: transform;
}

.table-item.round {
  border-radius: 999px;
}

.table-item.selected {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

.table-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #e2e8f0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.table-meta {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.85);
  pointer-events: none;
}

.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.9);
  border: 2px solid rgba(15, 23, 42, 1);
  box-sizing: content-box;
  display: none;
}
.table-item.selected .handle {
  display: block;
}

.handle.br {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.handle.rotate {
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: rgba(16, 185, 129, 0.95);
  cursor: grab;
}

.kbd {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}
.room-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.room-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 13px;
  padding-bottom: 7px;
}

.room-tab.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
}

.room-tab input {
  background: transparent;
  border: none;
  color: white;
  width: 120px;
}
.room-tab span:last-child {
  opacity: 0;
  transition: 0.15s;
}

.room-tab:hover span:last-child {
  opacity: 0.7;
}
.table-item.bar {
  display: block;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.bar-seat {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.bar-seat-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.bar-seat {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
}

.bar-seat-label {
  pointer-events: none;
}
.group.collapsed #mapSizeContent {
  display: none;
}
#mapSizeToggle {
  font-size: 14px;
  color: #cbd5e1;
  transform: rotate(0deg);
}

.group.collapsed #mapSizeToggle {
  transform: rotate(90deg);
}

.collapsed {
  padding-bottom: 0px;
}
.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;

  height: 60px;

  display: flex;
  align-items: center;
  justify-content: space-between; /* 🔥 this is key */

  padding: 0 20px;

  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-center {
  display: flex;
  gap: 10px;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.15s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
}

.headerLogo {
  width: 100px;
  margin-top: 16px;
  margin-right: 15px;
}

.nav-language {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.nav-language option {
  color: black;
}

.header-user {
  min-width: fit-content;
  margin-right: 10px;
  white-space: nowrap; /* 🔥 Prevent text wrapping */
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.hidden {
  display: none;
}

/* Modal Box */
.modal {
  width: 420px;
  max-width: 90%;
  background: #0f172a;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
}

/* Form */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  max-width: 90%;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}

.password-hint {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
}

.form-error {
  margin-top: 12px;
  color: #f87171;
  font-size: 13px;
}

/* Green signup state */
.signup-green {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34d399;
}

/* Soft pulse animation */
@keyframes signupPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.signup-pulse {
  animation: signupPulse 2.5s infinite;
}
.signup-green:hover {
  background: rgba(16, 185, 129, 0.35);
}

.room-icon {
  width: 11px;
  height: 14px;
  margin-left: 6px;
  opacity: 0.6;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  padding: 2px;
  margin-bottom: -4px;
  margin-right: -3px;
}

.room-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.room-icon.delete:hover {
  filter: brightness(0) saturate(100%) invert(32%) sepia(95%) saturate(7500%)
    hue-rotate(350deg) brightness(95%) contrast(110%);
}
.user-menu {
  position: relative;
  display: inline-block;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: #1c2537;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: 0.18s ease;
  z-index: 1000;
  border: 2px solid #2b3243;
  margin-top: 2px;
}

.user-menu.logged-in:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown.hidden {
  display: none;
}

.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#combineGroup.collapsed #combineContent {
  display: none;
}

#combineGroup.collapsed #combineToggle {
  transform: rotate(90deg);
}

.hidden {
  display: none !important;
}

.header-signup {
  margin-right: 10px;
  white-space: nowrap; /* 🔥 Prevent text wrapping */
}

.header-signin {
  margin-right: 10px;

  white-space: nowrap; /* 🔥 Prevent text wrapping */
}
