/* =====================================================================
   POS Tienda - Estilos principales
   Tema claro / oscuro con variables CSS
   ===================================================================== */

:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f6;
  --border: #e3e7ee;
  --border-strong: #cfd6e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-text: #3730a3;

  --success: #059669;
  --success-soft: #e7f8f1;
  --warning: #d97706;
  --warning-soft: #fff5e6;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --info: #0284c7;
  --info-soft: #e6f4fb;

  --sidebar-bg: #0f1424;
  --sidebar-text: #a6b0c6;
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, .06);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px -6px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --ring: 0 0 0 3px rgba(79, 70, 229, .18);

  --sidebar-w: 256px;
  --topbar-h: 64px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0f1a;
  --surface: #121829;
  --surface-2: #161d31;
  --surface-3: #1c2439;
  --border: #232c43;
  --border-strong: #2f3a56;
  --text: #e8ecf4;
  --text-2: #c3cad9;
  --muted: #8b95ab;

  --primary: #7c73ff;
  --primary-hover: #8f88ff;
  --primary-soft: rgba(124, 115, 255, .14);
  --primary-text: #b9b4ff;

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .12);

  --sidebar-bg: #0a0e19;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 6px 16px -6px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(124, 115, 255, .3);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.fw-600 { font-weight: 600; }
