@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

/* ==========================================================================
   Distribuidora Aurora — sistema de diseño compartido (tokens + componentes)
   Modo claro único. Sin dark mode por decisión de marca.
   Azul petróleo de depósito + naranja de señalización. Tipografía condensada.
   ========================================================================== */

:root {
  /* Paleta */
  --petroleo: #123B4F;
  --petroleo-2: #0D2C3B;
  --naranja: #E0662A;
  --naranja-osc: #C4531D;
  --naranja-suave: #FCEDE3;
  --arena: #F4F1EC;
  --arena-2: #FBF9F6;
  --blanco: #FFFFFF;
  --tinta: #1B2A33;
  --tinta-2: #5A6B75;
  --tinta-3: #7C8B94;
  --linea: #E2DCD3;
  --linea-2: #EFEAE2;
  --porvencer: #B77B12;
  --porvencer-osc: #8A5A08;
  --porvencer-bg: #FBF2DF;
  --vencido: #C0392B;
  --vencido-bg: #FBEBE9;

  /* Semanticos: mismo significado en toda la demo, sin excepcion */
  --cobro: #1E7A4C;
  --cobro-bg: #E6F2EC;
  --info: #1A6FB5;
  --info-bg: #E8F1F9;

  /* Estados de pedido */
  --est-nuevo: #1A6FB5;
  --est-nuevo-bg: #E8F1F9;
  --est-preparacion: #B77B12;
  --est-preparacion-bg: #FBF2DF;
  --est-reparto: #1D5670;
  --est-reparto-bg: #E4EDF2;
  --est-entregado: #1E7A4C;
  --est-entregado-bg: #E6F2EC;
  --est-no-entregado: #C0392B;
  --est-no-entregado-bg: #FBEBE9;

  /* Antiguedad de saldo */
  --ant-al-dia: #1E7A4C;
  --ant-al-dia-bg: #E6F2EC;
  --ant-d1-15: #1A6FB5;
  --ant-d1-15-bg: #E8F1F9;
  --ant-d16-30: #B77B12;
  --ant-d16-30-bg: #FBF2DF;
  --ant-d30-mas: #C0392B;
  --ant-d30-mas-bg: #FBEBE9;

  /* Radios */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Sombras: tintadas con el petroleo, nunca negro puro */
  --sombra-1: 0 1px 2px rgba(18, 59, 79, .06), 0 1px 1px rgba(18, 59, 79, .04);
  --sombra-2: 0 2px 6px rgba(18, 59, 79, .07), 0 6px 16px rgba(18, 59, 79, .06);
  --sombra-3: 0 8px 24px rgba(18, 59, 79, .10), 0 2px 6px rgba(18, 59, 79, .06);
  --sombra-4: 0 18px 48px rgba(18, 59, 79, .18), 0 4px 12px rgba(18, 59, 79, .10);
  --sombra-int: inset 0 1px 0 rgba(255, 255, 255, .6);

  /* Espaciado */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 20px;
  --e-6: 24px;
  --e-7: 32px;
  --e-8: 40px;

  /* Movimiento */
  --t-rapida: 120ms cubic-bezier(.4, 0, .2, 1);
  --t: 170ms cubic-bezier(.4, 0, .2, 1);
  --t-lenta: 260ms cubic-bezier(.22, .8, .3, 1);

  /* Tipografía */
  --f-ui: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-display: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Roboto Mono', monospace;

  --header-h: 60px;
}

/* ============================ Reset moderno ============================== */

/* El atributo hidden tiene que ganarle a cualquier display propio. Sin esto,
   un panel con display:flex sigue ocupando lugar aunque esté oculto: el
   panel lateral de la central tapaba media pantalla. */
[hidden] { display: none !important; }


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

html { -webkit-text-size-adjust: 100%; }

body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

ul[class], ol[class] { list-style: none; }

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--arena);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

a { color: var(--naranja); text-decoration: none; }
a:hover { text-decoration: underline; }

