/* ==========================================================================
   styles.css — Estilos base, tema claro/oscuro y componentes.
   Las variables de :root controlan colores, radios, sombras y tipografía.
   ========================================================================== */

:root {
  --bg: #fff3e0;
  --surface: #ffffff;
  --surface-2: #fff9f1;
  --surface-3: #ffe9e2;
  --floor: #fff3e0;
  --floor-dot: #f3d9cc;
  --border: #f6dcd2;
  --border-strong: #ebc2b6;

  --text: #2e1d1b;
  --text-2: #6e4f4a;
  --text-3: #a07f78;

  --accent: #ff8989;
  --accent-hover: #f87575;
  --accent-strong: #b8433f;
  --accent-soft: #ffdfdd;
  --accent-ink: #3a1717;

  --found: #d8902a;
  --found-strong: #8f5a0e;
  --found-soft: #fdebcf;

  --danger: #c2413a;
  --danger-hover: #a8352f;
  --danger-soft: #fde1de;

  --info: #3f5c8c;

  --ink: #3a2422;
  --ink-text: #fff6ee;

  --seat-free-bg: #ffffff;
  --seat-free-border: #efc4b9;
  --seat-free-text: #b0857c;
  --table-bg: #fffaf4;

  --focus-ring: #e46a66;

  --shadow-xs: 0 1px 1px rgba(32, 29, 22, 0.05);
  --shadow-sm: 0 1px 2px rgba(32, 29, 22, 0.06), 0 1px 1px rgba(32, 29, 22, 0.04);
  --shadow-md: 0 6px 18px -6px rgba(32, 29, 22, 0.16), 0 2px 4px rgba(32, 29, 22, 0.05);
  --shadow-lg: 0 28px 60px -16px rgba(24, 22, 16, 0.32), 0 4px 10px rgba(24, 22, 16, 0.06);

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --table-size: 232px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #191312;
  --surface: #231a19;
  --surface-2: #2a201e;
  --surface-3: #352725;
  --floor: #1d1615;
  --floor-dot: #3a2b29;
  --border: #3b2c2a;
  --border-strong: #54403d;

  --text: #fbeee8;
  --text-2: #cdb3ad;
  --text-3: #9c817b;

  --accent: #ff8989;
  --accent-hover: #ff9f9f;
  --accent-strong: #ffb9b6;
  --accent-soft: #43292a;
  --accent-ink: #2b1212;

  --found: #dcab55;
  --found-strong: #ecc47e;
  --found-soft: #3a2f1b;

  --danger: #e07d6c;
  --danger-hover: #ea9284;
  --danger-soft: #3b231f;

  --info: #8fa9d6;

  --ink: #fbeee8;
  --ink-text: #1d1413;

  --seat-free-bg: #2a201e;
  --seat-free-border: #5a4441;
  --seat-free-text: #9c817b;
  --table-bg: #2a201e;

  --focus-ring: #ffb3b0;

  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px -8px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 60px -16px rgba(0, 0, 0, 0.75), 0 4px 10px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-modal { overflow: hidden; }

h1, h2, h3, p { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 5px;
}

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--ink-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: none;
}
.icon svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- layout */

.app {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 28px 48px;
}

.main { outline: none; }

/* ---------------------------------------------------------------- header */

.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 520px) minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 4px 0 18px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.brand-mark svg { width: 28px; height: 28px; }

.brand-text { min-width: 0; }

.event-name {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 6px;
}
.event-name:hover { color: var(--accent); }

.event-meta {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-meta.is-placeholder { color: var(--text-3); }

.header-search { position: relative; }

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 120px 0 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-input::-webkit-search-cancel-button { display: none; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  display: flex;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  pointer-events: none;
}
.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd { display: none; }

.search-count {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--found-strong);
  pointer-events: none;
  white-space: nowrap;
}
.search-count.is-empty { color: var(--text-3); }

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
}
.search-clear:hover { background: var(--surface-3); }

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-xs); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn--secondary:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }

.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: var(--danger-hover); }
[data-theme="dark"] .btn--danger { color: #1a0f0d; }

.btn--danger-ghost { background: transparent; color: var(--danger); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }

.btn--danger-text { color: var(--danger); }
.btn--danger-text:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }

