/* ============================================================
   ADMIN CSS — Mesa y Comanda Admin Panel
   Premium warm-light restaurant management theme
   Mobile-first, card-based layout
   ============================================================ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Manrope:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties ─── */
:root {
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --primary: #151A40;
  --primary-dark: #0D112B;
  --primary-light: #20275C;
  --primary-hover: #1E2558;
  --primary-alpha: rgba(21, 26, 64, 0.08);
  --text: #151A40;
  --text-secondary: #4A5070;
  --text-muted: #585E7E;
  --border: #DCDFEA;
  --border-light: #EEF0F8;
  --hover: #F6F7FB;
  --success: #1F6B4A;
  --success-light: #E7F2EC;
  --warning: #C2581A;
  --warning-light: #FBEFE6;
  --danger: #B42318;
  --danger-light: #FBECEA;
  --info: #3B4BB8;
  --info-light: #EEF0FF;

  /* Status */
  --st-pendiente-bg: #FBEFE6;
  --st-pendiente: #C2581A;
  --st-confirmada-bg: #E7F2EC;
  --st-confirmada: #1F6B4A;
  --st-cancelada-bg: #FBECEA;
  --st-cancelada: #B42318;
  --st-avisada-bg: #EEF0FF;
  --st-avisada: #3B4BB8;
  --st-menu-bg: #F1EEFF;
  --st-menu: #5B4BB8;
  --st-reserva-bg: #EEF0F8;
  --st-reserva: #151A40;
  --st-noshow-bg: #F6F7FB;
  --st-noshow: #585E7E;

  /* Layout */
  --sidebar-w: 260px;
  --header-h: 64px;
  --bottom-nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(21, 26, 64, 0.04);
  --shadow: 0 2px 10px rgba(21, 26, 64, 0.06);
  --shadow-md: 0 4px 18px rgba(21, 26, 64, 0.08);
  --shadow-lg: 0 8px 30px rgba(21, 26, 64, 0.12);
  --shadow-hover: 0 6px 20px rgba(21, 26, 64, 0.10);

  /* Timing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s var(--ease);
  --transition-fast: 0.15s var(--ease);
  --transition-slow: 0.4s var(--ease);
}
/* Helper class for Material Symbols Rounded */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
}
.nav-icon.material-symbols-rounded {
  display: inline-flex;
}
.bottom-nav-icon.material-symbols-rounded {
  display: inline-flex;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─────────────────────────────────────────────── */
/* LOGIN SCREEN                                     */
/* ─────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F6F7FB 0%, #EEF0F8 50%, #E3E6F2 100%);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeInUp 0.6s var(--ease);
}

.login-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.login-logo-img {
  height: 90px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.login-title {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.login-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 12px;
  padding: 10px;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
}

.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}

.input-icon-wrap input {
  padding-left: 44px;
}

/* ─────────────────────────────────────────────── */
/* APP LAYOUT                                       */
/* ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #151A40;
  border-right: none;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 22px 20px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-container {
  display: flex;
  align-items: left;
  justify-content: left;
  width: 100%;
}

.sidebar-logo-img {
  height: 52px;
  max-height: 54px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s ease;
}

.sidebar-logo-img:hover {
  transform: scale(1.03);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #8A90AD;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  border-radius: 10px;
  margin: 3px 0;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-weight: 700;
}

/* Sidebar Plan Card */
.sidebar-plan-card {
  background: #1C234E;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  margin: 0 12px 14px 12px;
  color: #FFFFFF;
}
.plan-card-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.plan-card-icon-box .material-symbols-rounded {
  font-size: 18px;
  color: #FFFFFF;
}
.plan-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
}
.plan-card-status {
  font-size: 0.75rem;
  color: #8A90AD;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px 0;
}
.plan-card-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1F6B4A;
  display: inline-block;
}
.plan-card-btn {
  display: block;
  width: 100%;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  text-align: center;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.plan-card-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-footer .logout-btn {
  background: transparent;
  color: #8A90AD;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  width: calc(100% - 24px);
  margin: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-footer .logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
}

.logout-btn {
  width: 100%;
  text-align: left;
  color: var(--danger) !important;
}

.logout-btn:hover {
  background: var(--danger-light) !important;
}

/* ─── Sidebar Overlay ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ─── Hamburger Button ─── */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  width: 48px;
  height: 48px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition-fast);
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 24px;
  min-height: 100vh;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ─── Mobile Bottom Nav ─── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 12px rgba(107, 66, 38, 0.08);
  z-index: 998;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav {
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  min-width: 56px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-icon {
  font-size: 1.3rem;
}

.bottom-nav-label {
  font-size: 0.65rem;
  letter-spacing: 0.3px;
}

/* ─────────────────────────────────────────────── */
/* DAY NAVIGATOR                                    */
/* ─────────────────────────────────────────────── */
.day-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(179deg, var(--surface) 0%, #F6F7FB 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid #F6F7FB;
}

.day-nav-arrow {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: all var(--transition);
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.day-nav-arrow:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.day-nav-arrow:active {
  transform: scale(0.95);
}

.day-nav-center {
  text-align: center;
  flex: 1;
  padding: 0 16px;
}

.day-nav-date {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.today-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: var(--radius-pill);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─────────────────────────────────────────────── */
/* STATS GRID                                       */
/* ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border);
  transition: all var(--transition);
  text-align: center;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-primary { border-left-color: var(--primary); }
.stat-success { border-left-color: var(--success); }
.stat-warning { border-left-color: var(--warning); }
.stat-info { border-left-color: var(--info); }

.stat-number {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-primary .stat-number { color: var(--primary); }
.stat-success .stat-number { color: var(--success); }
.stat-warning .stat-number { color: var(--warning); }
.stat-info .stat-number { color: var(--info); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─────────────────────────────────────────────── */
/* SEARCH BAR                                       */
/* ─────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 24px;
}

.search-bar .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 56px;
  padding: 0 24px 0 52px;
  font-size: 1rem;
  border: 1px solid #ffffff;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-alpha), var(--shadow);
}

/* ─────────────────────────────────────────────── */
/* SECTION HEADER                                   */
/* ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
}

.section-header h2 {
  font-size: 1.15rem;
  color: var(--primary);
}

.section-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─────────────────────────────────────────────── */
/* RESERVATION CARDS                                */
/* ─────────────────────────────────────────────── */
.reservations-list {
  min-height: 200px;
}

.reservation-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
  overflow: visible;
  transition: all var(--transition);
  cursor: pointer;
}

.reservation-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.reservation-card.expanded {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-alpha);
}

.card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.card-time {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-status-wrap {
  flex-shrink: 0;
  position: relative;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  white-space: nowrap;
}

.status-badge:hover {
  filter: brightness(0.92);
  transform: scale(1.05);
}

.badge-pendiente {
  background: var(--st-pendiente-bg);
  color: var(--st-pendiente);
}

.badge-confirmada {
  background: var(--st-confirmada-bg);
  color: var(--st-confirmada);
}

.badge-cancelada {
  background: var(--st-cancelada-bg);
  color: var(--st-cancelada);
}

.badge-avisada {
  background: var(--st-avisada-bg);
  color: var(--st-avisada);
}

.badge-menu {
  background: var(--st-menu-bg);
  color: var(--st-menu);
}

.badge-reserva {
  background: var(--st-reserva-bg);
  color: var(--st-reserva);
}

.badge-noshow {
  background: var(--st-noshow-bg);
  color: var(--st-noshow);
}

/* Card Details (expandable) */
.card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
  padding: 0 16px;
  border-top: 0px solid var(--border-light);
}

.reservation-card.expanded .card-details {
  max-height: 600px;
  padding: 16px;
  border-top-width: 1px;
}

.detail-row {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.detail-row strong {
  color: var(--text);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  min-height: 40px;
  cursor: pointer;
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-whatsapp {
  background: #E8F5E9;
  color: #1F6B4A;
  border-color: #C8E6C9;
}
.btn-whatsapp:hover:not(:disabled) {
  background: #C8E6C9;
}

/* ─── Mesa Badges (Mesa asignada / Por asignar) ─── */
.mesa-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  vertical-align: middle;
  line-height: 1.2;
}

.mesa-badge.mesa-assigned {
  background: #fbf5ef;
  color: var(--primary);
  border: 1px solid var(--primary-light);
  box-shadow: 0 1px 2px rgba(21, 26, 64, 0.06);
}

.mesa-badge.mesa-assigned:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.mesa-badge.mesa-unassigned {
  background: #fff8f0;
  color: #C2581A;
  border: 1px dashed #C2581A;
}

.mesa-badge.mesa-unassigned:hover {
  background: #C2581A;
  color: #ffffff;
  border-style: solid;
}

/* ─── Cuenta & Cobro Badges ─── */
.cuenta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  vertical-align: middle;
  line-height: 1.2;
}

.cuenta-badge.cuenta-pendiente {
  background: #FEF9E7;
  color: #9A6700;
  border: 1px solid #F9E79F;
  box-shadow: 0 1px 2px rgba(183, 149, 11, 0.08);
}

.cuenta-badge.cuenta-pendiente:hover {
  background: #F1C40F;
  color: #7D6608;
}

.cuenta-badge.cuenta-cobrada {
  background: #E8F8F5;
  color: #1F6B4A;
  border: 1px solid #A3E4D7;
  box-shadow: 0 1px 2px rgba(17, 122, 101, 0.08);
}

.cuenta-badge.cuenta-cobrada:hover {
  background: #1ABC9C;
  color: #FFFFFF;
}

.cuenta-badge.cuenta-sin-calcular {
  background: #F4ECF7;
  color: #5B4BB8;
  border: 1px dashed #BB8FCE;
}

.cuenta-badge.cuenta-sin-calcular:hover {
  background: #8E44AD;
  color: #FFFFFF;
  border-style: solid;
}

.btn-cuenta {
  background: #F5EEF8;
  color: #5B4BB8;
  border-color: #D7BDE2;
}

.btn-cuenta:hover:not(:disabled) {
  background: #D7BDE2;
}

/* ─── Origen Badges (Web / Reserva Interna) ─── */
.origen-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  user-select: none;
  vertical-align: middle;
  line-height: 1.2;
  transition: all var(--transition-fast);
}

.origen-badge.origen-web {
  background: #EBF5FB;
  color: #2471A3;
  border: 1px solid #AED6F1;
  box-shadow: 0 1px 2px rgba(36, 113, 163, 0.08);
}

.origen-badge.origen-web:hover {
  background: #D4E6F1;
  color: #1B4F72;
}

.origen-badge.origen-interna {
  background: #F5EEF8;
  color: #7D3C98;
  border: 1px solid #D7BDE2;
  box-shadow: 0 1px 2px rgba(125, 60, 152, 0.08);
}

.origen-badge.origen-interna:hover {
  background: #E8DAEF;
  color: #512E5F;
}

/* ─── Modal Calculadora de Cuenta ─── */
.cuenta-calc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.cuenta-desglose-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.86rem;
}

.cuenta-desglose-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cuenta-desglose-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.cuenta-desglose-table tr:hover td {
  background: rgba(21, 26, 64, 0.03);
}

.cuenta-total-highlight {
  background: #F6F7FB;
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
}

.btn-edit {
  background: #E3F2FD;
  color: #1565C0;
  border-color: #BBDEFB;
}
.btn-edit:hover {
  background: #BBDEFB;
}

.btn-delete {
  background: #FFEBEE;
  color: #B42318;
  border-color: #FFCDD2;
}
.btn-delete:hover {
  background: #FFCDD2;
}

/* Status Dropdown */
.status-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 110;
  min-width: 180px;
  padding: 6px;
  animation: slideDown 0.2s var(--ease);
}

.status-dropdown.open {
  display: block;
}

.status-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
}

.status-option:hover {
  filter: brightness(0.95);
}

.status-option.badge-pendiente { color: var(--st-pendiente); }
.status-option.badge-confirmada { color: var(--st-confirmada); }
.status-option.badge-cancelada { color: var(--st-cancelada); }
.status-option.badge-avisada { color: var(--st-avisada); }
.status-option.badge-menu { color: var(--st-menu); }
.status-option.badge-reserva { color: var(--st-reserva); }

.status-option:hover {
  background: var(--hover);
}

/* Niños badge */
.ninos-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Zone tag */
.zone-tag {
  display: inline-block;
  padding: 1px 8px;
  background: var(--primary-alpha);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────── */
/* PHONE LINK                                       */
/* ─────────────────────────────────────────────── */
.phone-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.phone-link:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────── */
/* PAGE TRANSITIONS                                 */
/* ─────────────────────────────────────────────── */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s var(--ease);
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  color: var(--primary);
}

/* ─────────────────────────────────────────────── */
/* FORMS                                            */
/* ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

.form-group textarea {
  height: auto;
  padding: 12px 16px;
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-alpha);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

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

.form-row .form-group {
  flex: 1;
}

/* Form mode toggle */
.form-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
}

.mode-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 28px;
  transition: var(--transition);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.extra-fields {
  transition: all var(--transition);
}

.reservation-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    max-width: 100%;
}

/* ─────────────────────────────────────────────── */
/* BUTTONS                                          */
/* ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--hover);
  color: var(--primary);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #D32F2F;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
  background: #388E3C;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 56px;
  font-size: 1.05rem;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
}

/* ─────────────────────────────────────────────── */
/* CLIENT CARDS                                     */
/* ─────────────────────────────────────────────── */
.clientes-list {
  min-height: 200px;
}

.client-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.client-card:hover {
  box-shadow: var(--shadow);
}

.client-card.expanded {
  box-shadow: var(--shadow-md);
}

.client-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  gap: 16px;
}

