/* ══════════════════════════════════════════
   EVOLUTION GYM - Design System
   Dark Theme with Red Accent
   ══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-primary: #0A0A0F;
  --bg-secondary: #12121A;
  --bg-tertiary: #1C1C28;
  --bg-elevated: #22222E;
  --bg-hover: #353545;

  --red-primary: #E63946;
  --red-hover: #FF1A2E;
  --red-dark: #B71C28;
  --red-glow: rgba(230, 57, 70, 0.3);
  --red-subtle: rgba(230, 57, 70, 0.1);

  --green: #2ECC71;
  --green-subtle: rgba(46, 204, 113, 0.15);
  --yellow: #F39C12;
  --yellow-subtle: rgba(243, 156, 18, 0.15);
  --blue: #3498DB;
  --blue-subtle: rgba(52, 152, 219, 0.15);
  --purple: #9B59B6;
  --purple-subtle: rgba(155, 89, 182, 0.15);
  --orange: #E67E22;
  --orange-subtle: rgba(230, 126, 34, 0.15);
  --cyan: #00BCD4;
  --cyan-subtle: rgba(0, 188, 212, 0.15);

  --text-primary: #FAFAFA;
  --text-secondary: #A0A0B0;
  --text-muted: #6B6B7B;
  --text-inverse: #0A0A0F;

  --border-color: #2A2A3A;
  --border-light: #3A3A4A;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-red: 0 4px 20px rgba(230, 57, 70, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 80px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --font-body: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Glassmorphism */
  --glass-bg: rgba(18, 18, 26, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

a {
  color: var(--red-primary);
  text-decoration: none;
}

a:hover {
  color: var(--red-hover);
}

a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active,
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
a.btn-plan,
a.btn-plan:hover,
a.btn-plan:focus,
a.btn-plan:active,
a.btn-plan-featured,
a.btn-plan-featured:hover,
a.btn-plan-featured:focus,
a.btn-plan-featured:active,
a.btn-contact-action,
a.btn-contact-action:hover,
a.btn-contact-action:focus,
a.btn-contact-action:active,
a.btn-contact-whatsapp,
a.btn-contact-whatsapp:hover,
a.btn-contact-whatsapp:focus,
a.btn-contact-whatsapp:active,
a.btn-contact-instagram,
a.btn-contact-instagram:hover,
a.btn-contact-instagram:focus,
a.btn-contact-instagram:active {
  color: #FFFFFF !important;
  text-decoration: none !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 57, 70, 0.5);
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

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

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

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

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px var(--red-glow);
  }

  50% {
    box-shadow: 0 0 20px var(--red-glow), 0 0 40px rgba(230, 57, 70, 0.1);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

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

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.animate-fade {
  animation: fadeIn 0.4s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.5s ease forwards;
}

.page-enter {
  animation: fadeInScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ── LOGIN SCREEN (Desktop Split Layout) ── */
.main-wrapper {
  flex: 1;
  display: flex;
  align-items: stretch;
  /* Ocupar todo el alto */
  justify-content: center;
}

.login-screen {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Lado Izquierdo (Branding) */
.login-brand-side {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, #050508 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
}

.login-brand-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/img/fondo-gym.jpg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: overlay;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 500px;
  animation: slideInLeft 0.8s ease;
}

.brand-logo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--red-primary);
  box-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
  margin-bottom: 30px;
  object-fit: cover;
}

.login-brand-content h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.login-brand-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Lado Derecho (Formulario) */
.login-form-side {
  width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2;
  padding: 40px;
}

.login-container {
  width: 100%;
  max-width: 380px;
  animation: fadeIn 0.6s ease;
}

.login-header-mobile {
  display: none;
  /* Oculto en desktop */
  text-align: center;
  margin-bottom: 30px;
}

.login-title {
  margin-bottom: 40px;
}


.logo-circle i {
  font-size: 32px;
  color: white;
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: 6px;
  color: var(--text-primary);
  line-height: 1;
}

.logo-subtitle {
  font-size: 0.75rem;
  letter-spacing: 4px;
  color: var(--red-primary);
  font-weight: 600;
  margin-top: 4px;
}

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

