/* FIX FONT AWESOME SQUARES - MOVED TO TOP */
.fa,
.fas,
.fa-solid,
.fa-regular,
.far,
.fa-brands,
.fab {
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", sans-serif !important;
}

.fa-solid,
.fas {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.fa-regular,
.far {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 400 !important;
}

.fa-brands,
.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

/* GLOBAL FONT VARIABLE */
:root {
  --app-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Theme: Azul â€¢ Blanco â€¢ Amarillo â€¢ Morado */
  --bg: #020617;
  --panel: #0b1223;
  --panel-2: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;

  --blue: #2563eb;
  --blue-2: #38bdf8;
  --yellow: #fbbf24;
  --purple: #7c3aed;

  --ring: rgba(251, 191, 36, 0.35);
  --border: rgba(148, 163, 184, 0.25);

  --grad-main: linear-gradient(135deg, var(--blue), var(--purple));
  --grad-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.16));
}


*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--app-font-family);
}

/* LAYOUT */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
  width: 260px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: radial-gradient(circle at top, var(--yellow), var(--blue) 45%, var(--purple) 92%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #eff6ff;
  font-size: 1.1rem;
}

/* Logo oficial en la sidebar (reemplaza el cÃ­rculo "KL") */
.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

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

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.menu-section {
  margin-bottom: 1.25rem;
}

.menu-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.14em;
  margin-bottom: 0.4rem;
}

.menu-link {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: background 0.08s ease, color 0.08s ease, transform 0.06s ease;
}

.menu-link:hover {
  background: rgba(37, 99, 235, 0.25);
  color: #e5e7eb;
  transform: translateX(2px);
}

.menu-link.active {
  background: var(--grad-main);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--ring);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
}

.btn-logout-link {
  text-decoration: none;
}

.btn-logout {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  color: #dbeafe;
  cursor: pointer;
}

/* MAIN */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, #1d4ed8 0, #020617 52%);
}

/* TOPBAR */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem 0.75rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 20px;
  cursor: pointer;
  margin-right: 15px;
  padding: 0.5rem;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
}

.top-title {
  font-size: 1.05rem;
  color: #e5e7eb;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-search input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

.top-clock {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.7);
  font-size: 0.8rem;
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.15);
}

.top-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.top-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eff6ff;
  font-size: 0.9rem;
  font-weight: 600;
}

.top-user-info {
  display: flex;
  flex-direction: column;
}

.top-user-name {
  font-size: 0.85rem;
  color: #e5e7eb;
  font-weight: 500;
}

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

/* CONTENT */

.content {
  flex: 1;
  padding: 0.5rem 1.5rem 1.25rem;
}

.section {
  display: none;
}

.section.visible {
  display: block;
}

.section-title {
  font-size: 1.1rem;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
}

.section-note {
  font-size: 0.9rem;
  color: var(--muted);
}

/* CARDS */

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.6);
  padding: 0.9rem 1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

.card-label {
  font-size: 0.85rem;
  color: #cbd5f5;
  margin-bottom: 0.25rem;
}

.card-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.card-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.card-ventas {
  border-color: rgba(59, 130, 246, 0.9);
}

.card-ventas .card-value {
  color: #93c5fd;
}

.card-comision {
  border-color: rgba(37, 99, 235, 0.9);
}

.card-comision .card-value {
  color: #bfdbfe;
}

.card-premios {
  border-color: rgba(248, 113, 113, 0.9);
}

.card-premios .card-value {
  color: #dbeafe;
}

.card-resultados {
  border-color: rgba(34, 197, 94, 0.9);
}

.card-resultados .card-value {
  color: #bbf7d0;
}