.btn--sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn--sm .icon { width: 16px; height: 16px; }

.btn--icon { width: 38px; padding: 0; }
.btn--sm.btn--icon { width: 32px; }

/* --------------------------------------------------------------- summary */

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 2fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.stat-value {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-sub { font-size: 12.5px; color: var(--text-2); }

.stat--progress { justify-content: space-between; gap: 10px; }

.progress-head { display: flex; justify-content: space-between; align-items: baseline; }
.progress-head .stat-label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.progress-pct { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent); }

.progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress--lg { height: 9px; }
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}
.progress.is-complete .progress-fill { background: var(--accent-strong); }

.status-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.status-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-chip--full i { background: var(--accent); }
.status-chip--partial i { background: transparent; border: 2px solid var(--accent); }
.status-chip--empty i { background: var(--surface-3); border: 1px solid var(--border-strong); }

/* ------------------------------------------------------------------ tabs */

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 4px;
  margin: 0 -28px 18px;
  padding: 8px 28px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 560;
  font-size: 14.5px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.tab:hover { background: var(--surface-3); color: var(--text); }
.tab[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border);
}
.tab[aria-current="page"] .icon { color: var(--accent); }

/* ----------------------------------------------------------- move banner */

.move-banner {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 18px;
  background: var(--ink);
  color: var(--ink-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: rise 0.2s var(--ease);
}
.move-banner-text { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; min-width: 0; }
.move-banner-text strong { font-size: 15px; }
.move-banner-text span { opacity: 0.8; }
.move-banner-actions { display: flex; gap: 8px; flex: none; }
.move-banner .btn--secondary { background: transparent; color: var(--ink-text); border-color: rgba(255, 255, 255, 0.28); box-shadow: none; }
[data-theme="dark"] .move-banner .btn--secondary { border-color: rgba(0, 0, 0, 0.25); }
.move-banner .btn--secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* ----------------------------------------------------------------- views */

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.view-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.view-sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* ================================================================ PLANO */

.view--plano:not([hidden]) {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.unassigned-panel {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 92px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.unassigned-panel.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 6px 16px;
}
.panel-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.panel-hint { padding: 0 16px 10px; font-size: 12.5px; color: var(--text-3); }
.panel-empty { padding: 10px 16px 18px; font-size: 13.5px; color: var(--text-2); }

.chip-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chip {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 10px;
  transition: background-color 0.12s, box-shadow 0.12s;
}
.chip:hover { background: var(--surface-2); }
.chip.is-selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip.is-found .chip-name { color: var(--found-strong); }
.chip.is-drag-source { opacity: 0.4; }
.chip[draggable="true"] { cursor: grab; }

.chip-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 10px;
}

.chip-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chip.is-selected .chip-avatar { background: var(--accent); color: var(--accent-ink); }

.chip-text { min-width: 0; display: flex; flex-direction: column; }
.chip-name { font-size: 14px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-group { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chip-actions { display: flex; opacity: 0; transition: opacity 0.12s; padding-right: 2px; }
.chip:hover .chip-actions,
.chip:focus-within .chip-actions { opacity: 1; }

/* --------------------------------------------------------------- floor */

.floor-wrap {
  min-width: 0;
  background-color: var(--floor);
  background-image: radial-gradient(var(--floor-dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 14px 18px 26px;
}

.floor-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 2px 4px 12px;
  font-size: 12.5px;
  color: var(--text-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-tip { margin-left: auto; color: var(--text-3); }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg--free { background: var(--seat-free-bg); border: 1.5px solid var(--seat-free-border); }
.lg--occ { background: var(--accent); }
.lg--found { background: var(--found); box-shadow: 0 0 0 3px var(--found-soft); }
.lg--full { background: var(--accent-soft); border: 2px solid var(--accent); }

.floor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--table-size), 1fr));
  gap: 26px 14px;
  justify-items: center;
}

.table {
  position: relative;
  width: var(--table-size);
  transition: opacity 0.2s, filter 0.2s;
  scroll-margin: 120px;
}

.table-ring {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.table-top {
  position: absolute;
  inset: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--table-bg);
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s, transform 0.15s;
}
.table-top:hover { border-color: var(--accent); transform: scale(1.02); }

.table-name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-2);
}
.table-nick {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  color: var(--accent);
  line-height: 1.1;
}
.table-count {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.table-state {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  min-height: 0;
}
.table-state:empty { display: none; }

.table.is-full .table-top {
  background: #ffcbcb;
  border: 2px solid var(--accent);
}
[data-theme="dark"] .table.is-full .table-top { background: #4d2e2e; }
.table.is-full .table-name { color: var(--accent-strong); }

.table.is-found .table-top {
  border: 2px solid var(--found);
  box-shadow: 0 0 0 6px var(--found-soft), var(--shadow-md);
}

.floor.has-search .table:not(.is-found) { opacity: 0.26; filter: grayscale(0.7); }
.floor.has-search .table.is-found .seat:not(.is-found) { opacity: 0.55; }

.table.is-pulse .table-top { animation: pulse-ring 1.5s var(--ease); }

/* ---------------------------------------------------------------- seats */

.seat {
  position: absolute;
  width: var(--seat-size, 40px);
  height: var(--seat-size, 40px);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--seat-free-border);
  background: var(--seat-free-bg);
  color: var(--seat-free-text);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-xs);
  transition: transform 0.12s var(--ease), background-color 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  z-index: 1;
}
.seat:hover { transform: translate(-50%, -50%) scale(1.1); border-color: var(--accent); z-index: 3; }

