/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f5f0;
  --surface: #ffffff;
  --surface2: #f2ede8;
  --border: #e4ddd6;
  --text: #2d2522;
  --text-muted: #8a7a72;
  --primary: #c0725a;
  --primary-dark: #a05a44;
  --primary-light: #f5e6e0;
  --green: #4caf82;
  --green-light: #e8f7f0;
  --yellow: #f5a623;
  --yellow-light: #fef6e4;
  --red: #e05252;
  --red-light: #fdeaea;
  --blue: #5b8dee;
  --blue-light: #eaf0fd;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --transition: 0.18s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== HEADER ===== */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ===== MAIN ===== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}

.tab { display: none; }
.tab.active { display: block; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon { display: none; }
.stat-number { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.accent-green { border-color: var(--green); }
.accent-green .stat-number { color: var(--green); }
.accent-yellow { border-color: var(--yellow); }
.accent-yellow .stat-number { color: var(--yellow); }
.accent-red { border-color: var(--red); }
.accent-red .stat-number { color: var(--red); }
.accent-blue { border-color: var(--blue); }
.accent-blue .stat-number { color: var(--blue); }
.accent-purple { border-color: #7c4dcc; }
.accent-purple .stat-number { color: #7c4dcc; }
.accent-indigo { border-color: #1a73e8; }
.accent-indigo .stat-number { color: #1a73e8; }

/* ===== DASHBOARD ===== */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.dashboard-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.balance-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.balance-item {
  flex: 1;
  min-width: 100px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
}
.balance-item.income { background: var(--green-light); }
.balance-item.expense { background: var(--red-light); }
.balance-item.net.positive { background: var(--green-light); }
.balance-item.net.negative { background: var(--red-light); }
.balance-label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.balance-amount { font-size: 1.3rem; font-weight: 700; }
.balance-item.income .balance-amount { color: var(--green); }
.balance-item.expense .balance-amount { color: var(--red); }
.balance-item.net.positive .balance-amount { color: var(--green); }
.balance-item.net.negative .balance-amount { color: var(--red); }

.progress-bar-wrap {
  background: var(--surface2);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width 0.4s ease;
}
.progress-label { font-size: 0.8rem; color: var(--text-muted); text-align: right; }

.group-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.group-row-label { font-size: 0.9rem; flex: 1; }
.group-bar-wrap { flex: 2; background: var(--surface2); border-radius: 99px; height: 8px; overflow: hidden; }
.group-bar { height: 100%; border-radius: 99px; background: var(--primary); }
.group-count { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); min-width: 24px; text-align: right; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 0.9rem;
}
.recent-item .ri-type { font-size: 1.1rem; }
.recent-item .ri-desc { flex: 1; }
.recent-item .ri-amount { font-weight: 600; }
.recent-item .ri-amount.income { color: var(--green); }
.recent-item .ri-amount.expense { color: var(--red); }
.recent-item .ri-date { color: var(--text-muted); font-size: 0.8rem; }

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-wrap { flex: 1; min-width: 180px; }
.search-wrap input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--surface);
  outline: none;
  transition: var(--transition);
}
.search-wrap input:focus { border-color: var(--primary); }
.filter-wrap { display: flex; gap: 8px; }
.filter-wrap select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface);
  cursor: pointer;
  outline: none;
}

.finance-actions { display: flex; gap: 8px; }

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #3a9b6c; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c43c3c; }

/* ===== GUESTS GRID ===== */
.guests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.guest-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  border-top: 3px solid var(--border);
}
.guest-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.guest-card.confirmed { border-color: var(--green); }
.guest-card.pending { border-color: var(--yellow); }
.guest-card.declined { border-color: var(--red); opacity: 0.75; }

.guest-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.guest-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}
.guest-name { font-weight: 600; font-size: 1rem; }
.guest-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.guest-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-confirmed { background: var(--green-light); color: var(--green); }
.badge-pending { background: var(--yellow-light); color: var(--yellow); }
.badge-declined { background: var(--red-light); color: var(--red); }
.badge-group { background: var(--primary-light); color: var(--primary); }
.badge-plus1 { background: var(--blue-light); color: var(--blue); }