.btn-mini {
  margin-top: auto;
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(100, 116, 139, 0.5);
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-mini:hover {
  background: rgba(51, 65, 85, 0.3);
  border-color: rgba(148, 163, 184, 0.7);
  color: #f1f5f9;
  transform: translateY(-1px);
}

/* CHART */

.chart-card {
  margin-bottom: 1rem;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  padding: 0.8rem 1rem 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.chart-header h2 {
  font-size: 0.98rem;
  color: #e5e7eb;
}

.badge {
  font-size: 0.7rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.8);
  color: #bfdbfe;
}

.chart-placeholder {
  margin-top: 0.4rem;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.chart-bar {
  flex: 1;
  height: 90px;
  border-radius: 0.75rem 0.75rem 0.35rem 0.35rem;
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
  opacity: 0.35;
}

.chart-bar:nth-child(2) {
  height: 110px;
  opacity: 0.45;
}

.chart-bar:nth-child(3) {
  height: 70px;
}

.chart-bar:nth-child(4) {
  height: 95px;
  opacity: 0.5;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.3rem;
}

.chart-container-wrapper {
  position: relative;
  height: 150px;
  width: 100%;
  overflow: hidden;
}

/* TABLES */

.table-card {
  margin-bottom: 1rem;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
  padding: 0.8rem 1rem 1rem;
}

.table-card.small {
  padding: 0.6rem 0.9rem 0.9rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.table-header h2 {
  font-size: 0.96rem;
  color: #e5e7eb;
}

.table-wrapper {
  border-radius: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  display: block;
}

@media (max-width: 768px) {
  .table-wrapper {
    max-width: 100%;
  }

  .table-wrapper table {
    min-width: 600px;
  }

  .table-card {
    overflow: visible;
  }

  /* Modal más ancho en móviles cuando contiene tablas - DEBE IR PRIMERO */
  .modal:has(.table-card) {
    width: min(98vw, 100%) !important;
    max-width: 98vw !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  /* Tablas dentro de modales en móviles */
  .modal .table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: -0.6rem;
    /* Compensar padding del modal-body */
    padding-inline: 0.6rem;
    /* Restaurar padding para el contenido */
    width: calc(100% + 1.2rem);
    /* Asegurar que el scrollbar sea visible */
  }

  .modal .table-wrapper table {
    min-width: 450px;
    font-size: 0.75rem;
    width: 100%;
  }

  .modal-body {
    padding: 0.6rem 0.7rem 0.7rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .modal .table-card {
    padding: 0.5rem 0.6rem 0.6rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  /* Asegurar que las celdas de la tabla no se rompan */
  .modal .table-wrapper table th,
  .modal .table-wrapper table td {
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
  }

  /* Scroll horizontal para sorteos en móviles */
  .card-glass-body:has(.sorteos-grid) {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-inline: 0.5rem;
  }

  /* Fallback para navegadores que no soportan :has() */
  .card-glass-body .sorteos-grid {
    min-width: 600px;
    /* Ancho mínimo para activar el scroll */
  }

  .sorteo-row {
    min-width: 600px;
    /* Ancho mínimo para que el scroll funcione */
    width: 100%;
  }

  .sorteos-actions {
    min-width: 600px;
    /* Mantener el ancho mínimo para los botones */
    width: 100%;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

thead {
  background: rgba(15, 23, 42, 0.98);
}

th,
td {
  padding: 0.5rem 0.7rem;
  text-align: left;
}

th {
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.9);
}

.empty-row td {
  text-align: center;
  color: #6b7280;
}

/* TABLA LOTERÍAS - Mobile Scroll Fix */

.table-loterias {
  width: 100%;
  min-width: 700px;
  /* Ensures table is wide enough to need scrolling on mobile */
}

.table-loterias .col-center {
  text-align: center;
}

.table-loterias td {
  color: #e5e7eb;
  white-space: nowrap;
  /* Prevents text wrapping in cells */
}

.table-loterias .btn-edit-loteria {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: transform 0.2s ease;
}

.table-loterias .btn-edit-loteria:hover {
  transform: scale(1.2);
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
  .table-loterias {
    min-width: 750px;
    /* Slightly wider on mobile to ensure all columns are visible */
  }

  .table-wrapper {
    /* Add visible scrollbar hint on mobile */
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) rgba(15, 23, 42, 0.5);
  }

  .table-wrapper::-webkit-scrollbar {
    height: 8px;
  }

  .table-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
  }

  .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
  }

  .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
  }
}

/* GRID 4 */

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.card.tall {
  min-height: 210px;
}

.card-header-row {
  margin-bottom: 0.5rem;
}

.card-header-row h3 {
  font-size: 0.95rem;
  color: #e5e7eb;
}

.tickets-info {
  margin-top: 0.2rem;
}

.tickets-total {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.tickets-info ul {
  list-style: none;
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.tickets-info li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 0.4rem;
}

.dot-ok {
  background: #22c55e;
}

.dot-pend {
  background: #eab308;
}

.dot-win {
  background: #22c55e;
}

.table-mini table td {
  padding: 0.4rem 0.5rem;
}

/* BANCAS */

.bancas-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.banca-item {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.7rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
}

.banca-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #bfdbfe;
}

.banca-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

/* FORMS / FILTERS */

.config-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.config-tab {
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #cbd5f5;
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.config-tab.active {
  border-color: rgba(59, 130, 246, 0.9);
  background: rgba(37, 99, 235, 0.2);
  color: #e5e7eb;
}

.config-panels {
  margin-top: 0.4rem;
}

.config-panel {
  display: none;
}

.config-panel.visible {
  display: block;
}

.config-placeholder {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.config-form {
  margin-top: 0.3rem;
  max-width: 620px;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  padding: 0.9rem 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
}

.form-row {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.form-row label {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-row input,
.form-row select {
  border-radius: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.phone-row {
  display: flex;
  gap: 0.4rem;
}

.phone-code {
  min-width: 80px;
}

/* generic form + filters */

.form-actions {

  .config-separator {
    margin: 0.8rem 0;
    border: 0;
    border-top: 1px dashed rgba(55, 65, 81, 0.8);
  }

  margin-top: 0.4rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.7rem;
}

.filters-row input,
.filters-row select {
  border-radius: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  min-width: 140px;
}

/* FOOTER */

.footer {
  padding: 0.65rem 1.5rem 0.8rem;
  font-size: 0.78rem;
  color: #6b7280;
}

/* BUTTONS */

.btn-primary,
.btn-secondary {
  border-radius: 0.7rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.86rem;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--grad-main);
  color: #f9fafb;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

/* MODALS */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 40;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(360px, 96vw);
  background: var(--bg);
  border-radius: 0.9rem;
  border: 1px solid rgba(59, 130, 246, 0.7);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal más ancho cuando contiene tablas */
.modal:has(.table-card) {
  width: min(600px, 96vw);
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.modal-header,
.modal-footer {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-footer {
  border-top: 1px solid rgba(31, 41, 55, 0.95);
  border-bottom: none;
}

.modal-header h3 {
  font-size: 0.95rem;
  color: #e5e7eb;
}

.modal-body {
  padding: 0.8rem 0.9rem 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.modal-body label {
  font-size: 0.8rem;
  color: var(--muted);
}

.modal-body input,
.modal-body textarea {
  border-radius: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

/* LOGIN */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fondo azul mezclado con el panel */
  background:
    radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.35) 0, rgba(15, 23, 42, 0) 55%),
    radial-gradient(circle at 80% 30%, rgba(37, 99, 235, 0.45) 0, rgba(2, 6, 23, 0) 55%),
    linear-gradient(180deg, #0b1223 0%, #020617 100%);
}

.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: 1.25rem;
}

.login-card {
  background: rgba(2, 6, 23, 0.82);
  border-radius: 1.1rem;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.38);
  backdrop-filter: blur(8px);
}

.login-domain {
  text-align: center;
  color: #6b7280;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

/* Logo oficial en el login */
.login-logo {
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
  margin: 0.35rem auto 0.75rem;
  filter: drop-shadow(0 10px 18px rgba(2, 6, 23, 0.55));
}

.login-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #e5e7eb;
  text-align: center;
  letter-spacing: 0.15em;
}

.login-subtitle {
  text-align: center;
  color: #60a5fa;
  margin-top: 0.35rem;
  margin-bottom: 1.1rem;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-form label {
  font-size: 0.85rem;
  color: var(--muted);
}

.login-form input {
  border-radius: 0.8rem;
  border: 1px solid #1f2937;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  color: #e5e7eb;
  outline: none;
  font-size: 0.95rem;
}

.login-form input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

.btn-login {
  margin-top: 0.5rem;
}

.login-footer {
  margin-top: 1.7rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.8rem;
}

/* COMMON BUTTON EFFECTS */

.btn-primary {
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
  transition: transform 0.08s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 5px 10px rgba(15, 23, 42, 0.8);
}

/* SPACING HELPERS */

.mb-05 {
  margin-bottom: 0.5rem;
}

.mt-05 {
  margin-top: 0.5rem;
}

/* RESPONSIVE */

@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    display: flex !important;
  }

  .sidebar.active {
    left: 0;
  }

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

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

  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #e5e7eb;
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
    padding: 0.5rem;
    min-width: 40px;
    min-height: 40px;
  }

  .mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }

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

  .content {
    padding-inline: 0.9rem;
  }

  .topbar {
    padding-inline: 0.9rem;
  }
}

@media (max-width: 960px) {
  .content {
    padding-inline: 0.9rem;
  }

  .topbar {
    padding-inline: 0.9rem;
  }
}


/* SUBMENU CONFIGURACIÃ“N */

.submenu {
  margin: 0.25rem 0 0.4rem 0.6rem;
  /* Por defecto oculto (se abre cuando el padre agrega la clase .open) */
  display: none;
  flex-direction: column;
  gap: 0.1rem;
}

.submenu.open {
  display: flex;
}

.submenu-link {
  font-size: 0.8rem;
}

/* CONFIG: TABS DETAILS */

.config-subtitle {
  font-size: 0.9rem;
  color: #e5e7eb;
  margin-bottom: 0.6rem;
}

/* Ticket footer lines */

.ticket-lines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 720px;
}

.ticket-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.ticket-line input {
  border-radius: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.ticket-line-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 0.8rem;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn.danger {
  border-color: rgba(248, 113, 113, 0.9);
  color: #dbeafe;
}

.add-line-btn {
  margin-top: 0.6rem;
}

/* Chart options (GrÃ¡ficos) */

.chart-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  max-width: 820px;
}

.chart-option {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.chart-option.selected {
  border-color: rgba(129, 140, 248, 1);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.chart-icon {
  width: 72px;
  height: 56px;
  border-radius: 0.6rem;
  background: radial-gradient(circle at top, #a855f7, #7c3aed);
  position: relative;
  overflow: hidden;
}

.chart-bar-icon::before,
.chart-bar-icon::after,
.chart-horizontal-icon::before,
.chart-doughnut-icon::before,
.chart-pie-icon::before,
.chart-polar-icon::before,
.chart-radar-icon::before {
  content: "";
  position: absolute;
}

/* Different fake shapes for each icon */
.chart-bar-icon::before {
  left: 10px;
  bottom: 10px;
  width: 10px;
  height: 26px;
  background: rgba(248, 250, 252, 0.92);
  box-shadow: 14px -6px 0 0 rgba(248, 250, 252, 0.7),
    28px 4px 0 0 rgba(248, 250, 252, 0.5);
}

.chart-horizontal-icon::before {
  left: 10px;
  top: 12px;
  width: 36px;
  height: 8px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 6px 14px 0 0 rgba(248, 250, 252, 0.7),
    12px 28px 0 0 rgba(248, 250, 252, 0.5);
}

.chart-doughnut-icon::before {
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 8px solid rgba(248, 250, 252, 0.92);
  box-sizing: border-box;
}

.chart-pie-icon::before {
  top: 8px;
  left: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px 999px 0 999px;
  background: rgba(248, 250, 252, 0.92);
}

.chart-polar-icon::before {
  inset: 13px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.9);
  box-shadow: inset 14px 0 0 0 rgba(248, 250, 252, 0.9);
}

.chart-radar-icon::before {
  inset: 16px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.9);
}

/* radio circle */

.chart-label {
  font-size: 0.82rem;
  color: #e5e7eb;
}

.chart-radio {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.9);
  position: relative;
}

.chart-option.selected .chart-radio::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: #38bdf8;
}

/* Pago de premio grid */

.pago-table {
  margin-top: 0.4rem;
  max-width: 720px;
  border-radius: 0.9rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  overflow: hidden;
}

.pago-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.7fr 0.7fr;
}

.pago-row.header {
  background: rgba(15, 23, 42, 0.98);
}

.pago-cell {
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

.pago-cell.label {
  color: #e5e7eb;
}

.pago-row input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
}

.form-row.inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 520px;
}

