@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Premium Dark Arequipa Theme */
  --primary: #C4501A;      /* Terracota */
  --primary-hover: #e05e20;
  --primary-light: rgba(196, 80, 26, 0.15);
  --gold: #C9A84C;         /* Dorado */
  --gold-hover: #dbbb5d;
  --gold-light: rgba(201, 168, 76, 0.15);
  --sillar: #F5EDD5;       /* Sillar / Texto principal */
  --sillar-muted: #cbbfa1;
  
  --dark: #0D0600;         /* Fondo principal */
  --dark-2: #1A0C03;       /* Fondo secundario (cards, sidebar) */
  --dark-3: #261408;       /* Bordes, hover */
  
  --success: #2e7d32;
  --success-light: rgba(46, 125, 50, 0.15);
  --danger: #d32f2f;
  --danger-light: rgba(211, 47, 47, 0.15);
  --warning: #ed6c02;
  --warning-light: rgba(237, 108, 2, 0.15);
  --info: #0288d1;
  --info-light: rgba(2, 136, 209, 0.15);

  --font-main: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 15px rgba(196, 80, 26, 0.3);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--dark);
  color: var(--sillar);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--sillar);
  margin-bottom: 0.5rem;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition);
}

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

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--dark);
}
::-webkit-scrollbar-thumb {
  background: var(--dark-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, var(--dark-2) 0%, var(--dark) 100%);
  position: relative;
  overflow: hidden;
}

.login-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out alternate;
}

.login-orb:nth-child(1) {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.login-orb:nth-child(2) {
  width: 300px;
  height: 300px;
  background: var(--gold);
  bottom: -10%;
  right: -5%;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(26, 12, 3, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  text-align: center;
}

.login-logo {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgba(196, 80, 26, 0.3);
}

.login-logo span {
  color: var(--gold);
}

.login-subtitle {
  color: var(--sillar-muted);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

/* ==========================================================================
   LAYOUT (SIDEBAR & TOPBAR & MAIN)
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--dark-2);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--dark-3);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

/* Gradiente sutil en el borde derecho del sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  opacity: 0.3;
}

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

.sidebar-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--sillar);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo i {
  color: var(--primary);
  font-size: 1.8rem;
}

.btn-close-sidebar {
  display: none;
  background: transparent;
  border: none;
  color: var(--sillar-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-close-sidebar:hover {
  color: var(--primary);
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--sillar-muted);
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a i {
  width: 24px;
  font-size: 1.2rem;
  margin-right: 12px;
  text-align: center;
  color: inherit;
}

.sidebar-nav a:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--sillar);
}

.sidebar-nav a.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--dark-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dark-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: bold;
  border: 1px solid var(--gold-light);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-role {
  font-size: 0.8rem;
  color: var(--sillar-muted);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 6, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dark-3);
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.btn-menu {
  display: none;
  background: transparent;
  border: none;
  color: var(--sillar);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
}

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

.page-content {
  padding: 24px;
  flex: 1;
}

/* ==========================================================================
   ADMIN PAGES & ANIMATIONS
   ========================================================================== */
.admin-page {
  display: none;
  animation: fadeSlide 0.4s ease-out forwards;
}

.admin-page.active {
  display: block;
}

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

.page-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h2 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--sillar-muted);
  font-size: 0.95rem;
}

.page-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--dark-3);
}

.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 16px;
}

.filters-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   CARDS & STATS
   ========================================================================== */
.card {
  background: var(--dark-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-3);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, var(--dark-2) 0%, rgba(38, 20, 8, 0.4) 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid var(--dark-3);
  border-left: 4px solid var(--sillar);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.stat-title {
  color: var(--sillar-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sillar);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--sillar);
}

/* Variantes Stat Cards */
.stat-card.primary { border-left-color: var(--primary); }
.stat-card.primary .stat-icon { color: var(--primary); background: var(--primary-light); }

.stat-card.gold { border-left-color: var(--gold); }
.stat-card.gold .stat-icon { color: var(--gold); background: var(--gold-light); }

.stat-card.success { border-left-color: var(--success); }
.stat-card.success .stat-icon { color: var(--success); background: var(--success-light); }

.stat-card.info { border-left-color: var(--info); }
.stat-card.info .stat-icon { color: var(--info); background: var(--info-light); }