.seat.is-occupied {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.seat.is-occupied[draggable="true"] { cursor: grab; }

.seat.is-found {
  background: var(--found);
  border-color: var(--found);
  color: #fff;
  box-shadow: 0 0 0 4px var(--found-soft), var(--shadow-sm);
  z-index: 4;
}
[data-theme="dark"] .seat.is-found { color: #1d160a; }

.seat.is-selected {
  outline: 2px dashed var(--text);
  outline-offset: 3px;
  z-index: 4;
}

.seat.is-error {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
  animation: shake 0.4s;
}

.seat.drop-ok {
  transform: translate(-50%, -50%) scale(1.22);
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  color: var(--accent-strong);
  z-index: 5;
}
.seat.drop-swap {
  transform: translate(-50%, -50%) scale(1.22);
  box-shadow: 0 0 0 4px var(--found), var(--shadow-md);
  z-index: 5;
}

.seat.is-pulse { animation: pulse-seat 1.1s var(--ease) 2; z-index: 6; }
.seat.is-drag-source { opacity: 0.35; }

/* Nombre completo al pasar el cursor o enfocar con teclado. */
.seat.is-occupied::after {
  content: attr(data-name);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--ink-text);
  font-size: 12.5px;
  font-weight: 560;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  display: none;
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.seat.is-occupied:hover::after,
.seat.is-occupied:focus-visible::after { display: block; transform: translate(-50%, 0); animation: fade-in 0.12s ease-out; }

body.is-moving .seat:not(.is-occupied) { border-style: dashed; border-color: var(--accent); color: var(--accent); }
body.is-dragging .seat:not(.is-occupied) { border-style: dashed; }
body.is-dragging .seat::after { display: none; }

/* ============================================================== INVITADOS */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.toolbar-field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.toolbar-field label { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; }
.toolbar-field--sort { margin-left: auto; }
.sort-combo { display: flex; gap: 6px; }
.sort-combo .btn { min-width: 62px; }

select,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="search"]:not(.search-input):not(.consulta-input),
textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b877d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 9px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.th-actions { text-align: right !important; }

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  border-radius: 4px;
}
.th-sort:hover, .th-sort.is-active { color: var(--text); }
.sort-indicator { color: var(--accent); min-width: 8px; }

.cell-name { font-weight: 560; }
.guest-name { margin-right: 8px; }
.cell-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-group { color: var(--text-2); }
.cell-actions { text-align: right; width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 2px; }

.note-flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  vertical-align: 1px;
  cursor: help;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}