table { border-collapse: collapse; width: 100%; }

hr { border: 0; border-top: 1px solid var(--linea); margin: var(--e-5) 0; }

::selection { background: var(--naranja-suave); color: var(--petroleo); }

/* ============================= Tipografía =============================== */

.display {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.12;
}

h1, .t-h1 { font-family: var(--f-display); font-weight: 700; font-size: 32px; line-height: 1.15; letter-spacing: -.02em; }
h2, .t-h2 { font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -.015em; }
h3, .t-h3 { font-family: var(--f-ui); font-weight: 700; font-size: 17px; line-height: 1.3; }
h4, .t-h4 { font-family: var(--f-ui); font-weight: 700; font-size: 15px; line-height: 1.35; }

.t-etiqueta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tinta-2);
}

.t-sec { color: var(--tinta-2); }
.t-terc { color: var(--tinta-3); }
.t-chico { font-size: 13px; }
.t-mini { font-size: 12px; }
.t-mono { font-family: var(--f-mono); letter-spacing: .02em; }

/* Precios: siempre tabular */
.precio, .money, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.precio-grande {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.precio-tachado {
  color: var(--tinta-3);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

/* ============================== Botones ================================= */

.btn {
  --btn-bg: var(--blanco);
  --btn-fg: var(--tinta);
  --btn-bd: var(--linea);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-ui);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t),
              box-shadow var(--t), transform var(--t-rapida);
  box-shadow: var(--sombra-1);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--sombra-2); }
.btn:active { transform: translateY(0); box-shadow: var(--sombra-1); }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primario {
  --btn-bg: var(--naranja);
  --btn-fg: #fff;
  --btn-bd: var(--naranja);
}
.btn--primario:hover { --btn-bg: var(--naranja-osc); --btn-bd: var(--naranja-osc); }

.btn--oscuro {
  --btn-bg: var(--petroleo);
  --btn-fg: #fff;
  --btn-bd: var(--petroleo);
}
.btn--oscuro:hover { --btn-bg: var(--petroleo-2); --btn-bd: var(--petroleo-2); }

.btn--secundario {
  --btn-bg: var(--blanco);
  --btn-fg: var(--petroleo);
  --btn-bd: var(--linea);
}
.btn--secundario:hover { --btn-bd: #CFC8B7; --btn-bg: #FFFDF8; }

.btn--peligro {
  --btn-bg: var(--vencido);
  --btn-fg: #fff;
  --btn-bd: var(--vencido);
}
.btn--peligro:hover { --btn-bg: #A33622; --btn-bd: #A33622; }

.btn--fantasma {
  --btn-bg: transparent;
  --btn-fg: var(--tinta-2);
  --btn-bd: transparent;
  box-shadow: none;
}
.btn--fantasma:hover { --btn-bg: var(--naranja-suave); --btn-fg: var(--petroleo); box-shadow: none; transform: none; }

.btn--porvencer {
  --btn-bg: var(--porvencer);
  --btn-fg: #43310B;
  --btn-bd: var(--porvencer);
}
.btn--porvencer:hover { --btn-bg: #E29A22; --btn-bd: #E29A22; }

.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 16px; border-radius: var(--r-md); }
.btn--bloque { display: flex; width: 100%; }

.btn[disabled], .btn.is-deshabilitado, .btn[aria-disabled='true'] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: saturate(.7);
}

.btn--cargando { pointer-events: none; position: relative; color: transparent; }
.btn--cargando::after {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  border: 2px solid currentColor;
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: da-girar .7s linear infinite;
}

@keyframes da-girar { to { transform: rotate(360deg); } }

/* Botón icónico cuadrado */
.btn-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--tinta-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn-icono:hover { background: var(--naranja-suave); color: var(--petroleo); }
.btn-icono svg { width: 19px; height: 19px; }

/* =============================== Badges ================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--linea-2);
  color: var(--tinta-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge--sin-punto::before { display: none; }

.badge--nuevo { background: var(--est-nuevo-bg); color: var(--est-nuevo); }
.badge--preparacion { background: var(--est-preparacion-bg); color: var(--est-preparacion); }
.badge--reparto { background: var(--est-reparto-bg); color: var(--est-reparto); }
.badge--entregado { background: var(--est-entregado-bg); color: var(--est-entregado); }
.badge--no-entregado { background: var(--est-no-entregado-bg); color: var(--est-no-entregado); }

/* Antiguedad de saldo */
.badge--al-dia { background: var(--ant-al-dia-bg); color: var(--ant-al-dia); }
.badge--d1-15 { background: var(--ant-d1-15-bg); color: var(--ant-d1-15); }
.badge--d16-30 { background: var(--ant-d16-30-bg); color: var(--ant-d16-30); }
.badge--d30-mas { background: var(--ant-d30-mas-bg); color: var(--ant-d30-mas); }

.badge--vencido {
  background: var(--vencido);
  color: #fff;
  height: 22px;
  letter-spacing: .07em;
}
.badge--vencido::before { display: none; }

.badge--stock {
  background: rgba(28, 43, 36, .78);
  color: #fff;
  backdrop-filter: blur(2px);
}
.badge--stock::before { display: none; }

.badge--porvencer { background: var(--porvencer-bg); color: var(--porvencer-osc); }
.badge--contador {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  background: var(--porvencer);
  color: #3A2A07;
  font-size: 11px;
  justify-content: center;
}
.badge--contador::before { display: none; }

/* ================================ Chips ================================= */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips--envuelve { flex-wrap: wrap; overflow: visible; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--linea);
  border-radius: var(--r-pill);
  background: var(--blanco);
  color: var(--tinta-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t);
}

