/* ═══════════════════════════════════════════════════════════
   LicoGest — Design System v2 "Craft Beverage Premium"
   Paleta: vino tinto profundo · champán dorado · crema cálida
   Tipografía: Plus Jakarta Sans (display) + Inter (body)
   ═══════════════════════════════════════════════════════════ */
:root {
  /* Tokens de color */
  --bg: #F7F4F0;
  --surface: #FFFFFF;
  --surface-2: #F1ECE6;
  --ink: #241D1A;
  --ink-2: #4A403B;
  --muted: #8C8178;
  --line: #E9E2DA;
  --line-2: #F2ECE5;

  --brand: #6B1F2A;
  --brand-2: #551820;
  --brand-3: #7F2735;
  --brand-tint: #F7ECEE;
  --gold: #B4873A;
  --gold-2: #D6B26A;
  --gold-tint: #FAF3E4;
  --green: #1F7A4D;
  --green-tint: #E5F3EB;
  --red: #BC3A2D;
  --red-tint: #F9E9E7;
  --orange: #C97B1E;
  --orange-tint: #FCF0E0;

  /* Tipografía fluida */
  --fs-hero: clamp(26px, 7vw, 34px);
  --fs-title: clamp(18px, 5vw, 22px);
  --fs-stat: clamp(22px, 6.5vw, 28px);
  --fs-body: clamp(14px, 4vw, 15px);
  --fs-small: 12.5px;
  --fs-tiny: 11px;

  /* Sombras (pirámide — doble sombra para cards) */
  --shadow-sm: 0 1px 2px rgba(36, 29, 26, .05);
  --shadow-card: 0 1px 2px rgba(36, 29, 26, .04), 0 4px 14px rgba(36, 29, 26, .05);
  --shadow-card-hover: 0 2px 4px rgba(36, 29, 26, .05), 0 14px 32px rgba(36, 29, 26, .10);
  --shadow-md: 0 4px 16px rgba(36, 29, 26, .10);
  --shadow-lg: 0 8px 40px rgba(36, 29, 26, .16);
  --shadow-glow: 0 4px 20px rgba(180, 135, 58, .28);

  /* Forma */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  /* Layout */
  --sidebar-w: 248px;
  --header-h: 60px;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--gold-tint); }
.hidden { display: none !important; }

/* Iconos SVG (Lucide) — SIEMPRE con tamaño por CSS */
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 26px; height: 26px; }

