/* ============================================================
   DASHBOARD DEL PROPIETARIO
   ============================================================ */

:root {
  --accent:        #C9A84C;
  --accent-light:  #E8C96F;
  --accent-dim:    rgba(201,168,76,0.12);
  --bg-primary:    #0a0a0a;
  --bg-secondary:  #111;
  --bg-card:       #181818;
  --bg-hover:      #202020;
  --border:        rgba(255,255,255,0.08);
  --border-accent: rgba(201,168,76,0.25);
  --text-primary:  #f0ede8;
  --text-muted:    #7a7068;
  --text-dim:      #3a3530;
  --success:       #4ade80;
  --success-dim:   rgba(74,222,128,0.12);
  --danger:        #f87171;
  --danger-dim:    rgba(248,113,113,0.12);
  --warning:       #fbbf24;
  --warning-dim:   rgba(251,191,36,0.12);
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 20px rgba(0,0,0,0.4);
  --transition:    0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
  padding: 2rem;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}
.login-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.login-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2rem; }
.login-error {
  background: var(--danger-dim); border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm); padding: 0.6rem 0.875rem;
  font-size: 0.8rem; color: var(--danger);
  margin-bottom: 1rem; display: none;
}
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.form-group input {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.875rem;
  color: var(--text-primary); font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.btn-login {
  width: 100%; padding: 0.7rem;
  background: var(--accent); color: #000;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--transition);
  margin-top: 0.5rem;
}
.btn-login:hover { background: var(--accent-light); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: none; min-height: 100vh; flex-direction: column; }
.app.visible { display: flex; }

.topbar {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.topbar-title {
  font-size: 0.8rem; color: var(--text-muted);
  padding-left: 1rem; border-left: 1px solid var(--border);
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-logout {
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.main { flex: 1; padding: 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.stat-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-value.pending  { color: var(--warning); }
.stat-value.confirmed { color: var(--success); }
.stat-value.total   { color: var(--text-primary); }
.stat-value.today   { color: var(--accent); }

/* ============================================================
   FILTROS / TABS
   ============================================================ */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap;
}
.tabs { display: flex; gap: 0.25rem; }
.tab {
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.tab.active { background: var(--accent-dim); color: var(--accent); }

.search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.4rem 0.75rem;
}
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.85rem; width: 200px;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-dim); font-size: 0.9rem; }

/* ============================================================
   TABLA DE RESERVAS
   ============================================================ */
.bookings-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.bookings-table { width: 100%; border-collapse: collapse; }
.bookings-table th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.bookings-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem; vertical-align: middle;
}
.bookings-table tr:last-child td { border-bottom: none; }
.bookings-table tr:hover td { background: var(--bg-hover); }
.bookings-table tr.cancelled td { opacity: 0.45; }

.td-name { font-weight: 600; color: var(--text-primary); }
.td-contact { color: var(--text-muted); font-size: 0.8rem; }
.td-datetime { white-space: nowrap; }
.td-date { font-weight: 500; }
.td-time { font-size: 0.8rem; color: var(--text-muted); }

/* Badges de estado */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 100px; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.status-badge.pending   { background: var(--warning-dim); color: var(--warning); }
.status-badge.confirmed { background: var(--success-dim); color: var(--success); }
.status-badge.cancelled { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Acciones */
.actions { display: flex; gap: 0.375rem; }
.btn-action {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
}
.btn-accept {
  background: var(--success-dim); color: var(--success);
  border: 1px solid rgba(74,222,128,0.2);
}
.btn-accept:hover { background: rgba(74,222,128,0.2); }
.btn-cancel {
  background: var(--danger-dim); color: var(--danger);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-cancel:hover { background: rgba(248,113,113,0.2); }
.btn-action:disabled { opacity: 0.35; pointer-events: none; }

/* Loading / empty state */
.table-loading, .table-empty {
  padding: 3rem; text-align: center;
  color: var(--text-muted); font-size: 0.875rem;
}
.table-empty svg { margin: 0 auto 1rem; opacity: 0.2; display: block; }
.spinner-row {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Paginación */
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
}
.pagination { display: flex; gap: 0.25rem; }
.page-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--accent-dim); color: var(--accent); }
.page-btn:disabled { opacity: 0.3; pointer-events: none; }

/* ============================================================
   MODAL DE DETALLE
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  max-width: 480px; width: 100%;
  transform: translateY(8px); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-head h3 { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 400; }
.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  font-size: 1.1rem;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.detail-item {}
.detail-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.detail-value { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }
.modal-actions { display: flex; gap: 0.75rem; }
.modal-actions .btn-action { flex: 1; padding: 0.65rem; text-align: center; font-size: 0.85rem; }

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1.25rem;
  font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(80px); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(74,222,128,0.3); color: var(--success); }
.toast.error   { border-color: rgba(248,113,113,0.3); color: var(--danger); }
.toast.info    { border-color: var(--border-accent); color: var(--accent); }

/* ============================================================
   CONFIG UI
   ============================================================ */
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.config-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.config-section h4 { margin-bottom: 1rem; color: var(--accent); font-family: 'Orbitron', sans-serif; font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; }
.config-actions { display: flex; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ============================================================
   SCHEDULE REDESIGN — Premium weekly grid
   ============================================================ */
.schedule-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.schedule-day-row {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  transition: border-color var(--transition), background var(--transition);
}
.schedule-day-row.day-open {
  border-color: rgba(201,168,76,0.2);
}
.schedule-day-row.day-closed {
  opacity: 0.6;
}

/* Day header row */
.sched-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 36px;
}

/* Toggle label wrapper */
.sched-day-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

/* Hide native checkbox */
.sched-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom pill toggle */
.sched-toggle-pill {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.sched-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform var(--transition), background var(--transition);
}
/* When NOT closed (checkbox unchecked = open), pill is active */
.sched-toggle-input:not(:checked) ~ .sched-toggle-pill {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.sched-toggle-input:not(:checked) ~ .sched-toggle-pill .sched-toggle-knob {
  transform: translateX(18px);
  background: var(--accent);
}

/* Day name */
.sched-day-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.sched-day-abbr {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 28px;
}
.sched-day-full {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Right side: closed tag + add button */
.sched-day-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sched-closed-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 100px;
}
.sched-closed-tag.hidden { display: none; }

/* Add-range button */
.btn-add-range {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-add-range:hover { background: rgba(201,168,76,0.2); }

/* Time ranges container */
.sched-ranges {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(255,255,255,0.06);
}
.sched-ranges:empty { display: none; margin: 0; padding: 0; border: none; }

/* Individual time range row */
.time-range-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.time-range-row input[type="time"] {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.time-range-row input[type="time"]:focus { border-color: var(--accent); }
.range-sep {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.btn-remove-range {
  background: none;
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  margin-left: auto;
}
.btn-remove-range:hover { background: var(--danger-dim); }

/* Booking short ID in table */
.td-booking-id {
  font-size: 0.7rem;
  font-family: monospace;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 0.2rem;
  opacity: 0.8;
}

.services-list { display: flex; flex-direction: column; gap: 0.75rem; }
.service-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 0.75rem; align-items: center; background: var(--bg-secondary); padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.service-row input { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; color: var(--text-primary); font-size: 0.85rem; width: 100%; outline: none; }
.service-row input:focus { border-color: var(--accent); }
.btn-delete { background: var(--danger-dim); color: var(--danger); width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; transition: background 0.2s; font-size: 1.2rem; }
.btn-delete:hover { background: rgba(248,113,113,0.25); }

/* Custom Inputs */
input[type="color"] { padding: 0; border: none; height: 36px; width: 100%; border-radius: var(--radius-sm); cursor: pointer; background: none; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ============================================================
   DASHBOARD CALENDAR
   ============================================================ */
.dash-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.dash-cal-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
}
.dash-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  position: relative;
  transition: all var(--transition);
}
.dash-cal-day.other-month { opacity: 0.3; }
.dash-cal-day.has-bookings {
  background: var(--accent-dim);
  border-color: var(--accent);
  cursor: pointer;
}
.dash-cal-day.has-bookings:hover {
  background: rgba(201,168,76,0.25);
}
.dash-cal-day .date-num { font-weight: 600; }
.dash-cal-day .b-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: auto;
}
.dash-cal-day.has-bookings .b-count {
  color: var(--accent);
}
.dash-cal-pending-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 8px;
  height: 8px;
  background: var(--warning);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(251,191,36,0.6);
}

.edit-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  outline: none;
}
.edit-input:focus { border-color: var(--accent); }

/* ============================================================
   WHATSAPP & CONTACT STYLES
   ============================================================ */
.dash-whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--success);
  font-weight: 500;
  transition: color var(--transition), text-decoration var(--transition);
}
.dash-whatsapp-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}
.wa-icon {
  flex-shrink: 0;
  fill: currentColor;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Table layout only for middle width tablets in landscape */
@media (min-width: 769px) and (max-width: 900px) {
  .bookings-table th:nth-child(4),
  .bookings-table td:nth-child(4) { display: none; } /* ocultar estado */
}

/* Portrait tablets and mobile devices */
@media (max-width: 768px) {
  .main { padding: 1rem; }
  .topbar-title { display: none; }
  
  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  
  .search-box {
    width: 100%;
  }
  
  .search-box input {
    width: 100%;
  }
  
  /* Convert Table to Premium Cards */
  .bookings-panel {
    background: none;
    border: none;
    box-shadow: none;
    overflow: visible;
  }
  
  .bookings-table, 
  .bookings-table thead, 
  .bookings-table tbody, 
  .bookings-table tr, 
  .bookings-table td {
    display: block !important;
    width: 100% !important;
  }
  
  .bookings-table thead {
    display: none !important;
  }
  
  .bookings-table tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: transform var(--transition), border-color var(--transition);
  }
  
  .bookings-table tr:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
  }
  
  .bookings-table tr.cancelled {
    opacity: 0.6;
    border-color: transparent;
  }
  
  .bookings-table td {
    padding: 0.5rem 0 !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    text-align: left;
  }
  
  .bookings-table td:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-top: 0.75rem;
  }
  
  /* Client info full width and customized styling */
  .bookings-table td:first-child {
    display: block !important;
    padding-top: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.25rem;
  }
  
  .bookings-table td:first-child::before {
    display: none !important;
  }
  
  .bookings-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  
  .bookings-table .td-name {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
  }
  
  .bookings-table .td-contact {
    font-size: 0.85rem;
  }
  
  .bookings-table .td-datetime {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  
  .bookings-table .td-date {
    font-weight: 600;
  }
  
  .bookings-table .td-time {
    font-size: 0.9rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
  }
  
  /* Actions container */
  .bookings-table .actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  
  .bookings-table .actions .btn-action {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    text-align: center;
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }
  
  /* Mobile Calendar Grid optimizations */
  .dash-calendar-grid {
    padding: 0.75rem;
    gap: 0.25rem;
  }
  
  .dash-cal-day {
    padding: 0.25rem;
    font-size: 0.8rem;
  }
  
  .dash-cal-day .b-count {
    display: none;
  }
  
  .dash-cal-day.has-bookings::after {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: auto;
    align-self: center;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }
  
  .config-section {
    padding: 1rem;
  }
}