.form-row.inline label {
  min-width: 130px;
}

.inline-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Jugadas table */

.jugadas-table {
  margin-top: 0.4rem;
  max-width: 520px;
  border-radius: 0.9rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  overflow: hidden;
}

.jugadas-row {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
}

.jugadas-header {
  background: rgba(15, 23, 42, 0.98);
}

.jugada-cell {
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

.jugada-cell.code {
  color: #e5e7eb;
}

.jugadas-row input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
}



/* Toggle pill ON / OFF for Jugadas */

.toggle-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.98);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.6rem;
}

.toggle-pill::before {
  content: "";
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.9);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle-pill.on {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(22, 163, 74, 0.18);
  color: #bbf7d0;
}

.toggle-pill.on::before {
  transform: translateX(28px);
  background: rgba(34, 197, 94, 0.95);
}



.toggle-pill.on {
  border-color: rgba(34, 197, 94, 0.9);
  color: #bbf7d0;
}

.toggle-pill.on::before {
  transform: translateX(24px);
  background: rgba(34, 197, 94, 0.95);
}

/* Jugadas: 3 columnas (cÃ³digo, nombre, estatus) */

.jugadas-row {
  display: grid;
  grid-template-columns: 0.8fr 1.6fr 0.9fr;
}

/* Grupo / Zonas style */