.chip:hover { background: var(--naranja-suave); border-color: #CBDCD1; color: var(--petroleo); }

.chip.is-activo {
  background: var(--petroleo);
  border-color: var(--petroleo);
  color: #fff;
  box-shadow: var(--sombra-2);
}

.chip__ico { font-size: 15px; line-height: 1; }

.chip__contador {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--linea-2);
  color: var(--tinta-2);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chip.is-activo .chip__contador { background: rgba(255, 255, 255, .2); color: #fff; }

/* ============================== Formularios ============================= */

.campo { display: block; margin-bottom: var(--e-4); }

.campo__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--tinta-2);
}

.campo__label .req { color: var(--vencido); }

.input, .textarea, .select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--linea);
  border-radius: var(--r-sm);
  background: var(--blanco);
  color: var(--tinta);
  font-size: 15px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  box-shadow: var(--sombra-1);
}

.input::placeholder, .textarea::placeholder { color: var(--tinta-3); }

.input:hover, .textarea:hover, .select:hover { border-color: #CFC8B7; }

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--naranja);
  box-shadow: 0 0 0 3px rgba(46, 125, 79, .16);
}

.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6B62' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.campo__ayuda { margin-top: 5px; font-size: 12.5px; color: var(--tinta-3); }

.campo.is-error .input,
.campo.is-error .textarea,
.campo.is-error .select { border-color: var(--vencido); background: #FFFBFA; }

.campo.is-error .campo__ayuda { color: var(--vencido); font-weight: 600; }

.campo--fila { display: flex; gap: var(--e-3); }
.campo--fila > * { flex: 1; }

/* Buscador con lupa */
.buscador { position: relative; }
.buscador .input { padding-left: 40px; }
.buscador__ico {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--tinta-3);
  pointer-events: none;
}

/* ============================= Radio cards ============================== */

.radio-cards { display: grid; gap: var(--e-3); }
.radio-cards--2 { grid-template-columns: repeat(2, 1fr); }

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: 14px 15px;
  border: 1.5px solid var(--linea);
  border-radius: var(--r-md);
  background: var(--blanco);
  cursor: pointer;
  transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t-rapida);
  box-shadow: var(--sombra-1);
}

