/* ============================================================
   HOTELSYS - Estilos Principales
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* Modo Claro */
:root {
  --bg-body:        #f5f4f0;
  --bg-card:        #ffffff;
  --bg-sidebar:     #ffffff;
  --bg-sidebar-hover: #f0ede8;
  --bg-input:       #f9f8f6;
  --bg-badge:       #f0ede8;
  --text-primary:   #0f0f0f;
  --text-secondary: #6b6560;
  --text-sidebar:   #4a4540;
  --text-muted:     #9e9a96;
  --accent:         #b8975a;
  --accent-dark:    #9a7d45;
  --accent-light:   #f5ead8;
  --border:         #e8e4de;
  --border-light:   #f0ede8;
  --success:        #2d7a4f;
  --success-bg:     #edf7f1;
  --warning:        #a06b00;
  --warning-bg:     #fef9ec;
  --danger:         #c0392b;
  --danger-bg:      #fdf0ee;
  --info:           #1a6fa8;
  --info-bg:        #eaf4fd;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06);
  --shadow-md:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --radius-sm:      10px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --sidebar-w:      240px;
  --navbar-h:       64px;
  --transition:     all .2s ease;
  --login-bg-opacity: 0.18;
  --login-bg-blend:   normal;

  /* ── Sidebar colores fijos → variables ── */
  --sidebar-title-color:    #0f0f0f;
  --sidebar-strong-color:   #0f0f0f;
  --sidebar-section-color:  rgba(0,0,0,.3);
  --sidebar-border-color:   rgba(0,0,0,.08);
}

/* Modo Oscuro */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body:        #0c0c0c;
    --bg-card:        #161616;
    --bg-sidebar:     #080808;
    --bg-sidebar-hover: #1f1f1f;
    --bg-input:       #1e1e1e;
    --bg-badge:       #1e1e1e;
    --text-primary:   #f0ede8;
    --text-secondary: #9e9a96;
    --text-muted:     #5e5a56;
    --border:         #2a2a2a;
    --border-light:   #222222;
    --success-bg:     #0d2b1a;
    --warning-bg:     #2b1e00;
    --danger-bg:      #2b0d09;
    --info-bg:        #071b2b;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.3);
    --shadow-md:      0 4px 16px rgba(0,0,0,.4);
    --shadow-lg:      0 8px 32px rgba(0,0,0,.5);
    --login-bg-opacity: 0.12;
    --login-bg-blend:   normal;

    /* Sidebar en dark: igual que light (ya es oscuro) */
    --sidebar-title-color:    #ffffff;
    --sidebar-strong-color:   #ffffff;
    --sidebar-section-color:  rgba(255,255,255,.25);
    --sidebar-border-color:   rgba(255,255,255,.06);
  }
}



/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-left {
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-left .login-bg-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: var(--login-bg-opacity);
  mix-blend-mode: var(--login-bg-blend);
  pointer-events: none;
  z-index: 0;
  transition: opacity .3s ease;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,151,90,.15) 0%, transparent 70%);
  top: -100px; left: -100px;
  z-index: 1;
}

.login-brand {
  text-align: center;
  position: relative;
  z-index: 2;
}
.login-brand .logo-icon { font-size: 56px; margin-bottom: 16px; display: block; }
.login-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  color: #ffffff;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.login-brand p {
  color: var(--text-sidebar);
  font-size: .9rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.login-features {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 280px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-sidebar);
  font-size: .88rem;
}

.login-feature-icon {
  width: 36px; height: 36px;
  background: rgba(184,151,90,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-body);
}

.login-box { width: 100%; max-width: 400px; }
.login-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.login-box .subtitle {
  color: var(--text-secondary);
  font-size: .9rem;
  margin-bottom: 36px;
}

/* Alertas */
.alerta {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn .3s ease;
}
.alerta-error   { background: var(--danger-bg);  color: var(--danger);  border-left: 3px solid var(--danger); }
.alerta-success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.alerta-warning { background: var(--warning-bg); color: var(--warning); border-left: 3px solid var(--warning); }

/* Formularios */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(184,151,90,.12);
}
.form-control::placeholder { color: var(--text-muted); }

.btn-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
  transition: color .2s;
}
.btn-toggle-pass:hover { color: var(--accent); }

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.form-check label { font-size: .88rem; color: var(--text-secondary); cursor: pointer; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(184,151,90,.35);
}
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-danger  { background: var(--danger-bg);  color: var(--danger); }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── LAYOUT DASHBOARD ── */
.sidebar {
  background: var(--bg-sidebar);
  width: var(--sidebar-w);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border-color); /* ← FIX */
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-logo-icon { font-size: 26px; }
.sidebar-logo-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--sidebar-title-color); /* ← FIX */
  letter-spacing: 1px;
}
.sidebar-logo-text span {
  font-size: .7rem;
  color: var(--text-sidebar);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-section-title {
  padding: 12px 20px 6px;
  font-size: .68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sidebar-section-color); /* ← FIX */
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.sidebar-link:hover { background: var(--bg-sidebar-hover); color: #ffffff; }
.sidebar-link.active { background: rgba(184,151,90,.15); color: var(--accent); }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}
.sidebar-link .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border-color); /* ← FIX */
}
.sidebar-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(184,151,90,.4);
}
.sidebar-user-info small {
  display: block;
  font-size: .68rem;
  color: var(--text-sidebar);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sidebar-user-info strong {
  font-size: .85rem;
  color: var(--sidebar-strong-color); /* ← FIX */
}

/* Botón cerrar sesión en sidebar */
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(192, 57, 43, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.sidebar-logout:hover {
  background: rgba(192, 57, 43, 0.28);
  color: #ff6b6b;
  transform: translateY(-1px);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--navbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.navbar-left { display: flex; align-items: center; gap: 16px; }
.btn-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
}
.navbar-right { display: flex; align-items: center; gap: 16px; }
.navbar-date { font-size: .82rem; color: var(--text-secondary); }
.navbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

/* Contenido */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--navbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--navbar-h));
}

/* Tarjetas estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: fadeInUp .4s ease both;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.gold   { background: rgba(184,151,90,.12); }
.stat-icon.green  { background: var(--success-bg); }
.stat-icon.orange { background: var(--warning-bg); }
.stat-icon.blue   { background: var(--info-bg); }
.stat-icon.red    { background: var(--danger-bg); }
.stat-info small {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 4px;
}
.stat-info strong { font-size: 1.7rem; font-weight: 700; color: var(--text-primary); line-height: 1; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeInUp .4s ease both;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.card-body { padding: 22px; }

/* Tablas */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--bg-badge); }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: var(--bg-badge);   color: var(--text-muted); }
.badge-gold    { background: rgba(184,151,90,.15); color: var(--accent); }

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
  .navbar { left: 0; }
  .btn-menu-toggle { display: block; }
  .main-content { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .navbar-date { display: none; }
}