* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #3b82f6;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.25);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar nav { flex: 1; overflow-y: auto; }

.sidebar-header {
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #334155;
}

/* Campana notificaciones */
.btn-notif {
  position: relative;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  width: 100%;
  justify-content: center;
  transition: background 0.2s;
}
.btn-notif:hover { background: rgba(255,255,255,0.18); }

.notif-badge {
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Búsqueda global */
.global-search-wrap {
  padding: 8px 12px;
  position: relative;
}
.global-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.global-search-input:focus { border-color: var(--primary); }
.global-search-results {
  position: absolute;
  left: 12px; right: 12px;
  top: calc(100% - 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
}
.gs-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.gs-item:last-child { border-bottom: none; }
.gs-item:hover, .gs-item.gs-active { background: var(--bg); }
.gs-icono { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.gs-titulo { font-size: 13px; font-weight: 600; color: var(--text); }
.gs-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.gs-tipo {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
}

/* Panel desplegable */
.notif-panel {
  background: #fff;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 420px;
  overflow-y: auto;
  margin: 0 8px;
  position: relative;
  z-index: 100;
}
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  position: sticky;
  top: 0;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: #f8fafc; }
.notif-item-header { font-size: 13px; color: #1e293b; margin-bottom: 6px; }
.notif-item-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}
.notif-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

.sidebar-logo {
  width: 100%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.nav-btn:hover { background: var(--sidebar-hover); color: #f8fafc; }
.nav-btn.active { background: var(--sidebar-active); color: #fff; }

.sync-status {
  display: block;
  font-size: 11px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 20px;
  margin: 10px 16px 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.3s;
}
.sync-status.ok     { background: rgba(34,197,94,0.15); color: #22c55e; }
.sync-status.saving { background: rgba(234,179,8,0.15);  color: #ca8a04; }
.sync-status.error  { background: rgba(239,68,68,0.15);  color: #ef4444; }

.icon { font-size: 16px; display: flex; align-items: center; flex-shrink: 0; }
.icon svg { display: block; }

/* MAIN */
.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.date-label {
  font-size: 14px;
  color: var(--text-muted);
}

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

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}

.stat-card.blue   { border-left-color: var(--blue); }
.stat-card.green  { border-left-color: var(--green); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.red    { border-left-color: var(--red); }
.stat-card.purple { border-left-color: #7c3aed; }

.stat-icon { font-size: 32px; }

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

.stat-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* CARD */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 11px 14px;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td { border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 32px !important;
  font-style: italic;
}

/* BUTTONS */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

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

.btn-success {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-success:hover { background: #15803d; }

@keyframes rowHighlight {
  0%   { background: #dcfce7; }
  70%  { background: #dcfce7; }
  100% { background: transparent; }
}
tr.row-highlight { animation: rowHighlight 3s ease forwards; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover { background: var(--bg); color: var(--text); }

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.btn-icon:hover { background: var(--bg); }
.btn-icon.view   { color: #0284c7; }
.btn-icon.view:hover   { background: #e0f2fe; }
.btn-icon.edit   { color: #6b7280; }
.btn-icon.edit:hover   { background: #f3f4f6; }
.btn-icon.delete { color: #ef4444; }
.btn-icon.delete:hover { background: #fee2e2; }
.btn-icon.success{ color: #16a34a; }
.btn-icon.success:hover{ background: #dcfce7; }
.btn-icon.warning{ color: #ea580c; }
.btn-icon.warning:hover{ background: #ffedd5; }
.btn-icon.payment{ color: #7c3aed; }
.btn-icon.payment:hover{ background: #ede9fe; }

/* FILTERS */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}

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

/* ROOMS GRID */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.room-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--border);
  transition: box-shadow 0.15s;
}

.room-card:hover { box-shadow: var(--shadow-md); }
.room-card.disponible { border-top-color: var(--green); }
.room-card.ocupada { border-top-color: var(--red); }
.room-card.mantenimiento { border-top-color: var(--orange); }

.room-number {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.room-type {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-bottom: 10px;
}

.room-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.room-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.room-status.disponible { background: #dcfce7; color: #16a34a; }
.room-status.ocupada { background: #fee2e2; color: #dc2626; }
.room-status.mantenimiento { background: #ffedd5; color: #ea580c; }

.room-actions {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* BADGE STATUS */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge.confirmada { background: #dcfce7; color: #16a34a; }
.badge.pendiente { background: #fef9c3; color: #ca8a04; }
.badge.cancelada { background: #fee2e2; color: #dc2626; }

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

.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--bg);
  transition: border-color 0.15s;
}

.search-bar input:focus { border-color: var(--primary); background: #fff; }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
}

.modal form {
  overflow-y: auto;
  flex: 1;
}

.modal-wide { max-width: 620px; }

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

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

.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

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

form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  background: #fff;
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.readonly-field {
  background: var(--bg) !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* Dashboard tables */
.dashboard-tables {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.dashboard-tables .card { margin-bottom: 0; }
@media (max-width: 900px) {
  .dashboard-tables { grid-template-columns: 1fr; }
}

/* ============================================================
   RESERVAS - Panel de búsqueda
   ============================================================ */
.reservas-search-panel {
  background: #374151;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.reservas-search-panel .form-group label {
  color: #d1d5db;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reservas-search-panel .form-group input,
.reservas-search-panel .form-group select {
  background: #fff;
  border-color: #6b7280;
  color: var(--text);
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.search-panel-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-search {
  background: #ea580c;
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-search:hover { background: #c2410c; }

/* Resultados header */
.reservas-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.reservas-count {
  font-size: 14px;
  font-weight: 700;
  color: #ea580c;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Tabla scroll */
.table-scroll { overflow-x: auto; }

/* Fila agrupadora de fecha */
.date-group-row td {
  background: #f1f5f9;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border);
}

/* Iconos de huéspedes */
.guest-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Referencia clicable */
.reserva-ref {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: monospace;
}
.reserva-ref:hover { text-decoration: underline; }

/* Badges nuevos estados */
.badge.en_curso   { background: #dbeafe; color: #1d4ed8; }
.badge.completada { background: #f0fdf4; color: #15803d; }
.badge.aceptada   { background: #dcfce7; color: #16a34a; }
.badge.rechazada  { background: #fee2e2; color: #dc2626; }
.badge.vencida    { background: #f1f5f9; color: #94a3b8; }

/* Botones check-in / check-out */
.btn-checkin { color: #16a34a !important; }
.btn-checkout { color: #dc2626 !important; }

/* Ficha del huésped / Historial habitación — stat cards compartidas */
.ficha-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.ficha-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.ficha-stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
#ficha-reservas-tbody tr:hover { background: var(--bg); }

/* Título cotización en documento */
.cot-title { color: #b45309 !important; }
.cot-footer { border-top: 1px solid #e2e8f0; padding-top: 16px; color: #64748b; font-size: 13px; }
.cot-footer p { margin: 4px 0; }

.cot-deposito-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.cot-deposito-title {
  font-weight: 700;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cot-deposito-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed #fde68a;
}
.cot-deposito-monto { font-weight: 700; color: #b45309; font-size: 16px; }
.cot-deposito-nota {
  margin-top: 10px;
  font-size: 12px;
  color: #78350f;
  line-height: 1.5;
}

/* Form row 3 columnas */
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ============================================================
   PLANES TARIFARIOS
   ============================================================ */

.plan-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.plan-card-exento {
  border-left: 4px solid #16a34a;
}
.badge-exento {
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.plan-card-actions { display: flex; gap: 4px; }

.plan-nombre {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.plan-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.plan-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.plan-tag {
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.plan-rates-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.plan-rates-table th,
.plan-rates-table td {
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.plan-rates-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.plan-rates-form input[type="number"] {
  width: 120px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

/* Separador de sección en formularios */
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* ============================================================
   PAGOS
   ============================================================ */

/* Tabs */
.pagos-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.pagos-tab {
  padding: 10px 22px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.pagos-tab:hover  { color: var(--primary); }
.pagos-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

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

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Recargo input */
.recargo-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}
.recargo-input:disabled { background: var(--bg); color: var(--text-muted); }

/* Badge método de pago */
.metodo-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.metodo-efectivo      { background: #dcfce7; color: #16a34a; }
.metodo-clave         { background: #dbeafe; color: #1d4ed8; }
.metodo-visa          { background: #ede9fe; color: #7c3aed; }
.metodo-mastercard    { background: #fee2e2; color: #dc2626; }
.metodo-yappy         { background: #e0f2fe; color: #0369a1; }
.metodo-transferencia { background: #f0fdf4; color: #15803d; }

/* Resumen cobro en modal */
.cobro-resumen {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cobro-resumen-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.cobro-pendiente-row strong { color: var(--red); font-size: 15px; }

/* Desglose impuesto en modal reserva */
/* Cargos adicionales */
.cargos-section {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cargos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.btn-add-cargo {
  padding: 3px 10px;
  border: 1px dashed var(--primary);
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add-cargo:hover { background: rgba(59,130,246,0.08); }
.cargo-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px 90px 70px 28px;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.cargo-row:last-child { border-bottom: none; }
.cargo-row select,
.cargo-row input[type="text"],
.cargo-row input[type="number"] {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  width: 100%;
}
.cargo-subtotal-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
}
.cargo-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}
.cargo-remove:hover { background: #fee2e2; color: var(--red); }

.tax-breakdown {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tax-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.tax-row.tax-highlight {
  font-weight: 600;
  color: #92400e;
}

/* Fila de impuesto en tab Impuestos */
.tax-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
}

.tax-display-scope {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
}

.tax-display-pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  min-width: 48px;
  text-align: right;
}

/* Toggle label */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================================
   CALENDARIO
   ============================================================ */

/* Topbar controles */
.cal-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-range-sel {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  cursor: pointer;
  color: var(--text);
}

.cal-nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.cal-nav-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
  line-height: 1;
}

.cal-nav-btn:hover { background: var(--bg); color: var(--text); }

.cal-date-display {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 0 10px;
  white-space: nowrap;
}

.cal-today-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}

.cal-today-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Wrapper con scroll horizontal */
.cal-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Grid principal */
.cal-grid {
  display: grid;
  column-gap: 0;
  row-gap: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: max-content;
}

/* Esquina superior izquierda */
.cal-corner {
  background: #f8fafc;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 4;
}

/* Cabecera de día */
.cal-header-day {
  background: #f8fafc;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 8px 4px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 3;
}

.cal-hd-weekend { background: #fef9c3; }
.cal-hd-today   { background: #eff6ff; }

.cal-dow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-dn {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.cal-dn-today { color: var(--primary); }

.cal-dm {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cabecera de grupo de tipo */
.cal-type-header {
  background: #f1f5f9;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
  border-bottom: 1px solid var(--border);
  position: sticky;
  left: 0;
}

/* Etiqueta de habitación (columna izquierda) */
.cal-room-label {
  background: var(--card-bg);
  padding: 0 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 46px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.cal-room-num  { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-room-tipo { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* Celda de día */
.cal-cell {
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 46px;
  padding: 4px 0;
  cursor: pointer;
  position: relative;
}

.cal-cell-weekend { background: #fffbeb; }
.cal-cell-today   { background: #eff6ff; }
.cal-cell-empty:hover { background: #f0fdf4; }

/* Barras de reserva */
.cal-bar {
  height: 30px;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: filter 0.15s;
}

.cal-bar:hover { filter: brightness(0.88); }

.bar-start { margin-left: 5px; border-radius: 15px 0 0 15px; padding-left: 8px; }
.bar-mid   { margin: 0; border-radius: 0; }
.bar-end   { border-radius: 0 15px 15px 0; margin-right: 5px; }
.bar-solo  { margin: 0 5px; border-radius: 15px; padding: 0 8px; }

.bar-label {
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Colores por estado */
.estado-confirmada { background: #3b82f6; }
.estado-pendiente  { background: #f59e0b; }
.estado-en_curso   { background: #10b981; }
.estado-completada { background: #94a3b8; }

/* Leyenda del calendario */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.cal-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Vacío del calendario */
.cal-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  background: var(--card-bg);
}

/* ============================================================
   LEY 6 — DESCUENTO JUBILADOS
   ============================================================ */

/* Multi-habitación — filas dinámicas */
.hab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.hab-row .hab-row-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
}
.hab-row-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--red);
  font-size: 16px;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1;
}
.hab-row-remove:hover { background: #fee2e2; }
.btn-add-hab {
  margin-top: 6px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--primary);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  width: 100%;
}
.btn-add-hab:hover { background: #eff6ff; }

/* Quick-create client panel inside cotización form */
.quick-cliente-panel {
  margin-top: 10px;
  padding: 14px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}
.quick-cliente-title {
  font-size: 13px;
  font-weight: 600;
  color: #166534;
  margin-bottom: 10px;
}
[data-theme="dark"] .quick-cliente-panel {
  background: #052e16;
  border-color: #166534;
}
[data-theme="dark"] .quick-cliente-title { color: #86efac; }

/* Badge grupo en tabla reservas */
.badge-grupo {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 5px;
  vertical-align: middle;
}

/* Badge en tabla clientes / reservas */
.badge-ley6 {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Checkbox Ley 6 en modal cliente */
.ley6-check-row {
  margin: 8px 0 4px;
}
.ley6-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.ley6-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #7c3aed;
  cursor: pointer;
}
.ley6-check-text {
  color: #5b21b6;
  font-weight: 500;
}

/* Caja Ley 6 en modal reserva */
.ley6-box {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ley6-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}
.ley6-ocupacion {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 8px;
}
.ley6-ocupacion label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.ley6-ocupacion input[type="radio"] {
  accent-color: #7c3aed;
}

/* Breakdown Ley 6 */
.ley6-breakdown {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid #ddd6fe;
  padding-top: 8px;
  margin-top: 4px;
}
.ley6-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.ley6-row.ley6-ahorro {
  color: #7c3aed;
  font-weight: 600;
}
.ley6-row.ley6-subtotal-ley6 {
  color: #3b0764;
  font-weight: 700;
  border-top: 1px solid #ddd6fe;
  padding-top: 4px;
  margin-top: 2px;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .login-overlay {
    align-items: flex-start;
    padding: 40px 16px 60px;
  }
}
.login-box {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-logo-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
}
.login-hotel-name {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}
.login-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 28px;
}
.login-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 15px;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.login-select:focus { border-color: var(--primary); }
.login-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.login-user-rol {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
}
.login-user-rol.admin        { background: #eff6ff; color: #1d4ed8; }
.login-user-rol.cajero       { background: #fefce8; color: #854d0e; }
.login-user-rol.recepcionista{ background: #f0fdf4; color: #166534; }

.login-user-selected {
  font-size: 14px;
  margin-bottom: 16px;
  color: #0f172a;
}
.login-pin-inputs { display:none; } /* reemplazado por pin-pad */

/* Puntos del PIN */
.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}

/* Teclado numerico */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto 12px;
}
.pin-key {
  height: 56px;
  font-size: 20px;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.pin-key:active { background: var(--primary); color: #fff; transform: scale(0.95); }
.pin-key-del  { font-size: 18px; background: #fff0f0; border-color: #fca5a5; color: #ef4444; }
.pin-key-volver { font-size: 12px; font-weight: 500; background: #f1f5f9; }
.login-pin-error {
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* Sidebar usuario */
.sidebar-user-bar {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-rol {
  font-size: 10px;
  font-weight: 600;
  text-transform: capitalize;
}
.sidebar-user-rol.admin         { color: #93c5fd; }
.sidebar-user-rol.cajero        { color: #fde68a; }
.sidebar-user-rol.recepcionista { color: #86efac; }
.sidebar-logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: #f87171; }

/* Tarjeta usuario en Configuración */
.usuario-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
}
.usuario-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.usuario-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   CONFIGURACIÓN
   ============================================================ */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.config-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
}
.config-card-link { }
.config-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.config-card-icon { font-size: 20px; }
.config-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.config-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 16px;
}
.config-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.config-link-list li a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.config-link-list li a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Backup actions */
.backup-actions { display: flex; flex-direction: column; gap: 6px; }

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.backup-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.backup-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-danger {
  padding: 8px 16px;
  background: #fee2e2;
  color: var(--red);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-danger:hover { background: #fecaca; border-color: var(--red); }

/* Duplicados */
.dup-grupo {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.dup-grupo-header {
  background: #fef9c3;
  padding: 8px 14px;
  font-size: 13px;
  color: #92400e;
  border-bottom: 1px solid var(--border);
}
.dup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dup-row:last-child { border-bottom: none; }
.dup-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: 13px;
}
[data-theme="dark"] .dup-grupo-header { background: rgba(234,179,8,0.15); color: #fde68a; }

/* ============================================================
   SERVICIO DE LIMPIEZA
   ============================================================ */
.limp-topbar {
  margin-bottom: 16px;
  padding: 16px 20px;
}
.limp-quick-btns {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.limp-quick-btn {
  background: white;
  border: none;
  border-right: 1px solid var(--border);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}
.limp-quick-btn:last-child { border-right: none; }
.limp-quick-btn:hover { background: #f1f5f9; }
.limp-quick-btn.active { background: #374151; color: white; }

.limp-fecha-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tabla limpieza */
.limp-huespedes {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.limp-nota-input {
  width: 100%;
  min-width: 140px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  background: transparent;
  color: var(--text);
}
.limp-nota-input:focus {
  outline: none;
  border-color: var(--primary);
}
.limp-nota-input::placeholder { color: var(--primary); font-style: italic; }

.limp-estado-select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  background: white;
  cursor: pointer;
  min-width: 130px;
}
.limp-estado-select:focus { outline: none; }

/* Badges estado habitación */
.limp-estado-hab {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.limp-hab-sin_ocupar    { background: #f1f5f9; color: #64748b; }
.limp-hab-ocupadas      { background: #fef3c7; color: #92400e; }
.limp-hab-solo_entradas { background: #dcfce7; color: #166534; }
.limp-hab-solo_salidas  { background: #fee2e2; color: #991b1b; }
.limp-hab-entrada_salida{ background: #ede9fe; color: #5b21b6; }

/* ============================================================
   INFORMES
   ============================================================ */
.informes-tab-content { }

.inf-filter-bar {
  margin-bottom: 20px;
  padding: 16px 20px;
}

.inf-table-block { margin-bottom: 24px; }

.inf-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.inf-block-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.btn-export {
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-export:hover { background: #15803d; }

.ref-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.text-danger { color: #ef4444; font-weight: 600; }

/* Barras de métricas */
.inf-metodo-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inf-metodo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inf-bar-wrap {
  flex: 1;
  background: #f1f5f9;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}
.inf-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.inf-bar-green { background: #10b981; }
.inf-bar-blue  { background: #3b82f6; }
.inf-metodo-total {
  min-width: 80px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Gráfico de barras verticales */
.inf-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
  padding-bottom: 4px;
}
.inf-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 4px;
  height: 100%;
}
.inf-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: #f1f5f9;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  min-height: 8px;
}
.inf-chart-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
  min-height: 4px;
}
.inf-chart-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.inf-chart-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
  white-space: nowrap;
}

/* Dashboard chart period buttons */
.dash-period-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.dash-period-btn:hover { border-color: var(--primary); color: var(--primary); }
.dash-period-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.dash-chart-bar-current { background: var(--green) !important; }

/* 6-card stats grid (3 por fila en desktop, 2 en tablet) */
.stats-grid { grid-template-columns: repeat(3, 1fr); }

/* Print */
@media print {
  .sidebar, .pagos-tabs, .inf-filter-bar, .btn-export, .btn-secondary { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .section { display: block !important; }
}

/* ============================================================
   INVENTARIO
   ============================================================ */
.inv-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.inv-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.inv-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.inv-legend-item { display: flex; align-items: center; gap: 5px; }
.inv-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.inv-dot-libre  { background: #10b981; }
.inv-dot-ocupada { background: #f59e0b; }
.inv-dot-editado { background: #3b82f6; }

.inv-grid {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.inv-row-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}
.inv-row-label-tarifa {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
}
.inv-label-tipo {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}
.inv-label-plan {
  color: var(--text-muted);
}
.inv-label-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Celdas de disponibilidad */
.inv-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  min-height: 48px;
  text-align: center;
}
.inv-cell-weekend { background: #fff7ed; }
.inv-cell-today   { background: #eff6ff; }
.inv-cell-full    { background: #fef2f2; }
.inv-cell-edited  { background: #eff6ff; }
.inv-cell-tarifa  { background: #f8fafc; }
.inv-cell-tarifa.inv-cell-weekend { background: #fef9f0; }
.inv-cell-tarifa.inv-cell-today   { background: #eff6ff; }
.inv-cell-tarifa.inv-cell-edited  { background: #dbeafe; }

.inv-disp-num {
  font-size: 18px;
  font-weight: 700;
  color: #10b981;
  line-height: 1;
}
.inv-disp-num.inv-num-cero { color: #ef4444; }
.inv-disp-total {
  font-size: 10px;
  color: var(--text-muted);
}

/* Input de precio en inventario */
.inv-price-input {
  width: 56px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
  font-size: 13px;
  font-weight: 600;
  background: white;
  color: var(--text);
}
.inv-price-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.inv-cell-edited .inv-price-input {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Mobile top bar — oculto en desktop */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 54px;
  background: var(--sidebar-bg);
  color: #f8fafc;
  z-index: 200;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.mobile-topbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex: 1;
}
.mobile-hamburger {
  background: none;
  border: none;
  color: #f8fafc;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 149;
}

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-tables { grid-template-columns: 1fr 1fr; }
}

/* Tablet portrait + mobile (≤ 768px) */
@media (max-width: 768px) {
  /* Top bar visible */
  .mobile-topbar { display: flex; }

  /* Sidebar pasa a drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 150;
    width: 260px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay.mobile-open { display: block; }

  /* Contenido principal sin margen sidebar, con espacio topbar */
  .main-content {
    margin-left: 0 !important;
    padding: 70px 14px 20px;
  }

  /* Stats 2 columnas */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard tables 1 columna */
  .dashboard-tables { grid-template-columns: 1fr; }

  /* Tablas con scroll horizontal */
  .card > table,
  .card > div > table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Section header apilado */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .section-header > div {
    flex-wrap: wrap;
  }

  /* Modales a pantalla completa */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal, .modal-wide, .modal-factura-wrap {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  /* Formularios 1 columna */
  .form-row { grid-template-columns: 1fr !important; }

  /* Ocultar columnas secundarias en tablas de clientes/reservas */
  .hide-mobile { display: none !important; }
}

/* Mobile pequeño (≤ 480px) */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-icon svg { width: 20px; height: 20px; }
  .stat-number { font-size: 20px; }
  .section-header h2 { font-size: 18px; }
  .btn-primary, .btn-secondary { font-size: 13px; padding: 8px 12px; }
}

/* ============================================================
   FACTURA
   ============================================================ */
.modal-factura-wrap { max-width: 780px; width: 100%; }

.factura-doc {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #1a1a2e;
  font-size: 14px;
  line-height: 1.5;
}

.factura-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}

.factura-hotel-info { flex: 1; }
.factura-hotel-info p { margin: 1px 0; color: #555; font-size: 12px; }

.factura-logo {
  max-width: 140px;
  height: auto;
  display: block;
  margin-bottom: 6px;
}

.factura-meta { text-align: right; }

.factura-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #0f172a;
  margin: 0 0 8px;
}

.factura-meta-table { margin-left: auto; border-collapse: collapse; }
.factura-meta-table td { padding: 2px 6px; font-size: 12px; }
.factura-meta-table td:first-child { color: #888; text-align: right; }

.factura-cliente-block {
  background: #f8fafc;
  border-left: 4px solid #0f172a;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 0 6px 6px 0;
}
.factura-cliente-block h4 { margin: 0 0 4px; font-size: 10px; letter-spacing: 1px; color: #888; }
.factura-cliente-block p { margin: 1px 0; font-size: 12px; }
.factura-cliente-nombre { font-size: 14px !important; font-weight: 700; }

.factura-tabla {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
.factura-tabla thead tr {
  background: #0f172a;
  color: #fff;
}
.factura-tabla th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.factura-tabla td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.factura-tabla tbody tr:hover { background: #f8fafc; }
.factura-fila-plan td { color: #64748b; font-style: italic; }

.factura-totales {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}
.factura-totales-inner { min-width: 280px; }
.factura-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}
.factura-total-final {
  font-weight: 800;
  font-size: 16px !important;
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  padding: 8px 0;
  margin-top: 4px;
}
.factura-pagado span:last-child { color: #16a34a; font-weight: 600; }
.factura-pendiente span:last-child { color: #dc2626; font-weight: 700; }
.factura-saldado span:last-child {
  background: #dcfce7;
  color: #16a34a;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.factura-notas {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.factura-footer {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 8px;
}

/* PRINT — Quitar encabezados/pies del navegador */
@page { margin: 10mm; }

/* ============================================================
   DARK MODE OVERRIDES — elementos con colores hardcodeados
   ============================================================ */
[data-theme="dark"] .notif-panel,
[data-theme="dark"] .global-search-results { background: var(--bg-card); }

[data-theme="dark"] .search-bar input:focus { background: var(--bg-card); }

[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .modal { background: var(--bg-card); }

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .recargo-input,
[data-theme="dark"] .limp-nota-input,
[data-theme="dark"] .global-search-input {
  background: var(--bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .config-card,
[data-theme="dark"] .room-card,
[data-theme="dark"] .ficha-stat-card { background: var(--bg-card); border-color: var(--border); }

[data-theme="dark"] th { background: var(--bg) !important; color: var(--text-muted); }

[data-theme="dark"] .cal-cell-weekend,
[data-theme="dark"] .inv-cell-weekend { background: rgba(234,88,12,0.08); }

[data-theme="dark"] .cal-corner,
[data-theme="dark"] .cal-header-day { background: var(--bg); }
[data-theme="dark"] .cal-hd-weekend { background: rgba(234,88,12,0.12); }
[data-theme="dark"] .cal-hd-today   { background: rgba(59,130,246,0.15); }
[data-theme="dark"] .cal-cell-today { background: rgba(59,130,246,0.08); }
[data-theme="dark"] .cal-type-header { background: var(--bg); }

[data-theme="dark"] .date-group-row { background: var(--bg); }

[data-theme="dark"] .cobro-resumen,
[data-theme="dark"] #checkinout-info { background: var(--bg) !important; }

[data-theme="dark"] .pagos-tab { color: var(--text-muted); }
[data-theme="dark"] .pagos-tab.active { color: var(--primary); }

[data-theme="dark"] .login-overlay { background: rgba(15,23,42,0.97); }
[data-theme="dark"] .login-box { background: var(--bg-card); }

/* Botón toggle modo oscuro */
.btn-dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #94a3b8;
  transition: background .15s;
  line-height: 1;
}
.btn-dark-toggle:hover { background: var(--sidebar-hover); }

/* PRINT — Factura y Recibo */
body.printing-factura > *:not(#modal-factura) { display: none !important; }
body.printing-recibo   > *:not(#modal-recibo-pago) { display: none !important; }
body.printing-hoja-dia > *:not(#modal-hoja-dia)   { display: none !important; }
body.printing-informe .sidebar { display: none !important; }
body.printing-informe .main-content { margin-left: 0 !important; }
@media print {
  body.printing-factura > *:not(#modal-factura) { display: none !important; }
  body.printing-factura #modal-factura { position: static !important; background: none !important; display: block !important; }
  body.printing-cotizacion > *:not(#modal-doc-cotizacion) { display: none !important; }
  body.printing-cotizacion #modal-doc-cotizacion { position: static !important; background: none !important; display: block !important; }
  body.printing-recibo > *:not(#modal-recibo-pago) { display: none !important; }
  body.printing-recibo #modal-recibo-pago { position: static !important; background: none !important; display: block !important; }
  body.printing-hoja-dia > *:not(#modal-hoja-dia) { display: none !important; }
  body.printing-hoja-dia #modal-hoja-dia { position: static !important; background: none !important; display: block !important; }
  .modal-factura-wrap { box-shadow: none !important; max-width: 100% !important; }
  .no-print { display: none !important; }
  #factura-content, #doc-cotizacion-content, #recibo-content, #hoja-dia-content { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  .factura-doc { color: #000; }
  .factura-tabla thead tr { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Informes PDF */
  body.printing-informe .sidebar { display: none !important; }
  body.printing-informe .main-content { margin-left: 0 !important; }
  body.printing-informe .section:not(#informes) { display: none !important; }
  body.printing-informe #informes .section-header { display: none !important; }
  body.printing-informe #informes .pagos-tabs { display: none !important; }
  body.printing-informe #informes .inf-filter-bar { display: none !important; }
  body.printing-informe #informes .btn-print-pdf { display: none !important; }
  body.printing-informe #informes .btn-export { display: none !important; }
  body.printing-informe #informes .btn-primary { display: none !important; }
  body.printing-informe #informes .informes-tab-content:not(.printing-active) { display: none !important; }
  body.printing-informe #informes .informes-tab-content.printing-active { display: block !important; }
  body.printing-informe #informes .table-scroll { overflow: visible !important; }
  body.printing-informe #informes table { page-break-inside: auto; }
  body.printing-informe #informes tr { page-break-inside: avoid; }
  body.printing-informe #inf-print-header { display: block !important; }
}