/* Specific small mobile devices optimization */
@media (max-width: 600px) {
  /* Service Config row responsive layout */
  .service-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .service-row .svc-name {
    grid-column: 1 / -1;
  }
  
  .service-row .svc-duration,
  .service-row .svc-price {
    grid-column: span 1;
  }
  
  .service-row .btn-delete {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0.25rem;
  }
  
  /* Edit modal optimization */
  .modal-overlay {
    padding: 1rem;
  }
  
  .modal {
    padding: 1.25rem;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-actions .btn-action {
    width: 100%;
  }
}

/* Botones de acción secundaria (Añadir Cierre/Servicio) con alto contraste */
.btn-action-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary) !important;
  border: 1px dashed var(--border);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 1rem;
  width: auto;
}
.btn-action-add:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light) !important;
}

/* ============================================================
   RESPONSIVE ENHANCEMENTS
   ============================================================ */
html, body {
  max-width: 100%;
  /* overflow-x: hidden bloqueaba el scroll de tabs — usar clip en su lugar */
}

/* Base styles for CSS-only Reviews & Closures (stripped from JS inline styles) */
.review-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
.review-row > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.review-row label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.review-row input, .review-row select {
  width: 100%;
  padding: 0.6rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--transition);
}
.review-row input:focus, .review-row select:focus {
  border-color: var(--accent);
}
.rev-col-name { flex: 1 1 180px; }
.rev-col-rating { width: 145px; }
.rev-col-date { width: 140px; }
.rev-col-comment { flex: 2 1 280px; }

