/* ═══════════════════════════════════════
   CASA HIDALGO ADMIN — Light Professional CSS
   Mobile-First · v1.0
═══════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
  --gold: #C9A84C;
  --gold-light: #E2C46E;
  --gold-dim: rgba(201, 168, 76, 0.1);
  --gold-border: rgba(201, 168, 76, 0.3);

  --navy: #0D1B2A;
  --navy-mid: #1A3054;
  --navy-dim: rgba(13, 27, 42, 0.05);

  --bg: #F8F7F4;
  --bg-card: #FFFFFF;
  --bg-card-2: #F3F2EE;
  --bg-input: #FFFFFF;
  --bg-hover: #f0f0f0;

  --text: #0D1B2A;
  --text-sub: #4A5568;
  --text-muted: #718096;

  --border: rgba(0, 0, 0, 0.08);
  --border-focus: var(--navy);

  --green: #2D6A4F;
  --green-dim: rgba(45, 106, 79, 0.1);
  --red: #C53030;
  --red-dim: rgba(197, 48, 48, 0.1);
  --amber: #e0a050;
  --amber-dim: rgba(224, 160, 80, 0.15);

  --sidebar-w: 260px;
  --topbar-h: 60px;

  --radius-sm: 6px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);

  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9285' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

/* ── UTILITIES ── */
.hidden {
  display: none !important;
}

.mt-16 {
  margin-top: 16px;
}

.mt-32 {
  margin-top: 32px;
}

.mb-16 {
  margin-bottom: 16px;
}

.full-width {
  width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

/* ── ADDITIONAL UTILITIES ── */
.p-24 {
  padding: 24px !important;
}

.mt-12 {
  margin-top: 12px !important;
}

.mb-20 {
  margin-bottom: 20px !important;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.5s ease both;
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo-mark {
  width: 72px;
  height: 72px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 auto 16px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.login-brand img {
  max-height: 50px;
  margin-bottom: 12px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field-group label {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.pass-wrapper {
  position: relative;
}

.pass-wrapper input {
  padding-right: 44px;
}

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  padding: 4px;
}

.toggle-pass svg {
  width: 16px;
  height: 16px;
  display: block;
}

.login-error {
  color: var(--red);
  font-size: 0.82rem;
  text-align: center;
}

.login-footer {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  margin-top: 24px;
}

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-primary:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-sub);
  font-size: 0.85rem;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color var(--transition), color var(--transition);
}

.btn-outline:hover {
  border-color: var(--gold-border);
  color: var(--gold);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition);
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  white-space: nowrap;
  transition: background var(--transition);
}

.btn-ai:hover {
  background: rgba(201, 168, 76, 0.25);
}

.btn-ai svg {
  width: 14px;
  height: 14px;
}

.icon-btn {
  color: var(--text-muted);
  padding: 4px;
  font-size: 1rem;
  transition: color var(--transition);
}

.icon-btn:hover {
  color: var(--text);
}

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

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: transform var(--transition);
  transform: translateX(-100%);
}

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

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.brand-role {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-close {
  color: #fff;
  font-size: 1.1rem;
  padding: 4px 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  font-weight: 400;
  transition: all var(--transition);
  text-decoration: none;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
  border-right: 3px solid var(--gold);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
}

.logout-btn:hover {
  background: var(--red-dim);
  color: var(--red);
}

/* ── IMAGE MANAGER STYLES ── */
.image-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.image-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  cursor: grab;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--red);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-thumb:hover .image-thumb-remove {
  opacity: 1;
}


/* Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-right: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-sub);
  border-radius: 2px;
  transition: background var(--transition);
}

.menu-toggle:hover span {
  background: var(--gold);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: none;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

/* ── SECTIONS ── */
.section {
  padding: 24px 16px 80px;
  animation: fadeUp 0.35s ease both;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.02em;
}

@media (max-width: 767px) {
  .section-title {
    display: none;
  }

  .section-header {
    margin-bottom: 12px;
  }
}

.section-sub {
  color: var(--text-sub);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.card-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
  padding: 20px 20px 0;
}

/* ════════════════════════════════════
   DASHBOARD — KPI GRID
════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  /* Reducido de 20 a 16 para dar más espacio en móvil */
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
  min-width: 0;
  /* Permite encoger por debajo del min-content */
}

.kpi-card:hover {
  border-color: var(--gold-border);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color, var(--gold));
}

.kpi-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-dim, var(--gold-dim));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-color, var(--gold));
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.7rem;
  /* Ligeramente más pequeño */
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  word-wrap: break-word;
  /* Permitir que rompa líneas largas */
  hyphens: auto;
}

/* Quick room status */
.badge-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card-2);
  padding: 4px 10px;
  border-radius: 20px;
}

.quick-status-list {
  padding: 8px 0;
}

.quick-status-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
  /* Ajuste para móvil */
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  flex-wrap: wrap;
  /* Permite wrap en móviles muy estrechos */
}

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

.quick-status-item:hover {
  background: var(--bg-hover);
}

