:root {
    --primary-color: #FF6B00;
    --secondary-color: #333;
    --background-dark: #1A1A1A;
    --background-light: #2A2A2A;
    --text-light: #FFFFFF;
    --text-gray: #CCCCCC;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --warning-color: #FFC107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}
html {
    scroll-behavior: smooth;
}

body {
    background-color: #f2f3f5;
    color: #1f2933;
    line-height: 1.6;
    padding: 0;
}

body.staff-dashboard .container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--background-dark);   /* ✅ fondo oscuro */
    color: var(--text-light);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

body:not(.staff-dashboard) header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #111827;
}

h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-gray);
}

.user-info {
    background-color: var(--background-light);
    color: var(--text-light);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body:not(.staff-dashboard) .user-info,
body:not(.staff-dashboard) .reservation-section,
body:not(.staff-dashboard) .reserved-classes,
body:not(.staff-dashboard) .assistance-section,
body:not(.staff-dashboard) .payment-history,
body:not(.staff-dashboard) .attendance-history-box {
    color: var(--text-light);
}

body:not(.staff-dashboard) .user-info h2,
body:not(.staff-dashboard) .user-info h3,
body:not(.staff-dashboard) .user-info p,
body:not(.staff-dashboard) .user-info li,
body:not(.staff-dashboard) .user-info strong,
body:not(.staff-dashboard) .reservation-section h2,
body:not(.staff-dashboard) .reservation-section h3,
body:not(.staff-dashboard) .reservation-section p,
body:not(.staff-dashboard) .reservation-section li,
body:not(.staff-dashboard) .reservation-section strong,
body:not(.staff-dashboard) .reserved-classes h2,
body:not(.staff-dashboard) .reserved-classes h3,
body:not(.staff-dashboard) .reserved-classes p,
body:not(.staff-dashboard) .reserved-classes li,
body:not(.staff-dashboard) .reserved-classes strong,
body:not(.staff-dashboard) .assistance-section h2,
body:not(.staff-dashboard) .assistance-section h3,
body:not(.staff-dashboard) .assistance-section p,
body:not(.staff-dashboard) .assistance-section li,
body:not(.staff-dashboard) .assistance-section strong,
body:not(.staff-dashboard) .payment-history h2,
body:not(.staff-dashboard) .payment-history h3,
body:not(.staff-dashboard) .payment-history p,
body:not(.staff-dashboard) .payment-history li,
body:not(.staff-dashboard) .payment-history strong,
body:not(.staff-dashboard) .payment-history td,
body:not(.staff-dashboard) .payment-history th,
body:not(.staff-dashboard) .attendance-history-box h2,
body:not(.staff-dashboard) .attendance-history-box h3,
body:not(.staff-dashboard) .attendance-history-box p,
body:not(.staff-dashboard) .attendance-history-box li,
body:not(.staff-dashboard) .attendance-history-box strong,
body:not(.staff-dashboard) .attendance-history-box td,
body:not(.staff-dashboard) .attendance-history-box th {
    color: var(--text-light);
}

body:not(.staff-dashboard) .user-info .active {
    color: var(--success-color);
}

body:not(.staff-dashboard) .user-info .expired {
    color: var(--warning-color);
}

body:not(.staff-dashboard) .user-info .inactive {
    color: var(--error-color);
}
/*  SECCIONES BASE - FRONT CLIENTE */
.reservation-section,
.reserved-classes,
.assistance-section,
.payment-history,
.attendance-history-box {
  background-color: var(--background-light);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/*  STAFF DASHBOARD: secciones ocultas por defecto para menú lateral */
body.staff-dashboard .reservation-section,
body.staff-dashboard .reserved-classes,
body.staff-dashboard .assistance-section,
body.staff-dashboard .payment-history,
body.staff-dashboard .attendance-history-box {
  background-color: #ffffff;
  padding: 22px;
  border-radius: 16px;
  margin-bottom: 22px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);

  display: none;
}

body.staff-dashboard .section-active {
    display: block;
}

.reservation-section:hover,
.reserved-classes:hover,
.assistance-section:hover,
.payment-history:hover,
.attendance-history-box:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 107, 0, 0.28);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
} 