.radio-card:hover { border-color: #CBDCD1; background: #FFFDF8; }

.radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.radio-card__ico {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--naranja-suave);
  color: var(--petroleo);
  transition: background var(--t), color var(--t);
}
.radio-card__ico svg { width: 22px; height: 22px; }

.radio-card__txt { min-width: 0; display: block; }
.radio-card__titulo { display: block; font-weight: 700; font-size: 15px; line-height: 1.25; }
.radio-card__sub { display: block; font-size: 12.5px; color: var(--tinta-2); margin-top: 2px; }

.radio-card__check {
  margin-left: auto;
  width: 20px; height: 20px;
  flex: none;
  border: 2px solid var(--linea);
  border-radius: 50%;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.radio-card:has(input:checked),
.radio-card.is-activa {
  border-color: var(--naranja);
  background: var(--naranja-suave);
  box-shadow: 0 0 0 3px rgba(46, 125, 79, .12), var(--sombra-1);
}

.radio-card:has(input:checked) .radio-card__ico,
.radio-card.is-activa .radio-card__ico { background: var(--naranja); color: #fff; }

.radio-card:has(input:checked) .radio-card__check,
.radio-card.is-activa .radio-card__check {
  border-color: var(--naranja);
  background: var(--naranja);
  box-shadow: inset 0 0 0 3px var(--naranja-suave);
}

.radio-card:has(input:focus-visible) { outline: 2px solid var(--naranja); outline-offset: 2px; }

/* Switch / toggle */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__pista {
  width: 42px; height: 24px;
  border-radius: var(--r-pill);
  background: #D6D0C2;
  position: relative;
  transition: background var(--t);
  flex: none;
}
.switch__pista::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sombra-1);
  transition: transform var(--t);
}
.switch input:checked + .switch__pista { background: var(--naranja); }
.switch input:checked + .switch__pista::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__pista { outline: 2px solid var(--naranja); outline-offset: 2px; }
.switch__txt { font-size: 13px; font-weight: 600; color: var(--tinta-2); }

/* =============================== Stepper ================================ */

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--linea);
  border-radius: var(--r-sm);
  background: var(--blanco);
  box-shadow: var(--sombra-1);
  overflow: hidden;
  user-select: none;
}

.stepper__btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--petroleo);
  font-size: 18px;
  line-height: 1;
  transition: background var(--t), color var(--t);
}
.stepper__btn:hover { background: var(--naranja-suave); }
.stepper__btn:active { background: #D8E6DC; }
.stepper__btn[disabled] { color: var(--tinta-3); opacity: .5; cursor: not-allowed; background: transparent; }
.stepper__btn svg { width: 15px; height: 15px; }

.stepper__valor {
  min-width: 40px;
  padding: 0 4px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--linea-2);
  border-right: 1px solid var(--linea-2);
  align-self: stretch;
  display: grid;
  place-items: center;
}

.stepper--lg .stepper__btn { width: 44px; height: 44px; font-size: 20px; }
.stepper--lg .stepper__valor { min-width: 56px; font-size: 17px; }

.stepper--sm .stepper__btn { width: 28px; height: 28px; }
.stepper--sm .stepper__valor { min-width: 32px; font-size: 13.5px; }

.stepper.is-vacio .stepper__valor { color: var(--tinta-3); }

/* ================================ Cards ================================= */

.card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--r-lg);
  box-shadow: var(--sombra-1);
  transition: box-shadow var(--t), border-color var(--t), transform var(--t-rapida);
}

.card--clic { cursor: pointer; }
.card--clic:hover { box-shadow: var(--sombra-3); border-color: #D8D1C1; transform: translateY(-2px); }

.card__cabecera {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: 14px 18px;
  border-bottom: 1px solid var(--linea-2);
}
.card__cuerpo { padding: 18px; }
.card__pie {
  padding: 14px 18px;
  border-top: 1px solid var(--linea-2);
  background: #FDFCF8;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Panel/sección genérica */
.seccion { margin-bottom: var(--e-7); }
.seccion__titulo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--e-3);
  margin-bottom: var(--e-4);
}