.guest-notes { font-size: 0.82rem; color: var(--text-muted); font-style: italic; }

.guest-actions { display: flex; gap: 8px; margin-top: 4px; }
.guest-actions button {
  flex: 1;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}
.guest-actions .btn-edit:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.guest-actions .btn-del:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* Quick status buttons on card */
.status-quick { display: flex; gap: 6px; }
.status-quick button {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}
.status-quick .sq-confirmed { border-color: var(--green); }
.status-quick .sq-confirmed.active, .status-quick .sq-confirmed:hover { background: var(--green); color: #fff; }
.status-quick .sq-pending { border-color: var(--yellow); }
.status-quick .sq-pending.active, .status-quick .sq-pending:hover { background: var(--yellow); color: #fff; }
.status-quick .sq-declined { border-color: var(--red); }
.status-quick .sq-declined.active, .status-quick .sq-declined:hover { background: var(--red); color: #fff; }

/* ===== FINANCE TABLE ===== */
.finance-table-wrap { display: flex; flex-direction: column; gap: 10px; }

.finance-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition: var(--transition);
}
.finance-item:hover { transform: translateX(4px); }
.finance-item.income { border-color: var(--green); }
.finance-item.expense { border-color: var(--red); }

.fi-icon { font-size: 1.4rem; }
.fi-info { flex: 1; }
.fi-desc { font-weight: 600; font-size: 0.95rem; }
.fi-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.fi-amount { font-size: 1.2rem; font-weight: 700; }
.fi-amount.income { color: var(--green); }
.fi-amount.expense { color: var(--red); }
.fi-actions { display: flex; gap: 6px; }
.fi-actions button {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}
.fi-actions .btn-edit:hover { background: var(--primary-light); border-color: var(--primary); }
.fi-actions .btn-del:hover { background: var(--red-light); border-color: var(--red); }

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
.modal.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.modal-box-sm { max-width: 360px; }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-box h2 { font-size: 1.2rem; margin-bottom: 20px; }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  outline: none;
  transition: var(--transition);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--primary); }

.status-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.status-btn {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
}
.status-btn[data-value="confirmed"].active { background: var(--green); color: #fff; border-color: var(--green); }
.status-btn[data-value="pending"].active { background: var(--yellow); color: #fff; border-color: var(--yellow); }
.status-btn[data-value="declined"].active { background: var(--red); color: #fff; border-color: var(--red); }

.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-wrap input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.toggle-label { font-size: 0.9rem; font-weight: 400; color: var(--text); cursor: pointer; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d2522;
  color: #fff;
  padding: 12px 28px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: toastIn 0.2s ease;
}
.toast.hidden { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-state .es-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; }

.badge-photo { background: #f0eafd; color: #7c4dcc; }
.badge-invitation { background: #e8f4fd; color: #1a73e8; }

.photo-quick { margin-top: 2px; }
.pq-btn {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  color: var(--text-muted);
}
.pq-btn.active {
  background: #f0eafd;
  border-color: #7c4dcc;
  color: #7c4dcc;
}
.pq-btn:not(.active):hover {
  background: var(--surface2);
}

.invitation-quick { margin-top: 4px; }
.iq-btn {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  color: var(--text-muted);
}
.iq-btn.active {
  background: #e8f4fd;
  border-color: #1a73e8;
  color: #1a73e8;
}
.iq-btn:not(.active):hover {
  background: var(--surface2);
}

/* ===== GROUPS MODAL ===== */
.groups-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}
.group-manage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 8px;
}
.gmi-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,0.1);
}
.gmi-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.gmi-count { font-size: 0.8rem; color: var(--text-muted); }
.gmi-del {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}
.gmi-del:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }
.gmi-del:disabled { opacity: 0.35; cursor: not-allowed; }