.grupo-card {
  margin-top: 1rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.card-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-actions-right .search-input {
  max-width: 220px;
}

.btn-primary.small {
  padding-inline: 0.7rem;
  height: 32px;
  font-size: 0.78rem;
}

.table-wrapper .table th,
.table-wrapper .table td {
  font-size: 0.8rem;
}

.table-wrapper .empty-row {
  text-align: center;
  color: #6b7280;
}



/* LÃ­mites / Ajustes estilo tipo panel profesional */
.limits-config {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.limits-block {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
}

.limits-block-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.94rem;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.55), rgba(15, 23, 42, 0.98));
  border-bottom: 1px solid rgba(30, 64, 175, 0.7);
}

.limits-block-body {
  padding: 0.85rem 1rem 1rem;
}

.limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1.5rem;
}

@media (max-width: 640px) {
  .limits-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .limits-row input,
  .limits-row select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.limits-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.limits-row label {
  font-size: 0.8rem;
  color: var(--muted);
}

.limits-row input,
.limits-row select {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.6rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 0.42rem 0.6rem;
  font-size: 0.9rem;
  color: #f9fafb;
  outline: none;
}

.limits-row input:focus,
.limits-row select:focus {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
}

.limits-row-inline {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.limits-row-inline label {
  margin-bottom: 0;
}

.limits-row-inline select {
  max-width: 200px;
}

.btn-mini.danger,
.btn-block-remove {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #f9fafb;
}

.btn-mini.danger:hover,
.btn-block-remove:hover {
  background: #dc2626;
}

/* Botón de eliminar en modales de confirmación */
.btn-kima-primary.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #f9fafb;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.4);
}

.btn-kima-primary.danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(220, 38, 38, 0.5);
}

.btn-kima-primary.danger:disabled {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.5;
}


/* LÃ­mites - EstadÃ­sticas (vista de columnas) */
.limits-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
  margin-top: 0.6rem;
}

.limits-stats-header {
  justify-content: flex-start;
}

.select-mini {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.6rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 0.32rem 0.6rem;
  font-size: 0.8rem;
  color: #f9fafb;
  outline: none;
}

.select-mini:focus {
  border-color: rgba(59, 130, 246, 0.95);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* LÃ­mites - EstadÃ­sticas subheader */
.limits-block-subheader {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 0.35rem 1rem 0.4rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  background: rgba(15, 23, 42, 0.98);
}

.sub-title {
  font-size: 0.8rem;
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sub-hash {
  font-size: 0.78rem;
  color: var(--muted);
  padding-inline: 0.75rem 0.25rem;
}

.icon-btn {
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #e5e7eb;
}

.icon-btn:hover {
  border-color: rgba(59, 130, 246, 0.9);
}

/* COLUMNAS MAS GRANDES */
.limits-block {
  min-height: 480px;
}

.limits-stats-grid,
.limits-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.4rem !important;
}

.limits-block-header {
  height: 55px !important;
}

.stats-row {
  padding: 0.45rem 0.7rem !important;
}

/* AJUSTES NORMAL (TAMAÃ‘O ORIGINAL) */
#section-limits .limits-block {
  min-height: 300px !important;
}

/* SOLO ESTADISTICAS GRANDES */
#section-limits-estadisticas .limits-block {
  min-height: 480px !important;
}

#section-limits-estadisticas .limits-grid,
#section-limits-estadisticas .limits-stats-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.4rem !important;
}

@media (max-width: 768px) {

  .limits-stats-grid,
  .limits-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  #section-limits-estadisticas .limits-grid,
  #section-limits-estadisticas .limits-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .limits-block {
    min-height: auto !important;
  }

  .limits-block-header {
    height: auto !important;
    padding: 0.6rem 0.8rem;
  }
}

/* Tabla de loterÃ­as (similar a Toto Bolet) */
.table-loterias th.col-center,
.table-loterias td.col-center {
  text-align: center;
}

.table-loterias td.col-edit {
  width: 52px;
}

.btn-edit-loteria {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #60a5fa;
}

.btn-edit-loteria:hover {
  transform: scale(1.05);
}