.qs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.qs-name {
  font-size: 0.9rem;
  font-weight: 400;
  flex: 1;
  min-width: 100px;
}

.qs-price {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.available {
  background: #28a745;
  color: white;
  border: 1px solid #218838;
}

.status-badge.reserved {
  background: #6c757d;
  color: white;
  border: 1px solid #5a6268;
}

.status-badge.blocked {
  background: #dc3545;
  color: black;
  border: 1px solid #c82333;
}

/* Room Card extra */
.room-card.status-blocked {
  opacity: 0.85;
  filter: grayscale(0.5);
}

.room-card-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: rgba(13, 27, 42, 0.8);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.dot-available {
  background: #28a745 !important;
}

.dot-reserved {
  background: #6c757d !important;
}

.dot-blocked {
  background: #dc3545 !important;
}

/* ════════════════════════════════════
   ROOMS GRID
════════════════════════════════════ */
.rooms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.room-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-card-2);
}

.room-card-img-placeholder {
  width: 100%;
  height: 180px;
  background: var(--bg-card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.room-card-body {
  padding: 16px;
}

.room-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.room-card-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.room-card-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  white-space: nowrap;
}

.room-card-price span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.room-card-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 12px;
}

.room-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.room-card-capacity {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.room-card-capacity svg {
  width: 13px;
  height: 13px;
}

.room-card-actions {
  display: flex;
  gap: 8px;
}

.room-card-actions button {
  flex: 1;
  padding: 9px;
  font-size: 0.8rem;
}

/* Quick status toggle in room card */
.status-toggle-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.status-toggle {
  flex: 1;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  transition: all var(--transition);
}

.status-toggle.active-available {
  border-color: #218838;
  background: #28a745;
  color: white;
}

.status-toggle.active-reserved {
  border-color: #5a6268;
  background: #6c757d;
  color: white;
}

.status-toggle.active-blocked {
  border-color: #c82333;
  background: #dc3545;
  color: black;
}

/* ════════════════════════════════════
   CALENDAR / AVAILABILITY
════════════════════════════════════ */
.room-pills-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  margin: -24px -16px 24px;
}

.room-pills {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.room-pill {
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-sub);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  background: var(--bg-card);
}

.room-pill.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 27, 42, 0.2);
}

.calendar-card {
  margin-bottom: 120px;
  /* Espacio para la barra flotante */
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.cal-month {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px;
  gap: 2px;
  background: #fff;
  user-select: none;
}

.cal-day-header {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 0;
  font-weight: 700;
}

.cal-day {
  aspect-ratio: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-sub);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  z-index: 1;
}

.cal-day:active {
  transform: scale(0.9);
}

.cal-day.cal-today {
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
}

.cal-day.cal-available {
  background: #28a745;
  color: white;
  border-color: #218838;
}

.cal-day.cal-reserved {
  background: #6c757d;
  color: white;
  border: 1px solid #5a6268;
  font-weight: 600;
}

.cal-day.cal-blocked {
  background: #dc3545;
  color: black;
}

.cal-day.cal-past {
  opacity: 0.2;
  cursor: default;
}

/* Drag Selection Style */
.cal-day.selected {
  background: var(--navy) !important;
  color: var(--gold) !important;
  border-radius: 0;
  border: none;
  z-index: 2;
}

.cal-day.selected:first-of-type {
  border-radius: 8px 0 0 8px;
}

.cal-day.selected:last-of-type {
  border-radius: 0 8px 8px 0;
}

/* Si solo hay un elemento seleccionado, borde redondeado completo */
.cal-day.selected:first-of-type:last-of-type {
  border-radius: 8px;
}

/* Calendar Legend Dots */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-available {
  background: #28a745;
  border: 1px solid #218838;
}

.dot-reserved {
  background: #6c757d;
  border: 1px solid #5a6268;
}

.dot-blocked {
  background: #dc3545;
}

/* Admin Calendar Layout for Desktop */
@media (min-width: 1024px) {
  .calendar-admin-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
    margin-top: 16px;
    max-width: 1000px;
  }

  .calendar-card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* Floating Action Bar (Premium Bottom Sheet) */
.day-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px;
  z-index: 1100;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.day-panel.hidden {
  display: none !important;
}

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

.day-panel-header h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--navy);
  font-weight: 600;
}

.day-panel-header .icon-btn {
  font-size: 1.2rem;
}

.day-actions {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  /* Permite scroll si los botones son muy anchos */
  padding-bottom: 4px;
}

.day-action-btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-sub);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition);
}

.day-action-btn svg {
  width: 22px;
  height: 22px;
}

.day-action-btn.available:hover {
  background: var(--bg-hover);
  border-color: var(--text-sub);
  color: var(--text);
}

.day-action-btn.reserved:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.day-action-btn.blocked:hover {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--text-muted);
}

.day-panel .guest-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-panel .guest-input-wrap input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