/* ================================ Tablas ================================ */

.tabla-wrap {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--r-lg);
  overflow: auto;
  box-shadow: var(--sombra-1);
}

.tabla { width: 100%; font-size: 14px; }

.tabla thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #FBF8F1;
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tinta-2);
  border-bottom: 1px solid var(--linea);
  white-space: nowrap;
}

.tabla tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--linea-2);
  vertical-align: middle;
}

.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background var(--t); }
.tabla tbody tr:hover { background: #FBFAF5; }

.tabla .num, .tabla .der { text-align: right; font-variant-numeric: tabular-nums; }
.tabla__total td { font-weight: 700; background: #FBF8F1; border-top: 1px solid var(--linea); }

/* =============================== Toasts ================================= */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 15px;
  border-radius: var(--r-md);
  background: var(--petroleo);
  color: #F3F7F4;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: var(--sombra-4);
  animation: da-toast-in 240ms cubic-bezier(.22, .9, .3, 1);
}

.toast.is-saliendo { animation: da-toast-out 200ms ease forwards; }

.toast__ico {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
.toast__ico svg { width: 14px; height: 14px; }

.toast__txt { min-width: 0; }
.toast__txt b { display: block; font-weight: 700; }
.toast__txt span { display: block; font-weight: 500; opacity: .8; font-size: 12.5px; }

.toast--ok .toast__ico { background: var(--naranja); }
.toast--error { background: #5A241A; }
.toast--error .toast__ico { background: var(--vencido); }
.toast--aviso .toast__ico { background: var(--porvencer); color: #43310B; }

@keyframes da-toast-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes da-toast-out {
  to { opacity: 0; transform: translateY(10px) scale(.98); }
}

/* ========================= Overlay, modal, sheet ======================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(18, 34, 26, .48);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-lenta), visibility var(--t-lenta);
}
.overlay.is-abierto { opacity: 1; visibility: visible; }

.modal {
  position: fixed;
  z-index: 900;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  transform: translate(-50%, -46%) scale(.98);
  opacity: 0;
  visibility: hidden;
  background: var(--blanco);
  border-radius: var(--r-xl);
  box-shadow: var(--sombra-4);
  transition: opacity var(--t-lenta), transform var(--t-lenta), visibility var(--t-lenta);
}
.modal.is-abierto { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.modal__cabecera {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: 18px 20px 12px;
}
.modal__cuerpo { padding: 0 20px 20px; }
.modal__pie {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--linea-2);
  background: #FDFCF8;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.modal__pie .btn { flex: 1; }

/* Los paneles deslizantes (sheet desde abajo / lateral desde la derecha) viven en
   tienda.css como .det y .cart: ahí están sus únicas definiciones. */

/* ============================ Estados vacíos ============================ */

.vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--e-3);
  padding: 48px 24px;
  color: var(--tinta-2);
}
.vacio__ico {
  display: grid;
  place-items: center;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--naranja-suave);
  color: var(--petroleo);
}
.vacio__ico svg { width: 32px; height: 32px; }
.vacio__titulo { font-family: var(--f-display); font-size: 17px; color: var(--tinta); }
.vacio p { max-width: 34ch; font-size: 13.5px; }

/* ============================== Skeletons =============================== */

.sk {
  position: relative;
  overflow: hidden;
  background: #ECE7DC;
  border-radius: var(--r-sm);
}
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: translateX(-100%);
  animation: da-sk 1.15s ease-in-out infinite;
}
@keyframes da-sk { to { transform: translateX(100%); } }

.sk--txt { height: 11px; margin: 7px 0; border-radius: var(--r-pill); }
.sk--tile { aspect-ratio: 1; border-radius: var(--r-md); }

