/* ─────────────────────────────────────────────────────────────
   POS Inventario — Custom Styles
   LiteAdmin-inspired, Bootstrap 5 base
   ───────────────────────────────────────────────────────────── */

:root {
  /* Layout — sin cambio */
  --sidebar-width:  245px;
  --topbar-height:  58px;

  /* Fase 1 — Design tokens "Índigo Ejecutivo" */
  --ink-900: #151b2c;
  --ink-600: #4b5468;
  --ink-400: #6b7488;
  --surface: #ffffff;
  --canvas:  #f6f7fb;
  --border:  #e7e9f2;

  --sidebar-bg:     #131a2c;
  --sidebar-hover:  #1c2438;
  --sidebar-active: #4f46e5;
  --sidebar-text:   #8791ac;

  --accent-600: #4f46e5;
  --accent-500: #6366f1;
  --accent-50:  #eef0ff;

  --success: #16a34a; --success-soft: #ecfdf3;
  --warning: #d97706; --warning-soft: #fef6e7;
  --danger:  #dc2626; --danger-soft:  #fdecec;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20,20,50,.05);
  --shadow-md: 0 4px 12px rgba(20,20,50,.08);

  /* Alias de compatibilidad — nombres usados en el resto de pos.css */
  --primary:     var(--accent-600);
  --body-bg:     var(--canvas);
  --card-border: var(--border);
  --card-shadow: var(--shadow-sm);

  /* Retema componentes nativos de Bootstrap 5 sin rebuild de Sass */
  --bs-border-radius:    var(--r-md);
  --bs-border-radius-lg: var(--r-lg);
  --bs-border-radius-sm: var(--r-sm);
  --bs-primary:          var(--accent-600);
  --bs-primary-rgb:      79, 70, 229;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: #334155;
}

/* ── Login ──────────────────────────────────────────────────── */

.login-bg {
  background: linear-gradient(135deg, #1a2332 0%, #2d4060 50%, #1e3a5f 100%);
}

.login-card {
  width: 420px;
  max-width: 95vw;
  border: none;
  border-radius: 16px;
}

.logo-icon {
  width: 68px; height: 68px;
  background: #eff6ff;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Sidebar ────────────────────────────────────────────────── */

#sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 300;
  transition: width .25s ease;
  overflow: hidden;
}

.sidebar-header {
  display: flex; align-items: center;
  color: #fff;
  font-size: 1.05rem; font-weight: 700;
  padding: 0 20px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,.06);
  white-space: nowrap; flex-shrink: 0;
}

.sidebar-user {
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .8rem; color: #6b7d9c;
  white-space: nowrap; line-height: 1.5; flex-shrink: 0;
}

.sidebar-menu {
  flex: 1; padding: 8px 0;
  overflow-y: auto; overflow-x: hidden;
}

.sidebar-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none; white-space: nowrap;
  font-size: .875rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
  background: var(--sidebar-hover);
  color: #c5d3e8;
}

.sidebar-menu a.active {
  background: rgba(79,70,229,.18);
  color: #a5b4fc;
  border-left-color: var(--accent-600);
}

.sidebar-menu i {
  width: 18px; text-align: center; flex-shrink: 0;
  font-size: .9rem;
}

/* ── Sidebar collapsible group ──────────────────────────────── */
.sidebar-group-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none; white-space: nowrap;
  font-size: .875rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
  user-select: none;
  list-style: none;
}
.sidebar-group-toggle:hover {
  background: var(--sidebar-hover);
  color: #c5d3e8;
}
.sidebar-group-toggle i.grp-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: .9rem; }
.sidebar-group-toggle .grp-arrow {
  margin-left: auto;
  font-size: .7rem;
  transition: transform .2s;
  opacity: .5;
}
.sidebar-group-toggle.open .grp-arrow { transform: rotate(90deg); }

.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: rgba(0,0,0,.15);
}
.sidebar-submenu.open { max-height: 300px; }
.sidebar-submenu a {
  padding: 8px 20px 8px 46px !important;
  font-size: .83rem !important;
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}

.sidebar-logout {
  color: #6b7d9c !important;
  font-size: .85rem; width: 100%; text-align: left;
  padding: 8px 12px; text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  border-radius: 6px; transition: background .15s, color .15s;
}