@media (min-width: 1024px) {
  .day-panel {
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
    width: 100%;
    max-width: none;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
    margin-top: 0;
  }

  .day-panel-header {
    margin-bottom: 16px;
  }

  .day-actions {
    flex-direction: column;
    overflow: visible;
  }

  .day-action-btn {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
    min-width: 0;
  }
}

/* ════════════════════════════════════
   ANALYTICS
════════════════════════════════════ */
.analytics-note {
  padding: 14px 20px;
}

.analytics-note p {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.6;
}

.analytics-note code {
  background: var(--bg-hover);
  color: var(--gold);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.analytics-table-wrap {
  overflow-x: auto;
}

/* ── TABLAS RESPONSIVAS (Sistema Universal de Tarjetas) ── */
.analytics-table,
.res-table,
.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.analytics-table th,
.res-table th,
.reports-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.analytics-table td,
.res-table td,
.reports-table td {
  padding: 12px 20px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 767px) {

  .analytics-table,
  .res-table,
  .reports-table,
  .analytics-table thead,
  .res-table thead,
  .reports-table thead,
  .analytics-table tbody,
  .res-table tbody,
  .reports-table tbody,
  .analytics-table tr,
  .res-table tr,
  .reports-table tr,
  .analytics-table td,
  .res-table td,
  .reports-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  .analytics-table thead,
  .res-table thead,
  .reports-table thead {
    display: none;
  }

  .analytics-table tr,
  .res-table tr,
  .reports-table tr {
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
  }

  .analytics-table td,
  .res-table td,
  .reports-table td {
    text-align: right;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    gap: 12px;
    overflow: hidden;
    /* Evitar cualquier fuga */
  }

  /* El último TD (acciones) suele ser distinto */
  .analytics-table td:last-child,
  .res-table td:last-child,
  .reports-table td:last-child {
    border-bottom: none;
    background: var(--bg-card-2);
    margin-top: 8px;
    padding-top: 15px;
    padding-bottom: 15px;
    grid-template-columns: 1fr;
    /* Centrado en acciones */
    text-align: center;
  }

  .analytics-table td::before,
  .res-table td::before,
  .reports-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    flex: 0 0 95px;
    /* Label con ancho fijo garantizado */
  }

  .analytics-table td span,
  .res-table td span,
  .reports-table td span {
    text-align: right;
    flex: 1;
    min-width: 0;
    display: block;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    /* Cortar texto largo con puntos suspensivos */
    white-space: nowrap;
    /* Evitar que el texto crezca hacia los lados */
  }

  /* Excepción para permitir saltos de línea en Reservas donde sí son necesarios */
  .res-table td span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .analytics-table td>br,
  .res-table td>br,
  .reports-table td>br {
    display: none;
  }
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ════════════════════════════════════
   NEWSLETTER
════════════════════════════════════ */
.newsletter-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.compose-card {
  padding: 0;
}

.compose-card .card-title,
.preview-card .card-title {
  padding: 20px 20px 0;
}

.compose-card .field-group {
  padding: 0 20px;
  margin-bottom: 16px;
}

.compose-card>.btn-primary {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
}

.ai-compose-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-compose-bar input {
  flex: 1;
}

#emailBody {
  padding: 0 20px;
}

#emailBody,
.compose-card textarea {
  display: block;
  margin: 0 20px;
  width: calc(100% - 40px);
}

.email-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0 20px 20px;
  overflow: hidden;
  background: #fff;
  min-height: 400px;
}

/* ════════════════════════════════════
   MODALS
════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-lg);
  }
}

.modal-sm {
  max-width: 380px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.modal-close {
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body .field-group {
  margin-bottom: 0;
}

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

/* ════════════════════════════════════
   TOAST
════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-2);
  border: 1px solid var(--gold-border);
  color: var(--text);
  font-size: 0.85rem;
  padding: 12px 24px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  white-space: nowrap;
  animation: toastIn 0.3s ease;
}

/* ════════════════════════════════════
   ANIMATIONS
════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ════════════════════════════════════
   RESPONSIVE — TABLET & DESKTOP
════════════════════════════════════ */
@media (min-width: 640px) {
  .section {
    padding: 32px 32px 80px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .day-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar-date {
    display: block;
  }

  .rooms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: var(--sidebar-w);
  }

  .menu-toggle {
    display: none;
  }

  .section {
    padding: 40px 48px 60px;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .rooms-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .newsletter-layout {
    flex-direction: row;
  }

  .compose-card,
  .preview-card {
    flex: 1;
  }
}

/* ── SETTINGS DESIGN ── */
.settings-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header-title svg {
  width: 20px;
  height: 20px;
  color: var(--gold);
}

.logo-preview-box {
  background: var(--bg-card-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  min-height: 140px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg:first-child {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

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

.toggle-pass-settings {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
}

/* ── SYNC OVERLAY ANIMATIONS ── */
@keyframes syncProgress {
  0% {
    left: -100%;
  }

  50% {
    left: 0;
  }

  100% {
    left: 100%;
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.4);
  }

  100% {
    transform: scale(0.95);
    opacity: 0.9;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
  }
}

/* Fin del archivo */