/* Frenchie Cases · estilos de la app (mobile-first; claro por defecto, oscuro opcional)
   Identidad: manual "BRANDING FRENCHIE" + la cotización COT-0002 como referencia de aplicación:
   fondo blanco, marrón #632713 para texto y bloques, naranja #EC6426 como acento, durazno para paneles suaves,
   franja mango arriba. Todo en Poppins. */

@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(../fonts/poppins-400.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(../fonts/poppins-500.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(../fonts/poppins-600.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(../fonts/poppins-700.woff2) format('woff2'); }

:root {
  color-scheme: light;
  /* marca (fijos en ambos modos) */
  --marron: #632713;
  --marron-hover: #4E1E0E;
  --naranja: #EC6426;
  --mango: #F8A91F;
  --durazno: #FDE3CF;
  --gris: #E4DFD8;

  --page: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #FFF6EF;          /* durazno muy claro: filas, cajas suaves */
  --surface-3: #FDE3CF;          /* durazno: paneles destacados */
  --ink: #632713;                /* el texto es marrón, como en la cotización (11,5:1) */
  --ink-2: #7A4330;
  --ink-3: #946450;              /* 5:1 sobre blanco */
  --line: #F5E3D5;
  --line-strong: #EACBB5;
  --ring: rgba(99, 39, 19, .07);
  --accent: #C24E19;             /* naranja para texto pequeño (4,8:1); el #EC6426 va en rellenos y títulos grandes */
  --accent-ink: #FFFFFF;
  --accent-soft: #FFF1E7;
  --primario: var(--marron);
  --primario-ink: #FFFFFF;
  --primario-hover: var(--marron-hover);
  --titulo: var(--naranja);
  --good: #2D7A33;
  --good-soft: #E6F4E2;
  --warn: #9A5800;
  --warn-soft: #FFF4E0;
  --bad: #B83224;
  --bad-soft: #FDE8E4;
  /* series de gráficos (validadas con la skill dataviz sobre blanco): naranja, café, azul, mostaza */
  --s1: #e0561a; --s2: #8f4f26; --s3: #0b7fb0; --s4: #b57d00;
  --grid: #F5E3D5;
  --axis: #946450;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(99, 39, 19, .04), 0 4px 14px rgba(99, 39, 19, .05);
  --shadow-alto: 0 2px 6px rgba(99, 39, 19, .06), 0 12px 28px rgba(99, 39, 19, .10);
  --font: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1A0F0A; --surface: #24150d; --surface-2: #2E1C12; --surface-3: #42240F;
  --ink: #FBEADB; --ink-2: #E2C9B7; --ink-3: #BC9C8B;
  --line: #3A2519; --line-strong: #533628; --ring: rgba(253, 227, 207, .08);
  --accent: #F79A62; --accent-ink: #2E140A; --accent-soft: #3A2014;
  --primario: var(--naranja); --primario-ink: #FFFFFF; --primario-hover: #D9561C; --titulo: #F79A62;
  --good: #6CCB76; --good-soft: #1B2E18; --warn: #F8B53F; --warn-soft: #3A2A0E;
  --bad: #F2806F; --bad-soft: #3D1A14;
  /* en oscuro el naranja y el café se confunden: se usa la paleta validada para ese fondo */
  --s1: #e8692e; --s2: #2e9ad6; --s3: #b8774a; --s4: #b57ae0;
  --grid: #3A2519; --axis: #a88a7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-alto: 0 8px 26px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; text-transform: uppercase; color: var(--titulo); letter-spacing: .01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* franja mango superior (como en la cotización) */
.franja { height: 8px; background: var(--mango); position: sticky; top: 0; z-index: 40; }

/* ---------- shell */
.shell { min-height: calc(100dvh - 8px); }
.main {
  padding: 20px 16px calc(var(--nav-h) + var(--safe-b) + 28px);
  width: 100%; /* ancho fijo a la columna: con margin auto, filtros y tablas anchas lo estiraban */
  max-width: 1180px;
  margin: 0 auto;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; min-height: 44px;
}
.topbar .titulo-vista { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar .saludo { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.topbar .acciones { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
@media (max-width: 520px) {
  h1 { font-size: 21px; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }   /* si los botones no caben, bajan */
  .topbar .acciones { margin-left: auto; }
  .topbar .btn { min-height: 38px; padding: 7px 10px; font-size: 13px; }
  .topbar .btn svg { width: 16px; height: 16px; }
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marca img { width: 46px; height: 52px; object-fit: contain; }
.marca .nombre { font-weight: 700; font-size: 22px; line-height: 1; color: var(--marron); letter-spacing: -.01em; }
.marca .lema { font-size: 12px; color: var(--marron); margin-top: 3px; font-weight: 500; }
:root[data-theme="dark"] .marca .nombre, :root[data-theme="dark"] .marca .lema { color: var(--ink); }

/* navegación móvil: barra inferior blanca, botón Vender naranja */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 500;
}
.nav a svg { width: 23px; height: 23px; }
.nav a.activo { color: var(--ink); font-weight: 600; }
.nav a.activo svg { color: var(--naranja); }
.nav a.vender span.bola {
  width: 52px; height: 52px; border-radius: 18px; background: var(--naranja); color: #fff;
  display: grid; place-items: center; margin-top: -22px; box-shadow: 0 6px 16px rgba(236, 100, 38, .35);
}
.nav a.vender span.bola svg { color: #fff; width: 26px; height: 26px; }
.nav .solo-escritorio { display: none; }

/* navegación de escritorio: barra lateral blanca */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 8px; height: calc(100dvh - 8px); padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--surface); backdrop-filter: none;
    display: flex; flex-direction: column; gap: 2px; align-self: start;
  }
  .nav .solo-escritorio { display: flex; }
  .nav .marca { padding: 0 8px 22px; }
  .nav a {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; border-radius: 12px;
    font-size: 14.5px; font-weight: 500; color: var(--ink-2); position: relative;
  }
  .nav a svg { width: 20px; height: 20px; color: var(--ink-3); }
  .nav a:hover { background: var(--surface-2); }
  .nav a.activo { background: var(--surface-3); color: var(--marron); font-weight: 600; }
  .nav a.activo svg { color: var(--naranja); }
  .nav a.activo::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--naranja); }
  .nav a.vender { margin: 6px 0; background: var(--naranja); color: #fff; font-weight: 600; }
  .nav a.vender svg { color: #fff; }
  .nav a.vender:hover { background: #D9561C; }
  .nav a.vender.activo { background: var(--marron); color: #fff; }
  .nav a.vender.activo svg { color: #fff; }
  .nav a.vender.activo::before { display: none; }
  .nav a.vender span.bola { width: auto; height: auto; margin: 0; background: none; color: inherit; box-shadow: none; border-radius: 0; }
  .nav a.vender span.bola svg { color: inherit; width: 20px; height: 20px; }
  .nav .mas-movil { display: none; }
  .nav .pie-nav { margin-top: auto; padding: 14px 10px 0; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
  .main { padding: 30px 36px 52px; }
  h1 { font-size: 28px; }
}

/* ---------- cards & grids */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head .sub { color: var(--ink-3); font-size: 13px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) {
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .g2-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > *, .grid > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.seccion-titulo { font-weight: 700; font-size: 19px; color: var(--ink); margin: 12px 2px -2px; }
.seccion-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-top: 14px; }
.seccion-cab .seccion-titulo { margin: 0; }
.seccion-cab .sub { color: var(--ink-3); font-size: 13px; }
.cap { text-transform: capitalize; }

/* ---------- indicadores (KPI): una banda con celdas separadas por líneas finas, sin recuadros sueltos */
.kpis {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .label { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); margin: 2px 0; }
.kpi.destacado .value { color: var(--naranja); }
.kpi .delta { font-size: 12px; color: var(--ink-3); }
.kpi-grupo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: 4px 2px -6px; }
.hero .label { font-size: 14px; color: var(--ink-2); }
.hero .value { font-size: 48px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }

/* ---------- meta del año: anillo (vendido + proyección) y cifras */
@media (min-width: 1000px) { .g-2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.meta { position: relative; display: flex; flex-direction: column; justify-content: center; }
.meta .eyebrow { font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.meta-cuerpo { display: flex; align-items: center; gap: 22px; margin-top: 10px; flex-wrap: wrap; }
.anillo { width: 190px; height: 190px; flex: none; }
.anillo .pista { fill: none; stroke: var(--surface-3); stroke-width: 20; }
.anillo .arco-proy { fill: none; stroke: #F6B48F; stroke-width: 20; }
.anillo .arco { fill: none; stroke: var(--naranja); stroke-width: 20; }
.anillo .pct { font: 700 38px var(--font); fill: var(--marron); text-anchor: middle; }
.anillo .sub-anillo { font: 500 14px var(--font); fill: var(--ink-3); text-anchor: middle; }
:root[data-theme="dark"] .anillo .pct { fill: var(--ink); }
.meta-cifras { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.meta-cifras > div { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.meta-cifras .k { font-size: 13px; color: var(--ink-3); }
.meta-cifras b { grid-column: 2; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.meta-cifras .tiny { grid-column: 2; }
.punto { width: 12px; height: 12px; border-radius: 50%; }
.punto.vendido { background: var(--naranja); }
.punto.proy { background: #F6B48F; }
.punto.meta-p { background: var(--surface-3); border: 2px solid var(--line-strong); }
.meta .nota { font-size: 13.5px; margin: 14px 0 0; color: var(--ink-2); }
.meta .nota b { color: var(--accent); }
@media (max-width: 520px) { .anillo { width: 150px; height: 150px; } .meta-cuerpo { justify-content: center; } }

/* ---------- buttons, chips, inputs */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
  text-decoration: none; white-space: nowrap; transition: background .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primario); border-color: var(--primario); color: var(--primario-ink); }
.btn.primary:hover { background: var(--primario-hover); }
.btn.acento { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.btn.acento:hover { background: #D9561C; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.icon-btn {
  appearance: none; border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--ink-2);
}
.chip:hover { border-color: var(--naranja); }
.chip.on { background: var(--marron); color: #fff; border-color: var(--marron); }
.chip .cnt { opacity: .7; margin-left: 5px; }

/* pestañas tipo "segmented control" */
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; max-width: 100%; overflow-x: auto; }
.tabs button {
  appearance: none; border: 0; background: transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 14px;
  color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tabs button svg { width: 18px; height: 18px; }
.tabs button.on { background: var(--marron); color: #fff; box-shadow: var(--shadow); }
.tabs button .cnt { font-size: 12px; background: var(--surface-3); border-radius: 999px; padding: 1px 8px; color: var(--marron); }
.tabs button.on .cnt { background: var(--naranja); color: #fff; }

label.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; color: var(--ink); min-height: 44px;
}
.input::placeholder { color: var(--ink-3); opacity: .85; }
.input:focus, .chip:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .tabs button:focus-visible, .item:focus-visible {
  outline: 2px solid var(--naranja); outline-offset: 1px;
}
.input.money { font-variant-numeric: tabular-nums; }
.buscador { position: relative; }
.buscador svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.buscador .input { padding-left: 42px; border-radius: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { width: 40px; height: 24px; accent-color: var(--naranja); }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }

/* ---------- lists */
.lista { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item .principal { flex: 1; min-width: 0; }
.item .titulo, .item .detalle { display: block; }
.item .titulo { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .detalle { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .monto { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .avatar {
  width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--naranja); font-weight: 700; font-size: 13px;
}
.item .avatar svg { width: 19px; height: 19px; }
.dia-head {
  display: flex; justify-content: space-between; padding: 14px 6px 6px; font-size: 13px; color: var(--ink-3);
  font-weight: 600; border-bottom: 1px solid var(--line);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 12px;
  font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line);
}
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.naranja { background: var(--naranja); color: #fff; border-color: transparent; }

/* avisos: caja con borde naranja (como "Pedido bajo encargo") */
.alerta {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--naranja);
  cursor: pointer; text-align: left; width: 100%;
}
.alerta svg { width: 20px; height: 20px; color: var(--naranja); flex: none; }
.alerta b { color: var(--accent); }
.alerta.info { border-color: var(--line-strong); background: var(--surface); }
.alerta.info svg { color: var(--marron); }
.alerta .ir { margin-left: auto; color: var(--ink-3) !important; }

.vacio { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.vacio svg { width: 40px; height: 40px; opacity: .6; }

/* ---------- tables: encabezado marrón, líneas durazno, total con línea naranja */
.tabla-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tabla th, .tabla td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tabla th:first-child, .tabla td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.tabla thead th { font-weight: 600; color: #fff; background: var(--marron); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 0; }
.tabla thead th:first-child { background: var(--marron); border-radius: 10px 0 0 10px; }
.tabla thead th:last-child { border-radius: 0 10px 10px 0; }
.tabla td { font-variant-numeric: tabular-nums; }
.tabla tr.total td { font-weight: 700; border-top: 2px solid var(--naranja); border-bottom: 0; }
.tabla tr.sub td { color: var(--ink-3); font-size: 12.5px; }
.tabla tr.res td { font-weight: 600; background: var(--surface-2); }
.tabla tr.res td:first-child { background: var(--surface-2); }
.tabla tbody tr.clic { cursor: pointer; }
.tabla tbody tr.clic:hover td { background: var(--surface-2); }
.tabla tbody tr.sel td { background: var(--surface-3); font-weight: 600; }

/* ---------- estado de resultados (vertical, una columna de valores) */
.er { display: flex; flex-direction: column; }
.er-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.er-fila .nom { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.er-fila .nom .signo { width: 18px; text-align: center; color: var(--ink-3); font-weight: 600; flex: none; }
.er-fila .val { font-size: 14.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--ink); }
.er-fila .val small { display: block; font-size: 11.5px; color: var(--ink-3); }
.er-fila .pista { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-left: 26px; }
.er-fila .pista i { display: block; height: 100%; border-radius: 999px; background: #D9B8A2; }
.er-fila.ingreso .pista i { background: var(--s1); }
.er-fila.total { border-bottom: 0; background: var(--surface-3); border-radius: 10px; padding: 12px 12px; margin: 6px 0; }
.er-fila.total .nom { color: var(--marron); font-weight: 700; font-size: 15px; }
.er-fila.total .val { font-weight: 700; font-size: 17px; }
/* utilidad neta: franja naranja con texto blanco, como el TOTAL de la cotización */
.er-fila.neta { background: var(--naranja); }
.er-fila.neta .nom, .er-fila.neta .val, .er-fila.neta .signo { color: #fff; }
.er-fila.neta .val small, .er-fila.neta .muted, .er-fila.neta .comparar { color: #fff; }
.er-fila.neta.negativa { background: var(--bad); }
.er-grupo { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); padding: 14px 2px 2px; }
.comparar { font-size: 12px; white-space: nowrap; }

/* ---------- charts */
.chart-box { position: relative; height: 260px; }
.chart-box.alto { height: 320px; }
.col-flex { display: flex; flex-direction: column; }
.col-flex > .chart-box { flex: 1 1 auto; min-height: 320px; height: auto; }
.leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.leyenda i.linea { height: 3px; border-radius: 2px; vertical-align: 3px; width: 14px; }
.leyenda i.punteada { height: 0; border-top: 2px dashed var(--ink-3); background: none !important; vertical-align: 3px; width: 16px; border-radius: 0; }
.barras { display: flex; flex-direction: column; gap: 11px; }
.barra .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.barra .top .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra .pista { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.barra .relleno { height: 100%; border-radius: 999px; background: var(--s1); }

/* ---------- sheets (modal) */
.velo { position: fixed; inset: 0; background: rgba(99, 39, 19, .35); z-index: 50; animation: fade .15s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface);
  border-radius: 20px 20px 0 0; max-height: 92dvh; display: flex; flex-direction: column;
  animation: sube .2s ease; box-shadow: 0 -8px 30px rgba(99, 39, 19, .18); border-top: 6px solid var(--mango);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px 8px; }
.sheet-body { padding: 4px 18px 18px; overflow-y: auto; }
.sheet-foot {
  padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px;
}
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet {
    left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); width: min(620px, 94vw);
    border-radius: 18px; max-height: 88dvh; animation: fade .15s ease; overflow: hidden;
  }
}
@keyframes sube { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- toasts */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px));
}
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast {
  background: var(--marron); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(99, 39, 19, .3); animation: sube .2s ease;
}
.toast.error { background: var(--bad); color: #fff; }

/* ---------- POS (vender) */
.pos { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .pos { grid-template-columns: minmax(0, 1fr) 390px; align-items: start; } }
.productos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.prod {
  appearance: none; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 100px;
  transition: transform .08s, box-shadow .12s, border-color .12s; color: var(--ink);
}
.prod:hover { border-color: var(--naranja); box-shadow: var(--shadow-alto); transform: translateY(-1px); }
.prod .n { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.prod .m { font-size: 12px; color: var(--ink-3); }
.prod .p { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; gap: 6px; }
.prod .p b { font-variant-numeric: tabular-nums; color: var(--marron); }
:root[data-theme="dark"] .prod .p b { color: var(--mango); }
.prod .st { font-size: 11.5px; font-weight: 600; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; color: var(--ink-2); }
.prod .st.poco { background: var(--accent-soft); color: var(--accent); }
.buscador.grande .input { min-height: 54px; font-size: 17px; border-radius: 14px; border: 2px solid var(--line-strong); padding-left: 46px; }
.buscador.grande .input:focus { border-color: var(--naranja); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.buscador.grande svg { width: 20px; height: 20px; left: 16px; color: var(--naranja); }
.fila-venta { gap: 14px; }
.fila-venta .titulo, .fila-venta .detalle { white-space: normal; }   /* el nombre del combo y sus productos completos */
.fila-venta .monto { color: var(--marron); font-size: 15px; }
.agregar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 20px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--naranja); line-height: 1;
}
.fila-venta:hover .agregar { background: var(--naranja); color: #fff; border-color: var(--naranja); }
.agregar.con { background: var(--marron); color: #fff; border-color: var(--marron); font-size: 13px; }
.carrito { position: sticky; top: 24px; }
@media (max-width: 999px) { .escritorio-carrito { display: none; } }
.linea-carrito { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.linea-carrito .n { font-weight: 600; font-size: 14px; }
.cant { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; }
.cant button { appearance: none; border: 0; background: none; width: 34px; height: 34px; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.cant span { min-width: 24px; text-align: center; font-weight: 600; }
.precio-input { width: 120px; text-align: right; min-height: 36px; padding: 6px 10px; }
.total-linea { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.total-linea.grande { font-size: 20px; font-weight: 700; padding: 10px 12px; margin: 6px 0 2px; background: var(--naranja); color: #fff; border-radius: 10px; }
.barra-cobrar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 25;
}
@media (min-width: 1000px) { .barra-cobrar { display: none; } }

/* ---------- barbería (consignación): panel durazno como "Preparada para" */
.consig-cab {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--surface-3); color: var(--marron); border-radius: 14px; padding: 16px 18px;
}
.consig-cab p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.precios-consig { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.precios-consig b { color: var(--ink); font-weight: 600; }

/* ---------- dueño */
.dueno-valor { font-size: 34px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.dueno-estado { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; border-radius: 999px; padding: 4px 12px; }
.dueno-estado svg { width: 16px; height: 16px; }
.dueno-estado.debe { background: var(--good-soft); color: var(--good); }
.dueno-estado.aldia { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--page); border-top: 8px solid var(--mango); }
.login .card { width: min(400px, 100%); padding: 30px 26px; border-radius: 20px; box-shadow: var(--shadow-alto); }
.login .logo { width: 110px; height: 124px; margin: 0 auto 10px; display: block; object-fit: contain; }
.login h1 { font-size: 30px; color: var(--marron); text-transform: none; }

.cargando { display: grid; place-items: center; min-height: 50dvh; color: var(--ink-3); }
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--surface-3); border-top-color: var(--naranja); border-radius: 50%;
  animation: gira .8s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
.banda-demo {
  background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 500; padding: 6px 16px; text-align: center;
  border-bottom: 1px solid var(--line);
}
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv span:first-child { color: var(--ink-2); }
details.ayuda summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .kpis.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 699px) { .kpis.tres .kpi:last-child { grid-column: 1 / -1; } }