.small { font-size: 12.5px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #fff; font-size: 18px;
  box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .6);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--sidebar-text); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #5d6782; padding: 14px 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: 9px;
  color: var(--sidebar-text); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link i { font-size: 17px; width: 20px; text-align: center; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .08));
  color: var(--sidebar-active);
  box-shadow: inset 3px 0 0 #818cf8;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .06);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
  color: #fff; font-weight: 700; font-size: 13px;
}
.sidebar-user .name { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: 11.5px; }
.sidebar-user > div:not(.avatar) { min-width: 0; flex: 1; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; }
.topbar .crumb { font-size: 12px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.clock { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 0 8px; }
.menu-toggle { display: none; }

.content { padding: 24px 28px 40px; flex: 1; }
.content.flush { padding: 0; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; animation: pop .15s ease; }
.dropdown-menu button, .dropdown-menu a {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; background: none; border-radius: 8px;
  color: var(--text-2); cursor: pointer; text-align: left;
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-header { padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn i { font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .5); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(1.07); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.07); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-outline:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover:not(:disabled) { filter: brightness(.97); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn .spinner { width: 16px; height: 16px; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; }
.card-header .sub { font-size: 12.5px; color: var(--muted); }
.card-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }

/* ---------- KPIs ---------- */
.kpi {
  position: relative; overflow: hidden;
  padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 18px;
  background: var(--primary-soft); color: var(--primary);
}
.kpi-icon.green { background: var(--success-soft); color: var(--success); }
.kpi-icon.amber { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.sky { background: var(--info-soft); color: var(--info); }
.kpi-icon.red { background: var(--danger-soft); color: var(--danger); }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-foot { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; }
.trend.up { color: var(--success); background: var(--success-soft); }
.trend.down { color: var(--danger); background: var(--danger-soft); }
.trend.flat { color: var(--muted); background: var(--surface-3); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2);
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.table-compact td, .table-compact th { padding: 9px 14px; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--muted); }
tr.inactive td { opacity: .55; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input::placeholder { color: var(--muted); opacity: .8; }
.input-sm, .select.input-sm { height: 34px; font-size: 13px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-group .input { padding-left: 36px; }
.input-group .addon { position: absolute; right: 6px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar .select, .toolbar .input { width: auto; }
.toolbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.chip.active { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px;
  font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabs button {
  border: 0; background: none; padding: 14px 6px; margin-right: 18px;
  font-weight: 600; color: var(--muted); cursor: pointer; position: relative;
}
.tabs button.active { color: var(--primary); }
.tabs button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }

/* ---------- Paginación ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; }

/* ---------- Estado vacío / carga ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 38px; display: block; margin-bottom: 10px; opacity: .5; }
.empty .title { font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: spin .7s linear infinite; opacity: .7;
}
.loading { padding: 40px; display: grid; place-items: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }

/* ---------- Modales (dialog nativo) ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 18px;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.modal.lg { width: min(860px, calc(100vw - 32px)); }
dialog.modal.sm { width: min(420px, calc(100vw - 32px)); }
dialog.modal[open] { animation: modalIn .2s ease; display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(10, 14, 26, .55); backdrop-filter: blur(3px); }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16.5px; }
.modal-header .close { margin-left: auto; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modal-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; margin: 0 auto 14px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 280px; max-width: 400px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}
.toast i { font-size: 18px; margin-top: 1px; }
.toast.success { border-left-color: var(--success); } .toast.success i { color: var(--success); }
.toast.error { border-left-color: var(--danger); } .toast.error i { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); } .toast.warning i { color: var(--warning); }
.toast.hide { animation: toastOut .2s ease forwards; }

/* ---------- Listas simples ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.rank.r1 { background: #fef3c7; color: #b45309; }
.rank.r2 { background: #e5e7eb; color: #4b5563; }
.rank.r3 { background: #fde2cf; color: #c2410c; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #22d3ee); border-radius: 99px; }

.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }

/* Detalle tipo "definición" */
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dl div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.dl dt { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 600; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* =====================================================================
   LOGIN
   ===================================================================== */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
}
.auth-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at -10% -10%, #4f46e5 0%, transparent 55%),
              radial-gradient(900px 500px at 110% 110%, #0891b2 0%, transparent 55%),
              #0b1020;
  color: #fff; padding: 48px; display: flex; flex-direction: column;
}
.auth-hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brand-name { font-size: 17px; }
.auth-hero h2 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: auto; max-width: 480px; }
.auth-hero h2 span { background: linear-gradient(90deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #b8c0d6; margin-top: 16px; max-width: 440px; font-size: 15px; }
.auth-features { display: flex; gap: 22px; margin-top: 36px; flex-wrap: wrap; }
.auth-features div { display: flex; align-items: center; gap: 8px; color: #d4d9e8; font-weight: 500; font-size: 13px; }
.auth-features i { color: #67e8f9; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 28px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .input { height: 46px; }
.auth-card .btn-lg { margin-top: 8px; }
.pass-toggle { position: absolute; right: 6px; }
.auth-foot { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }

/* =====================================================================
   PUNTO DE VENTA
   ===================================================================== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100vh - var(--topbar-h)); }
.pos-left { display: flex; flex-direction: column; min-width: 0; padding: 20px 20px 0 28px; }
.pos-search { position: relative; margin-bottom: 14px; }
.pos-search .input { height: 54px; font-size: 16px; padding-left: 50px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pos-search > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 19px; color: var(--muted); }
.pos-search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
kbd {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  color: var(--muted);
}
.pos-hint { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.pos-hint span { display: inline-flex; align-items: center; gap: 6px; }
.pos-results { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.product-card {
  position: relative; text-align: left;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px; min-height: 120px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.product-card:hover, .product-card.focused { border-color: var(--primary); box-shadow: var(--ring); }
.product-card:active { transform: scale(.98); }
.product-card.out { opacity: .5; }
.product-card .pc-cat { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.product-card .pc-name { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .pc-code { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.product-card .pc-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding-top: 6px; }
.product-card .pc-price { font-size: 17px; font-weight: 800; color: var(--primary); }
.product-card .pc-stock { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.product-card .pc-stock.low { color: var(--warning); }
.product-card .pc-stock.zero { color: var(--danger); }

.pos-cart { display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; }
.cart-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cart-head h3 { font-size: 16px; }
.cart-count { background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.cart-head .btn { margin-left: auto; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); animation: fadeIn .2s ease; }
.cart-item.flash { animation: flash .6s ease; }
.ci-name { font-weight: 600; line-height: 1.3; }
.ci-price { font-size: 12px; color: var(--muted); }
.ci-total { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ci-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer; color: var(--text-2); font-size: 15px; }
.qty button:hover { background: var(--surface-3); }
.qty input { width: 62px; height: 30px; border: 0; text-align: center; background: var(--surface); font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; background: var(--primary-soft); }
.ci-controls .remove { margin-left: auto; color: var(--muted); }
.ci-controls .remove:hover { color: var(--danger); background: var(--danger-soft); }
.ci-unit { font-size: 11.5px; color: var(--muted); }
.cart-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.cart-empty i { font-size: 54px; opacity: .25; display: block; margin-bottom: 10px; }

.cart-summary { border-top: 1px solid var(--border); padding: 16px 20px 20px; background: var(--surface-2); }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sum-row.total { margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--border-strong); color: var(--text); }
.sum-row.total .label { font-weight: 700; font-size: 15px; }
.sum-row.total .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.sum-row .discount-input { width: 110px; height: 30px; text-align: right; }

.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px; }
.pay-method {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: 11px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  font-weight: 600; font-size: 12px; color: var(--text-2);
  transition: all .15s;
}
.pay-method i { font-size: 19px; }
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.cash-box { margin-bottom: 12px; }
.cash-quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cash-quick button { flex: 1; min-width: 56px; }
.change-box { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--success-soft); color: var(--success); font-weight: 700; }
.change-box.bad { background: var(--danger-soft); color: var(--danger); }
.change-box .value { font-size: 20px; font-variant-numeric: tabular-nums; }
.btn-charge { height: 58px; font-size: 17px; border-radius: 14px; }

.success-amount { font-size: 34px; font-weight: 800; text-align: center; letter-spacing: -.02em; }

/* =====================================================================
   ENTRADAS (captura)
   ===================================================================== */
.entry-search { position: relative; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; display: none;
}
.suggest.open { display: block; }
.suggest button {
  display: flex; width: 100%; align-items: center; gap: 12px; text-align: left;
  padding: 10px 14px; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--border);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.focused { background: var(--primary-soft); }
.suggest .grow { flex: 1; min-width: 0; }
.table .input-sm { width: 110px; text-align: right; }

/* =====================================================================
   ANIMACIONES
   ===================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
@keyframes flash { 0% { background: var(--primary-soft); } 100% { background: transparent; } }

/* =====================================================================
   RESPONSIVO
   ===================================================================== */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos { grid-template-columns: minmax(0, 1fr) 370px; }
}
@media (max-width: 1024px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .clock { display: none; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-left { padding: 16px; }
  .pos-results { max-height: 50vh; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--border); }
  .cart-items { max-height: 50vh; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4, .form-grid, .dl { grid-template-columns: minmax(0, 1fr); }
  .toolbar .select, .toolbar .input { width: 100%; }
  .kpi-value { font-size: 22px; }
}