/* CONTROLES DE FILTRO EN HISTORIAL DE PAGOS */
.history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.history-controls label {
    color: var(--text-light);
    font-weight: 500;
}

.history-controls select {
    background-color: #444;
    color: var(--text-light);
}

/* LISTA FILTRADA OCULTA HASTA “Mostrar” */
#filteredPaymentHistoryList {
    display: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px solid #555;
    padding-top: 10px;
}

/* ESTILO DE LA TABLA DENTRO DE filteredPaymentHistoryList */
#filteredPaymentHistoryList table {
    width: 100%;
    border-collapse: collapse;
}

#filteredPaymentHistoryList th,
#filteredPaymentHistoryList td {
    padding: 8px 12px;
    border: 1px solid #555;
    text-align: left;
}

#filteredPaymentHistoryList th {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

/* NOTIFICACIONES EN PANTALLA (sin cambios) */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: bold;
    z-index: 1000;
    display: none;
    pointer-events: none;
}
.notification.success {
    background-color: rgba(0, 128, 0, 0.85);
    color: #fff;
}
.notification.error {
    background-color: rgba(220, 53, 69, 0.85);
    color: #fff;
}

 /* Estado del cliente */
.active {
    color: var(--success-color);
}

.expired {
    color: var(--warning-color);
}

.inactive {
    color: var(--error-color);
}

/* Responsive */
@media (max-width: 768px) {
    .reservation-controls {
        flex-direction: column;
    }
    
    .assistance-cards {
        flex-direction: column;
    }
    
    .card {
        width: 100%;
    }
}
/* Historial de Asistencias: oculto hasta pulsar “Mostrar” */
#attendanceHistoryList {
  display: none;            /* oculto por defecto */
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  border-top: 1px solid #555;
  padding-top: 10px;
}
.button {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.button:hover {
    background-color: #e65c00;
}
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease-out forwards;
}

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

@media (max-width: 600px) {
  .container {
    padding: 1rem 1rem;
  }

  h1 {
    font-size: 1.4rem;
    text-align: center;
  }

  .reservation-controls,
  .history-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  select,
  button {
    width: 100%;
  }

  .cards {
    flex-direction: column;
  }

  .card {
    width: 100%;
  }

  .back-to-top {
    bottom: 10px;
    right: 10px;
  }
}
/* ==== STAFF DASHBOARD KPIs ==== */
#kpiBoard {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#kpiBoard .kpi-item {
  background: #ffffff;
  color: #111827;
  border-radius: 16px;
  padding: 22px;
  flex: 1;
  min-width: 180px;
  text-align: left;

  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#kpiBoard .kpi-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

#kpiBoard .kpi-item h3 {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 8px;
}

#kpiBoard .kpi-item p {
  font-size: 32px; /* 🔥 más grande */
  font-weight: 800;
  color: #FF6B00;
  margin: 0;
}
/* ===== STAFF LAYOUT (NUEVO) ===== */

.staff-layout {
    display: flex;
    min-height: 100vh;
    align-items: flex-start; /* 🔥 CLAVE */
}

/* SIDEBAR */
.staff-sidebar {
    width: 240px;
    background: #181818;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid #222;

    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow: hidden;
z-index: 10;

    transition: width 0.25s ease;
}

.staff-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-brand-logo {
    width: 40px;
    height: 40px;
}

.staff-brand strong {
    display: block;
    font-size: 14px;
}

.staff-brand span {
    font-size: 12px;
    color: #ccc;
}