.table-header-note {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Panel ediciÃ³n loterÃ­a */
.loteria-edit-card {
  display: none;
  margin-top: 1rem;
}

.loteria-edit-card.visible {
  display: block;
}

.form-row-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.form-col label {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-col input {
  border-radius: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.color-bar-demo {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #06b6d4, #3b82f6);
  border: 1px solid rgba(15, 23, 42, 0.95);
}

.premios-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.premios-label {
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* Vendedores - tabla principal */
.table-header-vendedores {
  align-items: center;
}

.vendedores-filters {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-mini {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  color: #e5e7eb;
  outline: none;
}

.filter-mini::placeholder {
  color: #6b7280;
}

.btn-icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.9);
  background: rgba(37, 99, 235, 0.25);
  color: #e5e7eb;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-circle:hover {
  background: rgba(37, 99, 235, 0.45);
}

.table-vendedores th.col-center,
.table-vendedores td.col-center {
  text-align: center;
}

.acciones-cell {
  white-space: nowrap;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  margin-inline: 2px;
}

.btn-icon:hover {
  color: #bfdbfe;
  transform: scale(1.05);
}

.conn-icon {
  font-size: 1rem;
}


/* ==== MI CUENTA (ACCOUNT) ==== */

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 0.8rem;
}

@media (max-width: 900px) {
  .account-layout {
    grid-template-columns: 1fr;
  }
}

.account-summary {
  text-align: center;
}

.account-avatar-wrapper {
  position: relative;
  display: inline-block;
  margin: 0 auto 0.7rem;
}

.account-avatar {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #38bdf8, #1d4ed8);
  color: #e5e7eb;
  font-weight: 700;
  font-size: 1.7rem;
  position: relative;
  overflow: hidden;
}

.btn-avatar-change {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--bg);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-avatar-change:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.btn-avatar-change:active {
  transform: scale(0.95);
}

.account-name {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.badge-role {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.7);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.7rem;
}

.account-details {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.detail-label {
  color: var(--muted);
}

.detail-value {
  color: #e5e7eb;
}

.detail-pill {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.status-active {
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(22, 163, 74, 0.8);
  color: #bbf7d0;
}

/* Tabs Mi Cuenta */

.account-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  padding: 0.12rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  align-self: flex-start;
}

.tab-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-link.active {
  background: linear-gradient(90deg, #1d4ed8, #22c55e);
  color: #f9fafb;
}

.tab-content {
  margin-top: 0.4rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-title {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

/* Forms dentro de Mi Cuenta */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem 0.9rem;
  margin-top: 0.6rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-group input,
.form-group select {
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9) !important;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  color: #e5e7eb !important;
}

.form-group input[readonly] {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #e5e7eb !important;
  cursor: not-allowed;
  opacity: 0.8;
}

.form-group input::placeholder {
  color: #6b7280;
}

.form-actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.form-actions .btn-primary {
  min-width: 170px;
}

/* Divider + two steps */

.divider {
  height: 1px;
  background: rgba(55, 65, 81, 0.9);
  margin: 1rem 0;
}

.section-note.small {
  font-size: 0.8rem;
}

.two-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

/* Simple switch */

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #374151;
  border-radius: 999px;
  transition: 0.2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #e5e7eb;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked+.slider {
  background-color: #22c55e;
}

.switch input:checked+.slider:before {
  transform: translateX(18px);
}


/* Panel de ediciÃ³n de vendedores (demo) */
.vendedor-edit-card {
  display: none;
  margin-top: 1rem;
}

.vendedor-edit-card.visible {
  display: block;
}

/* Sorteos - grid de loterÃ­as por columnas */
.sorteos-grid {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sorteo-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(120px, 180px) minmax(70px, 100px) minmax(70px, 100px) auto;
  gap: 0.4rem;
  align-items: center;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.4));
  border-radius: 0.8rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.sorteo-lot-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: #e5e7eb;
}


.sorteo-drawtype {
  font-size: 0.78rem;
  color: #93c5fd;
  opacity: 0.9;
  margin-left: 4px;
}

.badge-inactive {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.65);
}

.sorteo-row input:disabled,
.sorteo-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.sorteo-row input {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.6rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 0.35rem 0.55rem;
  font-size: 0.9rem;
  color: #f9fafb;
}

.sorteo-input-full {
  font-weight: 600;
  border-color: rgba(59, 130, 246, 0.7) !important;
}

.sorteo-input-col1,
.sorteo-input-col2 {
  background: rgba(30, 64, 175, 0.3) !important;
  font-weight: 700;
  text-align: center;
  color: #60a5fa !important;
}

.sorteo-row input:focus {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
}

.sorteo-clear {
  border: none;
  background: rgba(220, 38, 38, 0.16);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #dbeafe;
}

.sorteo-clear:hover {
  background: rgba(220, 38, 38, 0.26);
}


/* Quick date range select next to Fecha input (reportes venta demo) */
.filters-row .date-quick {
  max-width: 160px;
}

/* Date Picker Calendar */
.date-picker-wrapper {
  position: relative;
  display: inline-block;
}

.date-picker-wrapper input[readonly] {
  cursor: pointer;
  padding-right: 2.5rem;
}

.date-picker-wrapper {
  position: relative;
}

.date-display-value {
  font-size: 0.82rem;
  color: var(--text);
  pointer-events: none;
  user-select: none;
}

/* Date Range Picker */
.date-range-wrapper {
  position: relative;
}

.date-range-calendar {
  min-width: 600px;
  max-width: 90vw;
}

.date-range-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
}

.date-range-from,
.date-range-to {
  display: flex;
  flex-direction: column;
}

.date-range-from>label,
.date-range-to>label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-align: center;
}

.date-range-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.date-range-actions button {
  min-width: 80px;
}

.date-picker-day.in-range {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
}

.date-picker-day.range-start {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 600;
}

.date-picker-day.range-end {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 600;
}

.date-picker-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  color: var(--muted);
  transition: color 0.2s;
}

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

.date-picker-calendar {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.8rem;
  min-width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
}

.date-picker-calendar.visible {
  display: block;
}

.date-picker-quick-actions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.date-quick-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 0.5rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.date-quick-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--blue);
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.date-picker-nav {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  transition: background 0.2s;
}

.date-picker-nav:hover {
  background: rgba(37, 99, 235, 0.2);
}

.date-picker-month-year {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.date-picker-weekdays>div {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  padding: 0.3rem 0;
}

.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
}

.date-picker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
}

.date-picker-day:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--blue);
}

.date-picker-day.other-month {
  color: var(--muted);
  opacity: 0.4;
}

.date-picker-day.today {
  background: rgba(251, 191, 36, 0.2);
  border-color: var(--yellow);
  font-weight: 600;
}

.date-picker-day.selected {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 600;
}

.date-picker-day.selected.today {
  background: var(--blue);
  border-color: var(--blue);
}


/* Report export tools (Imprimir / PDF / Excel) */
.report-export-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  margin-bottom: 4px;
}

