/* ================================================
   ERP Kartódromo · Estilos globales
   Paleta oficial kartodromo-teotihuacan.com
   ================================================ */

:root {
  /* Primarios */
  --pista:   #111111;   /* Negro header/fondo */
  --asfalto: #161616;   /* Negro secundario cards */
  --neon:    #E40E0E;   /* Rojo principal marca */
  --amarillo:#F2C601;   /* Amarillo secundario marca */
  --bandera: #D10404;   /* Rojo intenso hover/alertas */
  --go:      #2DB742;   /* Verde WhatsApp / confirmaciones */
  --texto:   #FFFFFF;   /* Blanco tipografía */
  --muted:   #D1D5DB;   /* Gris bordes y secundario */
  --borde:   rgba(255,255,255,.09);
  /* Fondos sutiles */
  --fondo-suave: #F0F5FA;
  --gris-claro:  #F8F8F8;
}

* { box-sizing: border-box; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--pista);
  color: var(--texto);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--asfalto);
  border-right: 1px solid var(--borde);
  display: flex; flex-direction: column;
}
.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid var(--borde);
  font-size: 1.1rem; font-weight: 800;
  color: var(--neon); letter-spacing: .04em;
}
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: all .15s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,107,0,.12);
  color: var(--neon);
}
.nav-link .icon { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--borde);
  font-size: .82rem; color: var(--muted);
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  background: var(--asfalto);
  border-bottom: 1px solid var(--borde);
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.topbar-title { font-size: 1rem; font-weight: 700; }

.page { flex: 1; overflow-y: auto; padding: 24px; }

/* === BOTTOM NAV (mobile) === */
.bottom-nav {
  display: none;
  background: var(--asfalto);
  border-top: 1px solid var(--borde);
  padding: 0;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px; color: var(--muted); font-size: .65rem;
  text-decoration: none; gap: 3px;
}
.bottom-nav a .icon { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--neon); }

/* === CARDS === */
.card {
  background: var(--asfalto);
  border: 1px solid var(--borde);
  border-radius: 12px; padding: 20px;
}
.card-header { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.card-value  { font-size: 1.8rem; font-weight: 800; }
.card-value.neon    { color: var(--neon); }
.card-value.amarillo{ color: var(--amarillo); }
.card-value.verde   { color: var(--go); }
.card-value.rojo    { color: var(--bandera); }

/* === BOTONES === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .15s; border: none; outline: none;
}
.btn-primary   { background: var(--neon);    color: #fff; }
.btn-primary:hover { background: var(--bandera); }
.btn-secondary { background: rgba(255,255,255,.08); color: var(--texto); }
.btn-secondary:hover { background: rgba(255,255,255,.14); }
.btn-danger    { background: var(--bandera); color: #fff; }
.btn-success   { background: var(--go);      color: #000; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px;  font-size: .8rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* === FORMULARIOS === */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; background: rgba(255,255,255,.06);
  border: 1px solid var(--borde); border-radius: 8px;
  padding: 10px 12px; color: var(--texto); font-size: .9rem;
  font-family: inherit; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--neon);
}
input::placeholder { color: var(--muted); }
select option { background: var(--asfalto); }

/* === TABLA === */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
  text-align: left; padding: 10px 12px; font-size: .72rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--borde);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.data-table tr:hover td { background: rgba(255,255,255,.03); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* === BADGES === */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
}
.badge-cobrada  { background: rgba(0,210,106,.15); color: var(--go); }
.badge-cancelada{ background: rgba(230,57,70,.15);  color: var(--bandera); }
.badge-pendiente{ background: rgba(255,215,0,.15);  color: var(--amarillo); }

/* === GRID PRODUCTOS (venta táctil) === */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.producto-btn {
  background: var(--asfalto); border: 1px solid var(--borde);
  border-radius: 10px; padding: 14px 10px;
  text-align: center; cursor: pointer;
  transition: all .15s; color: var(--texto);
}
.producto-btn:hover, .producto-btn:active {
  border-color: var(--neon); background: rgba(255,107,0,.1);
}
.producto-btn .p-nombre { font-size: .82rem; font-weight: 600; margin-bottom: 4px; }
.producto-btn .p-precio { font-size: 1rem; font-weight: 800; color: var(--neon); }

/* === TOTAL GRANDE (pantalla de venta) === */
.total-display {
  font-size: 3rem; font-weight: 800; color: var(--amarillo);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* === ALERTAS === */
.alert { padding: 12px 16px; border-radius: 8px; font-size: .88rem; font-weight: 500; margin-bottom: 16px; }
.alert-success { background: rgba(0,210,106,.12); color: var(--go);      border: 1px solid rgba(0,210,106,.3); }
.alert-error   { background: rgba(230,57,70,.12);  color: var(--bandera); border: 1px solid rgba(230,57,70,.3); }
.alert-warning { background: rgba(255,215,0,.12);  color: var(--amarillo);border: 1px solid rgba(255,215,0,.3); }

/* === UTILIDADES === */
.muted { color: var(--muted); }
.text-neon    { color: var(--neon); }
.text-amarillo{ color: var(--amarillo); }
.text-go      { color: var(--go); }
.text-bandera { color: var(--bandera); }
.divider { border: none; border-top: 1px solid var(--borde); margin: 16px 0; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--neon); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === HAMBURGER BUTTON === */
.hamburger-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(255,255,255,.07); border: 1px solid var(--borde);
  color: var(--texto); font-size: 1.2rem; cursor: pointer;
  transition: background .15s; flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,.13); }

/* === DRAWER === */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 200;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; right: -300px; bottom: 0;
  width: 280px; background: var(--asfalto);
  border-left: 1px solid var(--borde);
  z-index: 201; display: flex; flex-direction: column;
  transition: right .25s cubic-bezier(.4,0,.2,1);
}
.drawer.open { right: 0; }

.drawer-head {
  padding: 16px; border-bottom: 1px solid var(--borde);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--pista);
}
.drawer-close {
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(255,255,255,.07); border: none;
  color: var(--muted); font-size: 1rem; cursor: pointer;
}

.drawer-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.drawer-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 8px;
  color: var(--muted); font-size: .9rem; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.drawer-nav a:hover, .drawer-nav a.active {
  background: rgba(255,107,0,.12); color: var(--neon);
}
.drawer-nav a .icon { font-size: 1.1rem; width: 22px; text-align: center; }

.drawer-foot {
  padding: 16px; border-top: 1px solid var(--borde);
}

/* === TOPBAR actualizado === */
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-username { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .page { padding: 16px; padding-bottom: 80px; }
  .topbar { padding: 10px 16px; }
  .productos-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .total-display { font-size: 2.2rem; }
}