.new-group-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.new-group-inputs input[type="text"] { flex: 1; }
.new-group-inputs input[type="color"] {
  width: 42px; height: 42px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
  flex-shrink: 0;
}

/* ===== MESAS (plan de asientos) ===== */
.toggle-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.toggle-inline input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.seating-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.seating-summary strong { color: var(--text); }
.summary-warn { color: var(--red); font-weight: 600; }

.seating-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

.unseated-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  border: 2px dashed transparent;
  transition: var(--transition);
}
.unseated-panel.dragover { border-color: var(--primary); background: var(--primary-light); }
.unseated-panel h3 { font-size: 0.95rem; margin-bottom: 4px; }
.unseated-count { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.seating-hint { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.unseated-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.unseated-empty { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 16px 0; }

.seat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
  cursor: grab;
  transition: var(--transition);
  user-select: none;
}
.seat-chip:hover { border-color: var(--primary); background: var(--primary-light); }
.seat-chip.dragging { opacity: 0.4; }
.seat-chip.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary); }
.seat-chip.pending { border-style: dashed; }
.seat-chip.pending .chip-name::after { content: ' ⏳'; font-size: 0.7rem; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-seats {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  padding: 1px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}
.chip-x {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.chip-x:hover { background: var(--red-light); color: var(--red); }

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: var(--transition);
}
.table-card.over { border-color: var(--red); }
.table-card.dragover { border-color: var(--primary); background: var(--primary-light); }
.table-card.droptarget { cursor: pointer; border-style: dashed; border-color: var(--border); }
.table-card.droptarget:hover { border-color: var(--primary); background: var(--primary-light); }

.table-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.table-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.table-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface);
}
.table-ring span { position: relative; font-size: 0.78rem; font-weight: 700; }
.table-ring.over span { color: var(--red); }
.table-title { flex: 1; min-width: 0; }
.table-name { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-meta { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.table-card.over .table-meta { color: var(--red); font-weight: 600; }
.table-btns { display: flex; gap: 4px; }
.table-btns button {
  border: 1px solid var(--border);
  background: none;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}
.tbl-edit:hover { background: var(--primary-light); border-color: var(--primary); }
.tbl-del:hover { background: var(--red-light); border-color: var(--red); }

.table-seats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 44px;
}
.table-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ===== PLANO DEL SALÓN ===== */
.hidden { display: none !important; }

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
}
.view-toggle button {
  border: none;
  background: none;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.view-toggle button.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.seating-main { min-width: 0; }

.floor-plan-scroll { overflow-x: auto; border-radius: var(--radius); }

.floor-plan {
  position: relative;
  min-width: 760px;
  aspect-ratio: 2 / 1;
  background:
    radial-gradient(ellipse at 50% 0%, var(--primary-light) 0%, transparent 55%),
    var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.plan-wall-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.plan-table {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow var(--transition), transform 0.1s ease;
  user-select: none;
}
.plan-table::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
}
.plan-table:hover { transform: translate(-50%, -50%) scale(1.08); z-index: 5; }
.plan-table.sel { box-shadow: 0 0 0 3px var(--primary); z-index: 4; }
.plan-table.dragover { box-shadow: 0 0 0 4px var(--primary); transform: translate(-50%, -50%) scale(1.12); z-index: 6; }
.plan-table.droptarget { box-shadow: 0 0 0 2px var(--yellow); }
.plan-table.over::before { background: var(--red-light); }

.plan-table.presidencia { width: 72px; height: 72px; }

.pt-in {
  position: relative;
  text-align: center;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.pt-num { font-weight: 700; font-size: 0.8rem; }
.presidencia .pt-num { font-size: 0.95rem; }
.pt-count { font-size: 0.58rem; color: var(--text-muted); }
.plan-table.over .pt-count { color: var(--red); font-weight: 700; }

.plan-seed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255,255,255,0.65);
  border-radius: var(--radius);
  z-index: 10;
}
.plan-seed p { color: var(--text-muted); font-size: 0.95rem; }