.stat-card.danger { border-left-color: var(--danger); }
.stat-card.danger .stat-icon { color: var(--danger); background: var(--danger-light); }


/* Balance Summary Cards Especiales */
.balance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.balance-card {
  background: var(--dark-2);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  text-align: center;
  border: 1px solid var(--dark-3);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.balance-title {
  color: var(--sillar-muted);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.balance-amount {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
}

.balance-card.ingreso {
  background: linear-gradient(180deg, rgba(46, 125, 50, 0.05) 0%, var(--dark-2) 100%);
}
.balance-card.ingreso::before { background: var(--success); }
.balance-card.ingreso .balance-amount { color: var(--success); }

.balance-card.gasto {
  background: linear-gradient(180deg, rgba(211, 47, 47, 0.05) 0%, var(--dark-2) 100%);
}
.balance-card.gasto::before { background: var(--danger); }
.balance-card.gasto .balance-amount { color: var(--danger); }

.balance-card.neto {
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.05) 0%, var(--dark-2) 100%);
  border: 1px solid rgba(201, 168, 76, 0.3);
}
.balance-card.neto::before { background: var(--gold); }
.balance-card.neto .balance-amount { color: var(--gold); text-shadow: 0 0 20px rgba(201, 168, 76, 0.2); }

/* ==========================================================================
   TABLAS
   ========================================================================== */
.table-container {
  background: var(--dark-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-3);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background-color: rgba(0,0,0,0.4);
  color: var(--gold);
  font-weight: 600;
  padding: 16px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--dark-3);
  white-space: nowrap;
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid var(--dark-3);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background-color 0.2s ease;
}

.admin-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.01);
}

.admin-table tbody tr:hover {
  background-color: rgba(196, 80, 26, 0.05); /* Highlight terracota leve */
}

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

/* ==========================================================================
   BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-pending, .badge-warning {
  background-color: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(237, 108, 2, 0.3);
}

.badge-paid, .badge-success {
  background-color: var(--success-light);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-validated, .badge-info {
  background-color: var(--info-light);
  color: #29b6f6;
  border: 1px solid rgba(41, 182, 246, 0.3);
}

.badge-danger {
  background-color: var(--danger-light);
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(196, 80, 26, 0.3);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-main);
  text-decoration: none;
  outline: none;
}

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

.btn i {
  font-size: 1.1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(196, 80, 26, 0.3);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 6px 15px rgba(196, 80, 26, 0.4);
}

.btn-gold {
  background-color: var(--gold);
  color: var(--dark);
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(201, 168, 76, 0.3);
}
.btn-gold:hover {
  background-color: var(--gold-hover);
  color: var(--dark);
  box-shadow: 0 6px 15px rgba(201, 168, 76, 0.4);
}

.btn-success {
  background-color: var(--success);
  color: #fff;
}
.btn-success:hover {
  background-color: #388e3c;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background-color: #d32f2f;
}

.btn-ghost {
  background-color: transparent;
  color: var(--sillar);
  border: 1px solid var(--dark-3);
}
.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--sillar-muted);
}

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

.btn-block {
  display: flex;
  width: 100%;
}

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

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--sillar);
  font-size: 0.9rem;
}

.form-control, .form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: rgba(0, 0, 0, 0.2); /* Oscuro semitransparente */
  border: 1px solid var(--dark-3);
  border-radius: var(--radius-sm);
  color: var(--sillar);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(196, 80, 26, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

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

.form-select option {
  background-color: var(--dark-2);
  color: var(--sillar);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--dark-3);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--dark-2);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(196, 80, 26, 0.3);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--sillar);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--sillar-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* ==========================================================================
   PROMOTERS CARDS GRID
   ========================================================================== */
.promoters-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.promoter-card {
  background: var(--dark-2);
  border: 1px solid var(--dark-3);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.promoter-card:hover {
  transform: translateY(-5px);
  border-color: rgba(196, 80, 26, 0.4);
  box-shadow: var(--shadow-md);
}

.promoter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.promoter-card:hover::before {
  opacity: 1;
}

.promoter-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--dark);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gold);
  overflow: hidden;
}

.promoter-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promoter-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.promoter-contact {
  color: var(--sillar-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.promoter-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-3);
}

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

.p-stat-val {
  font-weight: 700;
  color: var(--sillar);
}