.badge--ok, .badge--full { background: var(--accent-soft); color: var(--accent-strong); }
.badge--muted, .badge--empty { background: var(--surface-3); color: var(--text-2); }
.badge--partial { background: transparent; color: var(--accent-strong); box-shadow: inset 0 0 0 1.5px var(--accent); }
.badge--warn { background: var(--found-soft); color: var(--found-strong); }
.badge--error { background: var(--danger-soft); color: var(--danger); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 44px 20px;
  text-align: center;
  color: var(--text-2);
}

/* ================================================================ MESAS */

.stats-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.stat-line {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-line dt { font-size: 12.5px; color: var(--text-2); }
.stat-line dd { margin: 0; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.tcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, opacity 0.2s, transform 0.15s;
  overflow: hidden;
}
.tcard:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.tcard--full { border-color: var(--accent); }
.tcard--full::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}
.tcard.is-found { border-color: var(--found); box-shadow: 0 0 0 4px var(--found-soft); }
.tables-grid.has-search .tcard:not(.is-found) { opacity: 0.35; }

.tcard-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tcard-title { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; display: flex; align-items: baseline; gap: 8px; }
.tcard-nick { font-family: var(--font-display); font-style: italic; font-weight: 500; letter-spacing: 0; color: var(--accent); font-size: 14px; }
.tcard-count { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tcard-count strong { font-size: 20px; color: var(--text); letter-spacing: -0.01em; }

.tcard-names {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13.5px;
  flex: 1;
}
.tcard-names li { display: flex; gap: 8px; min-width: 0; }
.tcard-names li span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-names li.is-found { color: var(--found-strong); font-weight: 650; }
.tcard-seat { width: 18px; flex: none; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.tcard-empty { font-size: 13.5px; color: var(--text-3); flex: 1; }
.tcard-foot { display: flex; justify-content: space-between; gap: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* ========================================================== HERRAMIENTAS */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.tool-card--wide { grid-column: 1 / -1; }
.tool-card--danger { border-color: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.tool-title { font-size: 16px; font-weight: 650; }
.tool-text { font-size: 13.5px; color: var(--text-2); }
.tool-text--muted { color: var(--text-3); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.tool-inline { display: flex; gap: 8px; }
.tool-inline select { flex: 1; }

.event-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr auto;
  gap: 12px;
  align-items: end;
}
.event-form .field { margin: 0; }

/* =========================================================== FORMULARIOS */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 13px; font-weight: 620; color: var(--text); }
.field-optional { font-weight: 450; color: var(--text-3); }
.field-hint { font-size: 12.5px; color: var(--text-3); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 560; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field-row .field { margin: 0; }

.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; transition: opacity 0.15s; }
.fieldset.is-disabled { opacity: 0.42; }

.picker-block { margin-bottom: 4px; }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ================================================================ MODALES */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(22, 20, 15, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.16s ease-out;
}
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.6); }
.modal-overlay.is-leaving { animation: fade-out 0.14s ease-in forwards; }

.modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 540px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s var(--ease);
}
.modal--sm { width: min(100%, 440px); }
.modal--lg { width: min(100%, 860px); }
.modal-overlay.is-leaving .modal { animation: modal-out 0.14s ease-in forwards; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 6px 22px;
}
.modal-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.modal-subtitle { margin-top: 3px; font-size: 13.5px; color: var(--text-2); }
.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }

.modal-body { padding: 12px 22px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-text { font-size: 15px; margin-bottom: 10px; }
.modal-note { font-size: 13.5px; color: var(--text-2); margin-top: 10px; }
.modal-note--warn {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--found-soft);
  color: var(--found-strong);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 16px 22px;
  border-top: 1px solid var(--border);
}
.modal-footer-start, .modal-footer-end { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-footer-end { margin-left: auto; }

.dup-card, .swap-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.dup-name { font-size: 16px; }
.dup-where { color: var(--text-2); font-size: 14px; }
.swap-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.swap-row span { color: var(--text-2); font-size: 13.5px; }
.swap-arrow { text-align: center; color: var(--text-3); font-size: 18px; line-height: 1; }

/* detalle de mesa */
.detail-progress { margin-bottom: 12px; }
.seat-list { list-style: none; margin: 0; padding: 0; }
.seat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-top: 1px solid var(--border);
}
.seat-row:first-child { border-top: 0; }
.seat-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.seat-row.is-free .seat-num { background: var(--surface-3); color: var(--text-3); }
.seat-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.seat-who-name { font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-who-group { font-size: 12.5px; color: var(--text-3); }
.seat-who-free { color: var(--text-3); }
.seat-actions { display: flex; gap: 2px; }

/* importación */
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 620; }
.pill--ok { background: var(--accent-soft); color: var(--accent-strong); }
.pill--warn { background: var(--found-soft); color: var(--found-strong); }
.pill--error { background: var(--danger-soft); color: var(--danger); }