.export-actions {
  position: relative;
}

.export-toggle {
  min-width: 40px;
}

.export-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: rgba(8, 20, 40, 0.98);
  border-radius: 6px;
  padding: 4px 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 40;
}

.export-dropdown button {
  width: 140px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: #e6edf7;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.export-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* icons with text */
.export-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e6edf7;
  font-size: 13px;
  width: 100%;
  font-weight: 400;
}

.export-menu-item.print::before {
  content: "ðŸ–¨ï¸";
}

.export-menu-item.pdf::before {
  content: "\f1c1";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
  color: #e6edf7;
}

.export-menu-item.excel::before {
  content: "\f1c3";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
  color: #e6edf7;
}

/* Fix para el icono de print que tiene emoji mal codificado */
.export-menu-item.print::before {
  content: "\f02f" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  color: #e6edf7 !important;
}

/* Asegurar que el texto dentro del span sea visible */
.export-dropdown .export-menu-item {
  color: #e6edf7 !important;
}

.export-dropdown button span {
  color: #e6edf7 !important;
  font-weight: 400;
}

/* Consolas helpers */
.text-success {
  color: #22c55e;
}

.icon-eye {
  font-size: 1rem;
}


/* Iconos en el sidebar (Font Awesome) */
.menu-link i,
.btn-logout i {
  margin-right: 0.55rem;
  font-size: 0.9rem;
}

.menu-link span,
.btn-logout span {
  display: inline-block;
}



/* =========================================================
   KIMA LOTO â€¢ THEME OVERRIDES
   Paleta: verde â€¢ azul â€¢ amarillo â€¢ blanco (estilo moderno)
   Sidebar con Ã­conos profesionales y look mÃ¡s limpio
   ========================================================= */
:root {
  --kl-color-blue: #1d4ed8;
  --kl-color-blue-soft: #60a5fa;
  --kl-color-green: #16a34a;
  --kl-color-green-soft: #4ade80;
  --kl-color-yellow: #facc15;
  --kl-color-dark: #020617;
  --kl-color-surface: #020617;
  --kl-color-surface-soft: #0b1220;
  --kl-color-card: #020617;
  --kl-color-border-soft: rgba(148, 163, 184, 0.35);
  --kl-color-text-soft: #9ca3af;
  --kl-color-text-strong: #e5e7eb;
}

body {
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.35), #020617 50%, #020617 100%);
  color: var(--kl-color-text-strong);
}

/* Layout general */
.app-layout {
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 55%),
    radial-gradient(circle at bottom right, rgba(250, 204, 21, 0.12), transparent 60%),
    #020617;
}

/* Sidebar moderno con mezcla verde/azul/amarillo */
.sidebar {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.97) 0%, rgba(5, 46, 22, 0.98) 40%, rgba(15, 23, 42, 0.98) 100%);
  border-right: 1px solid var(--kl-color-border-soft);
  box-shadow: 10px 0 30px rgba(15, 23, 42, 0.9);
}

.app-brand .brand-logo {
  background: radial-gradient(circle at top, var(--kl-color-green-soft), var(--kl-color-blue));
  color: #f9fafb;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
}

/* Chip versiÃ³n */
.app-badge {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.38);
  color: var(--kl-color-text-soft);
}

/* MenÃº lateral con Ã­conos mÃ¡s "pro" */
.menu-list {
  gap: 0.15rem;
}

.menu-link {
  position: relative;
  border-radius: 0.8rem;
  padding: 0.5rem 0.85rem 0.5rem 1.05rem;
  background: transparent;
  color: var(--kl-color-text-soft);
}

.menu-link::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  transform: translateX(-4px);
}

.menu-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(30, 64, 175, 0.55);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.85);
}

.menu-label {
  font-size: 0.86rem;
}

/* Hover y activo: mezcla verde/azul/amarillo */
.menu-link:hover {
  background: rgba(15, 23, 42, 0.95);
  color: var(--kl-color-text-strong);
  transform: translateX(3px);
}

.menu-link:hover .menu-icon {
  border-color: rgba(34, 197, 94, 0.65);
}

.menu-link:hover::before {
  opacity: 1;
  transform: translateX(0);
  background: linear-gradient(180deg, var(--kl-color-green), var(--kl-color-yellow));
}

.menu-link.active {
  background: var(--grad-main);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--ring);
}

.menu-link.active::before {
  opacity: 1;
  transform: translateX(0);
  background: blueviolet;
}

.menu-link.active .menu-icon {
  background: radial-gradient(circle at top, var(--kl-color-green-soft), var(--kl-color-blue));
  border-color: transparent;
}

/* BotÃ³n cerrar sesiÃ³n */
.btn-logout {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(239, 68, 68, 0.65);
  color: #fecaca;
}

.btn-logout:hover {
  background: radial-gradient(circle at top, rgba(239, 68, 68, 0.16), rgba(15, 23, 42, 1));
}

/* Topbar */
.topbar {
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(34, 197, 94, 0.18), rgba(250, 204, 21, 0.14));
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.9);
}

.topbar-title span {
  color: var(--kl-color-yellow);
}

/* Tarjetas principales */
.dashboard-header,
.card,
.card-compact,
.stats-row .stats-card,
.table-card {
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 1));
  border: 1px solid var(--kl-color-border-soft);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.9);
}

/* Total hoy highlight */
.header-total-amount {
  color: #fefce8;
}

.header-sub {
  color: var(--kl-color-text-soft);
}

/* Botones primarios y secundarios */
.btn-primary {
  background: var(--grad-main);
  border: none;
  color: #f9fafb;
  box-shadow:
    0 10px 25px rgba(16, 185, 129, 0.55),
    0 0 0 1px rgba(15, 23, 42, 0.8);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--kl-color-blue), var(--kl-color-green));
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px rgba(16, 185, 129, 0.65),
    0 0 0 1px rgba(15, 23, 42, 0.8);
}