.p-stat-lbl {
  font-size: 0.75rem;
  color: var(--sillar-muted);
}

.promoter-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ==========================================================================
   SCANNER
   ========================================================================== */
.scanner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.scanner-card {
  background: var(--dark-2);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 30px rgba(196, 80, 26, 0.1);
  position: relative;
  overflow: hidden;
}

.scanner-viewport {
  width: 100%;
  aspect-ratio: 1;
  max-height: 350px;
  background: #000;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animación de escaneo línea láser */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px 2px var(--primary);
  animation: scan 2s linear infinite;
  z-index: 10;
}

@keyframes scan {
  0%, 100% { top: 5%; }
  50% { top: 95%; }
}

.scan-result {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-md);
  display: none; /* Oculto por defecto */
  animation: pulse 1s infinite;
}

.scan-result.active {
  display: block;
}

.scan-success {
  background: rgba(46, 125, 50, 0.1);
  border: 1px solid var(--success);
  color: #4caf50;
}

.scan-error {
  background: rgba(211, 47, 47, 0.1);
  border: 1px solid var(--danger);
  color: #ef5350;
}

.scan-warning {
  background: rgba(237, 108, 2, 0.1);
  border: 1px solid var(--warning);
  color: #ff9800;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--dark-2);
  border-left: 4px solid var(--primary);
  color: var(--sillar);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.toast.fade-out {
  animation: fadeOutRight 0.3s forwards;
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ==========================================================================
   MISC
   ========================================================================== */
.event-music-block {
  background: rgba(0,0,0,0.2);
  border: 1px dashed var(--dark-3);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--sillar-muted);
}
.empty-state i {
  font-size: 3rem;
  color: var(--dark-3);
  margin-bottom: 16px;
}

/* ==========================================================================
   RESPONSIVE MOBILE
   ========================================================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-260px);
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.8);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .btn-menu, .btn-close-sidebar {
    display: block;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .balance-summary {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filters-group {
    flex-direction: column;
  }
  
  .modal-content {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    transform: translateY(100%);
  }
  
  .modal.active .modal-content {
    transform: translateY(0);
  }
}

/* ==========================================================================
   LAYOUT FIX — Compatibilidad con estructura actual del HTML
   ========================================================================== */

/* El #admin-app actúa como contenedor flex raíz */
#admin-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar fijo a la izquierda */
#admin-app .sidebar,
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  background: var(--dark-2);
  border-right: 1px solid rgba(196,80,26,0.25);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

/* Main content con margen para el sidebar */
#admin-app .main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--dark);
}

/* Topbar visible */
#admin-app .topbar {
  position: sticky;
  top: 0; z-index: 90;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26,12,3,0.95);
  border-bottom: 1px solid var(--dark-3);
  backdrop-filter: blur(12px);
}

#admin-app .topbar h2,
#admin-app .topbar #page-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sillar);
  margin: 0;
}

/* Page content padding */
#admin-app .page-content {
  padding: 24px;
  flex: 1;
}

/* ── NAV ITEMS (li.nav-item con data-target) ── */
.sidebar-nav .nav-item,
.sidebar-nav li.nav-item {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--sillar-muted);
  font-size: 0.9rem;
  font-weight: 500;
  gap: 10px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  list-style: none;
  user-select: none;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav li.nav-item:hover {
  background: rgba(196,80,26,0.08);
  color: var(--sillar);
  border-left-color: rgba(196,80,26,0.4);
}

.sidebar-nav .nav-item.active,
.sidebar-nav li.nav-item.active {
  background: rgba(196,80,26,0.15);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-nav .nav-item i,
.sidebar-nav li.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Si los nav-items tienen un <span> interno */
.sidebar-nav .nav-item > span,
.sidebar-nav li.nav-item > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sidebar brand */
.sidebar-brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sillar);
}

/* Sidebar header */
.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--dark-3);
  min-height: 64px;
}

/* ── STAT CARDS — Soporte para variantes del nuevo HTML ── */
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-success i { color: var(--success); }
.stat-card.stat-danger  { border-left-color: var(--danger); }
.stat-card.stat-danger  i { color: var(--danger); }
.stat-card.stat-gold    { border-left-color: var(--gold); }
.stat-card.stat-gold    i { color: var(--gold); }

/* Stats grid simplificado del nuevo HTML */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--dark-2);
  border: 1px solid var(--dark-3);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card i { font-size: 1.4rem; color: var(--primary); }