.preview-table-wrap {
  margin-top: 12px;
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.preview-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.preview-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 8px 10px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.preview-table td { padding: 7px 10px; border-top: 1px solid var(--border); vertical-align: top; }
.preview-table .row--error td { background: var(--danger-soft); background: color-mix(in srgb, var(--danger-soft) 50%, transparent); }
.import-msg { display: block; margin-top: 3px; font-size: 12px; color: var(--text-2); }

.restore-list { margin: 0 0 6px; padding-left: 20px; font-size: 15px; line-height: 1.7; }

/* ================================================================ TOASTS */

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
body.is-moving .toast-region { bottom: 104px; }

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 8px 10px 14px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--ink-text);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.22s var(--ease);
}
.toast.is-leaving { animation: toast-out 0.18s ease-in forwards; }
.toast-symbol { font-weight: 700; color: #ffcbcb; }
[data-theme="dark"] .toast-symbol { color: var(--accent-strong); filter: brightness(0.6); }
.toast--error .toast-symbol { color: #f2b25c; }
.toast--info .toast-symbol { color: #a9c2ee; }
[data-theme="dark"] .toast--error .toast-symbol { color: #9a5a08; filter: none; }
[data-theme="dark"] .toast--info .toast-symbol { color: #2d4b80; filter: none; }
.toast-message { flex: 1; }
.toast-action {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 8px;
  border-radius: 8px;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.12); }
.toast-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: 0.6;
}
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.toast-close .icon { width: 15px; height: 15px; }

/* ============================================================ CONSULTA */

body.consulta-mode .app-header,
body.consulta-mode .summary,
body.consulta-mode .tabs,
body.consulta-mode .move-banner { display: none !important; }

.consulta:not([hidden]) {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 8px;
  min-height: calc(100vh - 80px);
}
.consulta-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.consulta-event { font-family: var(--font-display); color: var(--text-2); font-size: 16px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consulta-title { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 16px; }
.consulta-input {
  width: 100%;
  height: 68px;
  padding: 0 22px;
  border: 2px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  font-size: 24px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.consulta-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.consulta-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.consulta-results { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.consulta-hint { color: var(--text-3); font-size: 16px; text-align: center; padding: 24px 0; }
.consulta-none { text-align: center; padding: 28px 16px; color: var(--text-2); font-size: 15px; }
.consulta-none-title { font-size: 20px; font-weight: 650; color: var(--text); margin-bottom: 6px; }

.answer {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  animation: rise 0.18s var(--ease);
}
.answer-name { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.answer-group { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.answer-place { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.answer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.answer-label { font-size: 13px; font-weight: 700; letter-spacing: 0.18em; }
.answer-value { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.answer-nick { font-family: var(--font-display); font-style: italic; font-size: 15px; margin-top: 2px; }
.answer-missing { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--surface-3); color: var(--text-2); font-weight: 600; text-align: center; font-size: 17px; }
.consulta-results.is-single .answer-value { font-size: 88px; }

/* ================================================================ PRINT */

.print-root { display: none; }

/* ============================================================ ANIMACIONES */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(0.99); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translate(var(--rise-x, 0), 8px); } to { opacity: 1; } }
.move-banner { --rise-x: -50%; }
@keyframes shake {
  0%, 100% { margin-left: 0; }
  20% { margin-left: -4px; }
  40% { margin-left: 4px; }
  60% { margin-left: -3px; }
  80% { margin-left: 2px; }
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--found), var(--shadow-md); }
  100% { box-shadow: 0 0 0 18px transparent, var(--shadow-md); }
}
@keyframes pulse-seat {
  0% { box-shadow: 0 0 0 0 var(--found); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------- nombres bajo cada mesa (táctil) */

.table-names { display: none; }
.table-nick[hidden] { display: none; }

@media (hover: none), (max-width: 720px) {
  .table-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
    list-style: none;
    margin: 6px 0 0;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
  }
  .table-names:empty { display: none; }
  .table-names li { display: flex; gap: 6px; min-width: 0; }
  .tn-seat { flex: none; width: 16px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
  .tn-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .floor.has-search .table.is-found .table-names { border-color: var(--found); }
}

/* ------------------------------------------------- editor de mesas */

.tedit-note { margin: 0 0 10px; }
.tedit-list { display: flex; flex-direction: column; gap: 6px; }
.tedit-row {
  display: grid;
  grid-template-columns: 40px 92px minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 10px;
}
.tedit-row.is-focus { background: var(--accent-soft); }
.tedit-row.has-error { background: var(--danger-soft); }
.tedit-row.has-error input[type="number"] { border-color: var(--danger); }
.tedit-head { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); padding-bottom: 0; }
.tedit-pos {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.tedit-occ { font-size: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.tedit-row input { height: 36px; }
.tcard-tools { display: inline-flex; gap: 2px; }

/* ------------------------------------------------ estado de sincronización */

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.sync-pill:hover { border-color: var(--border-strong); color: var(--text); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.sync-pill.is-ok .sync-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sync-pill.is-saving .sync-dot { background: var(--found); animation: blink 1s infinite; }
.sync-pill.is-offline { color: var(--found-strong); background: var(--found-soft); border-color: transparent; }
.sync-pill.is-offline .sync-dot { background: var(--found); }
.sync-pill.is-locked { color: var(--text); }
.sync-pill.is-locked .sync-dot { background: transparent; border: 2px solid var(--text-2); }
.sync-pill.is-error { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.sync-pill.is-error .sync-dot { background: var(--danger); }
@keyframes blink { 50% { opacity: 0.3; } }

/* Solo lectura: se ocultan los controles de edición. */
body.is-readonly .panel-hint,
body.is-readonly #unassigned-add,
body.is-readonly #guests-add,
body.is-readonly .chip-actions,
body.is-readonly .row-actions,
body.is-readonly .seat-actions,
body.is-readonly #undo-btn,
body.is-readonly .tcard-tools [data-action="edit-table"] { display: none !important; }
body.is-readonly .seat { cursor: default; }

/* ======================================================= PLANO DEL SALÓN */

.venue-label { font-weight: 650; color: var(--text); margin-right: 4px; }
.venue-zoom { display: none !important; }
.floor-wrap.can-zoom .venue-zoom { display: inline-flex !important; }

.floor-wrap.has-venue {
  background-image: none;
  background-color: var(--surface);
  padding: 12px 16px 30px;
}

:root {
  --venue-floor: #fff3e0;
  --venue-tile: rgba(255, 137, 137, 0.12);
  --venue-wall: #4a2c2a;
}
[data-theme="dark"] {
  --venue-floor: #1d1615;
  --venue-tile: rgba(255, 255, 255, 0.035);
  --venue-wall: #5c3b38;
}

.floor.venue {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: var(--aspect, 1.6);
  --fp: 130px;
  background-color: var(--venue-floor);
  background-image:
    linear-gradient(var(--venue-tile) 1px, transparent 1px),
    linear-gradient(90deg, var(--venue-tile) 1px, transparent 1px);
  background-size: 6.06% 9.1%;
  border: 7px solid var(--venue-wall);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05), var(--shadow-md);
}

.floor.venue .table {
  position: absolute;
  transform: translate(-50%, -50%);
  display: block;
  scroll-margin: 140px;
}
.floor.venue .table-ring { width: 100%; height: 100%; aspect-ratio: auto; }
.floor.venue .table-names { display: none !important; }

.floor.venue .seat {
  width: calc(var(--fp) * 0.165);
  height: calc(var(--fp) * 0.165);
  font-size: calc(var(--fp) * 0.066);
  border-width: 1.5px;
  letter-spacing: 0;
}
.floor.venue .table-top { inset: 21%; gap: 0; }
.floor.venue .table-name { font-size: calc(var(--fp) * 0.064); letter-spacing: 0.1em; }
.floor.venue .table-count { font-size: calc(var(--fp) * 0.118); }
.floor.venue .table-nick { font-size: calc(var(--fp) * 0.074); }
.floor.venue .table-state { font-size: calc(var(--fp) * 0.05); letter-spacing: 0.04em; }
.table-num { display: none; }

/* Mesa rectangular (niños) */
.floor.venue .table--rect .table-top {
  inset: 22% 7%;
  border-radius: calc(var(--fp) * 0.05);
}
.floor.venue .table--rect .table-nick { font-size: calc(var(--fp) * 0.1); font-weight: 600; }

/* Decoración */
.venue-item {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 2px 4px;
  text-align: center;
  line-height: 1.15;
  font-size: calc(var(--fp) * 0.085);
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  pointer-events: none;
  overflow: hidden;
}
.venue-item span { overflow: hidden; }
.venue-item--round { border-radius: 50%; }
.venue-item--stage {
  border: 0;
  background: radial-gradient(circle at 30% 30%, #ffcbcb, #ff8989 75%);
  color: #3a1717;
  font-family: var(--font-display);
  font-style: italic;
  font-size: calc(var(--fp) * 0.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), var(--shadow-sm);
}
.venue-item--door {
  transform: translate(-50%, -20%);
  border: 0;
  border-radius: 6px;
  background: var(--venue-wall);
  color: #f4f1ea;
  font-size: calc(var(--fp) * 0.08);
}

/* Modo compacto (celular): mesas como marcadores; tocar abre el detalle */
.floor.venue.is-compact .seat { display: none; }
.floor.venue.is-compact .table-top { inset: 6%; }
.floor.venue.is-compact .table-name,
.floor.venue.is-compact .table-state,
.floor.venue.is-compact .table-nick { display: none; }
.floor.venue.is-compact .table-num {
  display: block;
  font-size: calc(var(--fp) * 0.32);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.floor.venue.is-compact .table-count { font-size: calc(var(--fp) * 0.15); color: var(--text-2); }
.floor.venue.is-compact .table--rect .table-top { inset: 6% 3%; }
.floor.venue.is-compact .table--rect .table-num { display: none; }
.floor.venue.is-compact .table--rect .table-nick { display: block; font-size: calc(var(--fp) * 0.2); }
.floor.venue.is-compact .table.is-full .table-top { background: var(--accent); border-color: var(--accent); }
.floor.venue.is-compact .table.is-full .table-num,
.floor.venue.is-compact .table.is-full .table-count,
.floor.venue.is-compact .table.is-full .table-nick { color: var(--accent-ink); }
.floor.venue.is-compact .table.is-partial .table-top { border: 2px solid var(--accent); }
.floor.venue.is-compact .venue-item { font-size: calc(var(--fp) * 0.13); border-width: 1px; padding: 1px; }
.floor.venue.is-compact .venue-item--stage { font-size: calc(var(--fp) * 0.15); }
body.is-moving .floor.venue.is-compact .table:not(.is-full) .table-top { border: 2px dashed var(--accent); }

/* Ver asientos en pantallas chicas: plano grande con desplazamiento lateral */
.floor-wrap.is-zoomed { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.floor-wrap.is-zoomed .floor.venue { width: 1150px; max-width: none; }

/* Detalle de mesa en modo mover */
.seat-row.is-current { background: var(--accent-soft); border-radius: 10px; }
.seat-actions--move .btn { min-width: 132px; }
.floor.venue .table--rect .table-name,
.floor.venue .table--rect .table-state { display: none; }
.floor.venue .table--rect .table-count { font-size: calc(var(--fp) * 0.105); }
.floor.venue .table-count { white-space: nowrap; }
.floor.venue.is-tiny .table-count { display: none; }
.floor.venue.is-tiny .table-num { font-size: calc(var(--fp) * 0.42); }
.floor.venue.is-tiny .table--rect .table-nick { font-size: calc(var(--fp) * 0.24); }
.floor.venue.is-tiny .venue-item { font-size: calc(var(--fp) * 0.17); }
/* Legibilidad con la paleta coral */
.table-state, .table-nick, .tcard-nick, .answer-nick { color: var(--accent-strong); }