/* ============================ Barra de progreso ========================= */

.progreso {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--linea-2);
  overflow: hidden;
}
.progreso__barra {
  height: 100%;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--naranja);
  transition: width 320ms cubic-bezier(.22, .8, .3, 1), background var(--t);
}
.progreso.is-completo .progreso__barra { background: var(--naranja); }
.progreso--porvencer .progreso__barra { background: var(--porvencer); }

/* ============================== Aviso / nota ============================ */

.aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--porvencer-bg);
  border: 1px solid #F0E3C4;
  color: #6A4E12;
  font-size: 13px;
  line-height: 1.45;
}
.aviso svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.aviso--verde { background: var(--naranja-suave); border-color: #CFE1D5; color: #235C3C; }
.aviso--rojo { background: var(--vencido-bg); border-color: #F0D4CD; color: #8C2E1D; }

/* ============================== Accesibilidad =========================== */

:focus-visible {
  outline: 2px solid var(--naranja);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================== Scrollbars ============================== */

* {
  scrollbar-width: thin;
  scrollbar-color: #CFC8B7 transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #D8D1C1;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: #BCB3A0; background-clip: content-box; }

/* ============================== Utilidades ============================== */

.u-fila { display: flex; align-items: center; }
.u-col { display: flex; flex-direction: column; }
.u-entre { justify-content: space-between; }
.u-centro { justify-content: center; }
.u-al-inicio { align-items: flex-start; }
.u-envuelve { flex-wrap: wrap; }
.u-crece { flex: 1; min-width: 0; }
.u-auto { margin-left: auto; }

.u-g1 { gap: 4px; } .u-g2 { gap: 8px; } .u-g3 { gap: 12px; }
.u-g4 { gap: 16px; } .u-g5 { gap: 20px; } .u-g6 { gap: 24px; }

.u-mt1 { margin-top: 4px; } .u-mt2 { margin-top: 8px; } .u-mt3 { margin-top: 12px; }
.u-mt4 { margin-top: 16px; } .u-mt5 { margin-top: 20px; } .u-mt6 { margin-top: 24px; }
.u-mb2 { margin-bottom: 8px; } .u-mb3 { margin-bottom: 12px; } .u-mb4 { margin-bottom: 16px; }

.u-der { text-align: right; }
.u-izq { text-align: left; }
.u-cen { text-align: center; }
.u-nowrap { white-space: nowrap; }
.u-1linea { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-2lineas {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.oculto { display: none !important; }
.u-relativo { position: relative; }

.u-contenedor { width: min(1180px, 100% - 32px); margin-inline: auto; }
.u-divisor { height: 1px; background: var(--linea); margin: var(--e-4) 0; }

/* Importes ocultos por el toggle "ojo" del panel */
.montos-ocultos .money {
  color: transparent !important;
  position: relative;
  user-select: none;
}
.montos-ocultos .money::after {
  content: '•••••';
  position: absolute;
  inset: 0;
  display: block;
  text-align: inherit;
  line-height: inherit;
  color: var(--tinta-3);
  letter-spacing: .06em;
}
/* contenedores flex: el monto va a la derecha aunque no herede text-align */
.montos-ocultos .totales__fila .money::after,
.montos-ocultos .totales__total .money::after { text-align: right; }

/* Ilustraciones de producto */
.da-svg { display: block; width: 100%; height: auto; }

/* ====================== Objetivos táctiles (dedo) ======================= */
/* En pantallas táctiles los controles chicos suben al mínimo cómodo (~44px):
   el − / + de la card es LA interacción de la tienda y en la grilla de 2 columnas
   dos steppers quedan muy cerca. El ícono no cambia, sólo el área tocable. */
@media (pointer: coarse) {
  .stepper__btn { width: 44px; height: 44px; }
  .stepper--sm .stepper__btn { width: 38px; height: 38px; }
  .stepper--sm .stepper__valor { min-width: 36px; }
  .btn-icono { width: 44px; height: 44px; }
  .chip { height: 42px; }

  /* iOS Safari hace zoom automático al enfocar un campo con fuente < 16px */
  .input, .textarea, .select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Fotos reales de producto (fotos.js): mismo comportamiento que .da-svg,
   recorte centrado y fondo crema mientras carga */
.da-foto { object-fit: cover; background: #F4F1EC; }

/* ==========================================================================
   Componentes propios de Aurora
   Lo que esta demo necesita y las anteriores no tenían: personas, deuda,
   recorrido y estado en vivo.
   ========================================================================== */

/* ------------------------------ Avatar --------------------------------- */
/* Iniciales sobre color de la persona. Se usa para vendedores, fleteros y
   comercios: da identidad sin necesitar fotos de gente. */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  background: var(--petroleo);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  text-transform: uppercase;
  user-select: none;
}

.avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.avatar--lg { width: 52px; height: 52px; font-size: 20px; }
.avatar--naranja { background: var(--naranja); }
.avatar--claro { background: var(--naranja-suave); color: var(--naranja-osc); }
.avatar--linea { background: var(--arena-2); color: var(--tinta-2); border: 1px solid var(--linea); }

/* Estado en vivo: punto que late cuando la persona está trabajando */
.avatar-wrap { position: relative; display: inline-flex; flex: none; }

.avatar-wrap__punto {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--blanco);
  border-radius: var(--r-pill);
  background: var(--tinta-3);
}

.avatar-wrap__punto.is-activo { background: var(--cobro); animation: da-latir 2.4s ease-in-out infinite; }

@keyframes da-latir {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 122, 76, .5); }
  50% { box-shadow: 0 0 0 5px rgba(30, 122, 76, 0); }
}

/* --------------------------- Franja de estado --------------------------- */
/* Barra de color a la izquierda de una card: la deuda vencida se ve de lejos. */
.franja { position: relative; padding-left: calc(var(--e-4) + 4px); }

.franja::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--linea);
}

.franja--al-dia::before { background: var(--ant-al-dia); }
.franja--d1-15::before { background: var(--ant-d1-15); }
.franja--d16-30::before { background: var(--ant-d16-30); }
.franja--d30-mas::before { background: var(--ant-d30-mas); }
.franja--naranja::before { background: var(--naranja); }

/* ------------------------------ Timeline -------------------------------- */
/* Recorrido de estados de un pedido, en vertical. */
.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--linea);
}