.stat-card h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sillar-muted); margin: 0; }
.stat-card h2 { font-size: 1.8rem; font-weight: 700; color: var(--sillar); margin: 0; }
.stat-card p  { font-size: 1.5rem; font-weight: 700; color: var(--sillar); margin: 0; }

/* ── FORMULARIOS MÁS VISIBLES ── */
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--sillar);
  font-size: 0.88rem;
  font-weight: 500;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(38, 20, 8, 0.6);
  border: 1px solid rgba(196,80,26,0.3);
  border-radius: var(--radius-sm);
  color: var(--sillar);
  font-family: var(--font-main);
  font-size: 0.92rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(38, 20, 8, 0.85);
  box-shadow: 0 0 0 3px rgba(196,80,26,0.15);
}
.form-input::placeholder { color: rgba(245,237,213,0.3); }

/* ── CARD VISIBLE ── */
.card {
  background: var(--dark-2);
  border: 1px solid var(--dark-3);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

/* ── MODAL CORREGIDO ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
  background: var(--dark-2);
  border: 1px solid var(--dark-3);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: fadeSlide 0.25s ease;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-3);
}

/* ── TABLAS ── */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(0,0,0,0.3);
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--dark-3);
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(38,20,8,0.6);
  color: var(--sillar);
  font-size: 0.88rem;
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(196,80,26,0.05); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-pending  { background: rgba(237,108,2,0.2);  color: #ed6c02; }
.badge-paid     { background: rgba(46,125,50,0.2);  color: #66bb6a; }
.badge-validated{ background: rgba(2,136,209,0.2);  color: #29b6f6; }

/* ── BOTONES ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); border: none; font-family: var(--font-main); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--dark); }
.btn-success { background: #2e7d32; color: #fff; }
.btn-danger { background: #c62828; color: #fff; }
.btn-ghost { background: transparent; color: var(--sillar-muted); border: 1px solid var(--dark-3); }
.btn-ghost:hover { color: var(--sillar); border-color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── UTILIDADES ── */
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  #admin-app .main-content { margin-left: 0; }
  #sidebar { transform: translateX(-260px); }
  #sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .btn-menu { display: flex !important; }
  .btn-close-sidebar { display: block !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── SCANNER ── */
.scanner-card { text-align: center; }
#qr-reader { margin: 16px auto; max-width: 100%; border-radius: var(--radius-md); overflow: hidden; }
#scan-result {
  padding: 16px; border-radius: var(--radius-md); margin-top: 16px; font-weight: 600;
}
.scan-success { background: rgba(46,125,50,0.2); border: 1px solid #2e7d32; color: #66bb6a; }
.scan-error   { background: rgba(198,40,40,0.2); border: 1px solid #c62828; color: #ef9a9a; }
.scan-warning { background: rgba(237,108,2,0.2); border: 1px solid #ed6c02; color: #ffb74d; }

/* ── LOGIN ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, #2A1200 0%, #0D0600 100%);
  padding: 20px;
}
.login-card {
  background: rgba(26,12,3,0.9);
  border: 1px solid rgba(196,80,26,0.3);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(20px);
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 12px; }
.login-card h2 { font-family: var(--font-heading); color: var(--sillar); margin-bottom: 6px; }
.login-card p { color: var(--sillar-muted); margin-bottom: 24px; font-size: 0.9rem; }
.login-error { color: #ef9a9a; font-size: 0.85rem; min-height: 20px; margin-bottom: 10px; }

/* ── PROMOTORES GRID ── */
.promoters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.promoter-card {
  background: var(--dark-3);
  border: 1px solid var(--dark-3);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease;
}
.promoter-card:hover { transform: translateY(-3px); }
.promoter-card img {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--primary);
  margin-bottom: 10px;
}
.promoter-card .promoter-name { font-weight: 600; color: var(--sillar); }
.promoter-card .promoter-phone { font-size: 0.82rem; color: var(--sillar-muted); margin: 4px 0 12px; }

/* ── IMAGE PREVIEW ── */
.img-preview {
  max-width: 120px;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  display: none;
}
.img-preview[src]:not([src=""]) { display: block; }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 350px;
}
.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }
.toast.info    { background: #0277bd; }
@keyframes toastIn { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }

