/* Almacén 360 · estilo propio
   Claro y ordenado: fondo gris azulado, tarjetas blancas con borde fino, un solo color de acción
   (el celeste de Los Andes en su tono oscuro, para que el texto blanco se lea) y estados en pastillas suaves.
   Letras: Bricolage Grotesque (títulos), Figtree (texto) y JetBrains Mono (números y códigos). */

:root {
  /* Base */
  --ground: #F3F7FB;      /* fondo */
  --surface: #FFFFFF;     /* tarjetas */
  --surface-2: #E8F0F8;   /* fondos de controles */
  --ink: #0E1B33;         /* texto principal */
  --muted: #56627E;       /* texto secundario */
  --line: #D9E3EE;        /* bordes */

  /* Los Andes */
  --andes: #58C8FF;       /* celeste del logo: marca y detalles */
  --accent: #0077B6;      /* mismo celeste, oscuro: botones y enlaces (contraste AA con blanco) */
  --accent-hover: #00669C;
  --accent-soft: #E2F4FE;
  --glow: rgba(88, 200, 255, .30);

  /* Estados */
  --ok: #138A52;   --ok-soft: #DDF3E8;
  --warn: #A45708; --warn-soft: #FCEBD3;
  --bad: #C0352B;  --bad-soft: #FBE3E1;

  --r: 14px;       /* controles */
  --r-panel: 18px; /* tarjetas y paneles */

  /* Nombres que usan las pantallas (se mantienen) */
  --tinta: var(--ink);
  --tinta-2: var(--accent);
  --papel: var(--ground);
  --tarjeta: var(--surface);
  --linea: var(--line);
  --texto: var(--ink);
  --suave: var(--muted);
  --verde: var(--ok);
  --rojo: var(--bad);
  --ambar: var(--warn);
  --andes-osc: var(--accent);
  --radio: var(--r-panel);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
  background: var(--ground);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}
.display, main h1, main h2 { font-family: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif; letter-spacing: -.02em; }
.dato { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: .94em; }
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rotulo-kpi { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 420px) { .rotulo-kpi { font-size: 10.5px; letter-spacing: .05em; white-space: nowrap; } }
.kpi-num { display: block; font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums;
           font-size: clamp(26px, 4vw, 32px); font-weight: 600; line-height: 1.15; margin-top: 6px; }