.btn-secondary,
.btn-outline {
  border-color: rgba(148, 163, 184, 0.75);
  color: var(--kl-color-text-strong);
  background: rgba(15, 23, 42, 0.9);
}

.btn-secondary:hover,
.btn-outline:hover {
  border-color: rgba(96, 165, 250, 0.9);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 1), rgba(15, 23, 42, 1));
}

/* Chips y etiquetas */
.badge-pill {
  background: rgba(22, 163, 74, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
}

.badge-pill.warning {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.7);
  color: #fef3c7;
}

.badge-pill.danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.75);
  color: #fecaca;
}

/* Inputs */
.input-base,
.select-base,
textarea.input-base {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.6);
  color: var(--kl-color-text-strong);
}

.input-base:focus,
.select-base:focus,
textarea.input-base:focus {
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.75);
}

/* Toggle ON con verde / amarillo */
.toggle-pill.on {
  background: radial-gradient(circle at top, var(--kl-color-green-soft), var(--kl-color-yellow));
  color: #052e16;
}

/* Tablas */
.table-wrapper table {
  border-collapse: separate;
  border-spacing: 0 0.15rem;
}

.table-wrapper thead th {
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.7);
}

.table-wrapper tbody tr {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.6rem;
}

.table-wrapper tbody tr:hover {
  background: rgba(15, 23, 42, 1);
}

/* Login */
.login-page {
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.24), transparent 55%),
    radial-gradient(circle at bottom, rgba(37, 99, 235, 0.2), transparent 55%),
    #020617;
}

.login-card {
  background: rgba(2, 6, 23, 0.82);
  border-radius: 1.1rem;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.38);
  backdrop-filter: blur(8px);
}

/* Scrollbar sutil acorde a la paleta */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--kl-color-blue-soft), var(--kl-color-green-soft));
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--kl-color-green-soft), var(--kl-color-yellow));
}


/* === SIDEBAR PRO UPDATE 2025 === */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0A1A2F 0%, #0F2F26 40%, #020617 100%);
  padding: 1rem 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 6px 0 25px rgba(0, 0, 0, 0.4);
}


/* === SIDEBAR SCROLL + BOTONES UP/DOWN === */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding-top: 0.25rem;
  padding-bottom: 0.5rem;
}

/* Scrollbar interno del sidebar */
.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, var(--kl-color-blue-soft), var(--kl-color-green-soft));
}

/* Contenedor de botones de scroll */
.sidebar-scroll-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Botones circulares */
.scroll-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at top, rgba(34, 197, 94, 0.8), rgba(37, 99, 235, 0.9));
  color: #fefce8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.7);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.scroll-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.9);
  border-color: rgba(250, 204, 21, 0.8);
}

.scroll-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.8);
}

/* === TOP USER DROPDOWN (ADMIN) === */
.top-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-user-wrapper {
  position: relative;
}

.top-user-btn {
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.top-avatar {
  position: relative;
  overflow: hidden;
}

.top-avatar img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.top-avatar-initial {
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.top-avatar-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid #020617;
  z-index: 2;
}

/* avatar grande en el menÃº */
.top-avatar.big {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

/* Caja del menÃº */
.top-user-menu {
  position: absolute;
  top: 120%;
  right: 0;
  width: 220px;
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 1));
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  z-index: 40;

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.top-user-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.top-user-menu-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.top-user-menu-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
}

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

.top-user-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
}

.top-user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.6rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: #e5e7eb;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.top-user-menu-item i {
  font-size: 0.95rem;
}

.top-user-menu-item:hover {
  background: rgba(15, 23, 42, 0.95);
  color: #facc15;
}

.top-user-menu-footer {
  padding-top: 0.4rem;
  margin-top: 0.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.top-user-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #fecaca;
  text-decoration: none;
}

.top-user-logout i {
  font-size: 0.9rem;
}

/* Acciones Sorteos */
.sorteos-actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sorteos-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-inline: 1rem;
  padding-block: 0.45rem;
}

.sorteos-hint {
  font-size: 0.75rem;
  color: var(--muted);
}


.yp-tagline {
  padding: 12px 16px;
  font-size: 12px;
  opacity: .85;
  text-align: center;
}

.login-msg {
  font-size: 13px;
}

/* GLASS CARDS */

.cards-glass-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .cards-glass-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cards-glass-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }
}

.card-glass {
  text-align: center;

  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(71, 85, 105, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-radius: 1rem;
  padding: 0.5rem 1.4rem;
  color: #e5e7eb;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-glass:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(100, 116, 139, 0.6);
}

.card-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

.card-glass-label {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-glass-value {
  font-variant-numeric: tabular-nums;

  gap: 0.25rem;

  align-items: center;

  justify-content: center;

  display: flex;

  white-space: nowrap;

  font-size: clamp(1.5rem, 3.2vw, 2.4rem);

  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
}

.card-glass-note {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
  margin-top: 0.15rem;
  margin-bottom: 0.8rem;
}

/* Color variations for glass cards */

/* FULL background color for dashboard glass cards */
.card-glass.card-ventas{
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.45), rgba(15, 23, 42, 0.98));
  border-color: rgba(56, 189, 248, 0.95);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.12), 0 15px 35px rgba(15, 23, 42, 0.85);
}
.card-glass.card-comision{
  background: radial-gradient(circle at top left, rgba(250, 204, 21, 0.40), rgba(239, 68, 68, 0.20), rgba(15, 23, 42, 0.98));
  border-color: rgba(250, 204, 21, 0.95);
  box-shadow: 0 18px 40px rgba(250, 204, 21, 0.10), 0 15px 35px rgba(15, 23, 42, 0.85);
}
.card-glass.card-premios{
  background: radial-gradient(circle at top left, rgba(236, 72, 153, 0.38), rgba(168, 85, 247, 0.20), rgba(15, 23, 42, 0.98));
  border-color: rgba(236, 72, 153, 0.95);
  box-shadow: 0 18px 40px rgba(236, 72, 153, 0.10), 0 15px 35px rgba(15, 23, 42, 0.85);
}
.card-glass.card-resultados{
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.38), rgba(15, 23, 42, 0.98));
  border-color: rgba(34, 197, 94, 0.95);
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.10), 0 15px 35px rgba(15, 23, 42, 0.85);
}
/* Stronger label contrast on colored cards */
.card-glass.card-ventas .card-glass-label,
.card-glass.card-comision .card-glass-label,
.card-glass.card-premios .card-glass-label,
.card-glass.card-resultados .card-glass-label{
  color: rgba(226, 232, 240, 0.92);
}