.client-info {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.client-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.client-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.client-stat {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.client-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
  padding: 0 16px;
  border-top: 0px solid var(--border-light);
}

.client-card.expanded .client-details {
  max-height: 300px;
  padding: 16px;
  border-top-width: 1px;
}

.client-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.empresa-tag {
  display: inline-block;
  padding: 1px 8px;
  background: var(--info-light);
  color: var(--info);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────── */
/* CONFIGURATION                                    */
/* ─────────────────────────────────────────────── */
.config-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.config-tabs::-webkit-scrollbar { display: none; }

.config-tab {
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: 44px;
}

.config-tab:hover {
  background: var(--hover);
}

.config-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.config-panel {
  display: none;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
}

.config-panel.active {
  display: block;
  animation: fadeIn 0.2s var(--ease);
}

/* Schedule rows */
.schedule-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.schedule-row:last-child {
  border-bottom: none;
}

.schedule-day {
  font-weight: 700;
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  min-width: 100px;
  color: var(--primary);
  padding-top: 4px;
}

.schedule-services {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-service {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 120px;
}

.toggle-input {
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.toggle-input::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.toggle-input:checked {
  background: var(--primary);
}

.toggle-input:checked::before {
  left: 23px;
}

.schedule-hours {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
}

/* Config list items */
.config-list {
  margin-bottom: 16px;
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.config-item:last-child {
  border-bottom: none;
}

.config-item > div {
  flex: 1;
  font-size: 0.9rem;
}

/* WhatsApp template items */
.wa-template-item {
  flex-direction: column;
  align-items: stretch;
}

.wa-template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.wa-template-text {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 8px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

.wa-template-text:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ─────────────────────────────────────────────── */
/* EXPORT                                           */
/* ─────────────────────────────────────────────── */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.export-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  text-align: center;
}

.export-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.export-card h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

.export-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.export-card .form-row {
  margin-bottom: 16px;
  text-align: left;
}

/* ─────────────────────────────────────────────── */
/* MODAL                                            */
/* ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s var(--ease);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 1.2rem;
  color: var(--primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
}

.modal-close:hover {
  background: var(--hover);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
  font-size: 0.95rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* ─────────────────────────────────────────────── */
/* TOAST NOTIFICATIONS                              */
/* ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--info);
  animation: toastIn 0.35s var(--ease);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.toast.toast-out {
  animation: toastOut 0.3s var(--ease) forwards;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────── */
/* LOADING & EMPTY STATES                           */
/* ─────────────────────────────────────────────── */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.loading-spinner p {
  font-size: 0.9rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 1rem;
}

/* ─────────────────────────────────────────────── */
/* AUTOCOMPLETE                                     */
/* ─────────────────────────────────────────────── */
.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
}

.autocomplete-dropdown.open {
  display: block;
  animation: slideDown 0.2s var(--ease);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 0.9rem;
}

.autocomplete-item:hover {
  background: var(--hover);
}

.autocomplete-empty {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─────────────────────────────────────────────── */
/* WHATSAPP TEMPLATE MODAL                          */
/* ─────────────────────────────────────────────── */
.wa-templates {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-option {
  text-decoration: none;
  text-align: center;
}

/* ─────────────────────────────────────────────── */
/* HISTORY LIST                                     */
/* ─────────────────────────────────────────────── */
.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.history-item:last-child {
  border-bottom: none;
}

.history-date {
  font-weight: 600;
  min-width: 80px;
}

/* ─────────────────────────────────────────────── */
/* EDIT FORM (in modal)                             */
/* ─────────────────────────────────────────────── */
.edit-form .form-group {
  margin-bottom: 12px;
}

.edit-form .form-row {
  gap: 12px;
}

/* ─────────────────────────────────────────────── */
/* UTILITY CLASSES                                  */
/* ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ─────────────────────────────────────────────── */
/* ANIMATIONS                                       */
/* ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.form-submit-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* ─────────────────────────────────────────────── */
/* RESPONSIVE: TABLET (768px)                       */
/* ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    max-width: 100%;
  }
}

/* ─────────────────────────────────────────────── */
/* RESPONSIVE: MOBILE (768px)                       */
/* ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar: hidden by default, slides in */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger-btn {
    display: flex;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 12px;
    padding-top: 72px; /* Space for hamburger */
    padding-bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Day navigator */
  .day-navigator {
    padding: 16px;
    margin-bottom: 16px;
  }

  .day-nav-date {
    font-size: 1.15rem;
  }

  .day-nav-arrow {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  /* Compacting print buttons on mobile */
  .dashboard-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 16px !important;
  }
  .dashboard-actions .btn-print {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 6px 4px !important;
    font-size: 0.75rem !important;
    height: 38px !important;
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }
  .btn-text-full {
    display: none !important;
  }
  .btn-text-short {
    display: inline !important;
  }

  /* Search */
  .search-bar {
    margin-bottom: 16px;
  }

  .search-bar input {
    height: 50px;
    font-size: 0.95rem;
  }

  /* Form rows stack */
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* Cards */
  .card-main {
    padding: 14px;
    gap: 12px;
  }

  .card-time {
    font-size: 1.1rem;
    min-width: 50px;
  }

  .card-name {
    font-size: 0.95rem;
  }

  .card-meta {
    font-size: 0.8rem;
  }

  .status-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  /* Config tabs scroll */
  .config-tabs {
    gap: 6px;
  }

  .config-tab {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .config-panel {
    padding: 16px;
  }

  /* Schedule rows */
  .schedule-row {
    flex-direction: column;
    gap: 8px;
  }

  .schedule-day {
    min-width: auto;
  }

  .schedule-service {
    flex-wrap: wrap;
  }

  /* Export */
  .export-grid {
    grid-template-columns: 1fr;
  }

  .export-card {
    padding: 20px;
  }

  /* Modal */
  .modal {
    max-width: 100%;
    max-height: 85vh;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    animation: slideUp 0.3s var(--ease);
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  /* Toast */
  .toast-container {
    bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    max-width: none;
  }

  /* Reservation form */
  .reservation-form {
    padding: 20px;
  }

  /* Page header */
  .page-title {
    font-size: 1.25rem;
  }

  /* Card actions wrap */
  .card-actions {
    flex-direction: column;
  }

  .btn-action {
    justify-content: center;
  }

  /* Login */
  .login-card {
    padding: 32px 24px;
  }

  .login-title {
    font-size: 1.5rem;
  }

  /* Responsive fixes */
  .form-submit-actions {
    flex-direction: column;
    gap: 8px;
  }
  .bottom-nav-item {
    padding: 6px 2px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }
}

/* ─────────────────────────────────────────────── */
/* RESPONSIVE: SMALL MOBILE (<400px)                */
/* ─────────────────────────────────────────────── */
@media (max-width: 400px) {
  .day-nav-date {
    font-size: 1rem;
  }

  .day-nav-arrow {
    width: 44px;
    height: 44px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .card-time {
    min-width: 44px;
    font-size: 1rem;
  }
}

/* ─────────────────────────────────────────────── */
/* DASHBOARD ACTION BUTTONS                         */
/* ─────────────────────────────────────────────── */
.dashboard-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-download {
  background: linear-gradient(354deg, #F6F7FB 0%, #ffffff 100%);
  color: var(--primary);
  border: 1px solid #d3d3d3;
  font-weight: 600;
  min-height: 48px;
  flex: 1;
  min-width: 140px;
}

.btn-download:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-print {
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
  font-weight: 600;
  min-height: 48px;
  min-width: 120px;
}

.btn-print:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-text-short {
  display: none;
}
.btn-text-full {
  display: inline;
}

/* ─────────────────────────────────────────────── */
/* CLIENTS TABLE                                    */
/* ─────────────────────────────────────────────── */
.clients-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
}

.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 700px;
}

.clients-table thead {
  background: linear-gradient(135deg, #F6F7FB 0%, #EEF0F8 100%);
  border-bottom: 2px solid var(--border);
}

.clients-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.clients-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.clients-table tbody tr {
  transition: background var(--transition-fast);
}

.clients-table tbody tr:hover {
  background: var(--hover);
}

.clients-table tbody tr:last-child td {
  border-bottom: none;
}

.clients-table .client-name-cell {
  font-weight: 600;
  color: var(--text);
}

.clients-table .phone-link {
  color: var(--primary);
  font-weight: 500;
}

.clients-table .empresa-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--info-light);
  color: var(--info);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.clients-table .obs-cell {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.clients-table .btn-action {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ─────────────────────────────────────────────── */
/* WHATSAPP TEMPLATE CARDS (Full CRUD)              */
/* ─────────────────────────────────────────────── */
.wa-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}

.wa-card:hover {
  box-shadow: var(--shadow);
}

.wa-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wa-card-header input {
  flex: 1;
  min-width: 120px;
  height: 40px;
  padding: 0 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition-fast);
}

.wa-card-header input:focus {
  border-color: var(--primary);
}

.wa-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.wa-card textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 12px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  line-height: 1.5;
}

.wa-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

.wa-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: white;
}

/* ─────────────────────────────────────────────── */
/* TIPOS EVENTO & CAMPOS CONFIG                     */
/* ─────────────────────────────────────────────── */
.tipo-evento-list {
  margin-bottom: 16px;
}

.tipo-evento-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.tipo-evento-item:last-child {
  border-bottom: none;
}

.tipo-evento-item .tipo-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.tipo-evento-item .tipo-actions {
  display: flex;
  gap: 6px;
}

.campo-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.campo-toggle-row:last-child {
  border-bottom: none;
}

.campo-toggle-row .campo-label {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Tipos de evento y campos: una sola pantalla con secciones */
.te-intro h3 { margin: 0 0 4px; }
.te-intro p { font-size: 0.85rem; margin: 0 0 18px; }
.te-section {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--surface, #fff);
}
.te-section h4 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 2px; font-size: 1rem;
}
.te-section h4 .material-symbols-rounded { font-size: 1.2rem; color: var(--primary); }
.te-ayuda { font-size: 0.82rem; margin: 0 0 10px; }
.te-vacio { font-size: 0.85rem; padding: 8px 16px; }
.te-fijo { font-size: 1.1rem; color: var(--text-secondary, #8a8fa3); padding: 6px; }
.te-add-form { display: flex; gap: 10px; margin-top: 8px; }
.te-add-form input {
  flex: 1; min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  font: inherit; font-size: 0.9rem;
}
.te-campos-list .campo-toggle-row { gap: 12px; padding: 8px 16px; }
.te-campo-nombre {
  flex: 0 1 320px; min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  font: inherit; font-size: 0.9rem; font-weight: 500;
}
.te-campo-original { flex: 1; font-size: 0.78rem; color: var(--text-secondary, #8a8fa3); }
.te-campos-acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .te-section { padding: 14px 12px; }
  .te-campo-original { display: none; }
  .te-campos-acciones .btn { flex: 1; }
}

/* ─────────────────────────────────────────────── */
/* PRINT VIEW (hidden container for printing)       */
/* ─────────────────────────────────────────────── */
.print-view {
  display: none;
}

/* ─────────────────────────────────────────────── */
/* PRINT STYLES                                     */
/* ─────────────────────────────────────────────── */
@page {
  margin: 8mm;
}

@media print {
  .sidebar,
  .hamburger-btn,
  .mobile-bottom-nav,
  .search-bar,
  .card-actions,
  .toast-container,
  .modal-overlay,
  .dashboard-actions,
  .day-nav-arrow,
  .today-badge,
  .status-dropdown {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .reservation-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  .reservation-card .card-details {
    max-height: none !important;
    padding: 8px 16px !important;
    border-top-width: 1px !important;
  }

  .reservation-card.expanded .card-details {
    max-height: none !important;
  }

  .day-navigator {
    box-shadow: none !important;
    border: none !important;
    padding: 10px 0 !important;
    justify-content: center !important;
  }

  .stats-grid {
    display: none !important;
  }

  .page:not(.active) {
    display: none !important;
  }

  .print-view {
    display: block !important;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    page-break-inside: auto;
  }

  .print-table th {
    background: #EEF0F8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 6px 8px;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    border: 1px solid #ccc;
  }

  .print-table td {
    padding: 5px 8px;
    border: 1px solid #ccc;
    vertical-align: top;
  }

  .print-table tr {
    break-inside: avoid;
  }

  .print-section-title {
    font-size: 19px;
    font-weight: 700;
    margin: 12px 0 6px;
    color: #151A40;
  }

  /* ── Reservas Print Table ── */
  .print-section-title-compact {
    font-size: 17px;
    font-weight: 700;
    margin: 14px 0 6px 0;
    border-bottom: 2px solid #151A40;
    padding-bottom: 3px;
    text-transform: none;
    color: #151A40;
  }

  .print-table-reservas {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  .print-table-reservas th {
    background: #F6F7FB !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1px solid #C3C7D6;
    padding: 5px 8px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    text-align: left;
    color: #7a6652;
    letter-spacing: 0.03em;
  }
  .print-table-reservas td {
    border: 1px solid #DCDFEA;
    padding: 5px 8px;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.4;
    color: #222;
  }
  .print-table-reservas tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .print-table-reservas td.center {
    text-align: center;
  }
  .print-table-reservas td.bold {
    font-weight: 700;
  }

  /* ── Card-based Comanda Print Styles ── */
  .print-header-compact {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #151A40;
  }
  .print-header-compact h2 {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
    color: #151A40;
  }
  .print-header-compact p {
    margin: 4px 0 0 0;
    font-size: 16px;
    color: #555;
  }

  /* Individual comanda card */
  .comanda-print-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #fff;
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
  }
  .comanda-print-card-header {
    padding: 10px 16px;
    background: #faf5ef !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border-bottom: 1px solid #DCDFEA;
  }
  .comanda-print-card-header .card-title {
    font-size: 18px;
    font-weight: 700;
    color: #151A40;
    margin: 0;
    font-style: italic;
  }
  .comanda-print-card-header .card-subtitle {
    font-size: 14px;
    color: #666;
    margin: 2px 0 0 0;
  }

  /* 4-column table inside each card */
  .comanda-print-card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.45;
  }
  .comanda-print-card-table th {
    background: #F6F7FB !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1px solid #C3C7D6;
    border-top: none;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    text-align: left;
    color: #7a6652;
    letter-spacing: 0.03em;
  }
  .comanda-print-card-table td {
    border: 1px solid #DCDFEA;
    border-bottom: none;
    padding: 8px 12px;
    vertical-align: top;
    font-size: 15px;
    line-height: 1.55;
    color: #222;
  }
  .comanda-print-card-table td .item-qty {
    font-weight: 800;
    font-size: 1.05em;
    margin-right: 3px;
  }
  .comanda-print-card-table td .item-nota {
    color: #B42318;
    font-weight: 700;
    font-size: 0.9em;
  }
  .comanda-print-card-table td .empty-cell {
    color: #bbb;
    font-style: italic;
  }

  /* Extras / Notas bar below the table */
  .comanda-print-card-extras {
    padding: 6px 12px;
    font-size: 14px;
    color: #333;
    border-top: 1px solid #DCDFEA;
    background: #fdfaf7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: white;
  }
}

/* Card position relative for dropdown */
.reservation-card {
  position: relative;
}

/* ─────────────────────────────────────────────── */
/* ─────────────────────────────────────────────── */
/* CALENDAR POPUP ENHANCED (CON OCUPACIÓN Y TURNOS)*/
/* ─────────────────────────────────────────────── */
.calendar-popup {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s var(--ease);
}

.calendar-popup-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(21, 26, 64, 0.15);
  padding: 20px;
  width: 580px;
  max-width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  animation: slideUp 0.3s var(--ease);
}

.calendar-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-popup-title {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.calendar-popup-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
}

.calendar-popup-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.calendar-popup-close:hover {
  color: var(--primary);
  background: var(--hover);
}

.calendar-summary-banner {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}

.calendar-summary-banner strong {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  background: #F6F7FB;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.calendar-month-label {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: capitalize;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-nav-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 6px;
  width: 100%;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}

.cal-card-day {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease-out;
  position: relative;
  user-select: none;
  box-sizing: border-box;
}

.cal-card-day:hover {
  border-color: var(--primary);
  background: var(--hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.cal-card-day.other-month {
  background: #F7F5F2;
  border-color: #EFEAE5;
  opacity: 0.45;
  cursor: default;
}

.cal-card-day.closed-day {
  background: #F0ECE8;
  border-color: #E2D7CC;
}

.cal-card-day.is-today {
  border-color: var(--primary-light);
  background: #FFFDF9;
  box-shadow: inset 0 0 0 1px var(--primary-light);
}

.cal-card-day.is-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow);
}

.cal-card-day.is-selected .cal-day-num,
.cal-card-day.is-selected .cal-shift-row {
  color: #FFFFFF !important;
}

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3px;
}

.cal-shift-row {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 1px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  justify-content: center;
}

.cal-shift-row.shift-closed {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.cal-shift-icon {
  font-size: 0.7rem;
}

.cal-shift-icon {
  font-size: 0.75rem;
}

.calendar-today-btn {
  width: 100%;
  margin-top: 12px;
}

.day-nav-date {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.day-nav-date:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

/* ─────────────────────────────────────────────── */
/* COMANDAS PAGE                                    */
/* ─────────────────────────────────────────────── */
.comandas-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.comandas-list {
  min-height: 200px;
}

.comanda-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all var(--transition);
}

.comanda-card:hover {
  box-shadow: var(--shadow);
}

.comanda-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, #F6F7FB 0%, #EEF0F8 100%);
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  flex-wrap: wrap;
}

.comanda-card-header .comanda-info {
  flex: 1;
}

.comanda-card-header .comanda-name {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
}

.comanda-card-header .comanda-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.comanda-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.comanda-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.comanda-column {
  padding: 12px;
  border-right: 1px solid var(--border-light);
  min-height: 80px;
}

.comanda-column:last-child {
  border-right: none;
}

.comanda-column-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-alpha);
}

.comanda-item {
  font-size: 0.85rem;
  padding: 3px 0;
  color: var(--text);
  line-height: 1.4;
}

.comanda-item .comanda-qty {
  font-weight: 700;
  color: var(--primary);
  margin-right: 4px;
}

.comanda-item .comanda-note {
  font-size: 0.75rem;
  color: var(--warning);
  font-weight: 600;
  display: block;
  margin-left: 20px;
}

.comanda-notes {
  padding: 10px 16px;
  background: var(--warning-light);
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.comanda-notes strong {
  color: var(--warning);
}

/* No comanda state */
.no-comanda-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px dashed var(--border);
  margin-bottom: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  opacity: 0.8;
  transition: all var(--transition);
}

.no-comanda-card:hover {
  opacity: 1;
  border-color: var(--primary);
}

.no-comanda-info {
  flex: 1;
}

.no-comanda-name {
  font-weight: 600;
  color: var(--text);
}

.no-comanda-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Resumen cocina */
.resumen-cocina {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.resumen-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.resumen-section-title {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-alpha);
}

.resumen-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.9rem;
  border-bottom: 1px dotted var(--border-light);
}

.resumen-item:last-child {
  border-bottom: none;
}

.resumen-item .resumen-qty {
  font-weight: 700;
  color: var(--primary);
  min-width: 30px;
  text-align: right;
}

/* Comanda form in modal */
.comanda-form-section {
  margin-bottom: 20px;
}

.comanda-form-section-title {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comanda-form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}

.comanda-form-row input[type="number"] {
  width: 70px;
  height: 40px;
  text-align: center;
  padding: 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  outline: none;
}

.comanda-form-row input[type="number"]:focus {
  border-color: var(--primary);
}

.comanda-form-row input[type="text"] {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.comanda-form-row input[type="text"]:focus {
  border-color: var(--primary);
}

.comanda-form-row .btn-remove-row {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--danger);
  background: var(--danger-light);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  border: none;
}

.comanda-form-row .btn-remove-row:hover {
  background: var(--danger);
  color: white;
}

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-alpha);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 4px;
}

.btn-add-row:hover {
  background: var(--primary);
  color: white;
  border-style: solid;
}

/* Comanda print view */
.comandas-print-view {
  display: none;
}

/* Print overrides for comandas */
@media print {
  .comandas-print-view {
    display: block !important;
  }

  .comanda-print-block {
    page-break-inside: avoid;
    margin-bottom: 24px;
    border: 1px solid #ccc;
    padding: 12px;
  }

  .comanda-print-header {
    font-size: 14px;
    font-weight: 700;
    color: #151A40;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #151A40;
  }

  .comanda-print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }

  .comanda-print-col {
    padding: 6px 8px;
    border-right: 1px solid #ccc;
    font-size: 11px;
  }

  .comanda-print-col:last-child {
    border-right: none;
  }

  .comanda-print-col-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ccc;
  }

  .comandas-actions {
    display: none !important;
  }
}

