/* ============================================================
   Sistema de Ventas — estilos base
   ============================================================ */
:root {
  --azul: #0d6efd;
  --azul-osc: #0a58ca;
  --sidebar-bg: #0f172a;
  --sidebar-bg2: #1e293b;
  --sidebar-txt: #cbd5e1;
  --sidebar-ancho: 210px;
}

/* Modo compacto: densifica toda la UI (equivalente a ~zoom 80%). */
html { font-size: 80%; }

* { box-sizing: border-box; }
body { margin: 0; background: #f1f4f9; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: #1f2937; }

/* ---------------- Login ---------------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1000px 500px at 15% -10%, rgba(13,110,253,.25), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(99,102,241,.20), transparent 55%), #0f172a;
}
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 34px 30px; box-shadow: 0 25px 60px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand i { font-size: 2.4rem; color: var(--azul); }
.login-brand h1 { font-size: 1.4rem; margin: 10px 0 2px; }
.login-brand p { color: #6b7280; margin: 0; font-size: .9rem; }
.login-foot { text-align: center; margin-top: 20px; font-size: .85rem; }
.login-foot a { color: #16a34a; text-decoration: none; }

/* ---------------- Shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-ancho); flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg2)); color: var(--sidebar-txt);
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px; font-size: 1.1rem; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand i { color: var(--azul); font-size: 1.4rem; }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--sidebar-txt); text-decoration: none; font-size: .93rem; margin-bottom: 3px; transition: .15s; }
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--azul); color: #fff; box-shadow: 0 6px 16px rgba(13,110,253,.4); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--azul); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sidebar-user .nombre { color: #fff; font-size: .9rem; font-weight: 600; line-height: 1.1; }
.sidebar-user .rol { font-size: .75rem; color: #94a3b8; }

.main { flex: 1; margin-left: var(--sidebar-ancho); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: 0 2px 6px rgba(0,0,0,.03); }
.page-title { font-size: 1.15rem; font-weight: 700; margin: 0; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }
.content { flex: 1; padding: 22px; }
.footer { padding: 14px 22px; background: #fff; border-top: 1px solid #e5e7eb; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .82rem; color: #6b7280; }
.footer .wa { color: #16a34a; text-decoration: none; font-weight: 600; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }

/* ---------------- KPIs ---------------- */
.kpi { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: 0 4px 14px rgba(0,0,0,.05); border-left: 4px solid var(--azul); }
.kpi-ico { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; background: var(--azul); flex-shrink: 0; }
.kpi-label { font-size: .78rem; color: #6b7280; text-transform: uppercase; letter-spacing: .3px; }
.kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kpi-sub { font-size: .78rem; color: #9ca3af; }
.kpi-primary { border-left-color: #0d6efd; } .kpi-primary .kpi-ico { background: #0d6efd; }
.kpi-success { border-left-color: #16a34a; } .kpi-success .kpi-ico { background: #16a34a; }
.kpi-info    { border-left-color: #0891b2; } .kpi-info .kpi-ico    { background: #0891b2; }
.kpi-warning { border-left-color: #d97706; } .kpi-warning .kpi-ico { background: #d97706; }

/* ---------------- POS ---------------- */
.pos-resultados { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: #fff; border: 1px solid #e5e7eb; border-radius: 0 0 10px 10px; max-height: 340px; overflow-y: auto; }
.pos-res-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.pos-res-item:hover { background: #eff6ff; }
.pos-res-empty { padding: 14px; color: #9ca3af; text-align: center; }
.pos-cobro { position: sticky; top: 76px; }
.pos-tot { padding: 5px 0; font-size: .95rem; }
.pos-total { font-size: 1.4rem; font-weight: 700; color: #16a34a; }

/* ---------------- Responsive ---------------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-overlay.show { display: block; }
}