.sidebar-logout:hover { background: var(--sidebar-hover); color: #c5d3e8 !important; }

/* ── Main content ───────────────────────────────────────────── */

#main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left .25s;
}

.top-navbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ── Sidebar collapsed ──────────────────────────────────────── */

body.sidebar-collapsed #sidebar { width: 58px; }
body.sidebar-collapsed #main-content { margin-left: 58px; }

body.sidebar-collapsed .sidebar-header span,
body.sidebar-collapsed .sidebar-user,
body.sidebar-collapsed .sidebar-menu a span,
body.sidebar-collapsed .sidebar-group-toggle span,
body.sidebar-collapsed .sidebar-group-toggle .grp-arrow,
body.sidebar-collapsed .sidebar-logout span { display: none; }

body.sidebar-collapsed .sidebar-menu a,
body.sidebar-collapsed .sidebar-group-toggle {
  justify-content: center; padding: 13px;
  border-left: none; border-radius: 0;
}

body.sidebar-collapsed .sidebar-submenu { max-height: 0 !important; overflow: hidden; }
body.sidebar-collapsed .sidebar-submenu.open {
  position: fixed;
  left: 58px;
  width: 210px;
  max-height: none !important;
  overflow: visible;
  background: var(--sidebar-hover);
  box-shadow: 4px 4px 14px rgba(0,0,0,.35);
  border-radius: 0 8px 8px 0;
  padding: 6px 0;
  z-index: 500;
}
body.sidebar-collapsed .sidebar-submenu.open a {
  padding: 8px 16px !important;
  justify-content: flex-start !important;
}
body.sidebar-collapsed .sidebar-submenu.open a span { display: inline-block !important; }

body.sidebar-collapsed .sidebar-header { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar-logout { justify-content: center; }

.sidebar-logo-badge { display: none; }
body.sidebar-collapsed .sidebar-logo-full { display: none; }
body.sidebar-collapsed .sidebar-logo-badge { display: block; }

/* ── Page header ────────────────────────────────────────────── */

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

.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.35rem; font-weight: 700; color: var(--ink-900); margin: 0;
}

.page-title i { color: var(--primary); margin-right: .5rem; }

/* ── Stat Cards ─────────────────────────────────────────────── */

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex; align-items: center; gap: 16px;
  height: 100%;
}

.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}