/* MENU */
.staff-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    overflow: hidden;
}
.staff-menu a {
    display: block; /* 🔥 clave */
    width: 100%; /* 🔥 clave */
    box-sizing: border-box;

    text-decoration: none;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;

    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.staff-menu a:hover {
    background: #FF6B00;
    color: #fff;
    transform: translateX(3px);
}

.staff-menu a.active {
    background: #FF6B00;
    color: #fff;
    font-weight: 600;
}

/* MAIN */
.staff-main {
    min-height: 100vh;
    margin-left: 0;
    width: 100%;
    min-width: 0;
}

/* TOPBAR */
.staff-topbar {
    padding: 0 0 24px 0;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    background: transparent;
}

.staff-topbar h1 {
    margin: 0;
    color: #111827;
    text-align: left;
}

.staff-eyebrow {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 4px;
}

.staff-main .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 36px;
    background: #f2f3f5;
    border-radius: 0;

    display: flex;
    flex-direction: column;
    gap: 24px;
}
.sidebar-toggle {
    display: none;
}
/* =========================================================
   STAFF DASHBOARD - OVERRIDE FUERTE (solo esta pantalla)
   ========================================================= */
body.staff-dashboard {
  background: #efefef !important;
  color: #1f2937 !important;
  padding: 0 !important;
}

/* Marco general */
body.staff-dashboard .container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #efefef !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1f2937 !important;
}

/* Franja superior Staff Dashboard */
body.staff-dashboard > .container > header {
  background:
    linear-gradient(90deg, rgba(255, 107, 0, 0.16) 0%, rgba(255, 107, 0, 0) 34%),
    linear-gradient(135deg, #101f2e 0%, #071625 100%) !important;

  border-radius: 14px 14px 0 0 !important;
  padding: clamp(10px, 1.6vw, 16px) clamp(16px, 4vw, 30px) !important;
  margin-bottom: 0 !important;
  text-align: left !important;

  display: flex !important;
  align-items: center !important;
  gap: clamp(12px, 2vw, 20px) !important;

  border-top: 3px solid #FF6B00 !important;
}

body.staff-dashboard > .container > header .logo {
  width: clamp(76px, 8vw, 118px) !important;
  height: auto !important;
  max-width: 118px !important;
  margin: 0 !important;
  object-fit: contain !important;
  image-rendering: auto !important;
  opacity: 1 !important;
  flex-shrink: 0 !important;

  background: rgba(255, 255, 255, 0.96) !important;
  padding: clamp(6px, 0.9vw, 9px) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.20) !important;
}

body.staff-dashboard > .container > header h1 {
  margin: 0 !important;
  color: #f8fafc !important;
  font-size: clamp(24px, 3.2vw, 40px) !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: -0.4px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
}
/* Caja principal blanca (como mockup) */
body.staff-dashboard .staff-layout {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 0 !important;
  background: #f5f6f8 !important;
  border: 1px solid #d9dde3 !important;
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(16,24,40,.08) !important;
  min-height: 78vh;
}

/* Sidebar oscuro */
body.staff-dashboard .staff-sidebar {
  background: linear-gradient(180deg, #0d2033 0%, #081828 100%) !important;
  padding: 22px 16px !important;
  position: sticky;
  top: 12px;
  align-self: start;
  min-height: 100%;
}

body.staff-dashboard .staff-sidebar h2 {
  color: #f8fafc !important;
  margin: 6px 10px 14px !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .7px;
}

/* Menú lateral (arregla links azules/subrayados) */
body.staff-dashboard .staff-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

body.staff-dashboard .staff-nav a,
body.staff-dashboard .staff-nav a:link,
body.staff-dashboard .staff-nav a:visited,
body.staff-dashboard .staff-nav a:hover,
body.staff-dashboard .staff-nav a:active {
  display: block !important;
  width: 100% !important;
  color: #e2e8f0 !important;
  text-decoration: none !important;
  font-size: .93rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  border-left: 3px solid transparent !important;
  background: transparent !important;
  transition: all .2s ease;
}

body.staff-dashboard .staff-nav a:hover {
  background: rgba(255,255,255,.08) !important;
  border-left-color: #ff3b57 !important;
  color: #fff !important;
}

/* Main */
body.staff-dashboard .staff-main {
  padding: 18px !important;
  background: #f5f6f8 !important;
}

/* KPI en tarjetas */
body.staff-dashboard #kpiBoard {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
  gap: 12px !important;
  margin: 0 0 14px 0 !important;
}