/* Responsive comandas */
@media (max-width: 768px) {
  .comanda-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comanda-column {
    border-bottom: 1px solid var(--border-light);
  }

  .comanda-column:nth-child(2) {
    border-right: none;
  }

  .comanda-column:nth-last-child(-n+2) {
    border-bottom: none;
  }

  .comandas-actions {
    flex-direction: column;
  }

  .calendar-popup {
    padding: 0;
    align-items: flex-end;
  }

  .calendar-popup-content {
    width: 100%;
    max-width: 100%;
    padding: 16px 8px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    max-height: 90vh;
    box-sizing: border-box;
  }

  .calendar-days {
    gap: 2px;
  }

  .cal-card-day {
    padding: 3px 1px;
    min-height: 56px;
  }

  .cal-day-num {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  .cal-shift-row {
    font-size: 0.58rem;
  }

  .cal-shift-icon {
    font-size: 0.65rem;
  }

  .resumen-cocina {
    grid-template-columns: 1fr;
  }

  .comanda-form-row {
    flex-wrap: wrap;
  }

  .comanda-form-row input[type="number"] {
    width: 60px;
  }
}

/* Paginación de Clientes */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-page-indicator {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* Modal edición clientes premium grid */
.edit-client-grid-form .form-section-title {
  font-family: 'Lato', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 6px;
  margin: 20px 0 12px 0;
}

.edit-client-grid-form .form-section-title:first-child {
  margin-top: 0;
}

.clients-table th {
  position: sticky;
  top: 0;
  background: #F6F7FB;
}

.clients-table-wrap {
  position: relative;
  max-height: 70vh;
  overflow: auto;
}

/* Dashboard Comanda Integration */
.badge-comanda-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #1F6B4A;
  color: white;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.comanda-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.comanda-mini-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comanda-mini-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.comanda-mini-item {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.comanda-mini-item strong {
  color: var(--primary);
  background: var(--primary-alpha);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.75rem;
}

.comanda-mini-note {
  color: var(--danger);
  font-weight: bold;
  cursor: help;
}

.btn-action.btn-comanda {
  background-color: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
}

.btn-action.btn-comanda:hover {
  background-color: var(--primary-dark);
}

/* ── PIN Code Styles ── */
.pin-form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px !important;
}

.pin-label {
  font-size: 0.8rem !important;
  letter-spacing: 0.1em;
  font-weight: 700 !important;
  color: var(--text-secondary);
  margin-bottom: 8px !important;
  text-transform: uppercase;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 20px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background-color: transparent;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background-color: var(--primary);
  transform: scale(1.15);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 260px;
  margin: 0 auto 20px;
}

.pin-key {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--surface);
  font-family: inherit;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  padding: 0;
  margin: 0;
  transition: all var(--transition-fast) !important;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
}

.pin-key:active,
.pin-key.active {
  background-color: var(--hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(0.92);
}

.pin-key-action {
  font-size: 18px;
  background-color: var(--border-light);
  border-color: transparent;
}

.pin-key-action:active,
.pin-key-action.active {
  background-color: var(--border);
  color: var(--text);
}

/* ── Admin Booking Widget Iframe ── */
.nr-iframe-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  background-color: var(--surface);
  transition: all var(--transition);
}

.nr-iframe-container iframe {
  width: 100%;
  height: 980px;
  border: none;
  display: block;
}

#lbl-reserva-rapida.active,
#lbl-reserva-completa.active {
  font-weight: 700;
  color: var(--primary);
}

/* ── Custom Print Styles for Comandas and Kitchen Summary ── */
.resumen-print-view {
  display: none;
}

@media print {
  /* Ocultar el layout principal de la aplicación al imprimir comandas o resumen total */
  body.printing-custom-view #app {
    display: none !important;
  }

  body.printing-custom-view .comandas-print-view,
  body.printing-custom-view .resumen-print-view,
  body.printing-custom-view #print-container {
    display: block !important;
  }

  /* Tabla Estilo Columnas Excel */
  .comanda-print-excel-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 10px;
    background: #ffffff;
  }

  .comanda-print-excel-table th,
  .comanda-print-excel-table td {
    border: 1.5px solid #000000 !important; /* Bordes gruesos estilo Excel */
    padding: 6px 8px;
    font-size: 11px;
    text-align: left;
    vertical-align: top;
    color: #000000 !important;
  }

  .comanda-print-excel-table th {
    background: #f2f2f2 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.05em;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .comanda-print-excel-table td.empty-cell {
    color: #999999 !important;
    text-align: center;
    font-style: italic;
  }

  .comanda-print-qty {
    font-weight: 800;
    margin-right: 4px;
    background: #e1e7ed !important;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid #7f8c8d;
    display: inline-block;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .comanda-print-note {
    color: #B42318 !important;
    font-weight: 700;
    font-size: 9px;
    margin-left: 4px;
  }

  /* Estilos Impresión Resumen Cocina */
  .resumen-print-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
  }

  .resumen-print-section {
    border: 1.5px solid #000000;
    border-radius: 6px;
    padding: 14px;
    background: #ffffff;
    page-break-inside: avoid;
  }

  .resumen-print-section-title {
    font-size: 17px;
    font-weight: 800;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #151A40;
  }

  .resumen-print-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    padding: 5px 0;
    border-bottom: 1px dashed #7f8c8d;
  }

  .resumen-print-item:last-child {
    border-bottom: none;
  }

  .resumen-print-item.empty {
    justify-content: center;
    color: #999999;
    font-style: italic;
  }

  .resumen-print-qty {
    font-weight: 800;
    font-size: 17px;
    background: #e1e7ed !important;
    padding: 2px 6px;
    border: 1.5px solid #000000;
    border-radius: 4px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ── Contrato de Entrega a Cuenta Print Styles ── */
.contrato-print-view {
  display: none;
}

@media print {
  body.printing-custom-view .contrato-print-view {
    display: block !important;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: #000000 !important;
    background: #ffffff !important;
    padding: 30px 40px;
    font-size: 18px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
  }

  .contrato-header {
    text-align: center;
    margin-bottom: 25px;
  }

  .contrato-logo {
    max-height: 80px;
    display: block;
    margin: 0 auto 15px auto;
  }

  .contrato-title {
    font-size: 21px;
    font-weight: 700;
    text-transform: uppercase;
    color: #151A40 !important;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-align: center;
  }

  .contrato-date {
    text-align: right;
    font-size: 18px;
    margin-bottom: 25px;
    font-style: italic;
  }

  .contrato-section-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 1.5px solid #151A40;
    padding-bottom: 4px;
    color: #151A40 !important;
  }

  .contrato-text {
    margin-bottom: 12px;
    text-align: justify;
  }

  .contrato-list {
    margin-bottom: 20px;
    padding-left: 20px;
  }

  .contrato-list li {
    margin-bottom: 8px;
    text-align: justify;
  }

  .contrato-table-entregas {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 25px 0;
  }

  .contrato-table-entregas th,
  .contrato-table-entregas td {
    border: 1px solid #dddddd !important;
    padding: 8px 12px;
    text-align: left;
    font-size: 17px;
  }

  .contrato-table-entregas th {
    background-color: #f8f9fa !important;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .contrato-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    page-break-inside: avoid;
  }

  .contrato-signature-block {
    width: 45%;
    text-align: center;
  }

  .contrato-signature-line {
    border-top: 1px solid #000000;
    margin-top: 50px;
    margin-bottom: 8px;
  }

  .contrato-signature-label {
    font-size: 17px;
    font-weight: bold;
  }

  .contrato-footer {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 15px;
    color: #777777 !important;
    border-top: 1px solid #eeeeee;
    padding-top: 8px;
    page-break-before: avoid;
  }
}

/* ============================================================
   FICHA DE CLIENTE PREMIUM
   ============================================================ */

.client-profile-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px;
}

.client-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.client-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #151A40;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(28, 40, 75, 0.15);
}

.client-profile-info {
  flex: 1;
}

.client-vip-tag {
  background: #151A40;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.client-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.client-stat-box {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  transition: transform 0.2s;
}

.client-stat-box:hover {
  transform: translateY(-2px);
}

.client-stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #151A40;
  line-height: 1.2;
}

.client-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.client-last-visit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text);
  margin-top: 4px;
}

.client-notes-box {
  background: #f8f9fa;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-left: 3px solid var(--primary);
  margin-top: 4px;
}

.client-notes-text {
  margin: 0;
  font-size: 0.85rem;
  font-style: italic;
  color: #555;
  line-height: 1.4;
}





/* ─────────────────────────────────────────────── */
/* DAY NAVIGATOR (Modern MYC)                      */
/* ─────────────────────────────────────────────── */
.day-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(21, 26, 64, 0.04);
  border: 1px solid #DCDFEA;
  padding: 14px 24px;
  margin-bottom: 20px;
}

.day-nav-arrow {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #151A40;
  background: #FFFFFF;
  border: 1px solid #DCDFEA;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.day-nav-arrow:hover {
  background: #151A40;
  color: #FFFFFF;
  border-color: #151A40;
  transform: scale(1.04);
}

.day-nav-center {
  text-align: center;
  flex: 1;
}

.day-nav-date-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.day-nav-cal-icon {
  font-size: 1.2rem;
  color: #151A40;
}

.day-nav-date {
  font-size: 1.25rem;
  font-weight: 800;
  color: #151A40;
  margin: 0;
}

.day-nav-subtitle {
  font-size: 0.78rem;
  color: #585E7E;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────── */
/* STATS GRID (Modern MYC Mockup)                  */
/* ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(21, 26, 64, 0.04);
  border: 1px solid #DCDFEA;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(21, 26, 64, 0.08);
}

.stat-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-box .material-symbols-rounded {
  font-size: 24px;
}

.stat-icon-navy {
  background: #151A40;
  color: #FFFFFF;
}

.stat-icon-mint {
  background: #E7F2EC;
  color: #1F6B4A;
}

.stat-icon-orange {
  background: #FBEFE6;
  color: #C2581A;
}

.stat-icon-blue {
  background: #EEF0FF;
  color: #3B4BB8;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: 'Lato', sans-serif;
  font-size: 1.85rem;
  font-weight: 900;
  color: #151A40;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #151A40;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.stat-sub {
  display: block;
  font-weight: 500;
  color: #585E7E;
  text-transform: lowercase;
}

/* ─────────────────────────────────────────────── */
/* UNIFIED DASHBOARD TOOLBAR (Single-Line Layout)  */
/* ─────────────────────────────────────────────── */
.dashboard-toolbar-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.filter-pills-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-btn {
  height: 44px !important;
  box-sizing: border-box !important;
  padding: 0 16px !important;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #DCDFEA;
  background: #FFFFFF;
  color: #151A40;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #C3C7D6;
  background: #F6F7FB;
}

.filter-btn.active {
  background: #151A40 !important;
  color: #FFFFFF !important;
  border-color: #151A40 !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(21, 26, 64, 0.15);
}

.toolbar-search-bar {
  flex: 1;
  min-width: 180px;
  max-width: none;
  height: 44px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  background: #FFFFFF;
  border: 1px solid #DCDFEA;
  border-radius: 10px;
  padding: 0 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(21, 26, 64, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.toolbar-search-bar:focus-within {
  border-color: #151A40;
  box-shadow: 0 0 0 3px rgba(21, 26, 64, 0.08);
}

.toolbar-search-bar .search-icon {
  position: static !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.25rem !important;
  color: #585E7E !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none;
  flex-shrink: 0;
}

.toolbar-search-bar input {
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  font-size: 0.88rem !important;
  color: #151A40 !important;
  background: transparent !important;
  box-shadow: none !important;
  line-height: normal !important;
}

.toolbar-search-bar input::placeholder {
  color: #585E7E !important;
  font-size: 0.88rem !important;
}

.toolbar-search-bar .search-filter-icon {
  position: static !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #585E7E !important;
  font-size: 1.2rem !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
}

.toolbar-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Print Dropdown Popover */
.print-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.btn-icon-only {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px;
  background: #151A40;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(21, 26, 64, 0.15);
  transition: all 0.2s ease;
}

.btn-icon-only:hover {
  background: #1E2558;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 26, 64, 0.22);
}

.btn-icon-only .material-symbols-rounded {
  font-size: 1.35rem;
}

.print-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #DCDFEA;
  box-shadow: 0 10px 25px -5px rgba(21, 26, 64, 0.18), 0 8px 10px -6px rgba(21, 26, 64, 0.1);
  min-width: 220px;
  padding: 6px;
  z-index: 1100;
  display: none;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.print-dropdown-menu.show {
  display: flex;
}

.print-dropdown-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #585E7E;
  padding: 8px 12px 4px 12px;
}

.print-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #151A40;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.print-menu-item .material-symbols-rounded {
  font-size: 1.15rem;
  color: #585E7E;
}

.print-menu-item:hover {
  background: #EFF2FA;
  color: #151A40;
}

.print-menu-item:hover .material-symbols-rounded {
  color: #151A40;
}

.print-menu-divider {
  height: 1px;
  background: #DCDFEA;
  margin: 4px 6px;
}

.print-menu-item-all {
  color: #0F1226;
  font-weight: 700;
}

/* Compact Block Button */
.btn-block-compact {
  background: #B42318;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  padding: 0 16px !important;
  font-weight: 700;
  font-size: 0.86rem;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.2);
}

.btn-block-compact:hover {
  background: #BE123C;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28);
}

.btn-block-compact .material-symbols-rounded {
  font-size: 1.15rem;
}

/* ─────────────────────────────────────────────── */
/* SERVICIOS CONFIGURATION PANEL                  */
/* ─────────────────────────────────────────────── */
.service-config-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid #DCDFEA;
  border-radius: 10px;
  gap: 16px;
  transition: all 0.2s ease;
}

.service-config-card:hover {
  border-color: #C3C7D6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.service-config-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.service-config-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #EFF2FA;
  color: #151A40;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.service-config-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.service-config-name {
  font-weight: 700;
  font-size: 1rem;
  color: #151A40;
}

.service-config-id {
  font-size: 0.75rem;
  font-weight: 600;
  color: #585E7E;
  background: #EEF0F8;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.service-config-hours {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #585E7E;
}

.service-config-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-toggle-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.service-toggle-btn.active {
  background: #E7F2EC;
  color: #065F46;
}

.service-toggle-btn.inactive {
  background: #FBECEA;
  color: #991B1B;
}

/* ─────────────────────────────────────────────── */
/* ZONAS / ESPACIOS CONFIGURATION PANEL           */
/* ─────────────────────────────────────────────── */
.zona-config-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid #DCDFEA;
  border-radius: 10px;
  gap: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.zona-config-card:hover {
  border-color: #C3C7D6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.zona-config-card.inactive-card {
  opacity: 0.65;
  background: #F6F7FB;
}

.zona-config-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.zona-config-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #EFF2FA;
  color: #151A40;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.zona-config-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zona-config-name {
  font-weight: 700;
  font-size: 1rem;
  color: #151A40;
}

.zona-config-capacity {
  font-size: 0.82rem;
  color: #585E7E;
  display: flex;
  align-items: center;
  gap: 6px;
}

.zona-capacity-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #151A40;
  background: #E8EEF5;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zona-config-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zona-toggle-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zona-toggle-btn.active {
  background: #E7F2EC;
  color: #065F46;
}

.zona-toggle-btn.inactive {
  background: #FBECEA;
  color: #991B1B;
}