.closure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.closure-row > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.closure-row label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.closure-row .edit-input {
  margin: 0 !important;
}
.cls-col-date { flex: 1 1 120px; }
.cls-col-reason { flex: 2 1 200px; }

/* Specific small mobile devices optimization */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Save Config and add action buttons full-width */
  .btn-action-add {
    width: 100%;
    box-sizing: border-box;
  }
  .btn-login {
    width: 100%;
    box-sizing: border-box;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }

  /* Table footer and legend wrap */
  .table-footer {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    align-items: center;
  }

  .dash-calendar-legend {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
  }

  /* Schedule input scaling to prevent overflow */
  .time-range-row {
    width: 100%;
  }
  .time-range-row input[type="time"] {
    flex: 1;
    min-width: 0;
  }
  .btn-remove-range {
    margin-left: 0.25rem;
  }

  .schedule-day-row {
    padding: 0.75rem 0.875rem;
  }
  
  /* Closures vertical stacking card layout */
  .closure-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    position: relative !important;
    padding-bottom: 3.5rem !important;
  }
  .closure-row > div {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .closure-row .btn-delete {
    position: absolute !important;
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    margin-top: 0 !important;
    width: 36px !important;
    height: 36px !important;
  }
  
  /* Reviews vertical stacking card layout */
  .review-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    position: relative !important;
    padding-bottom: 3.5rem !important;
  }
  .review-row > div {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .review-row .btn-delete {
    position: absolute !important;
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    margin-top: 0 !important;
    width: 36px !important;
    height: 36px !important;
  }
}