.timeline__item { position: relative; padding-bottom: var(--e-5); }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--blanco);
  border-radius: var(--r-pill);
  background: var(--linea);
  box-shadow: 0 0 0 1px var(--linea);
}

.timeline__item.is-hecho::before { background: var(--cobro); box-shadow: 0 0 0 1px var(--cobro); }
.timeline__item.is-actual::before { background: var(--naranja); box-shadow: 0 0 0 1px var(--naranja); }

.timeline__titulo { font-weight: 600; font-size: 14px; }
.timeline__hora { font-size: 12.5px; color: var(--tinta-3); font-variant-numeric: tabular-nums; }
.timeline__item.is-pendiente .timeline__titulo { color: var(--tinta-3); font-weight: 500; }

/* --------------------------- Tarjeta de KPI ----------------------------- */
.kpi {
  padding: var(--e-4);
  border: 1px solid var(--linea);
  border-radius: var(--r-md);
  background: var(--blanco);
  box-shadow: var(--sombra-1);
}

.kpi__etiqueta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tinta-2);
}

.kpi__valor {
  margin-top: 2px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}

.kpi__pie { margin-top: 2px; font-size: 12.5px; color: var(--tinta-3); }
.kpi__delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi__delta--sube { color: var(--cobro); }
.kpi__delta--baja { color: var(--vencido); }