@media (max-width: 960px) {
  .dashboard-toolbar-line {
    flex-wrap: wrap;
  }
  .filter-pills-group {
    order: 1;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
  }
  .toolbar-search-bar {
    order: 2;
    min-width: 100%;
  }
  .toolbar-actions-group {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   MÓDULO: PLANO DE SALA INTERACTIVO Y EDITOR DE MESAS (Mesa y Comanda)
   ══════════════════════════════════════════════════════════════════════════ */

/* Selector de Modo de Vista (Toolbar) */
.plano-view-selector {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-view-mode:hover {
  color: var(--text);
  background: var(--primary-alpha, rgba(44, 62, 80, 0.06));
}

.btn-view-mode.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-view-mode .material-symbols-rounded {
  font-size: 1.1rem;
}

/* Layout del Grid del Dashboard según la vista seleccionada */
.dashboard-content-grid {
  width: 100%;
  transition: all 0.25s ease;
}

/* Vista Lista (Por defecto) */
.dashboard-content-grid.view-mode-lista .dashboard-list-panel {
  width: 100%;
  display: block;
}

.dashboard-content-grid.view-mode-lista .dashboard-plano-panel {
  display: none !important;
}

/* Vista Dividida (Split: Lista a la izquierda, Plano a la derecha) */
.dashboard-content-grid.view-mode-split {
  display: grid;
  grid-template-columns: minmax(350px, 420px) 1fr;
  gap: 20px;
  align-items: stretch;
}

.dashboard-content-grid.view-mode-split .dashboard-list-panel {
  display: block;
  max-height: calc(100vh - 190px);
  min-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
}

.dashboard-content-grid.view-mode-split .dashboard-list-panel::-webkit-scrollbar {
  width: 6px;
}

.dashboard-content-grid.view-mode-split .dashboard-list-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.dashboard-content-grid.view-mode-split .dashboard-plano-panel {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 190px);
  min-height: 600px;
}

/* Vista Plano Completo */
.dashboard-content-grid.view-mode-mapa .dashboard-list-panel {
  display: none !important;
}

.dashboard-content-grid.view-mode-mapa .dashboard-plano-panel {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 640px;
}

/* Contenedor Principal del Plano de Sala (Diseño Limpio en Blanco) */
.dashboard-plano-panel {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(21, 26, 64, 0.06);
  position: relative;
}

/* Pantalla Completa */
.dashboard-plano-panel.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  z-index: 99999 !important;
}

/* Barra Superior del Plano */
.plano-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
}

/* Tabs de Zonas / Salones */
.plano-zones-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.plano-zones-tabs::-webkit-scrollbar {
  height: 4px;
}

.plano-zones-tabs::-webkit-scrollbar-thumb {
  background: rgba(21, 26, 64, 0.15);
  border-radius: 4px;
}

.plano-zone-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 6px;
  position: relative;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.plano-zone-tab:hover {
  color: var(--primary);
  background: #EEF0F8;
}

.plano-zone-tab.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(21, 26, 64, 0.15);
}

/* Acciones y Herramientas del Plano */
.plano-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plano-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F6F7FB;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.plano-stat-pax,
.plano-stat-mesas {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.plano-stats-pill .material-symbols-rounded {
  font-size: 1rem;
  color: var(--primary);
}

.plano-stat-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.btn-plano-mode {
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  background: #ffffff !important;
  font-size: 0.82rem !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-plano-mode:hover {
  background: #EEF0F8 !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.btn-plano-mode.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}

.plano-design-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Contenedor del Canvas (Fondo Blanco con Cuadrícula Sutil) */
.plano-canvas-container {
  flex: 1;
  position: relative;
  overflow: auto;
  background-color: #F6F7FB;
  background-image: radial-gradient(#C3C7D6 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  display: flex;
  align-items: stretch;
  user-select: none;
}

.plano-canvas {
  position: relative;
  width: 100%;
  min-width: 720px;
  height: 100%;
  min-height: 560px;
}

/* Modo Diseño Activo sobre el Canvas */
.plano-canvas-container.mode-design .plano-canvas {
  cursor: crosshair;
}

.plano-canvas-container.mode-design .plano-mesa {
  cursor: grab;
}

.plano-canvas-container.mode-design .plano-mesa:active {
  cursor: grabbing;
}

.plano-canvas-container.mode-design .plano-elem {
  cursor: grab;
}

.plano-canvas-container.mode-design .plano-elem:active {
  cursor: grabbing;
}

/* Elementos de Texto / Rótulos */
.plano-elem-texto {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(21, 26, 64, 0.05);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 0 2px 8px rgba(21, 26, 64, 0.06);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plano-elem-texto .btn-del-elem {
  display: none;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: #ffffff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mode-design .plano-elem-texto:hover .btn-del-elem {
  display: inline-flex;
}

/* Elementos Mesas (Base) */
.plano-mesa {
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
  font-family: inherit;
  z-index: 5;
  transition: box-shadow 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
  cursor: pointer;
}

.plano-mesa:hover {
  transform: translate(-50%, -50%) scale(1.03);
  z-index: 10;
}

.plano-mesa.is-dragging {
  opacity: 0.92;
  transform: translate(-50%, -50%) scale(1.06) !important;
  box-shadow: 0 16px 36px rgba(21, 26, 64, 0.35) !important;
  z-index: 999 !important;
  transition: none !important;
}

.plano-mesa.highlight-pulse {
  animation: tablePulse 1.2s ease 3;
}

@keyframes tablePulse {
  0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(21, 26, 64, 0.7); }
  50% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 14px rgba(21, 26, 64, 0); }
  100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(21, 26, 64, 0); }
}

/* Mesas Rectangulares y Cuadradas (Libres por defecto) */
.plano-mesa-rect,
.plano-mesa-cuadrada {
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #C3C7D6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-sizing: border-box;
}

.plano-mesa-rect {
  min-width: 132px;
  min-height: 84px;
}

.plano-mesa-cuadrada {
  min-width: 108px;
  min-height: 108px;
  aspect-ratio: 1 / 1;
}

.plano-mesa-rect .plano-mesa-header,
.plano-mesa-cuadrada .plano-mesa-header {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F6F7FB;
  border-bottom: 1px solid #DCDFEA;
}

.plano-mesa-num {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--primary);
}

.plano-mesa-cap {
  font-size: 0.70rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.plano-mesa-rect .plano-mesa-body,
.plano-mesa-cuadrada .plano-mesa-body {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  flex: 1;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: #ffffff;
}

/* Mesas Redondas (Círculo Perfecto con Aspect Ratio 1:1) */
.plano-mesa-redonda {
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
  min-width: 120px;
  min-height: 120px;
  background: #ffffff;
  border: 2.5px solid #C3C7D6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 11px 8px;
  box-sizing: border-box;
  overflow: visible;
}

.plano-mesa-redonda .plano-mesa-header {
  position: static !important;
  background: #EEF0F8;
  border: 1px solid #DCDFEA;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  max-width: 88%;
}

.plano-mesa-redonda .plano-mesa-body {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
}

/* ESTADOS DE MESAS */

/* 1. LIBRE */
.plano-mesa.status-libre {
  border-color: #C3C7D6;
  background: #ffffff;
}

.plano-mesa.status-libre:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(21, 26, 64, 0.12);
}

.plano-mesa-status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #3B4BB8;
  background: rgba(2, 132, 199, 0.08);
  padding: 3px 10px;
  border-radius: 12px;
}

/* 2. OCUPADA / ASIGNADA (AZUL CORPORATIVO #151A40) */
.plano-mesa.status-confirmada,
.plano-mesa.status-ocupada {
  border-color: #0d112b !important;
  background: #151a40 !important;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(21, 26, 64, 0.28);
}

.plano-mesa.status-confirmada .plano-mesa-header,
.plano-mesa.status-ocupada .plano-mesa-header {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.plano-mesa.status-confirmada .plano-mesa-num,
.plano-mesa.status-ocupada .plano-mesa-num {
  color: #ffffff !important;
}

.plano-mesa.status-confirmada .plano-mesa-cap,
.plano-mesa.status-ocupada .plano-mesa-cap {
  color: #93c5fd !important;
}

.plano-mesa.status-confirmada .plano-mesa-body,
.plano-mesa.status-ocupada .plano-mesa-body {
  background: transparent !important;
  color: #ffffff;
}

.plano-mesa-time-pax {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.2px;
}

.plano-mesa-time-pax .material-symbols-rounded {
  font-size: 1.05rem;
  color: #93c5fd;
}

/* Nombre del cliente fuera de la mesa (elegante badge inferior) */
.plano-mesa-outside-name {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #0F1226;
  border: 1.5px solid #C3C7D6;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10);
  pointer-events: none;
  z-index: 15;
  white-space: nowrap;
  max-width: 150px;
}

.plano-mesa-outside-name .material-symbols-rounded {
  font-size: 0.9rem;
  color: #3B4BB8;
  flex-shrink: 0;
}

.plano-mesa-outside-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plano-mesa-redonda.status-confirmada,
.plano-mesa-redonda.status-ocupada {
  border-color: #0d112b !important;
  background: #151a40 !important;
}

.plano-mesa-redonda .round-booking-time {
  font-size: 0.80rem;
  font-weight: 800;
  color: #ffffff;
}

/* 3. PENDIENTE (Azul marino con indicador ámbar) */
.plano-mesa.status-pendiente {
  border-color: #d97706 !important;
  background: #1e2558 !important;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.25);
}

.plano-mesa.status-pendiente .plano-mesa-header {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

.plano-mesa.status-pendiente .plano-mesa-num {
  color: #fef3c7 !important;
}

.plano-mesa.status-pendiente .plano-mesa-cap {
  color: #fde68a !important;
}

.plano-mesa.status-pendiente .plano-mesa-body {
  background: transparent !important;
  color: #ffffff;
}

/* 4. MODO DISEÑO: Acciones Rápidas (Duplicar y Eliminar mesa fuera del círculo) */
.plano-mesa-quick-actions {
  display: none;
  position: absolute;
  top: -14px;
  right: -8px;
  align-items: center;
  gap: 5px;
  z-index: 30;
  pointer-events: auto;
}

.mode-design .plano-mesa-quick-actions {
  display: inline-flex;
}

.btn-quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  padding: 0;
}

.btn-quick-action:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-quick-action:active {
  transform: scale(0.95);
}

.btn-quick-duplicate {
  background: #ffffff;
  color: #151a40;
  border: 1.5px solid #C3C7D6;
}

.btn-quick-duplicate:hover {
  background: #F6F7FB;
  color: #3B4BB8;
  border-color: #38bdf8;
}

.btn-quick-duplicate .material-symbols-rounded {
  font-size: 15px;
  font-weight: 600;
}

.btn-quick-delete {
  background: #ef4444;
  color: #ffffff;
  border: 1.5px solid #ffffff;
}

.btn-quick-delete:hover {
  background: #dc2626;
}

.btn-quick-delete .material-symbols-rounded {
  font-size: 16px;
  font-weight: 600;
}

/* Estado Vacío de Zona (Blanco elegante) */
.plano-empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 32px;
  background: #ffffff;
  border: 2px dashed #C3C7D6;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.plano-empty-icon {
  font-size: 3.5rem;
  color: var(--primary);
  opacity: 0.85;
  margin-bottom: 8px;
}

/* Modal Popup rápido de asignación o inspección de mesa */
.plano-quick-assign-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.plano-quick-assign-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.plano-quick-assign-item:hover {
  background: var(--primary-alpha, rgba(44, 62, 80, 0.05));
  border-color: var(--primary);
  transform: translateX(4px);
}

.plano-quick-assign-pax {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .dashboard-content-grid.view-mode-split {
    grid-template-columns: 1fr;
  }
  .dashboard-content-grid.view-mode-split .dashboard-list-panel {
    max-height: 380px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   PULIDO DE LANZAMIENTO (octubre 2026)
   Correcciones de visualización en móvil, tablet y escritorio.
   Va al final para prevalecer sobre las capas anteriores.
   ══════════════════════════════════════════════════════════════════════════ */

::selection { background: rgba(21, 26, 64, 0.16); color: var(--primary); }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Iconos dentro de botones de texto */
.btn-ic {
  font-size: 1.05em;
  vertical-align: -0.18em;
}

/* Tarjetas de estadísticas: no son clicables, sin efecto de elevación */
.stat-card:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(21, 26, 64, 0.04);
}
.stat-card { min-width: 0; }
.stat-details { min-width: 0; }

/* Las 4 tarjetas no caben en tablet ni móvil: rejilla 2 × 2 */
@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-icon-box { width: 40px; height: 40px; border-radius: 10px; }
  .stat-icon-box .material-symbols-rounded { font-size: 20px; }
  .stat-number { font-size: 1.5rem; }
  .stat-label, .stat-sub { font-size: 0.7rem; }
}