body.staff-dashboard #kpiBoard .kpi-item {
  background: #ffffff !important;
  border: 1px solid #e4e7ec !important;
  border-radius: 12px !important;
  padding: 14px 12px !important;
  box-shadow: 0 2px 8px rgba(16,24,40,.05) !important;
}

body.staff-dashboard #kpiBoard .kpi-item h3 {
  margin: 0 0 8px 0 !important;
  color: #4b5563 !important;
  font-size: .95rem !important;
  font-weight: 700 !important;
}

body.staff-dashboard #kpiBoard .kpi-item p {
  margin: 0 !important;
  color: #111827 !important;
  font-size: 1.55rem !important;
  font-weight: 800 !important;
}

/* Secciones internas */
body.staff-dashboard .reservation-section,
body.staff-dashboard .payment-history,
body.staff-dashboard .attendance-history-box {
  background: #fff !important;
  border: 1px solid #e4e7ec !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin-bottom: 14px !important;
  box-shadow: 0 2px 8px rgba(16,24,40,.04) !important;
}

body.staff-dashboard .reservation-section h2,
body.staff-dashboard .payment-history h2,
body.staff-dashboard .attendance-history-box h2 {
  color: #111827 !important;
  font-size: 1.2rem !important;
  margin-bottom: 10px !important;
}

body.staff-dashboard .history-controls label {
  color: #111827 !important;
}

/* Inputs claros */
body.staff-dashboard input,
body.staff-dashboard select {
  background: #fff !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
}

/* Botón */
body.staff-dashboard .button {
  background: #ff3b57 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 8px rgba(255,59,87,.28) !important;
}
body.staff-dashboard .button:hover {
  background: #e12d49 !important;
}

/* Responsive */
@media (max-width: 980px) {
  body.staff-dashboard .staff-layout {
    grid-template-columns: 1fr !important;
  }
  body.staff-dashboard .staff-sidebar {
    position: relative !important;
    top: 0 !important;
  }
}
/* ===== Ajuste fino 2: topbar + look mockup ===== */
body.staff-dashboard .staff-main {
  padding: 0 !important;
  background: #eceff3 !important;
}

body.staff-dashboard .staff-topbar {
  height: 56px;
  background: #d6d8dc;
  border-bottom: 1px solid #c7cad0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

body.staff-dashboard .staff-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.staff-dashboard .staff-menu-btn {
  border: none;
  background: transparent;
  color: #4b5563;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 2px 6px;
}

body.staff-dashboard .staff-topbar-title {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .8px;
  color: #4b5563;
}

body.staff-dashboard .staff-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: #6b7280;
  font-weight: 600;
}

body.staff-dashboard .staff-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff3b57;
  display: inline-block;
}

/* contenido debajo de topbar */
body.staff-dashboard .staff-main > section {
  margin: 14px !important;
}

/* sidebar más tipo mockup */
body.staff-dashboard .staff-sidebar {
  border-right: 1px solid rgba(255,255,255,.08);
}

body.staff-dashboard .staff-nav a {
  text-transform: uppercase;
  font-size: .78rem !important;
  letter-spacing: .3px;
}

/* KPI más visual */
body.staff-dashboard #kpiBoard .kpi-item {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.staff-dashboard #kpiBoard .kpi-item:nth-child(1) { border-top: 4px solid #0f4c81; }
body.staff-dashboard #kpiBoard .kpi-item:nth-child(2) { border-top: 4px solid #ff3b57; }
body.staff-dashboard #kpiBoard .kpi-item:nth-child(3) { border-top: 4px solid #1f7a8c; }
body.staff-dashboard #kpiBoard .kpi-item:nth-child(4) { border-top: 4px solid #2d3748; }

/* responsive */
@media (max-width: 980px) {
  body.staff-dashboard .staff-main > section {
    margin: 10px !important;
  }

  body.staff-dashboard .staff-topbar-right {
    display: none;
  }
}
/* ===== Ajuste 3: KPI cards tipo dashboard ===== */
body.staff-dashboard #kpiBoard {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)) !important;
  gap: 14px !important;
}