/* ============================================================
   BOTTOM NAVIGATION BAR — Móvil y Tablet (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* El contenido principal necesita espacio para la barra inferior */
  .main {
    padding-bottom: 74px !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* La barra de tabs: fixed al fondo */
  .tabs {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border) !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5) !important;
    /* Safe area para dispositivos con barra de inicio */
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* Cada tab ocupa la misma fracción del ancho */
  .tab {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.45rem 0.1rem 0.5rem !important;
    border-radius: 0 !important;
    font-size: 0.48rem !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    color: var(--text-muted) !important;
    background: transparent !important;
    gap: 3px !important;
    position: relative !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    transition: color var(--transition), background var(--transition) !important;
    border-right: 1px solid var(--border) !important;
  }
  .tab:last-child { border-right: none !important; }

  /* Tab activo */
  .tab.active {
    color: var(--accent) !important;
    background: rgba(201,168,76,0.07) !important;
  }
  /* Línea indicadora superior en tab activo */
  .tab.active::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 15% !important;
    right: 15% !important;
    height: 2px !important;
    background: var(--accent) !important;
    border-radius: 0 0 2px 2px !important;
  }

  /* Iconos por tab via ::before */
  .tab::before {
    font-size: 1rem !important;
    line-height: 1 !important;
    display: block !important;
  }
  .tab[data-filter="all"]::before          { content: "☰"; font-size: 1.1rem !important; }
  .tab[data-filter="pending"]::before      { content: "◷"; font-size: 1rem !important; }
  .tab[data-filter="confirmed"]::before    { content: "✓"; font-size: 1.1rem !important; font-weight: 900 !important; }
  .tab[data-filter="cancelled"]::before    { content: "✕"; font-size: 0.95rem !important; }
  .tab[data-filter="calendar_view"]::before{ content: "▦"; font-size: 1rem !important; }
  .tab[data-filter="history"]::before      { content: "↺"; font-size: 1.15rem !important; }
  .tab[data-filter="config"]::before       { content: "⚙"; font-size: 0.95rem !important; }

  /* La barra de búsqueda ocupa todo el ancho cuando los tabs están abajo */
  .panel-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    margin-bottom: 0.75rem !important;
  }
  .search-box {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .search-box input { width: 100% !important; }

  /* Ajustes extra de layout */
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .config-grid { grid-template-columns: 1fr !important; }
  .config-section { padding: 1rem !important; }
  .topbar-title { display: none; }
}

@media (max-width: 480px) {
  /* En móviles muy pequeños, reducir padding del topbar */
  .topbar { padding: 0 0.75rem; }
  .tab { font-size: 0.42rem !important; }
  .tab::before { font-size: 0.9rem !important; }
}