/* Datos de la reserva: que los distintivos (mesa, origen) bajen de línea en vez de cortarse con "…" */
.card-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.7;
}
.card-meta .mesa-badge,
.card-meta .origen-badge,
.card-meta .phone-link { white-space: nowrap; }
.card-time { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Cabecera de sección (Comidas / Cenas) en pantallas estrechas */
@media (max-width: 768px) {
  .section-header {
    flex-wrap: wrap;
    gap: 2px 12px;
  }
  .section-header .section-count {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }
}

/* Barra de herramientas del inicio en tablet: filtros + acciones en una fila, buscador debajo */
@media (min-width: 769px) and (max-width: 960px) {
  .filter-pills-group { order: 1; width: auto; flex: 1 1 auto; }
  .toolbar-actions-group { order: 2; width: auto; }
  .toolbar-search-bar { order: 3; flex: 1 1 100%; }
}

/* Navegación inferior móvil: etiquetas legibles (mín. 11 px) */
.bottom-nav-item,
.bottom-nav-label {
  font-size: 0.72rem;
}
.bottom-nav-item { min-height: 52px; justify-content: center; }

/* Pestañas de Configuración: en escritorio se reparten en varias filas; en móvil se desplazan con aviso visual */
@media (min-width: 1025px) {
  .config-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
}
@media (max-width: 1024px) {
  .config-tabs {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
            mask-image: linear-gradient(to right, #000 85%, transparent);
    padding-right: 32px;
  }
}

/* Horarios: alinear los interruptores en columna */
.schedule-service .toggle-label > span:first-child {
  min-width: 7.5rem;
}
@media (max-width: 768px) {
  .schedule-row { flex-direction: column; gap: 8px; }
  .schedule-day { min-width: 0; padding-top: 0; }
}

/* Clientes: columna fija con nombre y acciones; resto de columnas ordenadas por utilidad */
.clients-table { min-width: 0; width: max-content; min-width: 100%; }
.clients-table .client-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-width: 220px;
  max-width: 260px;
}
.clients-table thead .client-sticky-col { background: #F6F7FB; z-index: 3; }
.clients-table tbody tr:hover .client-sticky-col { background: var(--hover); }
.client-cell { display: flex; flex-direction: column; gap: 6px; }
.client-cell .client-name-cell { font-weight: 700; line-height: 1.3; }
.client-actions { display: flex; gap: 6px; }
.client-actions .btn-action { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.clients-table .cell-nowrap { white-space: nowrap; }
.clients-table .cell-num { text-align: center; font-variant-numeric: tabular-nums; }
.clients-table .obs-cell { min-width: 160px; max-width: 280px; }
@media (max-width: 768px) {
  .clients-table .client-sticky-col { min-width: 168px; max-width: 190px; }
  .client-actions .btn-action { font-size: 0; gap: 0; padding: 6px 8px; }
  .client-actions .btn-action .btn-ic { font-size: 18px; }
}

/* Objetivos táctiles cómodos en pantallas táctiles */
@media (pointer: coarse) {
  .status-badge { min-height: 32px; padding-inline: 12px; }
  .day-nav-arrow, .calendar-nav-btn { min-width: 44px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card, .reservation-card, .config-tab { transition: none; }
}

/* Paginación de clientes en móvil */
.pagination-page-indicator { white-space: nowrap; }
.pagination-controls .btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
@media (max-width: 768px) {
  .pagination-container { flex-wrap: wrap; gap: 10px; justify-content: center !important; }
  .pagination-info { flex-basis: 100%; text-align: center; }
  .pagination-controls { width: 100%; justify-content: space-between; }
}

/* Móvil: el botón de menú se desplaza con la página para no tapar las tarjetas
   (la navegación principal ya está en la barra inferior) */
@media (max-width: 768px) {
  .hamburger-btn { position: absolute; }
}

/* Variables que usaban algunas pantallas (Ajustes, modales) sin estar definidas:
   sin ellas los campos salían sin borde y algunos textos sin color. */
:root {
  --bg-card: var(--surface);
  --bg-input: var(--surface);
  --border-color: var(--border);
  --danger-color: var(--danger);
  --font-heading: 'Lato', sans-serif;
  --primary-rgb: 21, 26, 64;
  --radius-md: 10px;
  --secondary-light: var(--hover);
  --shadow-sm: 0 1px 4px rgba(21, 26, 64, 0.06);
  --text-dark: var(--text);
  --text-primary: var(--text);
}

/* ══ Segunda pasada: tablet y primera impresión ══ */

/* Tablet (769–1180 px): menú lateral compacto solo con iconos para ganar espacio de trabajo */
@media (min-width: 769px) and (max-width: 1180px) {
  :root { --sidebar-w: 84px; }
  .sidebar { width: var(--sidebar-w); }
  .main-content { margin-left: var(--sidebar-w); }
  .sidebar .nav-text,
  .sidebar-plan-card { display: none; }
  .sidebar-header { padding-left: 0; padding-right: 0; display: flex; justify-content: center; }
  .sidebar .sidebar-brand-container { width: 100%; display: flex; justify-content: center; margin: 0; }
  .sidebar .sidebar-logo-img { width: 56px; max-width: 56px; height: auto; margin: 0; }
  .sidebar-nav { padding: 16px 10px; }
  .sidebar .nav-link {
    justify-content: center;
    padding: 12px 0;
    min-height: 48px;
  }
  .sidebar .nav-icon { font-size: 24px; margin: 0; }
  .sidebar-footer .logout-btn { justify-content: center; padding: 12px 0; }
}

/* Día sin reservas: estado vacío que guía al siguiente paso */
.empty-state--day {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state--day .empty-icon {
  font-size: 2.75rem;
  color: var(--primary);
  background: var(--primary-alpha);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 16px;
}
.empty-state--day .empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state--day .empty-text { max-width: 42ch; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; margin-bottom: 20px; }
.empty-state--day .empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.empty-state--day .empty-actions .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* ── v4: estados de cocina ── */
.comanda-item { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.item-estado-btn { border: none; background: none; padding: 0; cursor: pointer; line-height: 1; display: inline-flex; }
.item-estado-btn .material-symbols-rounded { font-size: 1.15rem; }
.comanda-item-servido { opacity: 0.55; text-decoration: line-through; }
.comanda-estado-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.comanda-estado-chip .material-symbols-rounded { font-size: 1rem; }
.pantalla-cocina { position: fixed; inset: 0; z-index: 3000; background: #0F1226; color: #DCDFEA; overflow: auto; padding: 18px; }
.cocina-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cocina-top h2 { margin: 0; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 1.4rem; }
.cocina-pendientes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; font-size: 0.95rem; }
.cocina-pend-chip { background: #1e293b; border: 1px solid #2E3566; border-radius: 999px; padding: 4px 10px; }
.cocina-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cocina-card { background: #1e293b; border: 2px solid #2E3566; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cocina-card-tarde { border-color: #C2581A; }
.cocina-card-head { display: flex; justify-content: space-between; align-items: center; font-size: 1.15rem; color: #fff; }
.cocina-card-head small { color: #8A90AD; font-size: 0.85rem; margin-left: 6px; }
.cocina-min { background: #2E3566; border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 0.95rem; }
.cocina-sub { color: #8A90AD; font-size: 0.85rem; margin-top: -6px; }
.cocina-items { display: flex; flex-direction: column; gap: 6px; }
.cocina-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: #0F1226; border: 1px solid #2E3566; color: #DCDFEA; border-radius: 10px; padding: 10px; font-size: 1.05rem; cursor: pointer; width: 100%; }
.cocina-item em { display: block; font-style: normal; color: #fbbf24; font-size: 0.85rem; }
.cocina-item-servido { opacity: 0.45; }
.cocina-item-servido .cocina-item-txt { text-decoration: line-through; }
.cocina-item-en_preparacion { border-color: #C2581A; }
.cocina-notas { background: #422006; color: #fde68a; border-radius: 8px; padding: 8px; font-size: 0.9rem; }
.cocina-card-foot { display: flex; justify-content: space-between; align-items: center; color: #8A90AD; font-size: 0.9rem; }

/* ── v4: señal ── */
.senal-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.senal-pendiente { background: #fff4e5; color: #c2410c; }
.senal-pagada { background: #e8f7ee; color: #15803d; }

/* ── v4.2: el cliente reconfirma o cancela desde el correo ── */
.cliente-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.cliente-reconfirmo { background: #e8f7ee; color: #15803d; }
.cliente-cancelo { background: #fdecee; color: #b91c1c; }

/* ── v4: carta y QR ── */
@media (max-width: 860px) { .carta-qr-grid { grid-template-columns: 1fr !important; } }

/* ── Usuarios, permisos y registro de actividad (v4.1) ── */
.usuario-actual { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 6px 8px; border-radius: 10px; background: rgba(255,255,255,0.06); color: #fff; }
.usuario-actual small { display: block; font-size: 0.72rem; opacity: 0.7; }
.usuario-actual strong { display: block; font-size: 0.85rem; line-height: 1.2; }
.usuarios-bloque { max-width: 900px; margin: 0 auto 20px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.usuarios-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.usuarios-lista { display: flex; flex-direction: column; gap: 8px; }
.usuario-fila { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card, var(--surface)); }
.usuario-fila-fija { background: rgba(21,26,64,0.04); }
.usuario-inactivo { opacity: 0.55; }
.usuario-ic { color: var(--primary); }
.usuario-datos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.usuario-datos small { color: var(--text-secondary); font-size: 0.8rem; }
.rol-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.rol-admin { background: rgba(21,26,64,0.1); color: #151A40; }
.rol-usuario { background: rgba(217,107,39,0.12); color: #B4531A; }
.permisos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.permiso-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.permiso-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.actividad-filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.actividad-filtros select, .actividad-filtros input { height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.actividad-tabla { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.actividad-tabla th { text-align: left; font-size: 0.75rem; text-transform: uppercase; color: var(--text-secondary); padding: 8px; border-bottom: 1px solid var(--border); }
.actividad-tabla td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.actividad-paginas { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 0.85rem; color: var(--text-secondary); }
body.sin-borrar .btn-delete[onclick*="deleteReservation"] { display: none !important; }
body.sin-cuentas [onclick*="abrirModalCuenta"] { display: none !important; }

/* ── Enlaces para Google, Instagram y web ── */
.enlaces-bloque { max-width: 760px; margin: 0 auto 20px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.enlaces-lista { display: flex; flex-direction: column; gap: 12px; }
.enlace-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.enlace-titulo { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.enlace-titulo .material-symbols-rounded { color: var(--primary); }
.enlace-copiar { display: flex; gap: 8px; align-items: center; }
.enlace-copiar input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-family: monospace; font-size: 0.85rem; background: var(--bg, #f8f9fb); color: var(--text); }
.enlace-pasos { margin: 8px 0 0; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }

/* Espacios con horario propio (v4.1) */
.zona-horario-resumen { display: block; margin-top: 2px; font-size: 0.78rem; color: var(--text-secondary); }
.zona-horario-box { border-top: 1px solid var(--border-light, #e5e7eb); padding-top: 12px; margin-top: 12px; }
.zona-dias { display: flex; gap: 6px; flex-wrap: wrap; }
.zona-dia { display: inline-flex; align-items: center; cursor: pointer; }
.zona-dia input { position: absolute; opacity: 0; pointer-events: none; }
.zona-dia span { min-width: 34px; padding: 6px 10px; text-align: center; border: 1px solid var(--border, #d1d5db); border-radius: 8px; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.zona-dia input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.zona-dia input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─────────────────────────────────────────────── */
/* INFORMES (resumen por meses)                     */
/* ─────────────────────────────────────────────── */
.inf-filtros {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.inf-atajos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.inf-atajo {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.inf-atajo:hover { background: var(--hover); color: var(--text); }
.inf-atajo.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.inf-fechas { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inf-fechas .form-group { margin: 0; min-width: 150px; }
.inf-fechas .btn { display: inline-flex; align-items: center; gap: 6px; }
.inf-descargas { display: flex; gap: 8px; margin-left: auto; }
.inf-periodo { color: var(--text-muted); font-size: 0.85rem; margin: 4px 2px 12px; }

.inf-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.inf-kpi {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
  min-width: 0;
}
.inf-kpi-top { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 0.82rem; font-weight: 500; }
.inf-kpi-top .material-symbols-rounded { font-size: 1.15rem; color: var(--text-muted); }
.inf-kpi-valor { font-size: 1.6rem; font-weight: 700; color: var(--text); margin: 6px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inf-kpi-detalle { font-size: 0.78rem; color: var(--text-muted); }

.inf-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px 20px;
  margin-bottom: 16px;
  min-width: 0;
}
.inf-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.inf-card-head h3 { font-size: 1rem; color: var(--text); margin: 0; }
.inf-nota { font-size: 0.78rem; color: var(--text-muted); }
.inf-vacio { color: var(--text-muted); font-size: 0.9rem; padding: 12px 0; grid-column: 1 / -1; }

/* Gráfico de barras */
.inf-grafico {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 240px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.inf-col {
  flex: 1 1 0;
  min-width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  outline: none;
  border-radius: var(--radius-sm);
}
.inf-col:hover, .inf-col:focus-visible { background: var(--hover); }
.inf-col-valor { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; height: 18px; }
.inf-col-pista { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.inf-barra { width: min(36px, 70%); background: var(--primary); border-radius: 4px 4px 0 0; }
.inf-col-mes { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; white-space: nowrap; }
.inf-col-ocup { font-size: 0.7rem; color: var(--text-muted); height: 16px; white-space: nowrap; }
.inf-tip {
  display: none;
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.inf-tip strong, .inf-tip span { display: block; }
.inf-col:hover .inf-tip, .inf-col:focus-visible .inf-tip { display: block; }
.inf-col:first-child .inf-tip { left: 0; transform: none; }
.inf-col:last-child .inf-tip { left: auto; right: 0; transform: none; }

/* Tabla */
.inf-tabla-wrap { overflow-x: auto; }
.inf-tabla { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.inf-tabla th {
  text-align: right;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.inf-tabla td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--border-light); white-space: nowrap; color: var(--text); }
.inf-tabla th:first-child, .inf-tabla td:first-child { text-align: left; }
.inf-tabla td small { color: var(--text-muted); font-size: 0.75rem; margin-left: 2px; }
.inf-tabla tbody tr:hover td { background: var(--hover); }
.inf-tabla tr.inf-total td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }

/* Desglose por origen y servicio */
.inf-dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.inf-fila { margin-bottom: 12px; }
.inf-fila-txt { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--text); margin-bottom: 5px; }
.inf-fila-txt span:last-child { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.inf-fila-pista { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.inf-fila-pista div { height: 100%; background: var(--primary); border-radius: 4px; }

.inf-subtitulo { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; color: var(--text); margin: 28px 0 14px; }

@media (max-width: 640px) {
  .inf-filtros { padding: 14px; }
  .inf-fechas .form-group { flex: 1 1 130px; min-width: 0; }
  .inf-fechas > .btn, .inf-descargas { flex: 1 1 100%; margin-left: 0; }
  .inf-descargas .btn { flex: 1; min-width: 0; justify-content: center; }
  .inf-card-head { flex-direction: column; gap: 2px; }
  .inf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .inf-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .inf-kpi { padding: 12px; }
  .inf-kpi-valor { font-size: 1.3rem; }
  .inf-grafico { height: 210px; }
}

/* ── v4.2: Configuración > Facturas ── */
.fact-prueba { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: #fff7ed; color: #9a3412; border: 1px dashed #fdba74; font-size: 0.82rem; font-weight: 600; }
.fact-prueba .material-symbols-rounded { font-size: 1.05rem; }
.fact-tabla-wrap { overflow-x: auto; }
.fact-tabla { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.fact-tabla th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fact-tabla td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fact-tabla tbody tr:hover { background: var(--primary-alpha); }
.fact-numero { white-space: nowrap; }
.fact-contacto { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 14px 0 0; font-size: 0.85rem; color: var(--text-secondary); }
.fact-contacto .material-symbols-rounded { font-size: 1rem; }
.fact-contacto a { color: var(--primary); font-weight: 700; }
.fact-cifra { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-secondary); }
.fact-importe { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.fact-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.fact-chip .material-symbols-rounded { font-size: 0.95rem; }
.fact-pagada { background: #e8f7ee; color: #15803d; }
.fact-pendiente { background: #fff4e5; color: #c2410c; }
.fact-vencida { background: #fdecee; color: #b91c1c; }
.fact-vence { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 0.72rem; }
.fact-acciones { text-align: right; white-space: nowrap; }
.fact-acciones-in { display: inline-flex; flex-direction: column; align-items: stretch; gap: 6px; }
.fact-acciones .btn, .fact-acciones .btn-action { display: inline-flex; align-items: center; justify-content: center; gap: 4px; text-decoration: none; }
.fact-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.facturas-vacio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 16px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-secondary); }
.facturas-vacio > .material-symbols-rounded { font-size: 2.2rem; color: var(--primary); opacity: .55; }
.facturas-vacio strong { color: var(--text-primary); font-size: 1rem; }
.facturas-vacio p { margin: 0 0 6px; max-width: 420px; font-size: 0.87rem; line-height: 1.5; }
@media (max-width: 720px) {
  .fact-tabla thead { display: none; }
  .fact-tabla, .fact-tabla tbody, .fact-tabla tr, .fact-tabla td { display: block; width: 100%; }
  .fact-tabla tr { border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; }
  .fact-tabla td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; }
  .fact-tabla td[data-label]::before { content: attr(data-label); color: var(--text-secondary); font-size: 0.78rem; }
  .fact-tabla td[data-label="Estado"] { flex-wrap: wrap; }
  .fact-acciones { justify-content: flex-end !important; padding-top: 8px !important; }
  .fact-acciones-in { flex-direction: row; }
}

/* Acceso grande a la pantalla de cocina (Comandas) y en el menú lateral */
.cocina-acceso {
  width: 100%; display: flex; align-items: center; gap: 18px; margin: 0 0 18px; padding: 18px 22px;
  border: 0; border-radius: 16px; background: var(--navy, #151A40); color: #fff; text-align: left; cursor: pointer;
  font-family: inherit; box-shadow: 0 6px 18px rgba(21, 26, 64, .18); transition: transform .12s ease, box-shadow .12s ease;
}
.cocina-acceso:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(21, 26, 64, .25); }
.cocina-acceso-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 14px; background: rgba(255, 255, 255, .12); font-size: 2.1rem !important; }
.cocina-acceso-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cocina-acceso-txt strong { font-size: 1.35rem; font-weight: 900; }
.cocina-acceso-txt span { color: var(--on-navy-2, #C4C9E4); font-weight: 700; }
.cocina-acceso-go { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 12px; background: #fff; color: var(--navy, #151A40); font-weight: 900; font-size: 1.02rem; }
@media (max-width: 760px) {
  .cocina-acceso { flex-wrap: wrap; padding: 16px; }
  .cocina-acceso-go { width: 100%; justify-content: center; }
}
.nav-cocina-count:not(:empty) { margin-left: auto; background: var(--warning, #C2581A); color: #fff; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.nav-cocina .nav-text { white-space: nowrap; }
.nav-link.nav-cocina { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); border-radius: 12px; margin: 4px 0; font-weight: 800; color: #fff; }
.nav-link.nav-cocina .nav-text, .nav-link.nav-cocina .nav-icon { color: #fff; }

/* Pantalla de cocina: comanda maestra a la izquierda y platos por grupos */
.cocina-layout { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 16px; align-items: start; }
.cocina-maestra {
  position: sticky; top: 0; max-height: calc(100vh - 90px); overflow-y: auto;
  background: #fff; color: #151A40; border-radius: 14px; padding: 14px 14px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.cocina-maestra-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 3px solid #151A40; }
.cocina-maestra-head strong { display: block; font-size: 1.3rem; font-weight: 900; }
.cocina-maestra-head small { color: #585E7E; font-weight: 700; font-size: .8rem; }
.cocina-maestra-total { display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: 2rem; font-weight: 900; background: #151A40; color: #fff; border-radius: 12px; padding: 8px 12px; }
.cocina-maestra-total small { font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .75; margin-top: 3px; }
.cocina-maestra-grupo { margin-top: 12px; }
.cocina-maestra-grupo h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; padding: 6px 10px; border-radius: 8px; font-size: .85rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; background: var(--g-bg); color: var(--g-ink); }
.cocina-maestra-plato { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px solid #E8EAF2; }
.cocina-maestra-plato:last-child { border-bottom: 0; }
.cocina-maestra-q { flex: none; min-width: 40px; text-align: center; font-size: 1.25rem; font-weight: 900; background: #EEF0F8; border-radius: 8px; padding: 2px 6px; }
.cocina-maestra-n { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.cocina-maestra-n small { display: block; font-weight: 600; font-size: .78rem; color: #585E7E; margin-top: 2px; }
.cocina-maestra-n small i { font-style: normal; color: #C2581A; font-weight: 800; }
.cocina-maestra-vacia { color: #585E7E; text-align: center; padding: 24px 0; }
/* Colores de cada grupo (en la maestra y dentro de cada comanda) */
.cocina-grupo-frios { --g-bg: #E3F1FB; --g-ink: #1D5C8A; --g-line: #5BA4D6; }
.cocina-grupo-calientes { --g-bg: #FBEBDD; --g-ink: #9A3D0E; --g-line: #E07B39; }
.cocina-grupo-segundos { --g-bg: #EEF0FF; --g-ink: #3B4BB8; --g-line: #8E9CF0; }
.cocina-grupo-postres { --g-bg: #F4EAF8; --g-ink: #7A3B92; --g-line: #C08AD6; }
.cocina-grupo-otros { --g-bg: #EEF0F8; --g-ink: #4A5070; --g-line: #8A90AD; }
.cocina-grupo { display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 4px solid var(--g-line); }
.cocina-grupo + .cocina-grupo { margin-top: 6px; }
.cocina-grupo-tit { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--g-line); }
.cocina-grupo-tit small { color: #8A90AD; font-weight: 800; }
.cocina-grupo.is-hecho { opacity: .55; }
.cocina-ninos { font-size: .72rem; font-weight: 800; color: #fbbf24; border: 1px solid #fbbf24; border-radius: 6px; padding: 0 5px; margin-left: 4px; }
@media (max-width: 900px) {
  .cocina-layout { grid-template-columns: 1fr; }
  .cocina-maestra { position: static; max-height: none; }
}

/* ════════════════════════════════════════════════════════════
   Comanda rápida (demo TPV v0.5): carta en botones + comanda
   ════════════════════════════════════════════════════════════ */
.modal.modal-comanda { max-width: 1240px; height: min(92vh, 900px); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-comanda .modal-body { flex: 1; min-height: 0; padding: 0; overflow: hidden; display: flex; }
.modal.modal-comanda .modal-footer { flex: none; }
.cmd { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cmd-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--border-light); flex: none; }
.cmd-cab-quien { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cmd-cab-quien strong { font-size: 1.05rem; }
.cmd-cab-quien span { color: var(--text-secondary); font-size: .9rem; }
.cmd-cab-menu { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--st-menu-bg); color: var(--st-menu); font-weight: 800; font-size: .85rem; white-space: nowrap; }
.cmd-cab-menu .mi { font-size: 1.05rem; }
.cmd-cab-menu.is-carta { background: var(--border-light); color: var(--text-secondary); }
.cmd-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); }

/* Carta */
.cmd-carta { min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 16px 24px; border-right: 1px solid var(--border-light); }
.cmd-buscar { position: relative; flex: none; }
.cmd-buscar .mi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.25rem; pointer-events: none; }
.cmd-buscar input { width: 100%; height: 48px; padding: 0 14px 0 44px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 1rem; background: var(--surface); color: var(--text); }
.cmd-buscar input:focus, .cmd-libre input:focus, .cmd-libre select:focus, .cmd-notas textarea:focus, .cmd-nota:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px rgba(59, 75, 184, .15); }
.cmd-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.cmd-tab { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast); }
.cmd-tab i { width: 10px; height: 10px; border-radius: 50%; background: var(--g-line, var(--border)); flex: none; }
.cmd-tab .mi { font-size: 1.1rem; }
.cmd-tab:hover { border-color: var(--text-muted); }
.cmd-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cmd-tab.is-menu { border-color: var(--st-menu); color: var(--st-menu); background: var(--st-menu-bg); }
.cmd-tab.is-menu.on { background: var(--st-menu); color: #fff; }
.cmd-multi { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; }
.cmd-multi > span { font-size: .8rem; font-weight: 800; color: var(--text-muted); margin-right: 4px; }
.cmd-x { min-width: 40px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 800; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.cmd-x.on { background: var(--warning); border-color: var(--warning); color: #fff; }
.cmd-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 4px 2px; margin: 0 -4px 0 -2px; }
.cmd-grid-tit { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 10px 0 8px; }
.cmd-grid-tit:first-child { margin-top: 0; }
.cmd-grid-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cmd-plato { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 92px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--g-bg, var(--surface)); color: var(--text); text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow-xs); transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast); }
.cmd-plato:hover { box-shadow: var(--shadow); border-color: var(--g-line, var(--text-muted)); }
.cmd-plato:active { transform: scale(.97); }
.cmd-plato-n { font-weight: 800; font-size: .98rem; line-height: 1.25; }
.cmd-plato-t { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--g-ink, var(--text-muted)); }
.cmd-plato-q { position: absolute; top: -7px; right: -7px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--primary); color: #fff; font-size: .82rem; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(21, 26, 64, .25); font-variant-numeric: tabular-nums; }
.cmd-plato.is-in { border-color: var(--primary); }
.cmd-vacio { grid-column: 1 / -1; color: var(--text-muted); padding: 18px 0; margin: 0; }
.cmd-libre { display: flex; gap: 8px; flex: none; padding-top: 12px; border-top: 1px solid var(--border-light); }
.cmd-libre input, .cmd-libre select { height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--text); }
.cmd-libre input { flex: 1; min-width: 0; }
.cmd-libre-btn { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.cmd-libre-btn .mi { font-size: 1.15rem; }

/* Comanda */
.cmd-ticket { min-height: 0; display: flex; background: var(--bg); }
.cmd-ticket form { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 16px 24px 16px 20px; gap: 14px; }
.cmd-ticket-cab { display: flex; align-items: baseline; justify-content: space-between; }
.cmd-ticket-cab h3 { margin: 0; font-size: 1.1rem; }
.cmd-ticket-cab span { font-weight: 800; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cmd-lineas { display: flex; flex-direction: column; gap: 12px; }
.cmd-pase { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 10px 12px 4px; margin: 0; }
.cmd-pase-tit { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--g-ink); padding-bottom: 6px; }
.cmd-pase-tit i { width: 10px; height: 10px; border-radius: 50%; background: var(--g-line); }
.cmd-pase-tit small { margin-left: auto; font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cmd-linea { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border-light); margin: 0; }
.cmd-linea.is-nuevo { animation: cmdNuevo .7s cubic-bezier(.16, 1, .3, 1); }
@keyframes cmdNuevo { from { background: var(--warning-light); } to { background: transparent; } }
.cmd-linea-n { font-weight: 700; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cmd-nota { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: .85rem; font-weight: 500; background: var(--warning-light); color: var(--text); width: 100%; }
.cmd-paso { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.cmd-paso button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cmd-paso button:hover { background: var(--hover); }
.cmd-paso button .mi { font-size: 1.2rem; }
.cmd-paso b { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.cmd-linea-nota { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cmd-linea-nota:hover { background: var(--hover); }
.cmd-linea-nota.on { color: var(--warning); background: var(--warning-light); }
.cmd-vacio-ticket { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 36px 16px; border: 1.5px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.cmd-vacio-ticket .mi { font-size: 2rem; }
.cmd-vacio-ticket p { margin: 4px 0 0; font-weight: 800; color: var(--text-secondary); }
.cmd-sub { display: block; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.cmd-extras-lista { display: flex; flex-direction: column; gap: 6px; }
.cmd-extra { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.cmd-extra label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; min-height: 34px; }
.cmd-extra input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; flex: none; }
.cmd-extra-n { font-weight: 700; font-size: .9rem; }
.cmd-extra-p { margin-left: auto; color: var(--text-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.cmd-extra .comanda-extra-qty-wrap { opacity: .35; pointer-events: none; }
.cmd-extra.on { border-color: var(--primary); }
.cmd-extra.on .comanda-extra-qty-wrap { opacity: 1; pointer-events: auto; }
.cmd-extra .comanda-extra-qty { width: 52px; height: 34px; text-align: center; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.cmd-notas textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.cmd ::selection { background: rgba(59, 75, 184, .18); }

@media (max-width: 899px) {
  .modal.modal-comanda { height: 92vh; }
  .modal.modal-comanda .modal-body { overflow-y: auto; display: block; }
  .cmd-cab { padding: 10px 16px; flex-wrap: wrap; }
  .cmd-cuerpo { display: flex; flex-direction: column; }
  .cmd-carta { padding: 14px 16px; border-right: 0; }
  .cmd-grid { overflow: visible; }
  .cmd-grid-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-plato { min-height: 76px; }
  .cmd-ticket form { padding: 16px; overflow: visible; }
  .cmd-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .cmd-tab { flex: none; }
}
.cmd-x.on { background: var(--primary); border-color: var(--primary); }
.cmd-x.on:not([data-x="1"]) { background: var(--warning); border-color: var(--warning); }
.cmd-extra-p { white-space: nowrap; }
.cmd-plato { min-height: 78px; }
.cmd-ir-ticket { display: none; }
@media (max-width: 899px) {
  .cmd-ir-ticket { display: flex; align-items: center; justify-content: center; gap: 8px; position: sticky; bottom: 8px; z-index: 2; height: 48px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font: inherit; font-weight: 800; box-shadow: var(--shadow-md); cursor: pointer; }
  .cmd-ir-ticket .mi { font-size: 1.2rem; }
  .cmd-libre { flex-wrap: wrap; }
  .cmd-libre input { flex-basis: 100%; }
  .cmd-libre select { flex: 1; }
}

/* ── Comanda en filas con autocompletado (demo TPV v0.5.1) ── */
.modal.modal-comandaf { max-width: 760px; }
.cmdf-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--bg); margin-bottom: 14px; }
.cmdf-cab strong { font-size: 1.02rem; }
.cmdf-cab span { color: var(--text-secondary); font-size: .9rem; }
.cmdf-cab .cmdf-menu { padding: 4px 12px; border-radius: var(--radius-pill); background: var(--st-menu-bg); color: var(--st-menu); font-weight: 800; font-size: .82rem; }
.cmdf-rapido { position: sticky; top: -24px; z-index: 3; display: flex; gap: 8px; align-items: center; padding: 8px 0 12px; background: var(--surface); }
.cmdf-rapido > .mi { position: absolute; left: 14px; color: var(--text-muted); font-size: 1.25rem; pointer-events: none; }
.cmdf-rapido #cmdf-rapido { flex: 1; min-width: 0; height: 50px; padding: 0 14px 0 44px; border: 1.5px solid var(--primary); border-radius: var(--radius); font: inherit; font-size: 1rem; background: var(--surface); color: var(--text); }
.cmdf-rapido #cmdf-rapido-q { width: 64px; height: 50px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 1rem; font-weight: 800; background: var(--surface); color: var(--text); }
.cmdf-pase { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--surface); }
.cmdf-pase-tit { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--g-ink); }
.cmdf-pase-tit i { width: 10px; height: 10px; border-radius: 50%; background: var(--g-line); flex: none; }
.cmdf-pase-tit .cmdf-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--g-bg); color: var(--g-ink); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.cmdf-pase-tit .cmdf-n:empty { display: none; }
.cmdf-add { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 12px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; font-weight: 800; letter-spacing: 0; text-transform: none; cursor: pointer; }
.cmdf-add:hover { border-color: var(--text-muted); }
.cmdf-add .mi { font-size: 1.05rem; }
.comanda-form-row.cmdf-fila { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(90px, 150px) 40px; gap: 8px; align-items: center; margin: 0 0 6px; }
.comanda-form-row.cmdf-fila.is-nuevo { animation: cmdNuevo .8s cubic-bezier(.16, 1, .3, 1); border-radius: var(--radius-sm); }
.cmdf-q { display: inline-flex; align-items: center; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.cmdf-q button { width: 32px; height: 100%; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cmdf-q button:hover { background: var(--hover); color: var(--text); }
.cmdf-q button .mi { font-size: 1.1rem; }
.comanda-form-row.cmdf-fila .cmdf-q input[type="number"] { width: 38px; height: 100%; border: 0; border-radius: 0; padding: 0; text-align: center; font-weight: 800; font-size: 1rem; -moz-appearance: textfield; background: transparent; }
.cmdf-q input::-webkit-outer-spin-button, .cmdf-q input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.comanda-form-row.cmdf-fila input[type="text"] { height: 44px; max-width: none; }
.comanda-form-row.cmdf-fila .comanda-plato-input { font-weight: 700; font-size: .95rem; }
.comanda-form-row.cmdf-fila .comanda-nota-input { font-size: .85rem; }
.comanda-form-row.cmdf-fila .btn-remove-row { width: 40px; height: 40px; }
.cmdf-extras, .cmdf-notas { margin-top: 14px; }
.cmdf-sub { display: block; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.cmdf-extras-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.cmdf-notas textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.cmdf input:focus, .cmdf textarea:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px rgba(59, 75, 184, .15); }
.cmdf-q:focus-within { border-color: var(--info); }
.cmdf-q input:focus { box-shadow: none !important; }
/* Desplegable */
.cmdf-ac-lista { position: fixed; z-index: 4000; max-height: 300px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(21, 26, 64, .18); }
.cmdf-ac-op { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; font-size: .95rem; color: var(--text); }
.cmdf-ac-op:hover, .cmdf-ac-op.on { background: var(--hover); }
.cmdf-ac-op.on { box-shadow: inset 0 0 0 1.5px var(--info); }
.cmdf-ac-op mark { background: var(--warning-light); color: inherit; border-radius: 3px; padding: 0 1px; }
.cmdf-ac-op small { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--g-ink); }
.cmdf-ac-op small i { width: 8px; height: 8px; border-radius: 50%; background: var(--g-line); }
.cmdf-ac-vacio { padding: 12px; color: var(--text-muted); font-size: .9rem; }
@media (max-width: 640px) {
  .comanda-form-row.cmdf-fila { grid-template-columns: auto minmax(0, 1fr) 40px; }
  .comanda-form-row.cmdf-fila .comanda-nota-input { grid-column: 2 / 3; grid-row: 2; height: 38px; }
  .cmdf-rapido { top: -16px; }
}

/* Pantalla de cocina: botón propio abajo del menú lateral, encima del plan */
.sidebar-cocina-btn { display: flex; align-items: center; gap: 12px; margin: 0 12px 12px; padding: 14px; border-radius: 14px; background: #C2581A; color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: background var(--transition-fast), transform var(--transition-fast); }
.sidebar-cocina-btn:hover { background: #A84A14; }
.sidebar-cocina-btn:active { transform: scale(.98); }
.sidebar-cocina-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .18); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; }
.sidebar-cocina-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-cocina-txt strong { font-size: 1rem; color: #fff; white-space: nowrap; }
.sidebar-cocina-txt small { font-size: .75rem; color: rgba(255, 255, 255, .85); }
.sidebar-cocina-btn .nav-cocina-count:not(:empty) { margin-left: auto; background: #fff; color: #C2581A; }
.sidebar-nav .tpv-nav { margin-bottom: 8px; }

/* v0.7: menú ya creado dentro de la comanda */
.cmdf-menu-sel { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: var(--radius-pill); background: var(--st-menu-bg); color: var(--st-menu); }
.cmdf-menu-sel select { border: 0; background: transparent; color: inherit; font-weight: 800; font-size: .9rem; padding: 6px 4px; cursor: pointer; max-width: 320px; }
.cmdf-menu-sel select:focus-visible { outline: 2px solid currentColor; border-radius: 8px; }
.cmdf-menu-aviso { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; margin: -6px 0 14px; border-radius: var(--radius); background: var(--st-menu-bg); color: var(--text); font-size: .88rem; line-height: 1.4; }
.cmdf-menu-aviso[hidden] { display: none; }
.cmdf-menu-aviso .mi { color: var(--st-menu); font-size: 1.1rem; }
.cmdf-fila.is-cero .comanda-plato-input { color: var(--text-secondary); }
.cmdf-fila.is-cero .comanda-qty-input { color: var(--text-secondary); }
.cmdf-fila.is-menu .comanda-plato-input { background-image: linear-gradient(90deg, var(--st-menu-bg), transparent 60%); }
.cmdf-pase-tit .cmdf-n.is-ok { background: #E3F4EA; color: #1E7A46; }

/* v0.8: Comandas — calendario arriba y una fila de acciones debajo */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.comandas-head.comandas-head-v8 { display: flex !important; flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
.comandas-head-v8 .day-navigator { flex: none !important; margin: 0 !important; max-width: none; width: 100%; }
.comandas-head-v8 .comandas-actions { position: static !important; display: flex !important; flex-direction: row !important; justify-content: flex-end; flex-wrap: wrap; gap: 8px !important; width: 100%; margin: 0 !important; }
.comandas-head-v8 .comandas-actions .btn { height: 42px; padding: 0 16px; font-size: .9rem; }
.comandas-head-v8 .more-menu-btn > span:last-child.cmd-caret { font-size: 18px; margin-left: -2px; }
.comandas-head-v8 .more-menu-list { right: auto; left: 0; min-width: 260px; }
@media (max-width: 768px) {
  .comandas-head-v8 .comandas-actions { justify-content: stretch; }
  .comandas-head-v8 .comandas-actions > * { flex: 1 1 0; }
  .comandas-head-v8 .comandas-actions .btn { width: 100%; justify-content: center; padding: 0 8px; font-size: .8rem; }
  .comandas-head-v8 .more-menu-btn { width: 100% !important; }
  .comandas-head-v8 .more-menu-btn > span:nth-child(2) { display: inline !important; }
  .comandas-head-v8 #abrir-mesa-btn > span:last-child::after { content: ''; }
}

/* v0.8: Pantalla de cocina en el menú lateral, discreta y sin número */
.sidebar-cocina-btn { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); padding: 12px; gap: 12px; }
.sidebar-cocina-btn:hover { background: rgba(255, 255, 255, .13); }
.sidebar-cocina-ic { background: #fff; color: var(--navy, #151A40); width: 38px; height: 38px; font-size: 1.35rem; }
.sidebar-cocina-txt strong { font-size: .95rem; white-space: normal; }
.sidebar-cocina-txt small { color: rgba(255, 255, 255, .7); }
.comandas-head-v8 .comandas-actions { align-items: center; }
.comandas-head-v8 .comandas-actions .btn, .comandas-head-v8 .more-menu-btn { height: 42px !important; min-height: 42px; margin: 0 !important; }
@media (max-width: 768px) {
  .comandas-head-v8 #cocina-acceso-btn { flex: 1 1 100%; order: -1; }
}
.comandas-head-v8 .comandas-actions .more-menu { display: flex; }
.comandas-head-v8 .comandas-actions { flex-wrap: wrap !important; }
.comandas-head-v8 .more-menu-list { min-width: 300px; }

/* v0.9: reserva desplegada — una fila de acciones, ficha vertical y comanda completa */
.reservation-card.expanded .tpv-card-bar { display: none; }
body:not(.tpv-on) .rdx-tpv { display: none; }
.rdx-bar { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line, #E4E6F0); }
.rdx-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line, #DCDFEA); background: #fff; color: var(--navy, #151A40); font: inherit; font-size: .86rem; font-weight: 800; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.rdx-btn:hover { background: var(--mist, #EEF0F8); border-color: var(--line-2, #C9CDE0); }
.rdx-btn .material-symbols-rounded { font-size: 19px; color: var(--lav-ink, #3B4BB8); }
.rdx-btn.is-main { background: var(--navy, #151A40); border-color: var(--navy, #151A40); color: #fff; }
.rdx-btn.is-main .material-symbols-rounded { color: #fff; }
.rdx-btn.is-main:hover { background: #262C5C; }
.rdx-btn.rdx-tpv { background: #2F5BEA; border-color: #2F5BEA; color: #fff; }
.rdx-btn.rdx-tpv .material-symbols-rounded { color: #fff; }
.rdx-btn.rdx-tpv:hover { background: #2549C4; }
.rdx-btn em { font-style: normal; font-weight: 900; padding: 2px 7px; border-radius: 6px; background: #FFF1E6; color: #A84A14; font-size: .8rem; }
.rdx-btn em.is-ok { background: #E3F4EA; color: #1E7A46; }
.rdx-body { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 20px; padding: 16px 0 6px; }
.rdx-ficha { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.rdx-ficha li { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--ink, #151A40); line-height: 1.35; min-width: 0; }
.rdx-ficha li > .material-symbols-rounded { font-size: 18px; color: var(--ink-3, #8A90AE); flex: none; margin-top: 1px; }
.rdx-ficha li > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.rdx-ficha a { color: inherit; }
.rdx-link { border: 0; background: none; padding: 0; font: inherit; color: var(--navy, #151A40); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.rdx-link.is-warn { color: #A84A14; font-weight: 800; }
.rdx-muted { color: var(--ink-3, #8A90AE); }
.rdx-x { border: 0; background: none; cursor: pointer; padding: 0 2px; color: var(--ink-3, #8A90AE); vertical-align: middle; }
.rdx-x .material-symbols-rounded { font-size: 16px; }
.rdx-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rdx-main .rd-note { margin: 0; }
.rdx-empty { display: flex; align-items: center; gap: 8px; padding: 16px; border: 1px dashed var(--line-2, #C9CDE0); border-radius: 12px; color: var(--ink-3, #8A90AE); font-size: .9rem; }
.rdx-comanda { border: 1px solid var(--line, #E4E6F0); border-radius: 12px; background: #F8F9FC; padding: 12px 14px; }
.rdx-comanda-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rdx-comanda-h .material-symbols-rounded { font-size: 19px; color: var(--lav-ink, #3B4BB8); }
.rdx-chip { padding: 2px 10px; border-radius: 999px; background: var(--st-menu-bg, #EEF0FF); color: var(--st-menu, #3B4BB8); font-weight: 800; font-size: .78rem; }
.rdx-estado { margin-left: auto; font-size: .78rem; font-weight: 800; color: var(--ink-3, #8A90AE); }
.rdx-pases { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; }
.rdx-pase-t { display: block; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, #8A90AE); margin-bottom: 4px; }
.rdx-item { display: flex; gap: 8px; font-size: .88rem; padding: 2px 0; line-height: 1.3; }
.rdx-item b { min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.rdx-item em { font-style: normal; color: #A84A14; font-size: .8rem; }
.rdx-item.is-off { color: var(--ink-3, #8A90AE); }
.rdx-item.is-off b { font-weight: 600; }
.rdx-incluye { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line, #E4E6F0); font-size: .82rem; color: var(--ink-2, #4A5070); }
.rdx-foot { display: flex; justify-content: flex-end; gap: 6px; padding-top: 10px; }
.rdx-ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line, #DCDFEA); background: #fff; color: var(--navy, #151A40); cursor: pointer; }
.rdx-ic:hover { background: var(--mist, #EEF0F8); }
.rdx-ic .material-symbols-rounded { font-size: 20px; }
.rdx-ic.is-wa { color: #1E7A46; }
.rdx-ic.is-del { color: #B42318; }
.rdx-ic.is-del:hover { background: #FDECEA; border-color: #F4C7C3; }
.rdx-ic:disabled { opacity: .4; cursor: default; }
@media (max-width: 760px) {
  .rdx-body { grid-template-columns: 1fr; gap: 14px; }
  .rdx-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .rdx-btn { justify-content: center; padding: 0 8px; }
}
.card-details.rdx { container-type: inline-size; }
.rdx-chip { white-space: nowrap; }
@container (max-width: 620px) {
  .rdx-body { grid-template-columns: 1fr; gap: 14px; }
  .rdx-bar .rdx-btn { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .rdx-pases { grid-template-columns: 1fr 1fr; }
}
@container (max-width: 360px) { .rdx-pases { grid-template-columns: 1fr; } }

/* v0.9.1: botones todos juntos abajo (texto + icono; en estrecho solo icono) */
.rdx-body { padding-top: 4px; }
.rdx-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--line, #E4E6F0); }
.rdx-sp { flex: 1 1 auto; }
.rdx-btn.is-wa .material-symbols-rounded { color: #1E7A46; }
.rdx-btn.is-del { color: #B42318; }
.rdx-btn.is-del .material-symbols-rounded { color: #B42318; }
.rdx-btn.is-del:hover { background: #FDECEA; border-color: #F4C7C3; }
.rdx-btn:disabled { opacity: .4; cursor: default; }
@container (max-width: 860px) {
  .rdx-foot .rdx-t { display: none; }
  .rdx-foot .rdx-btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .rdx-foot .rdx-btn em { display: none; }
  .rdx-foot { gap: 6px; }
}
@container (max-width: 620px) { .rdx-bar .rdx-btn, .rdx-foot .rdx-btn { flex: none; } }
/* Mesa, sala y origen junto al estado (y en ningún otro sitio) */
.card-status-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-tags .mesa-badge, .card-tags .zone-tag, .card-tags .origen-badge { margin: 0; }
.view-mode-split .reservation-card .card-status-wrap { justify-content: flex-start; }
@media (max-width: 768px) { .reservation-card .card-status-wrap { justify-content: flex-start; } }
@container (max-width: 520px) {
  .rdx-sp { display: none; }
  .rdx-foot { gap: 5px; justify-content: space-between; }
  .rdx-foot .rdx-btn { width: 40px; height: 40px; }
}
.rdx-ficha:not(:has(li)) { display: none; }
.card-email { color: inherit; text-decoration: none; }
.card-email:hover { text-decoration: underline; }
.reservation-card:not(.expanded) .card-email { display: none; }
.rdx-body { grid-template-columns: auto minmax(0, 1fr); column-gap: 0; }
.rdx-ficha { min-width: 180px; max-width: 260px; margin-right: 20px; }
.rdx-main { grid-column: 2; }
@container (max-width: 620px) {
  .rdx-body { grid-template-columns: 1fr; }
  .rdx-ficha { max-width: none; margin-right: 0; }
  .rdx-main { grid-column: 1; }
}

/* v0.9.2: todo dentro del cuadro de comanda, a todo el ancho */
.rdx-body { display: block !important; padding-top: 4px; }
.rdx-main { grid-column: auto; }
.rdx-info { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -2px 0 12px; font-size: .88rem; color: var(--ink, #151A40); }
.rdx-info > span { display: inline-flex; align-items: center; gap: 6px; }
.rdx-info .material-symbols-rounded { font-size: 18px; color: var(--ink-3, #8A90AE); }
.rdx-info a { color: inherit; }
.rdx-obs { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: #FFF7E8; color: #6B4A12; font-size: .86rem; }
.rdx-obs .material-symbols-rounded { font-size: 18px; }
.rdx-vacia { font-size: .88rem; }

/* v0.9.4: Comanda y TPV en la línea de arriba, con el mismo formato que mesa/sala/origen */
.card-tags .tpv-card-inline { display: inline-flex; align-items: center; gap: 6px; padding: 0; margin: 0; }
.card-tags .tpv-card-inline .tpv-card-btn, .card-tags .tpv-card-inline .tpv-card-mini {
  width: auto; min-height: 0; height: auto; padding: 3px 9px; margin: 0; gap: 4px;
  border-radius: var(--radius-sm, 8px); font-size: .76rem; font-weight: 800; line-height: 1.2; box-shadow: none;
}
.card-tags .tpv-card-inline .tpv-card-mini { background: #fff; color: var(--navy, #151A40); border: 1px solid var(--line-2, #C9CDE0); box-shadow: none !important; }
.card-tags .tpv-card-inline .tpv-card-mini:hover { background: var(--navy, #151A40); color: #fff; }
.card-tags .tpv-card-inline .tpv-card-btn { border: 1px solid transparent; }
.card-tags .tpv-card-inline .tpv-card-btn.is-open { border-color: #2F5BEA; box-shadow: none; }
.card-tags .tpv-card-inline .tpv-ic { width: 14px; height: 14px; }
.card-tags .tpv-card-inline .tpv-card-btn-txt strong { font-size: .76rem; font-weight: 800; letter-spacing: 0; }
.card-tags .tpv-card-inline .tpv-card-btn-amt { font-size: .72rem; padding: 1px 5px; border-radius: 4px; margin-left: 2px; }
.reservation-card.expanded .card-tags .tpv-card-inline { display: none; }
.card-email { display: none; }
.reservation-card.expanded .card-email { display: inline; }

/* v0.9.5: botones de la línea de arriba más redondos, con más aire y en escritura normal */
.reservation-card .card-tags .mesa-badge,
.reservation-card .card-tags .zone-tag,
.reservation-card .card-tags .origen-badge,
.reservation-card .card-status-wrap .status-badge,
.card-tags .tpv-card-inline .tpv-card-btn,
.card-tags .tpv-card-inline .tpv-card-mini {
  border-radius: 999px !important; padding: 6px 13px !important; font-size: .8rem !important; font-weight: 700 !important;
  text-transform: none !important; letter-spacing: 0 !important; line-height: 1.2; min-height: 30px; display: inline-flex; align-items: center; gap: 5px;
}
.card-tags .tpv-card-inline .tpv-card-btn-txt strong { font-size: .8rem; font-weight: 700; text-transform: none; }
.card-tags .tpv-card-inline .tpv-card-btn-amt { border-radius: 999px; padding: 1px 7px; }
.reservation-card .card-status-wrap, .card-tags, .card-tags .tpv-card-inline { gap: 8px; }
.reservation-card .badge-comanda-indicator { text-transform: none !important; letter-spacing: 0 !important; border-radius: 999px !important; padding: 4px 11px !important; font-size: .76rem !important; font-weight: 700 !important; }

/* v0.9.6 — Sala y mesa bajo la hora: «S1 / M9» con icono de mesa */
.reservation-card .card-time { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 64px !important; }
.reservation-card .card-sitio { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--text, #1F2440); white-space: nowrap; cursor: pointer; padding: 2px 7px 2px 5px; border-radius: 999px; background: #F1F3F9; line-height: 1.4; letter-spacing: 0; }
.reservation-card .card-sitio .material-symbols-rounded { font-size: .95rem; color: #6B7194; }
.reservation-card .card-sitio:hover { background: #E6E9F4; }
.reservation-card .card-sitio.is-sin { color: #B54708; background: #FEF3E7; }
.reservation-card .card-sitio.is-sin .material-symbols-rounded { color: #B54708; }
@media (max-width: 768px) { .reservation-card .card-main { grid-template-columns: auto minmax(0, 1fr) !important; } }
.view-mode-split .reservation-card .card-main { grid-template-columns: auto minmax(0, 1fr) !important; }
.zona-abrev-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 2px 8px; border-radius: 999px; background: #EEF1FB; color: var(--primary); font-weight: 800; font-size: .78rem; }

/* v0.9.7 — Nada en mayúsculas forzadas: todo en escritura normal (preferencia de Oscar) */
body *:not(.keep-case) { text-transform: none !important; }

/* ══════════════════════════════════════════════════════════════
   v1.0 — Limpieza general (28/10): misma estructura, menos ruido.
   Tipografía tranquila, controles de la misma altura y forma de
   píldora, cabecera del día y cifras más compactas.
   ══════════════════════════════════════════════════════════════ */

/* Tipografía: sin tracking abierto (era para mayúsculas) y sin negrita 900 en textos pequeños */
html body *:not(h1):not(h2):not(.stat-number):not(.keep-case) { letter-spacing: 0 !important; }
html body .form-group label { font-size: .82rem !important; font-weight: 700 !important; color: var(--ink-2) !important; margin-bottom: 6px !important; }
html body th { font-weight: 700 !important; font-size: .78rem !important; color: var(--ink-3) !important; }

/* Cabecera del día: una sola línea compacta */
html body .day-navigator { padding: 10px 12px !important; min-height: 0 !important; }
html body .day-nav-center { flex-direction: row !important; flex-wrap: wrap; justify-content: center; gap: 10px !important; }
html body .day-nav-date { font-size: 1.35rem !important; font-weight: 800 !important; }
html body .day-nav-arrow { width: 40px !important; height: 40px !important; }
html body .today-badge { font-size: .76rem !important; font-weight: 700 !important; padding: 3px 11px !important; }

/* Cifras del día: más compactas, etiqueta en una línea */
html body .stat-card { padding: 12px 16px !important; gap: 12px !important; min-height: 0 !important; }
html body .stat-icon-box { width: 40px !important; height: 40px !important; border-radius: 12px !important; }
html body .stat-number { font-size: 1.6rem !important; font-weight: 800 !important; margin-bottom: 2px !important; }
html body .stat-label { font-size: .82rem !important; font-weight: 700 !important; color: var(--ink) !important; }
html body .stat-sub { display: inline !important; font-size: .82rem !important; font-weight: 400 !important; color: var(--ink-3) !important; margin-left: 4px; }
@media (max-width: 768px) {
  html body .stat-card { padding: 10px 8px !important; }
  html body .stat-number { font-size: 1.25rem !important; }
  html body .stat-label, html body .stat-sub { font-size: .7rem !important; }
  html body .stat-sub { display: block !important; margin-left: 0; }
  html body .day-nav-date { font-size: 1.1rem !important; }
}

/* Botones y controles: forma de píldora y misma altura en la barra de herramientas */
html body .btn { border-radius: 999px !important; }
html body .dashboard-toolbar-line { gap: 10px !important; align-items: center !important; }
html body .dashboard-toolbar-line .filter-btn,
html body .dashboard-toolbar-line .toolbar-search-bar,
html body .dashboard-toolbar-line .toolbar-actions-group .btn { height: 42px !important; min-height: 42px !important; }
html body .filter-btn { border-radius: 999px !important; padding: 0 16px !important; font-weight: 700 !important; }
html body .filter-btn:not(.active) { border-color: var(--line) !important; background: #fff !important; color: var(--ink-2) !important; }
html body .plano-view-selector { border-radius: 999px !important; height: 42px !important; box-sizing: border-box; align-items: stretch !important; padding: 3px !important; }
html body .plano-view-selector .btn-view-mode { border-radius: 999px !important; height: auto !important; padding: 0 14px !important; }
html body .toolbar-search-bar { border-radius: 999px !important; box-shadow: none !important; }
html body #print-dropdown-btn { width: 42px !important; box-shadow: none !important; }

/* Tarjetas y paneles: un solo nivel de sombra, sin brillos */
html body .stat-card, html body .day-navigator { box-shadow: none !important; }

/* Menú lateral: tarjeta del plan discreta */
html body .sidebar-plan-card { padding: 10px 12px !important; gap: 6px !important; background: transparent !important; border-color: var(--navy-line) !important; }
html body .plan-card-icon-box { display: none !important; }
html body .plan-card-title { font-size: .85rem !important; }
html body .plan-card-btn { padding: 6px 10px !important; font-size: .78rem !important; }

/* Títulos de página: aire arriba, menos abajo */
html body .page-header { margin-bottom: 16px !important; }
/* Campos: borde fino y claro; el foco ya lo marca el halo lavanda */
html body input[type="text"], html body input[type="tel"], html body input[type="email"], html body input[type="number"], html body input[type="date"],
html body input[type="time"], html body input[type="password"], html body select, html body textarea { border-width: 1.5px !important; }
html body .plan-card-status, html body .nav-section-title { color: var(--on-navy-2) !important; }
/* Configuración: todas las pestañas laterales con la misma altura y separación */
@media (min-width: 769px) {
  html body .config-tabs .config-tab { min-height: 40px !important; margin: 0 0 2px !important; padding: 8px 14px !important; gap: 10px !important; border-radius: 10px !important; }
}

/* Ajustes › Encargos: platos de la carta que se pueden encargar */
.encargo-platos-box { display: grid; gap: 8px; }
.enc-fam { border: 1px solid var(--line, #DCDFEA); border-radius: 12px; background: #fff; }
.enc-fam summary { cursor: pointer; padding: 10px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.enc-n { font-weight: 600; font-size: .78rem; color: var(--lav-ink, #3B4BB8); background: var(--lav-soft, #EEF0FF); border-radius: 999px; padding: 1px 9px; }
.enc-n:empty { display: none; }
.enc-platos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; padding: 0 12px 12px; }
.enc-plato { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-light, #E8EAF2); cursor: pointer; font-size: .9rem; }
.enc-plato:has(input:checked) { border-color: var(--lav, #9FB0FF); background: var(--lav-soft, #EEF0FF); }
.enc-plato span { flex: 1; }
.enc-plato em { font-style: normal; color: var(--ink-3, #585E7E); font-size: .8rem; }
html body .form-group .enc-plato { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px !important; margin: 0 !important; font-size: .9rem !important; font-weight: 600 !important; color: var(--ink) !important; }
html body .enc-plato input[type="checkbox"] { width: 18px !important; height: 18px !important; min-height: 0 !important; flex: 0 0 18px; margin: 0 !important; padding: 0 !important; accent-color: var(--navy, #151A40); -webkit-appearance: auto; appearance: auto; box-shadow: none !important; }
html body .enc-plato em { margin-left: auto; }

/* Turno que se ve en el plano con «Ver todo» */
.plano-stat-servicio {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--primary);
  padding: 0 2px;
  cursor: pointer;
  max-width: 120px;
}
.plano-stat-servicio[hidden], .plano-stat-sep[hidden] { display: none; }

/* ─────────────────────────────────────────────── */
/* CLIENTES v2: lista y ficha                       */
/* ─────────────────────────────────────────────── */
.cl-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cl-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.cl-title .material-symbols-rounded { font-size: 2rem; }
.cl-total { margin: 4px 0 0 42px; color: var(--text-muted); font-size: 0.9rem; min-height: 1.2em; }
.cl-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-header-actions .btn { height: 44px; padding: 0 18px; }

.cl-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cl-toolbar .cl-search { flex: 1; margin: 0; }
.cl-toolbar .cl-search input { height: 50px; border-color: var(--border-light); }
.cl-orden { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.cl-orden select { height: 50px; padding: 0 36px 0 14px; border: 1px solid var(--border-light); border-radius: var(--radius-pill); background-color: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; box-shadow: var(--shadow-xs); cursor: pointer; }

.cl-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cl-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.cl-chip .material-symbols-rounded { font-size: 1.05rem; }
.cl-chip:hover { border-color: var(--primary); color: var(--primary); }
.cl-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cl-chip-n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary-alpha); font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cl-chip.active .cl-chip-n { background: rgba(255, 255, 255, 0.2); }

.cl-table { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.cl-head, .cl-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(170px, 1fr) 120px minmax(200px, 1.6fr) 28px; gap: 16px; align-items: center; padding: 0 20px; }
.cl-head { height: 44px; background: var(--hover); border-bottom: 1px solid var(--border-light); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.cl-row { width: 100%; min-height: 76px; padding-top: 12px; padding-bottom: 12px; border: 0; border-bottom: 1px solid var(--border-light); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background var(--transition-fast); }
.cl-row:last-child { border-bottom: 0; }
.cl-row:hover { background: var(--hover); }
.cl-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cl-row:hover .cl-go { color: var(--primary); transform: translateX(2px); }
.cl-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cl-avatar, .cf-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; letter-spacing: 0.02em; }
.cl-avatar { width: 42px; height: 42px; font-size: 0.9rem; }
.tone-0 { background: #E6E8F5; color: #151A40; }
.tone-1 { background: #E7F2EC; color: #1F6B4A; }
.tone-2 { background: #FBEFE6; color: #9A4515; }
.tone-3 { background: #EEF0FF; color: #3B4BB8; }
.tone-4 { background: #F1EEFF; color: #5B4BB8; }
.tone-5 { background: #EAF4F6; color: #1D5E6B; }
.cl-who-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cl-name { font-weight: 700; color: var(--text); font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-vip { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 1px 7px 1px 4px; border-radius: var(--radius-pill); background: #FFF5D9; color: #8A5A00; font-size: 0.7rem; font-weight: 700; vertical-align: 2px; }
.cl-vip .material-symbols-rounded { font-size: 0.85rem; }
.cl-sub { display: flex; gap: 4px; flex-wrap: wrap; }
.cl-sub:empty { display: none; }
.cl-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--hover); border: 1px solid var(--border-light); color: var(--text-secondary); font-size: 0.72rem; font-weight: 600; }
.cl-tag .material-symbols-rounded { font-size: 0.85rem; }
.cl-tag-vip { background: #FFF5D9; border-color: #F3DFA5; color: #8A5A00; }
.cl-tag-fact { background: var(--info-light); border-color: transparent; color: var(--info); }
.cl-contact, .cl-visits { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.88rem; }
.cl-phone { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.cl-email { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-visits strong { font-size: 1.05rem; color: var(--text); font-variant-numeric: tabular-nums; }
.cl-visits span { color: var(--text-muted); font-size: 0.78rem; }
.cl-flags { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 0.82rem; }
.cl-flags > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-alergia { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; max-width: 100%; padding: 2px 8px 2px 5px; border-radius: 6px; background: var(--danger-light); color: var(--danger); font-weight: 700; font-size: 0.78rem; }
.cl-alergia .material-symbols-rounded, .cl-nota .material-symbols-rounded { font-size: 0.95rem; flex: none; }
.cl-pref { color: var(--text-secondary); }
.cl-nota { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-style: italic; }
.cl-go { color: var(--border); transition: all var(--transition-fast); }
.cl-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted); text-align: center; }
.cl-empty .material-symbols-rounded { font-size: 2.6rem; color: var(--border); }
.cl-empty p { margin: 0; }
.cl-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 4px; font-size: 0.88rem; color: var(--text-secondary); }
.cl-pag-controls { display: flex; align-items: center; gap: 12px; }

@media (max-width: 1100px) {
  .cl-head, .cl-row { grid-template-columns: minmax(200px, 1.4fr) minmax(150px, 1fr) 100px 24px; }
  .cl-head span:nth-child(4), .cl-row .cl-flags { display: none; }
}
@media (max-width: 768px) {
  .cl-header { align-items: flex-start; }
  .cl-header-actions { width: 100%; }
  .cl-header-actions .btn { flex: 1; padding: 0 12px; }
  .cl-total { margin-left: 0; }
  .cl-toolbar { flex-direction: column; align-items: stretch; }
  .cl-orden select { flex: 1; }
  .cl-filtros { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .cl-filtros::-webkit-scrollbar { display: none; }
  .cl-chip { flex: none; }
  .cl-head { display: none; }
  .cl-row { grid-template-columns: 1fr auto 20px; grid-template-areas: "who visits go" "flags flags flags"; gap: 6px 12px; padding: 14px 16px; }
  .cl-row .cl-who { grid-area: who; }
  .cl-row .cl-contact { display: none; }
  .cl-row .cl-visits { grid-area: visits; align-items: flex-end; text-align: right; }
  .cl-row .cl-visits span { display: none; }
  .cl-row .cl-visits strong::after { content: ' res.'; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
  .cl-row .cl-flags { grid-area: flags; display: flex; padding-left: 54px; }
  .cl-row .cl-flags .text-muted { display: none; }
  .cl-row .cl-go { grid-area: go; }
}

/* Ficha: panel lateral o pantalla completa */
body.cf-abierta { overflow: hidden; }
.cf-overlay { position: fixed; inset: 0; z-index: 1900; display: flex; justify-content: flex-end; background: rgba(13, 17, 43, 0); pointer-events: none; transition: background 0.2s var(--ease); }
.cf-overlay.open { background: rgba(13, 17, 43, 0.38); pointer-events: auto; }
.cf-panel { display: flex; flex-direction: column; width: min(960px, 100%); height: 100%; background: var(--bg); box-shadow: var(--shadow-lg); transform: translateX(24px); opacity: 0; transition: transform 0.22s var(--ease), opacity 0.22s var(--ease), width 0.22s var(--ease); }
.cf-overlay.open .cf-panel { transform: none; opacity: 1; }
.cf-overlay.cf-full .cf-panel { width: 100%; }

.cf-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 68px; background: var(--surface); border-bottom: 1px solid var(--border-light); flex: none; }
.cf-iconbtn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border-light); background: var(--surface); color: var(--text); cursor: pointer; transition: all var(--transition-fast); }
.cf-iconbtn:hover { background: var(--hover); border-color: var(--border); }
.cf-top-title { flex: 1; min-width: 0; }
.cf-crumb { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.cf-top-title h2 { margin: 0; font-size: 1.2rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-status { font-size: 0.82rem; color: var(--success); white-space: nowrap; }
.cf-status.dirty { color: var(--warning); font-weight: 700; }
.cf-top .btn { height: 44px; padding: 0 18px; }

.cf-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.cf-side { padding: 20px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.cf-main { flex: 1; padding: 0 24px 32px; }
.cf-full .cf-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); overflow: hidden; }
.cf-full .cf-side { overflow-y: auto; padding: 24px; background: var(--surface); border-right: 1px solid var(--border-light); }
.cf-full .cf-main { overflow-y: auto; padding: 0 32px 40px; }
.cf-full .cf-form { max-width: 980px; }

.cf-id { display: flex; align-items: center; gap: 14px; }
.cf-avatar { width: 64px; height: 64px; font-size: 1.35rem; }
.cf-name { font-size: 1.25rem; font-weight: 800; color: var(--text); line-height: 1.25; }
.cf-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.cf-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--danger-light); color: var(--danger); }
.cf-alert .material-symbols-rounded { flex: none; }
.cf-alert div { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.cf-alert strong { font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.cf-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-full .cf-quick { flex-direction: column; }
.cf-quick-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); background: var(--surface); color: var(--text); font: inherit; font-size: 0.88rem; font-weight: 600; text-decoration: none; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all var(--transition-fast); }
.cf-full .cf-quick-btn { background: var(--bg); }
.cf-quick-btn:hover { border-color: var(--primary); color: var(--primary); }
.cf-quick-btn .material-symbols-rounded { font-size: 1.15rem; color: var(--text-muted); flex: none; }
.cf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cf-full .cf-stats { grid-template-columns: 1fr 1fr; }
.cf-stats div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-light); }
.cf-full .cf-stats div { background: var(--bg); }
.cf-stats strong { font-size: 1.3rem; color: var(--text); font-variant-numeric: tabular-nums; }
.cf-stats span { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.cf-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.cf-facts div { display: flex; justify-content: space-between; gap: 12px; }
.cf-facts dt { color: var(--text-muted); }
.cf-facts dd { margin: 0; font-weight: 600; color: var(--text); text-align: right; }
.cf-hint { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.cf-show-sm { display: none; }

.cf-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 14px 0 10px; margin-bottom: 6px; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.cf-tabs::-webkit-scrollbar { display: none; }
.cf-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid transparent; background: none; color: var(--text-secondary); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.cf-tab .material-symbols-rounded { font-size: 1.1rem; }
.cf-tab:hover { background: var(--surface); border-color: var(--border-light); }
.cf-tab.active { background: var(--primary); color: #fff; }

.cf-pane { display: flex; flex-direction: column; gap: 14px; }
.cf-pane[hidden] { display: none; }
.cf-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 20px; }
.cf-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1rem; color: var(--text); }
.cf-card h3 .material-symbols-rounded { font-size: 1.2rem; color: var(--text-muted); }
.cf-card-alert h3 .material-symbols-rounded { color: var(--danger); }
.cf-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cf-card-head h3 { margin: 0; }
.cf-card-help { margin: -4px 0 12px; font-size: 0.85rem; color: var(--text-muted); }
.cf-card-help:last-child, .cf-help-after { margin: 14px 0 12px; }
.cf-card-help:last-child { margin-bottom: 0; }

.cf-chipset { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cf-opt { height: 38px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.cf-opt:hover { border-color: var(--primary); color: var(--primary); }
.cf-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cf-card-alert .cf-opt.on { background: var(--danger); border-color: var(--danger); }
.cf-otras, .cf-field input, .cf-field select, .cf-field textarea, .cf-notas { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.cf-otras:focus, .cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus, .cf-notas:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-alpha); }
.cf-notas { min-height: 260px; resize: vertical; line-height: 1.55; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.cf-card h3 + .cf-grid, .cf-card-help + .cf-grid { margin-top: 0; }
.cf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-field.wide { grid-column: 1 / -1; }
.cf-field label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }
.cf-field small { font-size: 0.75rem; color: var(--text-muted); }
.cf-field textarea { resize: vertical; }
.cf-check { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 0.92rem; color: var(--text-secondary); cursor: pointer; }
.cf-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.cf-danger { display: flex; align-items: center; gap: 12px; padding: 4px 4px 0; font-size: 0.82rem; color: var(--text-muted); }
.cf-danger .btn { color: var(--danger); }

.cf-history { list-style: none; margin: 0; padding: 0; }
.cf-history li { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-light); font-size: 0.88rem; }
.cf-history li:last-child { border-bottom: 0; }
.cf-h-date { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.cf-h-date span { color: var(--text-muted); font-size: 0.8rem; }
.cf-h-info { color: var(--text-secondary); min-width: 0; }
.cf-h-info em { display: block; color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-history .status-badge { cursor: default; }

@media (max-width: 900px) {
  .cf-overlay.cf-full .cf-body { display: flex; overflow-y: auto; }
  .cf-full .cf-side { overflow: visible; background: none; border: 0; padding: 20px 20px 8px; }
  .cf-full .cf-main { overflow: visible; padding: 0 20px 32px; }
  .cf-full .cf-quick { flex-direction: row; }
  .cf-full .cf-stats { grid-template-columns: repeat(4, 1fr); }
  .cf-full .cf-stats div, .cf-full .cf-quick-btn { background: var(--surface); }
}
@media (max-width: 768px) {
  .cf-panel { width: 100%; }
  .cf-top { padding: 10px 12px; gap: 8px; min-height: 60px; }
  .cf-top .btn { padding: 0 14px; }
  .cf-hide-sm, .cf-status { display: none; }
  .cf-show-sm { display: inline-flex; }
  .cf-side { padding: 16px 16px 4px !important; }
  .cf-main { padding: 0 16px 28px !important; }
  .cf-stats, .cf-full .cf-stats { grid-template-columns: 1fr 1fr; }
  .cf-card { padding: 16px; }
  .cf-grid { grid-template-columns: 1fr 1fr; }
  .cf-history li { grid-template-columns: 1fr auto; }
  .cf-h-info { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 480px) {
  .cf-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-overlay, .cf-panel { transition: none; }
}
@media print {
  .cf-overlay { display: none !important; }
}
.cf-h-date strong { color: var(--text); }