body.staff-dashboard #kpiBoard .kpi-item {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 14px 14px 12px !important;
  min-height: 122px !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06) !important;
}

body.staff-dashboard #kpiBoard .kpi-item h3 {
  font-size: .84rem !important;
  text-transform: uppercase;
  letter-spacing: .35px;
  color: #6b7280 !important;
  margin: 0 0 10px 0 !important;
  font-weight: 700 !important;
}

body.staff-dashboard #kpiBoard .kpi-item p {
  margin: 0 0 12px 0 !important;
  font-size: 1.9rem !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  color: #111827 !important;
}

/* mini progress bar */
body.staff-dashboard .kpi-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

body.staff-dashboard .kpi-bar > span {
  --kpi: 50%;
  display: block;
  width: var(--kpi);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff3b57 0%, #ff6b7f 100%);
}

/* alternar color por tarjeta para look tipo mockup */
body.staff-dashboard #kpiBoard .kpi-item:nth-child(2) .kpi-bar > span,
body.staff-dashboard #kpiBoard .kpi-item:nth-child(5) .kpi-bar > span {
  background: linear-gradient(90deg, #0b5cab 0%, #2d7dd2 100%);
}
body.staff-dashboard #kpiBoard .kpi-item:nth-child(3) .kpi-bar > span,
body.staff-dashboard #kpiBoard .kpi-item:nth-child(6) .kpi-bar > span {
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
}
body.staff-dashboard #kpiBoard .kpi-item:nth-child(4) .kpi-bar > span,
body.staff-dashboard #kpiBoard .kpi-item:nth-child(7) .kpi-bar > span {
  background: linear-gradient(90deg, #374151 0%, #6b7280 100%);
}
/* =========================================================
   AJUSTE 4 REAL (sin cambiar HTML)
   Convierte secciones en "cards colapsables visuales" compactas
   ========================================================= */

body.staff-dashboard .staff-main {
  padding-bottom: 14px !important;
}

/* Todas las secciones de módulos se ven compactas */
body.staff-dashboard .staff-main .reservation-section,
body.staff-dashboard .staff-main .payment-history,
body.staff-dashboard .staff-main .attendance-history-box {
  margin: 0 14px 12px !important;
  padding: 0 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  background: #fff !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04) !important;
}

/* Título tipo barra de acordeón */
body.staff-dashboard .staff-main .reservation-section > h2,
body.staff-dashboard .staff-main .payment-history > h2,
body.staff-dashboard .staff-main .attendance-history-box > h2 {
  margin: 0 !important;
  padding: 14px 16px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #111827 !important;
  background: #f9fafb !important;
  border-bottom: 1px solid #e5e7eb !important;
  cursor: pointer !important;
  position: relative;
}

/* Flecha visual */
body.staff-dashboard .staff-main .reservation-section > h2::after,
body.staff-dashboard .staff-main .payment-history > h2::after,
body.staff-dashboard .staff-main .attendance-history-box > h2::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: .95rem;
}

/* Contenido interno compacto */
body.staff-dashboard .staff-main .reservation-section > :not(h2),
body.staff-dashboard .staff-main .payment-history > :not(h2),
body.staff-dashboard .staff-main .attendance-history-box > :not(h2) {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Respeta espacios internos */
body.staff-dashboard .staff-main .history-controls {
  margin-top: 12px !important;
}

body.staff-dashboard .staff-main .reservation-section > :last-child,
body.staff-dashboard .staff-main .payment-history > :last-child,
body.staff-dashboard .staff-main .attendance-history-box > :last-child {
  padding-bottom: 14px !important;
}

/* KPI arriba se mantiene limpio */
body.staff-dashboard #kpiBoard {
  margin: 14px !important;
}

/* Mobile */
@media (max-width: 980px) {
  body.staff-dashboard .staff-main .reservation-section,
  body.staff-dashboard .staff-main .payment-history,
  body.staff-dashboard .staff-main .attendance-history-box,
  body.staff-dashboard #kpiBoard {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }
}
/* ===== FIX navegación por anclas + contraste de secciones ===== */