input, select, textarea { font-size: 16px; }      /* sin zoom automático en el celular */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Títulos y paneles ---------- */
main h1.display { font-size: clamp(28px, 1.4rem + 1.4vw, 38px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
main .rounded-2xl { border-radius: var(--r-panel); }
main .rounded-xl { border-radius: var(--r); }
main ul.divide-y > li { transition: background-color .15s; }
main ul.divide-y > li:hover { background: #F8FBFE; }

/* Fondo con retícula y halo celeste (cabecera de Hoy e ingreso) */
.escenario { position: relative; isolation: isolate; }
.escenario::before {
  content: ""; position: absolute; inset: -40px -24px -8px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; opacity: .6;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 30% 40%, #000 15%, transparent 72%);
          mask-image: radial-gradient(ellipse 70% 80% at 30% 40%, #000 15%, transparent 72%);
}
.escenario::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; width: 340px; height: 340px; right: -60px; top: -150px;
  border-radius: 50%; background: var(--andes); filter: blur(80px); opacity: .28;
}

/* ---------- Cabecera ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--ground) 86%, transparent);
          backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1160px; margin-inline: auto; display: flex; align-items: center; gap: 22px; height: 60px; padding-inline: 16px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Bricolage Grotesque", sans-serif;
         font-weight: 800; font-size: 20px; letter-spacing: -.03em; white-space: nowrap; }
.marca svg { width: 30px; height: 30px; flex: none; }
.marca-lugar { font-family: "Figtree", sans-serif; font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--muted);
               padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line); }
.enlaces { display: flex; gap: 4px; font-weight: 500; font-size: 15px; }
.enlace { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px;
          color: var(--muted); text-decoration: none; transition: color .15s, background-color .15s; }
.enlace:hover { color: var(--ink); background: var(--surface-2); }
.enlace[aria-current="page"] { color: var(--ink); font-weight: 600; }
.enlace[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 2px;
                                      border-radius: 2px; background: var(--accent); }
.insignia { font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px;
            border-radius: 99px; background: var(--accent); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--surface-2); }
.user-chip .quien { font-size: 14px; font-weight: 600; line-height: 1.15; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .quien small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.avatar { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
          background: var(--accent); color: #fff; font-family: "Bricolage Grotesque", sans-serif; font-size: 13px; font-weight: 700; }
.boton-icono { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); }
.boton-icono:hover { color: var(--ink); background: var(--surface-2); }
.chip-entorno { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface);
                color: var(--muted); border-radius: 99px; padding: 4px 11px 4px 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip-entorno::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* ---------- Barra inferior (celular) ---------- */
.barra-cel { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
             -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.barra-cel a[aria-current="page"] { color: var(--accent); }
.boton-central { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--accent);
                 color: #fff; box-shadow: 0 10px 24px -8px var(--glow), 0 0 0 4px var(--ground); }

/* ---------- Tarjeta de un pedido ---------- */
.etiqueta {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 16px 18px; transition: border-color .2s, box-shadow .2s;
}
.etiqueta:has(a:hover) { border-color: color-mix(in srgb, var(--andes) 70%, var(--line)); box-shadow: 0 10px 28px -18px var(--glow); }

/* ---------- Estado en pastilla ---------- */
.sello {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1;
  white-space: nowrap; padding: 5px 10px; border-radius: 99px;
}
.sello::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sello.ok { background: var(--ok-soft); color: var(--ok); }
.sello.adv { background: var(--warn-soft); color: var(--warn); }
.sello.error { background: var(--bad-soft); color: var(--bad); }
.sello.info { background: var(--accent-soft); color: var(--accent); }
.sello.neutro { background: var(--surface-2); color: var(--muted); }

/* ---------- Ruta del pedido (pasos) ---------- */
.ruta { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.ruta::before { content: ""; position: absolute; top: 15px; left: 12.5%; right: 12.5%; height: 2px; background: var(--line); }
.ruta .parada { position: relative; text-align: center; font-size: 12.5px; color: var(--muted); }
.ruta .punto {
  width: 32px; height: 32px; margin: 0 auto 6px; border-radius: 10px; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface-2); color: var(--muted); font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 13px;
}
.ruta .hecho .punto { background: var(--ok); color: #fff; }
.ruta .ahora .punto { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accent-soft); }
.ruta .hecho, .ruta .ahora { color: var(--ink); }
.ruta .tramo { position: absolute; top: 15px; height: 2px; background: var(--ok); left: 12.5%; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 15.5px; white-space: nowrap; cursor: pointer;
  transition: transform .12s ease, background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primario { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -12px var(--glow); }
.btn-primario:hover { background: var(--accent-hover); }
.btn-borde { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-borde:hover { border-color: var(--ink); }
.btn-chico { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14.5px; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* ---------- Campos ---------- */
.campo {
  display: block; width: 100%; min-height: 48px; padding: 11px 14px; background: var(--ground);
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink); transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.campo::placeholder { color: #8A95AC; }
.campo:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.campo[aria-invalid="true"] { border-color: var(--bad); background: #FFF8F7; }
select.campo { appearance: none; padding-right: 38px; cursor: pointer;
  background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2356627E' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; }
.rotulo { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.ayuda { font-size: 13px; color: var(--muted); margin-top: 5px; }

/* Opciones tipo interruptor (radio) */
.opciones { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.opciones input { position: absolute; opacity: 0; pointer-events: none; }
.opciones label {
  min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  cursor: pointer; font-weight: 600; font-size: 15px; color: var(--muted); transition: background-color .2s, color .2s;
}
.opciones label:hover { color: var(--ink); }
.opciones input:checked + label { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -10px var(--glow); }
.opciones input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Medio del requerimiento (correo o ticket): con el celeste de Los Andes */
.seccion-medio { border-color: color-mix(in srgb, var(--andes) 55%, var(--line)) !important;
                 box-shadow: 0 18px 40px -28px var(--glow), inset 0 3px 0 var(--andes); }
.opciones-medio label { min-width: 120px; }
.cargo { margin-top: 8px; font-size: 15px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); }

/* Contador − n + */
.contador { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.contador button { width: 44px; height: 44px; font-size: 20px; font-weight: 600; color: var(--accent); border-radius: 11px; }
.contador button:hover { background: var(--accent-soft); }
.contador input { width: 56px; text-align: center; border: 0; font-family: "JetBrains Mono", monospace; font-weight: 600; background: transparent; }

/* Foto */
.foto-caja { border: 1.5px dashed color-mix(in srgb, var(--andes) 60%, var(--line)); border-radius: var(--r-panel);
             background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); transition: border-color .2s, background-color .2s; }
.foto-caja:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Mensajes */
.aviso { border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.aviso::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-top: 8px; flex: none; }
.aviso.ok { background: var(--ok-soft); color: #0E6B3F; }
.aviso.error { background: var(--bad-soft); color: #9A2A22; }
.aviso.adv { background: var(--warn-soft); color: #7E4306; }
.aviso.error > p, .aviso.error > ul { margin: 0; }
div[role="alert"].aviso { display: block; }
div[role="alert"].aviso::before { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