.login-error {
  text-align: center;
  color: var(--red-primary);
  font-size: 0.875rem;
  padding: 10px;
  background: var(--red-subtle);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.login-footer {
  margin-top: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-footer i {
  color: var(--red-primary);
  margin-right: 6px;
}

/* ── FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  z-index: 10;
  pointer-events: none;
}

.input-icon i.fa-eye,
.input-icon i.fa-eye-slash {
  left: auto;
  right: 14px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 11;
}

.input-icon input,
.input-icon select {
  padding-left: 42px;
  position: relative;
  z-index: 1;
}

.input-icon:focus-within i:not(#toggle-pwd) {
  color: var(--red-primary);
}

/* Evitar que el autofill del navegador opaque los íconos o arruine el tema oscuro */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 10px var(--red-glow), 0 0 0 2px var(--red-subtle);
  transform: translateY(-1px);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

input::placeholder {
  color: var(--text-muted);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A0A0B0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: white;
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--red-hover), var(--red-primary));
  box-shadow: 0 0 15px var(--red-glow), 0 6px 25px rgba(230, 57, 70, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--red-primary);
  color: white;
}

.btn-danger:hover {
  background: var(--red-hover);
}

.btn-success {
  background: var(--green);
  color: var(--text-inverse);
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── APP SHELL ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  height: 100dvh;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(18, 18, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

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

.logo-circle-sm {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-circle-sm i {
  font-size: 16px;
  color: white;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--text-primary);
  line-height: 1;
}

.brand-sub {
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--red-primary);
  font-weight: 600;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: none;
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

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

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 12px 12px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--red-primary);
  border-radius: 0 3px 3px 0;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--red-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--red-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-logout:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
  background: var(--red-subtle);
}