.plan-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 10px 2px 0;
}

.plan-detail { margin-top: 12px; }
.plan-detail .table-card { max-width: 460px; }
.plan-detail-hint { font-size: 0.85rem; color: var(--text-muted); padding: 8px 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .dashboard-row { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; height: auto; padding: 12px 16px; gap: 10px; }
  main { padding: 16px; }
  .guests-grid { grid-template-columns: 1fr; }
  .seating-layout { grid-template-columns: 1fr; }
  .unseated-panel { position: static; max-height: 260px; }
  .tables-grid { grid-template-columns: 1fr; }
}

/* ===== Ajustes (version regalo) ===== */
.settings-welcome { background: var(--primary-light); color: var(--primary); padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.92rem; margin-bottom: 1rem; }


/* ===== Mesas arrastrables en el plano ===== */
.plan-table { touch-action: none; user-select: none; cursor: grab; }
.plan-table.moving { z-index: 20; cursor: grabbing; opacity: 0.9; box-shadow: 0 8px 20px rgba(0,0,0,0.3); transform: translate(-50%, -50%) scale(1.1); transition: none; }


.settings-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }


/* ===== MODO PRUEBA ===== */
.trial-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px;
  padding: 9px 16px;
  background: var(--text);
  color: #fff;
  font-size: 0.84rem;
}
.trial-bar strong { font-weight: 600; }
.trial-actions { display: flex; gap: 14px; align-items: center; }
.trial-link { background: none; border: none; color: #fff; opacity: 0.75; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.trial-link:hover { opacity: 1; }
.trial-cta { color: #fff; background: var(--primary); text-decoration: none; padding: 5px 12px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.trial-cta:hover { background: var(--primary-dark); }
body.trial header { top: 0; }

/* ===== ACCESO / SESIÓN ===== */
.modal-login { background: var(--bg); }
.login-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.login-error { color: var(--red); font-size: 0.85rem; min-height: 1.2em; }
.login-alt { text-decoration: none; display: inline-flex; align-items: center; }
.form-row input[type="text"]#login-code { letter-spacing: 0.08em; text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace; }
.btn-logout {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-logout:hover { background: var(--surface2); color: var(--text); }

/* ===== DIETA Y MENÚS ===== */
.badge-allergy { background: #fdeee4; color: #b5541f; }
.badge-gluten  { background: #f3efe0; color: #7a6520; }
.chip-diet { font-size: 0.78rem; margin-left: 2px; }
.summary-menus { color: var(--text-muted); }
.table-menus { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.table-menus summary { cursor: pointer; font-size: 0.82rem; color: var(--text-muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.table-menus summary::-webkit-details-marker { display: none; }
.table-menus summary::before { content: '▸'; font-size: 0.8rem; transition: transform 0.15s; }
.table-menus[open] summary::before { transform: rotate(90deg); }
.table-menus summary:hover { color: var(--text); }
.menu-rows { display: grid; gap: 6px; margin-top: 8px; }
.menu-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 0.85rem; }
.menu-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-comp { color: var(--text-muted); }
.menu-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.82rem; font-family: inherit; background: var(--surface); }
.menu-select:focus { border-color: var(--primary); outline: none; }

/* ===== PRESIDENCIA ===== */
.pt-num.pt-pres { font-size: 1.25rem; line-height: 1; }
.plan-table.presidencia .pt-count { font-size: 0.62rem; }

/* ===== MARCA ===== */
.login-brand { font-family: 'Fraunces', Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.brand-o { display: inline-block; width: 0.62em; height: 0.62em; vertical-align: -0.06em; margin: 0 0.015em; }

/* ===== RESUMEN EN FINANZAS ===== */
.finance-summary { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }

.code-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-line code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: 0.06em; background: var(--surface2); padding: 6px 12px; border-radius: 8px; }
.btn-mini { padding: 6px 12px; font-size: 0.8rem; }