/* 1) Cuando navegas a #seccion, deja espacio superior para que se vea */
body.staff-dashboard #crossReservationsSection,
body.staff-dashboard #personalReservationsSection,
body.staff-dashboard #attendanceSection,
body.staff-dashboard #paymentsSection,
body.staff-dashboard #newStudentSection,
body.staff-dashboard #studentReservationsSection,
body.staff-dashboard #comestiblesSection,
body.staff-dashboard #monthlyPaymentsSection,
body.staff-dashboard #overdueSection,
body.staff-dashboard #expensesSection {
  scroll-margin-top: 90px !important;
}

/* 2) Forzar visibilidad total de cada sección */
body.staff-dashboard .staff-main .reservation-section,
body.staff-dashboard .staff-main .payment-history,
body.staff-dashboard .staff-main .attendance-history-box {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #d9dee8 !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin: 14px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.05) !important;
}

/* 3) Títulos, labels, texto y tablas en oscuro (para no perderse en fondo claro) */
body.staff-dashboard .staff-main .reservation-section h2,
body.staff-dashboard .staff-main .payment-history h2,
body.staff-dashboard .staff-main .attendance-history-box h2,
body.staff-dashboard .staff-main h3,
body.staff-dashboard .staff-main label,
body.staff-dashboard .staff-main p,
body.staff-dashboard .staff-main li,
body.staff-dashboard .staff-main td,
body.staff-dashboard .staff-main th {
  color: #111827 !important;
}

/* 4) Inputs/select legibles */
body.staff-dashboard .staff-main input,
body.staff-dashboard .staff-main select,
body.staff-dashboard .staff-main textarea {
  background: #fff !important;
  color: #111827 !important;
  border: 1px solid #cfd6e3 !important;
}

/* 5) Resaltado visual de la sección destino al hacer click lateral */
body.staff-dashboard .staff-main section:target {
  outline: 3px solid #ff3b57 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255,59,87,.12) !important;
}
/* ===== BOTÓN VOLVER ARRIBA ===== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #ff3b57;
  color: #ffffff;
  text-decoration: none;

  border-radius: 999px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;

  box-shadow: 0 10px 24px rgba(255, 59, 87, 0.35);
  z-index: 9999;

  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.back-to-top:hover {
  background: #e12d49;
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(255, 59, 87, 0.45);
}

.back-to-top:active {
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    font-size: 28px;
  }
}
body.staff-dashboard .staff-sidebar {
  position: relative !important;
  top: 0 !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 100% !important;
}

/* ========= MODAL RACHAS / LOGROS ========= */
.streak-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.streak-modal-box {
  background: #1f2937;
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 48px rgba(255, 107, 0, 0.25);
  animation: streakPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes streakPopIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.streak-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color .2s;
}
.streak-modal-close:hover { color: #e5e7eb; }
.streak-modal-emoji {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 12px;
}
.streak-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
}
.streak-modal-subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 14px;
}
.streak-modal-stats {
  background: #111827;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0 16px;
  text-align: left;
}
.streak-modal-stats p {
  color: #d1d5db;
  font-size: 0.9rem;
  margin: 5px 0;
  line-height: 1.4;
}
.streak-modal-stats strong { color: #f9fafb; }
.streak-progress {
  background: #374151;
  border-radius: 8px;
  height: 10px;
  margin: 8px 0 4px;
  overflow: hidden;
}
.streak-progress-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 1.2s ease;
}
.streak-modal-cta {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  transition: opacity .2s;
}
.streak-modal-cta:hover { opacity: .88; }

/* ========= DARK BODY (solo app cliente, no staff) ========= */
body:not(.staff-dashboard) {
  background-color: #0f172a;
  color: #e2e8f0;
}
body:not(.staff-dashboard) h2 {
  color: #f1f5f9;
}