.kpi--acento { border-color: var(--naranja); box-shadow: 0 0 0 1px var(--naranja), var(--sombra-1); }
.kpi--vencido .kpi__valor { color: var(--vencido); }

/* Tarjeta clicable de antigüedad de saldo */
.kpi--filtro {
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t-rapida);
}

.kpi--filtro:hover { transform: translateY(-1px); box-shadow: var(--sombra-2); }
.kpi--filtro.is-activo { border-color: var(--petroleo); box-shadow: 0 0 0 1px var(--petroleo), var(--sombra-2); }

/* --------------------------- Movimiento en vivo -------------------------- */
/* Flash suave cuando entra algo desde otra pestaña: el ojo lo caza sin ruido. */
.entra { animation: da-entra 900ms cubic-bezier(.22, .9, .3, 1); }

@keyframes da-entra {
  0% { background: var(--naranja-suave); transform: translateY(-4px); opacity: 0; }
  35% { opacity: 1; transform: translateY(0); }
  100% { background: transparent; }
}

.punto-vivo {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--cobro);
  animation: da-latir 2.4s ease-in-out infinite;
}

/* ---------------------------- Notificaciones ---------------------------- */
.notif {
  display: flex;
  gap: var(--e-3);
  padding: var(--e-3) var(--e-4);
  border-bottom: 1px solid var(--linea-2);
  background: var(--blanco);
}

.notif.is-nueva { background: var(--naranja-suave); }

.notif__ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--info-bg);
  color: var(--info);
}

.notif__ico--cobro { background: var(--cobro-bg); color: var(--cobro); }
.notif__ico--stock { background: var(--porvencer-bg); color: var(--porvencer-osc); }
.notif__titulo { font-weight: 600; font-size: 14px; }
.notif__texto { font-size: 13px; color: var(--tinta-2); }
.notif__hora { font-size: 12px; color: var(--tinta-3); white-space: nowrap; }

/* --------------------------- Mapa de zonas ------------------------------ */
/* SVG propio: sin Google Maps, sin API key, sin coordenadas reales. */
.mapa-zonas {
  width: 100%;
  height: auto;
  background: var(--arena-2);
  border-radius: var(--r-md);
  border: 1px solid var(--linea);
}

.mapa-zonas .zona { fill: var(--blanco); stroke: var(--linea); stroke-width: 1.5; transition: fill var(--t); }
.mapa-zonas .zona.is-activa { fill: var(--naranja-suave); stroke: var(--naranja); }
.mapa-zonas .zona__nombre { font-family: var(--f-ui); font-size: 11px; font-weight: 600; fill: var(--tinta-2); }
.mapa-zonas .pin { transition: transform var(--t-lenta); }

/* ------------------------------ Semáforo -------------------------------- */
.semaforo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.semaforo::before { content: ''; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--cobro); }
.semaforo--bajo::before { background: var(--porvencer); }
.semaforo--critico::before { background: var(--vencido); }
.semaforo--bajo { color: var(--porvencer-osc); }
.semaforo--critico { color: var(--vencido); }

/* ------------------------- Barra inferior de app ------------------------ */
/* Navegación de las dos apps mobile. Fija, con área táctil cómoda. */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--blanco);
  border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 12px rgba(18, 59, 79, .06);
}

.tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 6px 2px;
  color: var(--tinta-3);
  font-size: 11px;
  font-weight: 600;
  transition: color var(--t);
}

.tabbar__item svg { width: 21px; height: 21px; }
.tabbar__item.is-activo { color: var(--naranja); }
.tabbar__item:hover { color: var(--naranja-osc); }

.tabbar__contador {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--vencido);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ------------------------- Impresión de comprobantes -------------------- */
/* Remito y recibo salen limpios: sin navegación, sin colores de pantalla. */
@media print {
  .no-imprimir, .tabbar, .toast-cont, .overlay { display: none !important; }
  body { background: #fff; }
  .comprobante { box-shadow: none; border: 0; margin: 0; padding: 0; }
}
