/* ============================================================
   Ayudas Visuales · sistema visual
   Tipografía de marca Domino's Sans, azul/rojo de marca como acento
   sobre neutros fríos. Colores de estado validados para daltonismo
   (dataviz validate_palette: PASS en orden de la barra apilada).
   ============================================================ */
@font-face { font-family: 'DS Text'; src: url('../fonts/Dominos_Sans_Text_VF.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'DS Display'; src: url('../fonts/Dominos_Sans_Display_VF.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ink-900: #081a2c;
  --ink-800: #0c2640;
  --ink-700: #123556;
  --ink-600: #1d4a73;
  --page: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #e3e9f0;
  --line-strong: #cfd8e3;
  --text: #0d2138;
  --text-2: #4a5f78;
  --text-3: #677a8f; /* ≥4.5:1 sobre blanco y --surface-2 */

  --blue: #0090e2;
  --blue-deep: #0068b3;
  --red: #e31837;
  --red-deep: #c10f2c;

  /* estados (orden barra: completado, en_camino, en_commisary, atrasado, problema) */
  --st-completado: #16a05d;
  --st-en_camino: #1f5fb8;
  --st-en_commisary: #4aa8e8;
  --st-atrasado: #e0a000;
  --st-problema: #d23a3a;
  --st-pendiente: #d5dde7;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(8, 26, 44, .05), 0 1px 1px rgba(8, 26, 44, .03);
  --shadow-2: 0 1px 2px rgba(8, 26, 44, .04), 0 10px 30px -8px rgba(8, 26, 44, .12);
  --shadow-3: 0 2px 6px rgba(8, 26, 44, .06), 0 24px 56px -12px rgba(8, 26, 44, .22);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.16, 1, .3, 1); /* expo-out: asentado, sin rebote */
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'DS Text', 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'DS Display', 'DS Text', sans-serif; margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue-deep); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, #17466f 0%, transparent 60%), var(--ink-900);
  color: #dce8f5; padding: 22px 16px; overflow: hidden;
}
.sidebar::after { /* patrón de puntos tipo dominó */
  content: ''; position: absolute; inset: auto -40px -40px auto; width: 260px; height: 260px; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 2.2px, transparent 2.6px);
  background-size: 18px 18px; mask-image: radial-gradient(circle at 70% 70%, #000 0%, transparent 70%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.brand b { display: block; font-family: 'DS Display'; font-size: 17px; color: #fff; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11.5px; color: #7f9bb8; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #5f7d9c; padding: 16px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: #b9cce0; text-decoration: none; font-weight: 500; transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(0,144,226,.28), rgba(0,144,226,.08)); color: #fff; }
.nav a.active .icon { color: #5cc2ff; }
.nav .lbl-s { display: none; }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar-foot { margin-top: auto; position: relative; z-index: 1; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06); }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-deep)); flex: none; }
.user-card b { display: block; color: #fff; font-size: 13.5px; }
.user-card small { color: #7f9bb8; font-size: 12px; }
.user-card button { margin-left: auto; background: none; border: 0; color: #7f9bb8; padding: 6px; border-radius: 8px; }
.user-card button:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { min-width: 0; padding: 26px 34px 60px; }
.main:focus { outline: none; }
.topbar { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar .crumb { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.topbar .crumb a { color: var(--text-2); text-decoration: none; }
.topbar .crumb a:hover { color: var(--blue-deep); }
.topbar h1 { font-size: 28px; font-weight: 800; }
.topbar .sub { color: var(--text-2); margin-top: 3px; }
.topbar .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--text);
  transition: transform .15s var(--ease-out), box-shadow .2s, background .2s, border-color .2s; box-shadow: var(--shadow-1);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #b6c3d2; box-shadow: var(--shadow-2); }
.btn:active { transform: scale(.97); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg, #ff2a47, var(--red)); border-color: var(--red-deep); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 20px -6px rgba(227,24,55,.55); }
.btn-primary:hover { border-color: var(--red-deep); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 12px 26px -6px rgba(227,24,55,.6); }
.btn-blue { background: linear-gradient(180deg, #16a2f0, var(--blue-deep)); border-color: #005c9e; color: #fff; box-shadow: 0 8px 20px -8px rgba(0,104,179,.6); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: rgba(13,33,56,.05); box-shadow: none; border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { background: var(--surface-2); border-color: var(--line); color: var(--text-3); box-shadow: none; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: rgba(13,33,56,.06); color: var(--text); }

/* ---------- tarjetas ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); border: 1px solid rgba(13,33,56,.04); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-family: 'DS Text'; font-size: 16.5px; font-weight: 700; letter-spacing: -.005em; }
.card-head .hint { color: var(--text-3); font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 20px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 28px 30px; color: #fff; margin-bottom: 24px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(0,144,226,.55) 0%, transparent 55%),
    radial-gradient(60% 90% at 0% 100%, rgba(227,24,55,.28) 0%, transparent 60%),
    linear-gradient(135deg, var(--ink-800), #0b4677);
  box-shadow: var(--shadow-3);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.10) 2px, transparent 2.4px); background-size: 22px 22px;
  mask-image: linear-gradient(100deg, transparent 35%, #000 100%);
}
.hero > * { position: relative; }
.hero .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #9fd3ff; font-weight: 600; }
.hero h2 { font-size: 30px; font-weight: 800; margin: 6px 0 4px; }
.hero p { margin: 0; color: #c9dcef; max-width: 560px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.hero-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 16px 18px; backdrop-filter: blur(6px); }
.hero-stat .v { font-family: 'DS Display'; font-size: 32px; font-weight: 800; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.hero-stat .v small { font-size: 15px; font-weight: 600; color: #a9c6e2; }
.hero-stat .l { font-size: 13px; color: #b9d0e6; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.hero-stat.alert { background: linear-gradient(135deg, rgba(224,160,0,.30), rgba(224,160,0,.12)); border-color: rgba(255,200,80,.35); }

/* ---------- envío cards ---------- */
.envios { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 20px; }
.envio-card {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px; text-decoration: none; color: inherit;
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.envio-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.envio-card .top { display: flex; gap: 16px; align-items: flex-start; }
.envio-card h3 { font-family: 'DS Text'; font-size: 19px; font-weight: 750; line-height: 1.22; letter-spacing: -.015em; }
.envio-card .date { color: var(--text-3); font-size: 13px; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.envio-card.cerrado { opacity: .78; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.chip b { color: var(--text); }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mini-stat { position: relative; background: var(--surface-2); border-radius: 12px; padding: 10px 8px 9px 10px; min-width: 0; }
.mini-stat .v { font-family: 'DS Display'; font-weight: 800; font-size: 19px; line-height: 1; }
.mini-stat .l { font-size: 11.5px; line-height: 1.2; color: var(--text-2); margin-top: 6px; }
.mini-stat .l .dot { position: absolute; top: 11px; right: 9px; }
.dot { width: 8px; height: 8px; border-radius: 3px; flex: none; display: inline-block; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.pill.st-completado { background: #e3f5ec; color: #0b6b3b; }
.pill.st-en_camino { background: #e5eefb; color: #1a4f9a; }
.pill.st-en_commisary { background: #e6f4fd; color: #1a6aa3; }
.pill.st-atrasado { background: #fdf3d8; color: #8a5a00; }
.pill.st-no_recibido, .pill.st-incidencia { background: #fbe6e6; color: #a32323; }
.pill.st-pendiente { background: #eef2f6; color: #5a6c80; }
.pill.activo { background: #e5f3fd; color: #0068b3; }
.pill.cerrado { background: #eef2f6; color: #5a6c80; }

/* ---------- anillo de progreso ---------- */
.ring { position: relative; flex: none; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .track { stroke: var(--st-pendiente); }
.ring .bar { stroke: var(--st-completado); transition: stroke-dashoffset 1.1s var(--ease-out); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .label b { font-family: 'DS Display'; font-size: 20px; font-weight: 800; line-height: 1; display: block; }
.ring .label small { display: block; font-size: 9.5px; color: var(--text-3); margin-top: 2px; }
.ring.sm .label b { font-size: 11px; }

/* ---------- barra apilada de estados ---------- */
.stackbar { animation: reveal .9s var(--ease-out) both; display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--st-pendiente); }
.stackbar.lg { height: 18px; border-radius: 8px; }
.stackbar span { display: block; height: 100%; min-width: 3px; position: relative; }
.stackbar span:hover { filter: brightness(1.12) saturate(1.1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- pipeline (recorrido) ---------- */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.stage { position: relative; padding: 4px 18px 0 0; }
.stage .node {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--text-2); box-shadow: var(--shadow-1);
}
.stage.done .node { background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(0,104,179,.7); }
.stage.partial .node { border-color: var(--blue); color: var(--blue-deep); }
.stage .node .icon { width: 21px; height: 21px; }
.stage .conn { position: absolute; left: 50px; right: 8px; top: 27px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.stage .conn i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--blue), #56c0ff); transform-origin: left; transition: transform 1.1s var(--ease-out); }
.stage .conn i::after {
  content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 6px, transparent 6px 14px);
  animation: flow 1.2s linear infinite;
}
@keyframes flow { to { background-position: 28px 0; } }
.stage:last-child .conn { display: none; }
.stage h4 { font-size: 13px; color: var(--text-2); font-family: 'DS Text'; font-weight: 600; margin: 14px 0 2px; }
.stage .v { font-family: 'DS Display'; font-size: 30px; font-weight: 800; line-height: 1.05; }
.stage .v small { font-size: 15px; color: var(--text-3); font-weight: 600; }
.stage .who { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.stage .bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 10px; overflow: hidden; max-width: 180px; }
.stage .bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; transform-origin: left; transition: transform 1s var(--ease-out); }

/* ---------- mapa Chile ---------- */
.chile { display: flex; flex-direction: column; gap: 4px; position: relative; }
.zona { display: grid; grid-template-columns: 116px 1fr auto; gap: 14px; align-items: center; padding: 9px 0; position: relative; }
.zona::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--line), var(--line)); }
.zona:first-child::before { top: 50%; }
.zona:last-child::before { bottom: 50%; }
.zona .zn { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; position: relative; }
.zona .zn::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); flex: none; box-shadow: 0 0 0 4px var(--surface); }
.zona .dots { display: flex; flex-wrap: wrap; gap: 6px; }
.zona .pct { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.sdot {
  width: 22px; height: 22px; border-radius: 7px; border: 0; padding: 0; position: relative;
  transition: transform .2s var(--ease-spring), box-shadow .2s; animation: pop .5s var(--ease-spring) both;
}
.sdot:hover { transform: scale(1.25); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor; z-index: 2; }
.sdot.st-pendiente { background: var(--st-pendiente); color: #b8c4d2; }
.sdot.st-en_commisary { background: var(--st-en_commisary); color: var(--st-en_commisary); }
.sdot.st-en_camino { background: var(--st-en_camino); color: var(--st-en_camino); }
.sdot.st-atrasado { background: var(--st-atrasado); color: var(--st-atrasado); }
.sdot.st-completado { background: var(--st-completado); color: var(--st-completado); }
.sdot.st-no_recibido, .sdot.st-incidencia { background: var(--st-problema); color: var(--st-problema); }
/* textura para problemas / atrasos: identidad no depende solo del color */
.sdot.st-no_recibido, .sdot.st-incidencia { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 5px); }
.sdot.st-atrasado { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 2px, transparent 2px 5px); }
@keyframes reveal { from { clip-path: inset(0 100% 0 0 round 6px); } to { clip-path: inset(0 0 0 0 round 6px); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; max-height: 520px; overflow: auto; margin: -4px -8px; padding: 4px 8px; }
.ev { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.ev:not(:last-child)::after { content: ''; position: absolute; left: 16px; top: 44px; bottom: -4px; width: 2px; background: var(--line); }
.ev .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.ev .ic .icon { width: 16px; height: 16px; }
.ev .t { font-size: 13.5px; }
.ev .m { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ev.creado .ic, .ev.cerrado .ic { background: #eef2f6; color: var(--text-2); }
.ev.recibido .ic { background: #e6f4fd; color: #1a6aa3; }
.ev.despachado .ic, .ev.correo .ic { background: #e5eefb; color: #1a4f9a; }
.ev.confirmado .ic { background: #e3f5ec; color: #0b6b3b; }
.ev.no_recibido .ic, .ev.incidencia .ic { background: #fbe6e6; color: #a32323; }

/* ---------- tabla ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg button .n { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.search { position: relative; }
.toolbar-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); text-wrap: pretty; }
.toolbar-hint .icon { width: 16px; height: 16px; }
.search input { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 14px 8px 36px; width: 220px; outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,144,226,.14); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
select.sel { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 32px 8px 14px; appearance: none; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5f78' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.table-wrap { overflow-x: auto; margin: 0 -24px -22px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
.t th:first-child, .t td:first-child { padding-left: 24px; }
.t th:last-child, .t td:last-child { padding-right: 24px; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr { transition: background .15s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: #f5f9fd; }
.t tbody tr:last-child td { border-bottom: 0; }
.t .store-cell b { display: block; font-weight: 600; }
.t .store-cell small { color: var(--text-3); }
.steps3 { display: inline-flex; align-items: center; gap: 4px; }
.steps3 i { width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center; background: #eef2f6; color: #9aabbd; }
.steps3 i .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.steps3 i.si { background: #e3f5ec; color: #0b6b3b; }
.steps3 i.no { background: #fbe6e6; color: #a32323; }
.steps3 em { width: 10px; height: 2px; background: var(--line-strong); border-radius: 2px; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); font-size: 14px; }
.empty .icon { display: block; width: 48px; height: 48px; padding: 12px; margin: 0 auto 12px; border-radius: 16px; background: var(--surface-2); color: var(--blue-deep); stroke-width: 1.8; }

/* ---------- drawer & modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 26, 44, .38); backdrop-filter: blur(3px); z-index: 40; opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); background: var(--surface); z-index: 41;
  border-radius: 24px; box-shadow: var(--shadow-3); display: flex; flex-direction: column; transform: translateX(110%); transition: transform .38s var(--ease-out);
}
.drawer.show { transform: none; }
.drawer-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h3 { font-family: 'DS Text'; font-size: 22px; font-weight: 750; letter-spacing: -.015em; }
.drawer-body { padding: 20px 24px; overflow: auto; flex: 1; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.kv > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.kv small { display: block; color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.kv b { font-weight: 600; }
.track { display: flex; flex-direction: column; gap: 0; margin: 4px 0 20px; }
.track-step { display: grid; grid-template-columns: 36px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.track-step:not(:last-child)::after { content: ''; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--line); }
.track-step.si:not(:last-child)::after { background: var(--st-completado); }
.track-step .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #eef2f6; color: #9aabbd; }
.track-step.si .ic { background: var(--st-completado); color: #fff; }
.track-step.no .ic { background: var(--st-problema); color: #fff; }
.track-step b { display: block; margin-top: 2px; }
.track-step small { color: var(--text-3); }
.track-step .note { margin-top: 6px; background: var(--surface-2); padding: 8px 10px; border-radius: 10px; font-size: 13px; color: var(--text-2); }
.photo { width: 100%; border-radius: 14px; margin-top: 8px; display: block; }

.modal {
  position: fixed; left: 50%; top: 50%; width: min(440px, calc(100vw - 32px)); background: var(--surface); z-index: 41; border-radius: 22px;
  box-shadow: var(--shadow-3); padding: 24px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .3s var(--ease-out), opacity .25s;
}
.modal.show { transform: translate(-50%, -50%); opacity: 1; }
.modal h3 { font-size: 19px; font-weight: 800; }
.modal p { color: var(--text-2); margin: 6px 0 16px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px; background: var(--surface); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,144,226,.14); }
textarea.input { resize: vertical; min-height: 80px; }

/* ---------- toast & tooltip ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink-900); color: #fff; padding: 11px 18px 11px 14px; border-radius: 14px; box-shadow: var(--shadow-3); display: flex; gap: 10px; align-items: center; font-weight: 500; animation: toastIn .35s var(--ease-spring); }
.toast .icon { color: #5ee3a1; }
.toast.err .icon { color: #ff8a8a; }
@keyframes toastIn { from { transform: translateY(14px) scale(.95); opacity: 0; } }
.tip {
  position: fixed; z-index: 70; pointer-events: none; background: var(--ink-900); color: #fff; font-size: 12.5px; padding: 8px 11px; border-radius: 10px;
  box-shadow: var(--shadow-3); max-width: 260px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip.show { opacity: 1; transform: none; }
.tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.tip span { color: #a9c1da; }

/* ---------- utilidades de layout ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title h2 { font-size: 19px; font-weight: 800; }
.section-title .count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.fade-in { animation: fadeUp .45s var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.skeleton { background: linear-gradient(90deg, #e8edf3 0%, #f4f7fa 50%, #e8edf3 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Commisary ---------- */
.day-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
.day-tab {
  border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px 16px; text-align: left; box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease-out), box-shadow .2s, border-color .2s; position: relative; overflow: hidden;
}
.day-tab:not([disabled]):hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.day-tab[disabled] { background: transparent; border: 1.5px dashed var(--line-strong); box-shadow: none; cursor: default; color: var(--text-3); }
.day-tab[disabled] .mini { visibility: hidden; }
.day-tab.on { border-color: transparent; background: linear-gradient(135deg, var(--ink-800), #0b4677); color: #fff; box-shadow: var(--shadow-3); }
.day-tab .d { font-family: 'DS Display'; font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.day-tab .today { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; background: var(--red); color: #fff; padding: 2px 7px; border-radius: 999px; font-family: 'DS Text'; }
.day-tab .s { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.day-tab.on .s { color: #b9d0e6; }
.day-tab .mini { height: 5px; border-radius: 3px; background: var(--line); margin-top: 12px; overflow: hidden; display: flex; gap: 2px; }
.day-tab.on .mini { background: rgba(255,255,255,.18); }
.day-tab .mini i { display: block; height: 100%; }
.trucks { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.truck { overflow: hidden; }
.truck-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.truck-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-deep)); box-shadow: 0 8px 18px -8px rgba(0,104,179,.8); }
.truck-ic .icon { width: 22px; height: 22px; }
.truck-head h3 { font-size: 18px; font-weight: 800; }
.truck-head small { color: var(--text-3); font-size: 12.5px; }
.truck-head .prog { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--text-2); }
.truck-head .prog b { font-family: 'DS Display'; font-size: 18px; color: var(--text); }
.truck-actions { display: flex; gap: 8px; padding: 0 20px 14px; }
.truck-actions .btn { flex: 1; justify-content: center; }
.stop { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--line); transition: background .2s; }
.stop:hover { background: #fafcfe; }
.stop .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.stop.all-done .n { background: var(--st-completado); color: #fff; border-color: transparent; }
.stop b { font-weight: 600; display: block; }
.stop small { color: var(--text-3); font-size: 12px; }
.stop small.warn { color: #a32323; }
.toggles { display: flex; gap: 6px; align-items: center; }
.tg {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--text-2);
  padding: 6px 11px; border-radius: 11px; font-size: 12.5px; font-weight: 600; transition: all .2s var(--ease-out);
}
.tg .icon { width: 15px; height: 15px; }
.tg:hover { border-color: var(--blue); color: var(--blue-deep); }
.tg.si { border-style: solid; border-color: transparent; background: var(--st-completado); color: #fff; box-shadow: 0 6px 14px -6px rgba(22,160,93,.7); }
.tg.si .icon { animation: pop .35s var(--ease-spring); }
.tg.no { border-style: solid; border-color: transparent; background: var(--st-problema); color: #fff; }
.tg[disabled] { opacity: .45; pointer-events: none; }
.envio-switch { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.envio-switch button { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 14px; text-align: left; box-shadow: var(--shadow-1); display: flex; gap: 10px; align-items: center; }
.envio-switch button.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,144,226,.16); }
.envio-switch b { display: block; font-size: 14px; }
.envio-switch small { color: var(--text-3); font-size: 12px; }

/* ---------- nuevo envío ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.step-card { margin-bottom: 20px; }
.step-card .card-head .sn { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-family: 'DS Display'; background: var(--ink-800); color: #fff; font-size: 14px; }
.mat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mat-suggest button { border: 1.5px dashed var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: all .2s; }
.mat-suggest button:hover { border-color: var(--blue); color: var(--blue-deep); border-style: solid; }
.mat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; background: var(--surface-2); animation: fadeUp .3s var(--ease-out); }
.mat-row input.name { border: 0; background: transparent; outline: none; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.stepper button { border: 0; background: none; width: 30px; height: 30px; display: grid; place-items: center; color: var(--text-2); }
.stepper input { width: 46px; text-align: center; border: 0; outline: none; font-weight: 700; background: transparent; font-variant-numeric: tabular-nums; }
.zone-block { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.zone-block header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.zone-block header b { font-size: 14px; }
.zone-block header small { color: var(--text-3); }
.zone-block header button { margin-left: auto; }
.store-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.schip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; transition: all .18s var(--ease-out); color: var(--text-2); }
.schip .icon { width: 14px; height: 14px; stroke-width: 2.6; opacity: .25; transform: scale(.7); transition: opacity .18s, transform .18s var(--ease-out); }
.schip.on { background: #e6f4fd; border-color: var(--blue); color: #0b4a7d; font-weight: 600; }
.schip.on .icon { opacity: 1; transform: none; }
.summary { position: sticky; top: 24px; overflow: hidden; }
.summary .sh { padding: 20px 22px; color: #fff; background: linear-gradient(135deg, var(--ink-800), #0b4677); position: relative; }
.summary .sh::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.10) 2px, transparent 2.4px); background-size: 18px 18px; mask-image: linear-gradient(100deg, transparent 20%, #000); }
.summary .sh * { position: relative; }
.summary .sh small { color: #9fd3ff; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.summary .sh h3 { font-family: 'DS Text'; font-weight: 750; font-size: 20px; line-height: 1.25; margin-top: 4px; min-height: 26px; letter-spacing: -.01em; }
.summary .sb { padding: 18px 22px; }
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.sum-row span { color: var(--text-2); }
.days-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 6px; }
.days-mini div { background: var(--surface-2); border-radius: 10px; padding: 8px 4px; text-align: center; }
.days-mini b { display: block; font-family: 'DS Display'; font-size: 18px; }
.days-mini small { font-size: 11px; color: var(--text-3); }
.how { margin-top: 14px; background: #f3f8fd; border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--text-2); display: flex; gap: 10px; }
.how .icon { color: var(--blue-deep); margin-top: 1px; }

/* ---------- correos ---------- */
.mail-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; height: calc(100vh - 150px); min-height: 520px; }
.mail-list { overflow: auto; padding: 8px; }
.mail-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 14px; border-radius: 14px; transition: background .15s; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.on { background: #e9f4fd; }
.mail-item .to { font-weight: 700; font-size: 13.5px; display: flex; gap: 8px; }
.mail-item .to time { margin-left: auto; font-weight: 500; color: var(--text-3); font-size: 12px; }
.mail-item .subj { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mail-view { display: flex; flex-direction: column; overflow: hidden; }
.mail-view header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mail-view header .meta { font-size: 13px; color: var(--text-2); }
.mail-view header .meta b { color: var(--text); }
.mail-view iframe { border: 0; flex: 1; width: 100%; background: #eef3f8; }
.pin-badge { font-family: 'DS Display'; font-weight: 800; letter-spacing: .2em; background: var(--surface-2); border: 1px dashed var(--line-strong); padding: 4px 10px; border-radius: 10px; }
.demo-note { display: flex; gap: 10px; align-items: center; background: #fff8e6; border: 1px solid #f5dd9c; color: #7a5300; border-radius: 14px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* ---------- tiendas ---------- */
.route-days { display: inline-flex; gap: 4px; }
.route-days i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: #f0f3f7; color: #b3c0cf; position: relative; }
.route-days i.on { background: #e6f4fd; color: #0b4a7d; }
.route-days i sub { position: absolute; right: -3px; bottom: -4px; font-size: 9px; background: var(--blue-deep); color: #fff; border-radius: 5px; padding: 0 3px; line-height: 13px; }
.inline-edit { border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 5px 8px; width: 100%; outline: none; transition: all .15s; }
.inline-edit:hover { border-color: var(--line-strong); background: var(--surface); }
.inline-edit:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(0,144,226,.14); }

@media (max-width: 1180px) {
  .two, .builder { grid-template-columns: 1fr; }
  .summary { position: static; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } /* sin esto, con poco contenido la barra superior se estira */
  /* barra superior compacta + navegación inferior tipo app */
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; min-width: 0; flex-direction: row; align-items: center; padding: 10px 16px; gap: 10px; overflow: visible; }
  .sidebar::after { display: none; }
  .brand { padding: 0; } .brand img { width: 32px; height: 32px; } .brand small, .nav-label, .sidebar-foot .user-card div { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .user-card { padding: 4px; gap: 4px; } .avatar { width: 32px; height: 32px; border-radius: 10px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; gap: 0; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--ink-900); box-shadow: 0 -10px 30px -12px rgba(8,26,44,.45);
  }
  .nav a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 7px 2px 6px; font-size: 11px; font-weight: 600; text-align: center; border-radius: 12px; }
  .nav a .icon { width: 20px; height: 20px; }
  .nav a.active { background: rgba(0,144,226,.2); }
  .nav .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav .lbl-s { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; font-size: 10px; padding: 0 5px; line-height: 16px; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .pipeline { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .day-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(136px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -16px 20px; padding: 2px 16px 8px; scrollbar-width: none; }
  .day-tab { scroll-snap-align: start; padding: 12px 14px; }
  .day-tab .d { font-size: 15.5px; }
  .stop { grid-template-columns: 26px 1fr; row-gap: 8px; padding: 12px 16px; }
  .stop .toggles { grid-column: 2; flex-wrap: wrap; }
  .truck-head, .truck-actions { padding-left: 16px; padding-right: 16px; }
  .mail-layout { grid-template-columns: 1fr; height: auto; }
  .mail-list { max-height: 340px; }
  .mail-view { min-height: 680px; scroll-margin-top: 72px; }
  .trucks, .envios { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar h1 { font-size: 24px; text-wrap: balance; }
  .topbar .actions { margin-left: 0; }
  .card-pad { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px -18px; }
  .t th:first-child, .t td:first-child { padding-left: 16px; }
  .t th:last-child, .t td:last-child { padding-right: 12px; }
  .card-head { flex-wrap: wrap; row-gap: 2px; }
  .card-head .hint { flex-basis: 100%; order: 3; }
  .card-head .right { margin-left: 0; }
  .zona { grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; }
  .zona .dots { grid-column: 1 / -1; grid-row: 2; padding-left: 26px; }
  .zona .zn::before { box-shadow: 0 0 0 4px var(--surface); }
  .zona:first-child::before { top: 20px; } .zona:last-child::before { bottom: auto; height: 20px; }
  /* en teléfono la tabla prioriza tienda, recorrido y estado */
  .t-envio th:nth-child(2), .t-envio td:nth-child(2), .t-envio th:nth-child(5), .t-envio td:nth-child(5) { display: none; }
  .t td { padding: 11px 8px; } .t th { padding: 10px 8px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .hero { padding: 22px 20px; border-radius: 22px; }
  .hero h2 { font-size: 25px; }
  .hero-stats { gap: 10px; }
  .hero-stat { padding: 14px; }
  .hero-stat .v { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
.seg-full { display: flex; width: 100%; flex-wrap: nowrap; }
.seg-full button { flex: 1; justify-content: center; white-space: nowrap; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* Solicitudes de tiendas */
.sol-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sol-link { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; overflow-wrap: anywhere; }
.sol-card { display: flex; flex-direction: column; gap: 10px; }
.sol-card h3 { font-family: 'DS Text'; font-size: 19px; font-weight: 750; line-height: 1.22; }
.sol-card .date { color: var(--text-3); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.sol-card.rechazada { opacity: .8; }
.sol-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.sol-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.sol-pill .icon { width: 14px; height: 14px; }
.sol-pill.nueva { background: #e6f4fd; color: var(--blue-deep); }
.sol-pill.aprobada { background: #e6f6ee; color: #0d6b3d; }
.sol-pill.rechazada { background: #fbe6e6; color: #a32323; }
.sol-motivo { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line-strong); background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--text-2); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.sol-foto { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.sol-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.sol-res { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.sol-res small { color: var(--text-3); }
.sol-res a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--blue-deep); }
.sol-qty { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; align-items: center; margin-bottom: 6px; }
.sol-qty span { overflow-wrap: anywhere; }

/* Usuarios */
.user-new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 170px auto; gap: 12px; align-items: end; }
.user-new .field { margin-bottom: 0; }
.users-tbl tr.inactive td { color: var(--text-3); }
.users-tbl .sel { min-width: 150px; }
.u-actions { text-align: right; white-space: nowrap; }
.u-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.u-st.ok { background: #e6f6ee; color: #0d6b3d; }
.u-st.temp { background: #fff8e6; color: #7a5300; }
.u-st.off { background: var(--surface-2); color: var(--text-3); }
.clave-box { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.clave-box code { flex: 1; font-size: 20px; font-weight: 700; letter-spacing: .08em; overflow-wrap: anywhere; }
.pw-forced { max-width: 440px; margin: 40px auto; }
@media (max-width: 860px) { .user-new { grid-template-columns: 1fr; } .u-actions { white-space: normal; } }
.user-card button + button { margin-left: 0; }

/* Ajustes QA solicitudes */
.sol-grid { align-items: start; }
.sol-mats { display: grid; gap: 4px; }
.sol-mats small { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 860px) {
  .sol-toolbar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .sol-toolbar .seg button { flex: none; }
  .nav.many a { font-size: 10px; letter-spacing: -.01em; }
}
@media (max-width: 420px) {
  .sol-actions { flex-direction: column-reverse; }
  .sol-actions .btn { width: 100%; justify-content: center; }
}
@media (max-width: 860px) {
  .sol-toolbar .seg { mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
/* Usuarios en celular: cada fila como tarjeta */
@media (max-width: 640px) {
  .users-tbl thead { display: none; }
  .users-tbl, .users-tbl tbody, .users-tbl tr, .users-tbl td { display: block; width: 100%; }
  .users-tbl tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .users-tbl td { padding: 4px 0; border: 0; display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; }
  .users-tbl td[data-l]::before { content: attr(data-l); color: var(--text-3); font-size: 12px; min-width: 64px; }
  .users-tbl .u-actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
}

/* Estado de los correos */
.mail-item .u-st { font-size: 11px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
.u-st.err { background: #fbe6e6; color: #a32323; }
.mail-err { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; color: #a32323; font-size: 13px; overflow-wrap: anywhere; }

/* "Ver como" (vista previa de otro rol para admins) */
.ver-como { display: block; margin-top: 2px; max-width: 100%; background: transparent; border: 0; padding: 0; color: #7f9bb8; font: inherit; font-size: 12px; cursor: pointer; }
.ver-como:hover, .ver-como:focus { color: #fff; outline: none; }
.ver-como option { color: #0f2742; }
.preview-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 8px 16px; background: #fff3d1; color: #6b4800; border-bottom: 1px solid #f0d58a; font-size: 13px; text-align: center; }
.preview-bar .icon { width: 16px; height: 16px; flex: none; }
.preview-bar button { border: 1px solid #d9b65a; background: #fff; color: #6b4800; border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.preview-bar button:hover { background: #fff8e6; }
body.previewing { padding-top: var(--pv-h, 40px); }
body.previewing .sidebar { top: var(--pv-h, 40px); height: calc(100vh - var(--pv-h, 40px)); }
.solo-movil { display: none; }
.ver-como-opts { display: grid; gap: 8px; }
.ver-como-opts .btn { justify-content: center; }
@media (max-width: 860px) {
  body.previewing .sidebar { height: auto; }
  .user-card .solo-movil { display: inline-flex; }
}

/* Reporte por tienda */
.rep-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.rep-filtros .search { flex: 1 1 220px; }
.rep-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.rep-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-1); min-width: 0; }
.rep-kpi .v { font-family: 'DS Display'; font-size: 30px; font-weight: 800; line-height: 1; color: var(--text); display: flex; align-items: baseline; gap: 6px; }
.rep-kpi .v small { font-size: 15px; font-weight: 600; color: var(--text-3); }
.rep-kpi .l { font-size: 13px; color: var(--text-2); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.rep-kpi .l .icon { width: 15px; height: 15px; color: var(--text-3); }
.rep-kpi.alerta { border-color: #f1c2c2; background: #fdf4f4; }
.rep-kpi.alerta .v { color: #a32323; }
.rep-graficos { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.rep-barras { display: grid; gap: 6px; }
.rep-barra { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 3px 0; font-size: 13.5px; }
.rep-barra .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rep-barra .b { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rep-barra .b i { display: block; height: 100%; background: var(--blue-deep); border-radius: 0 4px 4px 0; }
.rep-barra:hover .b i { filter: brightness(1.15); }
.rep-barra .v { font-weight: 700; color: var(--text); min-width: 3ch; text-align: right; }
.rep-zona { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.rep-zona .v { color: var(--text-2); min-width: 3ch; text-align: right; }
.rep-tabla th.num, .rep-tabla td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rep-tabla th .sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.rep-tabla th .sort.on { color: var(--text); }
.rep-tabla tr.click:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.warn-t { color: #8a5a00; font-weight: 700; }
.err-t { color: #a32323; font-weight: 700; }
.rep-drawer { width: min(560px, calc(100vw - 24px)); }
.rep-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 22px 0 10px; }
.rep-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 6px; }
.rep-item header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rep-item .muted { font-size: 12.5px; }
.rep-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.rep-pasos li { display: flex; gap: 6px; align-items: flex-start; }
.rep-pasos .icon { width: 15px; height: 15px; margin-top: 2px; }
.nav-mas { display: none; }
@media (max-width: 1100px) { .rep-graficos { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rep-kpi .v { font-size: 24px; }
  .nav.con-mas a[href="#/correos"], .nav.con-mas a[href="#/tiendas"], .nav.con-mas a[href="#/usuarios"] { display: none; }
  .nav-mas { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; font-size: 11px; font-weight: 600;
    background: none; border: 0; color: inherit; border-radius: 12px; position: relative; }
  .nav-mas.active { background: rgba(0,144,226,.2); }
  .nav-mas .icon { width: 20px; height: 20px; }
  .nav-mas .badge { position: absolute; top: 2px; left: calc(50% + 6px); font-size: 10px; padding: 0 5px; line-height: 16px; }
  .rep-zona { grid-template-columns: 84px minmax(0, 1fr) auto; }
}
@media (max-width: 640px) {
  /* Reporte en celular: cada tienda como tarjeta */
  .rep-tabla thead { display: none; }
  .rep-tabla, .rep-tabla tbody { display: block; }
  .rep-tabla tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .rep-tabla td { padding: 0 !important; border: 0 !important; text-align: left !important; display: flex; flex-direction: column; gap: 1px; }
  .rep-tabla td[data-l]::before { content: attr(data-l); font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
  .rep-tabla .store-cell, .rep-tabla .rep-est { grid-column: 1 / -1; min-width: 0 !important; }
  .rep-tabla .rep-ult { grid-column: span 3; flex-direction: row; gap: 6px; align-items: baseline; }
}

/* Tiene / Por llegar / Necesita */
.rep-kpi.aviso { border-color: #f1d99a; background: #fffaeb; }
.rep-kpi.aviso .v { color: #8a5a00; }
.rep-sub { display: flex; align-items: center; gap: 6px; }
.rep-sub .icon { width: 15px; height: 15px; }
.rep-item.necesita { border-color: #f1d99a; background: #fffcf3; }
.rep-nota { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.rep-nota .icon { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.rep-hist summary { cursor: pointer; color: var(--blue-deep); font-weight: 600; font-size: 13.5px; margin: 12px 0 10px; }
/* Tarjeta de usuario: el nombre (y el selector "Ver como") se encoge; los botones (salir, clave) nunca quedan fuera */
.user-card > div:not(.avatar) { flex: 1 1 auto; min-width: 0; }
.user-card > div:not(.avatar) b, .user-card > div:not(.avatar) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .ver-como { width: 100%; text-overflow: ellipsis; }
.user-card button { flex: none; }
.user-card #chpw { margin-left: auto; }