.si-blue   { background: #eff6ff; color: #3b82f6; }
.si-green  { background: #f0fdf4; color: #16a34a; }
.si-orange { background: #fff7ed; color: #ea580c; }
.si-red    { background: #fef2f2; color: #dc2626; }
.si-purple { background: #faf5ff; color: #9333ea; }
.si-teal   { background: #f0fdfa; color: #0d9488; }

.stat-value {
  font-size: 1.5rem; font-weight: 700; color: #1e293b; line-height: 1;
}

.stat-label {
  font-size: .78rem; color: #64748b; margin-top: 4px; font-weight: 500;
}

/* ── Dashboard – Greeting Banner ───────────────────────────── */

.dash-greeting {
  background: linear-gradient(135deg, #131a2c 0%, #262f4d 100%);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  gap: 16px;
}

.dash-greet-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fbbf24; flex-shrink: 0;
}

.dash-greet-title { font-family: 'Sora', sans-serif; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.dash-greet-sub   { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: 3px; }

.dash-pill {
  padding: 5px 13px; border-radius: 20px;
  font-size: .73rem; font-weight: 600; white-space: nowrap;
}
.kpill-blue   { background: rgba(59,130,246,.25);  color: #93c5fd; }
.kpill-red    { background: rgba(239,68,68,.25);   color: #fca5a5; }
.kpill-orange { background: rgba(245,158,11,.25);  color: #fcd34d; }

/* ── Dashboard – KPI Section Headers ───────────────────────── */

.kpi-section-head {
  display: flex; align-items: center; gap: 8px;
}

.kpi-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.ksd-blue   { background: var(--accent-600); }
.ksd-teal   { background: #0d9488; }
.ksd-orange { background: #f59e0b; }
.ksd-green  { background: #16a34a; }
.ksd-red    { background: #dc2626; }

.kpi-section-lbl {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #475569;
}

.kpi-section-aside {
  margin-left: auto; font-size: .71rem; color: #94a3b8; font-weight: 500;
}

/* ── Dashboard – KPI Cards ──────────────────────────────────── */

.kpi-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 18px 20px;
  border: 1px solid var(--card-border);
  border-top: 3px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  height: 100%;
}

.kpi-card[role="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.09);
  cursor: pointer;
}

.kpi-card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 14px;
}

.kpi-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-400); line-height: 1.4;
}

.kpi-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}

.kpi-value {
  font-family: 'Sora', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem; font-weight: 700; color: var(--ink-900);
  line-height: 1; margin-bottom: 6px;
}

.kpi-sub {
  font-size: .71rem; color: #94a3b8; font-weight: 500;
}

/* KPI color variants — border-top + icon bg/color */
.kpi-kc-blue   { border-top-color: var(--accent-600); }
.kpi-kc-blue   .kpi-icon-wrap { background: var(--accent-50); color: var(--accent-600); }

.kpi-kc-green  { border-top-color: #16a34a; }
.kpi-kc-green  .kpi-icon-wrap { background: #f0fdf4; color: #16a34a; }

.kpi-kc-teal   { border-top-color: #0d9488; }
.kpi-kc-teal   .kpi-icon-wrap { background: #f0fdfa; color: #0d9488; }

.kpi-kc-red    { border-top-color: #dc2626; }
.kpi-kc-red    .kpi-icon-wrap { background: #fef2f2; color: #dc2626; }

.kpi-kc-orange { border-top-color: #f59e0b; }
.kpi-kc-orange .kpi-icon-wrap { background: #fffbeb; color: #d97706; }

.kpi-kc-indigo { border-top-color: #6366f1; }
.kpi-kc-indigo .kpi-icon-wrap { background: #eef2ff; color: #6366f1; }

.kpi-kc-purple { border-top-color: #9333ea; }
.kpi-kc-purple .kpi-icon-wrap { background: #faf5ff; color: #9333ea; }

/* ── POS Cards ──────────────────────────────────────────────── */

.pos-card {
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.pos-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}

.pos-card-title {
  margin: 0; font-weight: 700; font-size: .9rem; color: #1e293b;
  display: flex; align-items: center; gap: 8px;
}

.dash-chart-panel canvas { max-height: 220px; }

/* ── Tables ─────────────────────────────────────────────────── */

.table-pos { margin: 0; font-size: .875rem; }

.table-pos thead th {
  background: var(--canvas);
  color: var(--ink-400); font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 16px;
  border-bottom: 1px solid var(--card-border); white-space: nowrap;
}

.table-pos tbody td {
  padding: 11px 16px;
  vertical-align: middle; color: #334155;
  border-bottom: 1px solid #f8fafc;
}

.table-pos tbody tr:last-child td { border-bottom: none; }
.table-pos tbody tr:hover td { background: var(--canvas); }
.table-pos td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Utilidad genérica — cifras alineadas (fuera de .table-pos) */
.num { font-variant-numeric: tabular-nums; }

/* ── ERP modern tables ──────────────────────────────────────── */

.erp-table-wrap { overflow-x: auto; }

.erp-table { border-collapse: separate; border-spacing: 0; }

.erp-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f1f5f9;
  color: #475569; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 16px; white-space: nowrap;
  border-bottom: 2px solid #e2e8f0;
}

.erp-table tbody td {
  padding: 12px 16px; vertical-align: middle; color: #334155;
  border-bottom: 1px solid #eef2f7;
}

.erp-table tbody tr { transition: background .12s ease; }
.erp-table tbody tr:nth-child(even) td { background: #fcfdfe; }
.erp-table tbody tr:hover td { background: #eef5ff; }
.erp-table tbody tr:last-child td { border-bottom: none; }

/* ── ERP pagination bar ─────────────────────────────────────── */

.erp-pagination {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--card-border);
  background: #fafbfc; font-size: .8rem; color: #64748b;
}
.erp-pagination .erp-pg-info { font-weight: 500; }
.erp-pagination .erp-pg-controls { display: flex; align-items: center; gap: 4px; }
.erp-pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0; background: #fff; color: #475569;
  border-radius: 8px; font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all .12s ease;
}
.erp-pg-btn:hover:not(:disabled) { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.erp-pg-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.erp-pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.erp-pg-size {
  height: 32px; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0 8px; font-size: .8rem; color: #475569; background: #fff;
}

/* ── Status badges ──────────────────────────────────────────── */

.sbadge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: .73rem; font-weight: 600; white-space: nowrap;
}

.sb-activo      { background: #dcfce7; color: #15803d; }
.sb-inactivo    { background: #fee2e2; color: #b91c1c; }
.sb-completada  { background: #dbeafe; color: #1d4ed8; }
.sb-pendiente   { background: #fef9c3; color: #a16207; }
.sb-anulada     { background: #f1f5f9; color: #64748b; }
.sb-true        { background: #dcfce7; color: #15803d; }
.sb-false       { background: #fee2e2; color: #b91c1c; }

/* ── Bootstrap reskin — botones, inputs, modales ───────────── */

.btn-primary {
  background-color: var(--accent-600);
  border-color: var(--accent-600);
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:active {
  background-color: var(--accent-500);
  border-color: var(--accent-500);
}
.btn-primary:focus {
  box-shadow: 0 0 0 .2rem var(--accent-50);
}

.form-control,
.form-select {
  border-color: var(--border);
  border-radius: var(--r-md);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 .2rem var(--accent-50);
}

.modal-content {
  border-radius: var(--r-lg);
  border: none;
  box-shadow: var(--shadow-md);
}
.modal-header,
.modal-footer {
  border-color: var(--border);
}

/* ── Stock colors ───────────────────────────────────────────── */

.stock-ok       { color: #16a34a; }
.stock-low      { color: #d97706; font-weight: 600; }
.stock-critical { color: #dc2626; font-weight: 700; }

/* ── Cart ───────────────────────────────────────────────────── */

.cart-item {
  background: #f8fafc; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
  font-size: .875rem; border: 1px solid var(--card-border);
}

/* ── Misc ───────────────────────────────────────────────────── */

.page-loader {
  text-align: center; padding: 56px 20px; color: #94a3b8;
}

code {
  font-size: .82rem; color: #6366f1;
  background: #f0f0ff; padding: 2px 6px; border-radius: 4px;
}

.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font-size: .8rem;
}

.list-group-item-action:hover { background: #f8fafc; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── App footer ──────────────────────────────────────────── */
.app-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .70rem;
  color: #94a3b8;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  letter-spacing: .01em;
}
.app-footer strong { color: #64748b; font-weight: 700; }
.app-footer i { color: #3b82f6; opacity: .6; font-size: .7rem; }
.app-footer .sep { color: #cbd5e1; }

/* ══════════════════════════════════════════════════════════════
   POS SPLIT SCREEN
   ══════════════════════════════════════════════════════════════ */

.pos-screen {
  display: flex;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

/* ── Left panel (cart) ────────────────────────────────────── */
.pos-left {
  width: 400px;
  min-width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 12px rgba(0,0,0,.06);
}

.pos-ticket-header {
  background: linear-gradient(135deg, #1a2332 0%, #1e3a5f 100%);
  color: #fff;
  padding: 12px 16px;
  flex-shrink: 0;
  font-size: .82rem;
}

.pos-total-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.pos-total-bar .total-label {
  font-size: .75rem;
  color: #64748b;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pos-total-bar .total-value {
  font-size: 1.9rem;
  font-weight: 900;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(74,222,128,.3);
}

.pos-cart-scroll {
  flex: 1;
  overflow-y: auto;
}

.pos-cart-scroll .table-pos thead th {
  padding: 8px 10px;
  font-size: .69rem;
  background: #f8fafc;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pos-cart-scroll .table-pos tbody td {
  padding: 7px 10px;
  font-size: .82rem;
}

.pos-cart-row-selected td { background: #eff6ff !important; }
.pos-cart-row-selected td:first-child {
  border-left: 3px solid #3b82f6;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.pos-toolbar {
  display: flex;
  flex-shrink: 0;
  background: #f1f5f9;
  padding: 7px 8px;
  gap: 5px;
  border-top: 1px solid #e2e8f0;
}

.pos-tool-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 4px 7px;
  border: none;
  background: #fff;
  font-size: .65rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 10px;
  transition: all .14s;
  text-transform: uppercase;
  letter-spacing: .03em;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.pos-tool-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pos-tool-btn i { font-size: 1.15rem; flex-shrink: 0; }
.pos-tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
}
.pos-tool-btn.tbtn-green  { color: #16a34a; background: #f0fdf4; }
.pos-tool-btn.tbtn-green:hover  { background: #dcfce7; }
.pos-tool-btn.tbtn-red    { color: #dc2626; background: #fff5f5; }
.pos-tool-btn.tbtn-red:hover    { background: #fee2e2; }
.pos-tool-btn.tbtn-blue   { color: #2563eb; background: #eff6ff; }
.pos-tool-btn.tbtn-blue:hover   { background: #dbeafe; }
.pos-tool-btn.tbtn-historial {
  color: #7c3aed;
  background: #f5f3ff;
}
.pos-tool-btn.tbtn-historial:hover { background: #ede9fe; }
.pos-tool-btn.tbtn-facturar {
  flex: 1.8 1 0;
  min-width: 0;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #4ade80;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.pos-tool-btn.tbtn-facturar:hover {
  background: linear-gradient(135deg, #334155, #1e293b);
  box-shadow: 0 5px 14px rgba(0,0,0,.3);
  transform: translateY(-2px);
}

/* ── Right panel (catalog) ───────────────────────────────── */
.pos-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}

.pos-right-top {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* Category grid — wraps, text-only tiles like reference image */
.pos-cat-strip {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  flex-shrink: 0;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}

.pos-cat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: .67rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  color: #475569;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.2;
  overflow: hidden;
}
.pos-cat-btn i { display: none; }
.pos-cat-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}
.pos-cat-btn.active {
  background: #1e3a5f;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(30,58,95,.3);
}
.pos-cat-btn.active i { color: #fff; }

/* POS action-buttons row at top of right panel */
.pos-action-row {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.pos-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  border: none;
  font-size: .63rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: all .13s;
}
.pos-action-btn i { font-size: 1.3rem; }
.pos-action-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* Client search modal */
.pos-cli-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pos-cli-modal-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: min(92vw, 680px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pos-cli-modal-row-sel { background: #dbeafe !important; }
.pos-cli-modal-row-sel td { font-weight: 600; }

/* Product grid */
.pos-prod-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  align-content: start;
}

/* Product tile — modern card with accent bar + ghost icon */
.pos-prod-tile {
  background: #fff;
  border: 1.5px solid #e8edf3;
  border-radius: 12px;
  padding: 16px 10px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.pos-prod-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #818cf8);
  border-radius: 12px 12px 0 0;
}
.pos-prod-tile:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(59,130,246,.18);
  transform: translateY(-3px);
}
.pos-prod-tile:active { transform: scale(.97); box-shadow: none; }
.pos-prod-tile .tile-bg-icon {
  font-size: 2.4rem;
  opacity: .06;
  position: absolute;
  bottom: 4px; right: 6px;
  pointer-events: none;
  line-height: 1;
}
.pos-prod-tile .tile-sku {
  font-size: .62rem;
  color: #94a3b8;
  margin-bottom: 4px;
  letter-spacing: .04em;
  font-weight: 600;
}
.pos-prod-tile .tile-name {
  font-size: .80rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
  margin-bottom: 8px;
}
.pos-prod-tile .tile-price {
  font-size: 1.05rem;
  font-weight: 900;
  color: #2563eb;
  letter-spacing: -.01em;
}
.pos-prod-tile .tile-cat {
  font-size: .60rem;
  color: #94a3b8;
  margin-top: 3px;
  font-weight: 600;
}

/* Stock badge inside product tile */
.tile-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .62rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  margin-top: 6px;
}
.stock-badge-ok   { background: #dcfce7; color: #15803d; }
.stock-badge-low  { background: #fef9c3; color: #a16207; }
.stock-badge-zero { background: #fee2e2; color: #b91c1c; }
.tile-set-badge {
  display: inline-flex; align-items: center;
  font-size: .58rem; font-weight: 800; letter-spacing: .05em;
  border-radius: 20px; padding: 2px 7px; margin-top: 4px;
  background: #ede9fe; color: #6d28d9; border: 1px solid #c4b5fd;
}

/* Dim tiles with zero stock */
.pos-prod-tile.tile-sin-stock {
  opacity: .52;
  border-color: #fca5a5;
}
.pos-prod-tile.tile-sin-stock::before {
  background: linear-gradient(90deg, #f87171, #fca5a5);
}
.pos-prod-tile.tile-sin-stock:hover {
  border-color: #f87171;
  box-shadow: none;
  transform: none;
}

/* ── Subcat section header inside product grid ──────────── */
.pos-subcat-header {
  grid-column: 1 / -1;
  font-size: .70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #475569;
  padding: 10px 6px 5px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pos-subcat-header::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 15px;
  background: linear-gradient(180deg, #3b82f6, #818cf8);
  border-radius: 3px;
}

/* ── Caja — denomination arqueo grid ────────────────────── */
.arqueo-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.arqueo-grid-coins {
  grid-template-columns: repeat(5, 1fr);
}
.arqueo-denom-card {
  text-align: center;
}
.arqueo-denom-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  background: #1e40af;
  color: #fff;
  margin-bottom: 5px;
  width: 100%;
}
.arqueo-denom-badge.coin { background: #b45309; }
.arqueo-denom-card input {
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
  padding: 4px 2px;
}
.arqueo-total-bar {
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.arqueo-total-label { font-size: .8rem; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.arqueo-total-value { font-size: 1.5rem; font-weight: 900; color: #4ade80; }
.caja-status-card {
  border-radius: 14px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.caja-abierta  { background: linear-gradient(135deg, #dcfce7, #bbf7d0); border: 2px solid #16a34a; }
.caja-cerrada  { background: linear-gradient(135deg, #fee2e2, #fecaca); border: 2px solid #dc2626; }
.caja-icon     { font-size: 2.5rem; }
.intentos-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .8rem;
  font-weight: 700;
}
/* ── Payment overlay ─────────────────────────────────────── */
.pos-pay-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.65);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.pos-pay-modal {
  background: #fff;
  border-radius: 14px;
  width: 680px;
  max-width: 98%;
  max-height: 96%;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
}

.pos-pay-head {
  background: #1a2332;
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px 14px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-pay-body { display: flex; flex: 1; min-height: 0; }

.pos-metodo-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
  gap: 10px;
}
.pos-metodo-row:hover  { background: #f0f9ff; }
.pos-metodo-row.active { background: #dbeafe; border-left: 3px solid #3b82f6; }

.pos-metodo-row .met-name  { font-weight: 600; font-size: .88rem; color: #1e293b; }
.pos-metodo-row .met-input {
  font-size: .95rem;
  font-weight: 700;
  text-align: right;
  border: none;
  background: transparent;
  color: #1e293b;
  width: 100%;
  outline: none;
}
.pos-metodo-row.active .met-input { background: #eff6ff; border-radius: 4px; padding: 2px 6px; }

.pos-pay-right {
  width: 220px;
  min-width: 200px;
  flex-shrink: 0;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 14px;
  gap: 10px;
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
}
.pos-summary-row .s-label { font-size: .78rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.pos-summary-row .s-value { font-size: 1.15rem; font-weight: 800; color: #1e293b; }
.pos-summary-row.total .s-value { font-size: 1.5rem; color: #dc2626; }
.pos-summary-row.cambio .s-value { color: #0d9488; }

.pos-btn-finalizar {
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-weight: 800;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .04em;
}
.pos-btn-finalizar:hover { background: #0f766e; }
.pos-btn-finalizar:disabled { background: #94a3b8; cursor: not-allowed; }
.pos-btn-cancelar {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
  font-size: .9rem;
  width: 100%;
  cursor: pointer;
  transition: background .15s;
}
.pos-btn-cancelar:hover { background: #e2e8f0; color: #334155; }

/* quick denomination buttons */
.pos-denom { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.pos-denom button {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 4px;
  font-size: .75rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: background .12s;
}
.pos-denom button:hover { background: #dbeafe; border-color: #93c5fd; }

/* ── Receipt (print) ─────────────────────────────────────── */
@media print {
  body > *:not(#pos-receipt-win) { display: none !important; }
}


/* ── Hide number input spinners in traslado items ─────────── */
#tr-items-body input[type=number]::-webkit-inner-spin-button,
#tr-items-body input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#tr-items-body input[type=number] { -moz-appearance: textfield; appearance: textfield; }