/* ========= QR AL TOPE ========= */
.qr-wrapper-top {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 24px rgba(255,107,0,0.18);
  border: 2px solid var(--primary-color);
}
.qr-label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: #111;
  margin-bottom: 10px;
  letter-spacing: .3px;
}
.qr-box {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-hint {
  display: block;
  color: #555;
  font-size: .78rem;
  margin-top: 10px;
  line-height: 1.4;
}

/* ========= AVATAR CON INICIALES ========= */
.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  font-size: 1.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  letter-spacing: .5px;
  box-shadow: 0 0 0 4px rgba(255,107,0,.2);
}

/* ========= STATUS BADGE ========= */
.status-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .4px;
}
.status-badge.activo   { background: #14532d; color: #4ade80; }
.status-badge.vencido  { background: #7f1d1d; color: #fca5a5; }
.status-badge.inactivo { background: #1e293b; color: #94a3b8; }

.status-warning {
  background: #431407;
  border: 1px solid #f97316;
  color: #fed7aa;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .85rem;
  margin-top: 10px;
  line-height: 1.4;
}

/* ========= WIDGET PRÓXIMA CLASE ========= */
.next-class-widget {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--primary-color);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.next-class-icon { font-size: 30px; flex-shrink: 0; }
.next-class-label {
  font-size: .75rem;
  color: #94a3b8;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.next-class-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* ========= PROGRESS BAR EN CARDS ASISTENCIA ========= */
.card-progress-wrap {
  margin-top: 10px;
}
.card-progress {
  background: #374151;
  border-radius: 6px;
  height: 7px;
  overflow: hidden;
}
.card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #fb923c);
  border-radius: 6px;
  transition: width 1s ease;
}
.card-remaining {
  display: block;
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 5px;
}

/* ========= MINI CALENDARIO SEMANAL ========= */
.week-calendar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 8px 0 14px;
}
.week-day {
  background: #1e293b;
  border-radius: 10px;
  padding: 8px 4px 6px;
  text-align: center;
  border: 1px solid #334155;
  transition: all .2s;
}
.week-day.has-class {
  background: #052e16;
  border-color: #22c55e;
}
.week-day.today {
  border-color: var(--primary-color);
}
.week-day .day-name {
  font-size: .65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}
.week-day .day-num {
  font-size: .95rem;
  font-weight: 600;
  color: #cbd5e1;
}
.week-day.has-class .day-num { color: #f0fdf4; }
.week-day .class-time {
  font-size: .62rem;
  color: #4ade80;
  margin-top: 3px;
  font-weight: 600;
}

/* ========= EMPTY STATE ========= */
.empty-state {
  text-align: center;
  padding: 24px 16px 16px;
}
.empty-state .empty-icon {
  font-size: 38px;
  margin-bottom: 8px;
}
.empty-state p {
  color: #64748b;
  font-size: .9rem;
  margin-bottom: 14px;
}
.empty-state-cta {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  transition: opacity .2s;
}
.empty-state-cta:hover { opacity: .85; }

/* ========= ANIMACIÓN CONTADOR ========= */
@keyframes countPop {
  0%   { transform: scale(1.4); opacity: .6; }
  100% { transform: scale(1);   opacity: 1; }
}
.count-pop { animation: countPop .35s ease forwards; }

/* ========= MASOTERAPIA ========= */
body:not(.staff-dashboard) .maso-section {
  color: var(--text-light);
}
body:not(.staff-dashboard) .maso-section h2 {
  color: #f1f5f9;
}
.maso-section {
  background-color: var(--background-light);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.maso-widget {
  border-color: #a855f7;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
}
.maso-widget .next-class-label { color: #c4b5fd; }
.maso-info-card {
  background: #111827;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}
#masoPrecioInfo p {
  font-size: .88rem;
  color: #d1d5db;
  margin: 0 0 12px;
  line-height: 1.5;
}
.maso-alumno-badge {
  display: inline-block;
  background: #1e3a5f;
  color: #60a5fa;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  margin-right: 6px;
  letter-spacing: .3px;
}
.maso-wa-btn {
  display: block;
  background: #16a34a;
  color: #fff;
  text-align: center;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: .3px;
  transition: opacity .2s;
}
.maso-wa-btn:hover { opacity: .88; }
}