/* ── Focus / a11y ── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════ SIDEBAR (desktop ≥900px) ═══════════════ */
.sidebar {
  display: none;
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 80;
  background: linear-gradient(180deg, #2A1118 0%, #1E0C12 100%);
  color: rgba(255, 255, 255, .92);
  flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand .logo-box {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.sidebar-brand img.logo-img { max-width: 130px; max-height: 40px; }
.sidebar-brand .name { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; letter-spacing: .2px; line-height: 1.15; }
.sidebar-brand .sub { font-size: 11px; color: rgba(255, 255, 255, .45); font-weight: 500; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255, 255, 255, .72); text-decoration: none;
  padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  margin-bottom: 3px; transition: background .18s, color .18s;
}
.sidebar-nav a .ico { color: rgba(255, 255, 255, .5); transition: color .18s; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-nav a.active { background: rgba(180, 135, 58, .16); color: var(--gold-2); }
.sidebar-nav a.active .ico { color: var(--gold-2); }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-rate {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 12.5px;
}
.sidebar-rate .lbl { color: rgba(255, 255, 255, .55); }
.sidebar-rate .val { font-weight: 800; color: var(--gold-2); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; }
.sidebar-user .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand-3), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
}
.sidebar-user .u-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.sidebar-user .u-rol { font-size: 11px; color: rgba(255, 255, 255, .5); }

/* ═══════════════ HEADER (mobile-first) ═══════════════ */
.header {
  position: sticky; top: 0; z-index: 70;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 0 14px; min-height: var(--header-h);
}
.header-title {
  flex: 1; font-family: var(--font-display); font-weight: 800;
  font-size: 17px; letter-spacing: -.2px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.header-brand .logo-box {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; box-shadow: var(--shadow-sm);
}
.header-brand img { max-height: 30px; max-width: 110px; }
.icon-btn {
  background: none; border: none; color: var(--ink-2);
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.tasa-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-tint); border: 1px solid #EBDCB9;
  color: #8A6522; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .2px;
}
.tasa-badge .ico { width: 15px; height: 15px; }

/* ═══════════════ DRAWER (mobile) ═══════════════ */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 286px; max-width: 86vw; z-index: 100;
  background: linear-gradient(180deg, #2A1118 0%, #1E0C12 100%);
  transform: translateX(-105%); transition: transform .25s cubic-bezier(.32, .72, .35, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(30, 12, 18, .5); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-head { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 12px; }
.drawer-logo {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.drawer-logo img { max-height: 44px; max-width: 120px; }
.drawer-nombre { font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1.2; }
.drawer-sub { font-size: 11px; color: rgba(255, 255, 255, .45); }
.drawer-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.drawer-nav a {
  display: flex; align-items: center; gap: 13px;
  color: rgba(255, 255, 255, .78); text-decoration: none;
  padding: 13px 14px; font-size: 14.5px; font-weight: 600;
  border-radius: 12px; margin-bottom: 2px; transition: background .15s;
}
.drawer-nav a .ico { color: rgba(255, 255, 255, .55); }
.drawer-nav a.active, .drawer-nav a:hover { background: rgba(180, 135, 58, .18); color: var(--gold-2); }
.drawer-nav a.active .ico { color: var(--gold-2); }
.drawer-foot { padding: 12px 14px 24px; border-top: 1px solid rgba(255, 255, 255, .08); }
.drawer-user { font-size: 12px; color: rgba(255, 255, 255, .6); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.drawer-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-3), var(--gold)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }

/* ═══════════════ LAYOUT ═══════════════ */
.app-shell { min-height: 100vh; }
.main { max-width: 1060px; margin: 0 auto; padding: 18px 16px 100px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head h1 { font-family: var(--font-display); font-size: var(--fs-title); font-weight: 800; letter-spacing: -.3px; }
.section-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ═══════════════ CARDS ═══════════════ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 18px; margin-bottom: 14px;
  transition: box-shadow .22s ease, transform .22s ease;
}
.card.clickable:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.card h2 {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 800;
  letter-spacing: -.1px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.card h2 .ico { color: var(--brand); width: 18px; height: 18px; }
.card-pad-0 { padding: 8px 16px; }

/* ═══════════════ STATS ═══════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 15px 16px; position: relative; overflow: hidden;
  transition: box-shadow .22s ease, transform .22s ease;
}
.stat:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.stat::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--gold)); opacity: .85;
}
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat .stat-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand);
}
.stat .stat-ico.gold { background: var(--gold-tint); color: #8A6522; }
.stat .stat-ico.green { background: var(--green-tint); color: var(--green); }
.stat .stat-ico.red { background: var(--red-tint); color: var(--red); }
.stat .stat-ico .ico { width: 17px; height: 17px; }
.stat .trend { font-size: 11px; font-weight: 800; color: var(--green); background: var(--green-tint); padding: 3px 8px; border-radius: 999px; }
.stat .val { font-family: var(--font-display); font-size: var(--fs-stat); font-weight: 800; letter-spacing: -.5px; line-height: 1.1; color: var(--ink); }
.stat .lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; text-transform: uppercase; letter-spacing: .6px; }

/* ═══════════════ BOTONES ═══════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 1px solid transparent;
  border-radius: 13px; padding: 0 20px; min-height: 46px;
  font-family: var(--font-body); font-size: 14.5px; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: transform .06s, background .16s, box-shadow .16s, border-color .16s;
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #A67830); box-shadow: 0 4px 14px rgba(180, 135, 58, .3); }
.btn-gold:hover { box-shadow: 0 6px 20px rgba(180, 135, 58, .4); }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-ghost { background: var(--surface); color: var(--brand); border-color: var(--line); box-shadow: none; font-weight: 700; }
.btn-ghost:hover { border-color: var(--brand); background: var(--brand-tint); }
.btn-ghost-white { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .4); }
.btn-ghost-white:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn-sm .ico { width: 15px; height: 15px; }
.btn-lg { min-height: 54px; font-size: 15.5px; border-radius: 15px; }
.fab {
  position: fixed; right: 18px; bottom: 24px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #A67830); color: #3A2E05;
  border: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(180, 135, 58, .45); cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 30px rgba(180, 135, 58, .55); }
.fab .ico { width: 24px; height: 24px; stroke-width: 2.5; }

/* ═══════════════ FORMULARIOS ═══════════════ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .2px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: var(--font-body); font-size: 14.5px; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(180, 135, 58, .15); }
.input::placeholder { color: #B4AAA2; }
textarea.input { min-height: 80px; resize: vertical; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238C8178' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px;
}
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search-box input { padding-left: 42px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.row-actions .btn { flex: 1; }

/* ═══════════════ LISTAS ═══════════════ */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 4px 16px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px; border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: none; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info .name { font-weight: 700; font-size: 14.5px; }
.list-item .info .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .price { font-weight: 800; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand-3), var(--brand));
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .2px;
}
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.green { background: var(--green-tint); color: var(--green); }
.badge.gold { background: var(--gold-tint); color: #8A6522; }
.badge.gray { background: var(--surface-2); color: var(--muted); }
.badge .ico { width: 12px; height: 12px; }

/* ═══════════════ TABLAS ═══════════════ */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; padding: 9px 10px; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  border-bottom: 1px solid var(--line); font-weight: 800; white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #FBF9F6; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ═══════════════ POS ═══════════════ */
.pos-layout { display: grid; gap: 16px; }
.pos-search {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px 8px 6px 14px; box-shadow: var(--shadow-card);
}
.pos-search .ico { color: var(--muted); }
.pos-search input { border: none; outline: none; flex: 1; min-height: 42px; font-size: 15px; background: none; font-family: var(--font-body); }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pos-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 15px;
  box-shadow: var(--shadow-card); padding: 13px 11px 11px; text-align: center;
  cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, box-shadow .15s, transform .08s;
}
.pos-card:active { transform: scale(.96); }
.pos-card:hover { border-color: #DFC89A; box-shadow: var(--shadow-card-hover); }
.pos-card.sel { border-color: var(--gold); background: linear-gradient(180deg, #FFFDF7, #FDF8EC); box-shadow: var(--shadow-glow); }
.pos-card .p-cat { font-size: 10px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .8px; }
.pos-card .p-nombre {
  font-size: 13px; font-weight: 700; line-height: 1.25; min-height: 2.5em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pos-card .p-precio { font-family: var(--font-display); font-size: 17.5px; font-weight: 800; color: var(--brand); letter-spacing: -.3px; }
.pos-card .p-stock { font-size: 11px; color: var(--muted); font-weight: 600; }
.pos-card .p-stock.bajo { color: var(--red); font-weight: 800; }
.pos-card .p-add {
  position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; border-radius: 9px;
  background: var(--brand-tint); color: var(--brand); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.pos-card .p-add:hover { background: var(--brand); color: #fff; }
.pos-card .p-add:active { transform: scale(.9); }
.pos-card .p-add .ico { width: 14px; height: 14px; stroke-width: 3; }
.pos-card .p-qty {
  position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  box-shadow: 0 2px 8px rgba(107, 31, 42, .4);
}

/* Carrito */
.cart-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  max-height: calc(100vh - 110px); position: sticky; top: 78px; overflow: hidden;
}
.cart-panel-head {
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
}
.cart-items { flex: 1; overflow-y: auto; padding: 4px 18px; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.cart-item:last-child { border-bottom: none; }
.cart-item .nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.cart-item .nm .sub { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.qty-ctl { display: flex; align-items: center; gap: 7px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 15px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
  transition: background .12s, border-color .12s;
}
.qty-btn:hover { border-color: var(--gold); color: var(--brand); }
.qty-btn.danger:hover { border-color: var(--red); color: var(--red); }
.cart-item .sub { font-weight: 800; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.cart-panel-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cart-total-row .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.cart-total-row .val { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.cart-empty { text-align: center; color: var(--muted); padding: 34px 12px; font-size: 13.5px; line-height: 1.6; }
.cart-empty .ico { width: 34px; height: 34px; margin-bottom: 8px; color: #D8CFC6; }

/* Barra carrito móvil */
.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 65;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-radius: 18px; padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(85, 24, 32, .45); cursor: pointer;
  transition: transform .2s;
}
.cart-bar:hover { transform: translateY(-1px); }
.cart-bar .ico { color: var(--gold-2); }
.cart-bar .count { font-size: 12.5px; font-weight: 700; opacity: .85; }
.cart-bar .total { flex: 1; text-align: right; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }

/* ═══════════════ LOGIN ═══════════════ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(180, 135, 58, .25), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(127, 39, 53, .55), transparent 55%),
    linear-gradient(150deg, #3A141D 0%, #24101A 55%, #170B10 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 26px 26px; pointer-events: none;
}
.login-card {
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 26px; padding: 36px 30px 30px; width: 100%; max-width: 384px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  text-align: center; position: relative; z-index: 1;
  backdrop-filter: blur(8px);
}
.login-logo {
  width: 74px; height: 74px; border-radius: 22px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; box-shadow: 0 10px 26px rgba(180, 135, 58, .4);
}
.login-logo img { max-height: 66px; max-width: 160px; border-radius: 14px; }
.login-nombre { font-family: var(--font-display); font-weight: 800; font-size: 23px; letter-spacing: -.4px; color: var(--ink); }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 26px; }
.login-card .field { text-align: left; }
.login-card .input { min-height: 50px; border-radius: 13px; font-size: 15px; }
.login-card .btn { min-height: 52px; }
.login-err { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 12px; min-height: 18px; }
.login-foot { margin-top: 22px; font-size: 11.5px; color: #B8AEA6; }

/* ═══════════════ MODAL ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(30, 12, 18, .55); z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px); animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); width: 100%; max-width: 500px; max-height: 92vh;
  border-radius: 24px 24px 0 0; overflow-y: auto; padding: 22px 20px 24px;
  animation: sheetUp .24s cubic-bezier(.32, .72, .35, 1);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal h3 { font-family: var(--font-display); font-weight: 800; font-size: 17.5px; letter-spacing: -.3px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.modal h3 .ico { color: var(--brand); }
.modal-close {
  float: right; background: var(--surface-2); border: none; width: 32px; height: 32px;
  border-radius: 10px; font-size: 15px; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center; margin-left: 8px;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--red-tint); color: var(--red); }

/* ═══════════════ TOAST ═══════════════ */
#toast-root { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; width: min(92vw, 430px); display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #241D1A; color: #fff; padding: 13px 16px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toastIn .22s cubic-bezier(.32, .72, .35, 1);
}
.toast .ico { width: 18px; height: 18px; flex: none; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══════════════ UTILIDADES ═══════════════ */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.empty {
  text-align: center; color: var(--muted); padding: 34px 12px; font-size: 13.5px; line-height: 1.6;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty .ico { width: 36px; height: 36px; color: #D8CFC6; margin-bottom: 4px; }
.divider { border-top: 1px dashed var(--line); margin: 14px 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 8px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  color: var(--ink-2); transition: all .15s; min-height: 38px;
}
.pill:hover { border-color: var(--gold); color: var(--brand); }
.pill.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pill .ico { width: 15px; height: 15px; }

/* Ticket */
.ticket-body { font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; background: #FFFDF8; border: 1px dashed var(--line); border-radius: 12px; padding: 14px; }

/* ── Skeleton loading ── */
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, #F8F4EF 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (min-width: 900px) {
  .sidebar { display: flex; }
  .main { margin-left: var(--sidebar-w); }
  .header { display: none; }
  .main { padding: 26px 28px 70px; }
  .pos-layout { grid-template-columns: 1fr 370px; align-items: start; }
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: 22px; max-width: 540px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .pos-products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (min-width: 768px) and (max-width: 899px) {
  .cart-bar { display: none; }
}

@media (max-width: 899px) {
  .cart-panel { display: none; }  /* en móvil el carrito es el sheet/bar */
}

@media (max-width: 400px) {
  .pos-products { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .row { flex-direction: column; }
  .row > * { width: 100%; }
}