/* ── MAIN CONTENT ── */
.main-content {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(18, 18, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.header-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-date i {
  color: var(--red-primary);
}

.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition-normal);
  animation: fadeIn 0.4s ease forwards;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 10px rgba(230, 57, 70, 0.1);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.red {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.stat-icon.green {
  background: var(--green-subtle);
  color: var(--green);
}

.stat-icon.yellow {
  background: var(--yellow-subtle);
  color: var(--yellow);
}

.stat-icon.blue {
  background: var(--blue-subtle);
  color: var(--blue);
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

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

/* ── CARDS ── */
.card {
  background: rgba(18, 18, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  /* overflow: hidden removed to allow dropdowns to overflow */
  animation: fadeIn 0.4s ease forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}



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

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--red-primary);
}

.card-body {
  padding: 24px;
}

.card-body.no-padding {
  padding: 0;
}

/* ── TABLES ── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
}

thead tr:first-child th:first-child { border-top-left-radius: 8px; }
thead tr:first-child th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td:first-child { border-bottom-left-radius: 8px; }
tbody tr:last-child td:last-child { border-bottom-right-radius: 8px; }

thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-right: 1px solid var(--border-color) !important;
  white-space: nowrap;
}

thead th:first-child {
  border-left: 1px solid var(--border-color) !important;
}

tbody td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color) !important;
  border-right: 1px solid var(--border-color) !important;
  vertical-align: middle;
}

tbody td:first-child {
  border-left: 1px solid var(--border-color) !important;
}

tbody tr td:first-child {
  box-shadow: inset 3px 0 0 transparent !important;
}

tbody tr {
  transition: all var(--transition-normal);
}

tbody tr:hover td {
  background: var(--bg-hover) !important;
}

tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--red-primary) !important;
}

tbody tr:hover .btn-ghost {
  border-color: var(--text-muted);
}

.table-calendario tbody tr:hover td {
  background: transparent !important;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-activo {
  background: var(--green-subtle);
  color: var(--green);
}

.badge-riesgo {
  background: var(--yellow-subtle);
  color: var(--yellow);
}

.badge-caducado {
  background: rgba(230, 57, 70, 0.15);
  color: var(--red-primary);
  border: 1px solid rgba(230, 57, 70, 0.4);
}

.badge-pendiente {
  background: var(--yellow-subtle);
  color: var(--yellow);
}

.badge-autorizado {
  background: var(--green-subtle);
  color: var(--green);
}

.badge-rechazado {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.badge-admin {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.badge-supervisor {
  background: var(--blue-subtle);
  color: var(--blue);
}

.badge-entrenador {
  background: var(--green-subtle);
  color: var(--green);
}

.badge-vendedor {
  background: var(--yellow-subtle);
  color: var(--yellow);
}

.badge-nutriologo {
  background: var(--purple-subtle);
  color: var(--purple);
}

.badge-podologo {
  background: var(--orange-subtle);
  color: var(--orange);
}

.badge-kinesiologo {
  background: var(--cyan-subtle);
  color: var(--cyan);
}

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

body.modal-open, html.modal-open {
  overflow: hidden !important;
  height: 100vh !important;
}

.modal-container {
  width: 100%;
  max-width: 700px;
  max-height: 95vh;
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: fadeInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

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

/* ── TOASTS ── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.4s ease;
  border-left: 4px solid;
  min-width: 300px;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-success {
  background: var(--bg-elevated);
  border-color: var(--green);
  color: var(--text-primary);
}

.toast-error {
  background: var(--bg-elevated);
  border-color: var(--red-primary);
  color: var(--text-primary);
}

.toast-warning {
  background: var(--bg-elevated);
  border-color: var(--yellow);
  color: var(--text-primary);
}

.toast-info {
  background: var(--bg-elevated);
  border-color: var(--blue);
  color: var(--text-primary);
}

.toast i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-success i {
  color: var(--green);
}

.toast-error i {
  color: var(--red-primary);
}

.toast-warning i {
  color: var(--yellow);
}

.toast-info i {
  color: var(--blue);
}

.toast-text {
  font-size: 0.875rem;
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
}

/* ── TOOLBAR ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-box input {
  padding: 8px 14px 8px 36px;
  width: 260px;
  font-size: 0.85rem;
  background: var(--bg-secondary);
}

/* ── ACTION BUTTONS IN TABLE ── */
.actions-cell {
  display: flex;
  gap: 6px;
}

.btn-edit {
  background: var(--blue-subtle);
  border: none;
  color: var(--blue);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}

.btn-edit:hover {
  background: var(--blue);
  color: white;
}

.btn-delete {
  background: var(--red-subtle);
  border: none;
  color: var(--red-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}

.btn-delete:hover {
  background: var(--red-primary);
  color: white;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ── FORM GRID ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

/* ── TURNOS GRID ── */
.turnos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.turno-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-fast);
  animation: fadeIn 0.3s ease forwards;
}

.turno-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

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

.turno-dia {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--red-primary);
}

.turno-horario {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.turno-persona {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.turno-persona i {
  color: var(--text-muted);
}

/* ── FIN DE DÍA CARDS ── */
.findia-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease forwards;
}

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

.findia-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.findia-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.findia-total {
  text-align: center;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.findia-total-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.findia-total-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.findia-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── DASHBOARD SECTIONS ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.section-grid-full {
  grid-column: 1 / -1;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .celda-futura {
    background: var(--bg-primary);
  }

  .page-content {
    padding: 20px 16px;
  }

  .page-header {
    padding: 0 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .findia-totals {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input {
    width: 100%;
  }

  .modal-container {
    width: 95%;
    margin: 10px auto;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header, .modal-footer {
    padding: 16px;
  }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 250px);
  -webkit-overflow-scrolling: touch;
}

.table-responsive thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-container {
    margin: 16px;
    padding: 32px 24px;
  }
}

/* ── UTILITIES ── */
.text-center {
  text-align: center;
}

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

.text-muted {
  color: var(--text-muted);
}

.text-red {
  color: var(--red-primary);
}

.text-green {
  color: var(--green);
}

.text-yellow {
  color: var(--yellow);
}

.text-blue {
  color: var(--blue);
}

.font-bold {
  font-weight: 700;
}

.mt-1 {
  margin-top: 8px;
}

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

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

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

.mb-3 {
  margin-bottom: 24px;
}

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

.celda-futura {
  background: transparent;
  transition: background-color 0.2s ease;
}

.celda-futura:hover {
  background-color: var(--bg-tertiary) !important;
}



  .modal-container  {
   border:  1px solid var(--border-color);
   box-shadow:  0 4px 12px rgba(0, 0, 0, 0.5);
   
}

 .modal-header,
 .modal-footer  {
   border-bottom:  1px solid var(--border-color);
   
}

 .modal-footer  {
   border-top:  1px solid var(--border-color);
   border-bottom:  none;
   
}

   @media (min-width: 1025px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* ── CUSTOM SELECT COMPONENT ── */
select.filter-select-custom {
  display: none !important;
}

.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
}

.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px var(--red-subtle);
}

.custom-select-trigger span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  flex: 1;
  text-align: left;
  margin-right: 10px;
}

.custom-select-trigger i {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.custom-select-wrapper.open .custom-select-trigger i {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  list-style: none;
  padding: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.custom-select-wrapper.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-options li {
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text-primary);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.custom-select-options li:last-child {
  border-bottom: none;
}

.custom-select-options li:hover, .custom-select-options li.selected {
  background: var(--red-primary);
  color: white;
}
/* Resizable table columns */
.table th {
  position: relative;
}
.resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  height: 100%;
  z-index: 10;
  transition: background-color 0.2s;
}
.resizer:hover, .resizer.resizing {
  background-color: var(--red-primary);
  opacity: 0.5;
}

/* Allow table cells to shrink below content size */
table.table[data-resizable="true"] {
  table-layout: fixed;
  width: 100%;
}

table.table[data-resizable="true"] td, 
table.table[data-resizable="true"] th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