.card-glass.card-ventas .card-glass-value {
  color: #ffffff;
}

.card-glass.card-comision .card-glass-value {
  color: #ffffff;
}

.card-glass.card-premios .card-glass-value {
  color: #ffffff;
}

.card-glass.card-resultados .card-glass-value {
  color: #ffffff;
}

/* Chart Container - Limitar tamaño máximo */
.card-chart {
  max-width: 100%;
  overflow: hidden;
}

.card-glass-body {
  overflow: hidden;
}

.chart-container-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
  overflow: hidden !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.chart-container-wrapper canvas {
  max-width: 100% !important;
  width: 100% !important;
  max-height: 150px !important;
  height: 150px !important;
  min-height: 150px !important;
  display: block !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Asegurar que Chart.js respete el tamaño del contenedor */
#salesChart {
  max-width: 100% !important;
  width: 100% !important;
  max-height: 150px !important;
  height: 150px !important;
  min-height: 150px !important;
  display: block !important;
  box-sizing: border-box !important;
}

color: #ffffff;
}

/* Extra payout lists (Pago por numero / condicional) */
.pago-extra-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pago-extra-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  border-radius: 10px;
}

.pago-extra-row input,
.pago-extra-row select {
  min-width: 120px;
}

.pago-extra-row .icon-btn {
  margin-left: auto;
}

/* === Dashboard cards: FULL color backgrounds (requested) === */
.card-ventas.card-glass{
  background: linear-gradient(135deg, rgba(56,189,248,0.95), rgba(59,130,246,0.95));
  border: none !important;
}
.card-comision.card-glass{
  background: linear-gradient(135deg, rgba(250,204,21,0.95), rgba(239,68,68,0.95));
  border: none !important;
}
.card-premios.card-glass{
  background: linear-gradient(135deg, rgba(244,114,182,0.95), rgba(239,68,68,0.95));
  border: none !important;
}
.card-resultados.card-glass{
  background: linear-gradient(135deg, rgba(34,197,94,0.95), rgba(16,185,129,0.95));
  border: none !important;
}

/* Ensure text is readable on colored cards */
.card-ventas.card-glass .card-glass-label,
.card-ventas.card-glass .card-glass-value,
.card-ventas.card-glass .card-glass-note,
.card-comision.card-glass .card-glass-label,
.card-comision.card-glass .card-glass-value,
.card-comision.card-glass .card-glass-note,
.card-premios.card-glass .card-glass-label,
.card-premios.card-glass .card-glass-value,
.card-premios.card-glass .card-glass-note,
.card-resultados.card-glass .card-glass-label,
.card-resultados.card-glass .card-glass-value,
.card-resultados.card-glass .card-glass-note{
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* Buttons on colored cards */
.card-ventas.card-glass .btn-mini,
.card-comision.card-glass .btn-mini,
.card-premios.card-glass .btn-mini,
.card-resultados.card-glass .btn-mini{
  background: rgba(255,255,255,0.18) !important;
  border: 1px solid rgba(255,255,255,0.28) !important;
  color: #ffffff !important;
}
.card-ventas.card-glass .btn-mini:hover,
.card-comision.card-glass .btn-mini:hover,
.card-premios.card-glass .btn-mini:hover,
.card-resultados.card-glass .btn-mini:hover{
  background: rgba(255,255,255,0.26) !important;
}


/* =========================================================
   KimaLoto FIX (2026-02-03) - Cards FULL color per request
   Ventas: azul cielo mix
   Comisión: amarillo + rojo mix
   Premios: rosa + rojo mix
   Resultados: verde mix
   ========================================================= */
.card-glass.card-ventas{
  background: linear-gradient(135deg, rgba(56,189,248,.95), rgba(29,78,216,.92)) !important;
  border-color: rgba(56,189,248,.95) !important;
  color: #fff !important;
}
.card-glass.card-comision{
  background: linear-gradient(135deg, rgba(250,204,21,.95), rgba(239,68,68,.92)) !important;
  border-color: rgba(250,204,21,.95) !important;
  color: #111 !important;
}
.card-glass.card-premios{
  background: linear-gradient(135deg, rgba(244,114,182,.95), rgba(239,68,68,.92)) !important;
  border-color: rgba(244,114,182,.95) !important;
  color: #111 !important;
}
.card-glass.card-resultados{
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(16,185,129,.92)) !important;
  border-color: rgba(34,197,94,.95) !important;
  color: #111 !important;
}
.card-glass.card-ventas .card-glass-label,
.card-glass.card-ventas .card-glass-note,
.card-glass.card-ventas .card-glass-value{
  color:#fff !important;
}
.card-glass.card-comision .card-glass-label,
.card-glass.card-comision .card-glass-note,
.card-glass.card-premios .card-glass-label,
.card-glass.card-premios .card-glass-note,
.card-glass.card-resultados .card-glass-label,
.card-glass.card-resultados .card-glass-note{
  color: rgba(17,24,39,.95) !important;
}
