/* NI Ventas · App layout & components — built on top of brand.css */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,24,48,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(143,212,222,.05), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--accent-alt); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--ink-100);
  border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
@media (max-width: 900px) {
  .sidebar { position: static; height: auto; }
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: var(--s-2) 0 var(--s-4);
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 100%;
  max-width: 150px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255,24,48,.4)) drop-shadow(0 0 10px rgba(42,216,255,.25));
}
.brand .b-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-item:hover { background: var(--ink-200); color: var(--fg); }
.nav-item.active {
  background: var(--ink-200);
  color: var(--fg);
  border-color: var(--border);
  box-shadow: inset 0 0 0 1px rgba(255,24,48,.15);
}
.nav-item .icon { width: 16px; text-align: center; opacity: .85; }
.nav-item .badge {
  margin-left: auto;
  background: var(--neon-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  min-width: 18px;
  text-align: center;
  box-shadow: var(--glow-red-sm);
}
.nav-item .badge.cyan { background: var(--neon-cyan); color: var(--ink-050); box-shadow: var(--glow-cyan-sm); }
.sidebar-foot {
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-faint);
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
}
.sidebar-foot .status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
/* Badge "✨ Generando IA…" de las brief-cards del kanban. Antes cada card
   inyectaba su propio <style> con esta @keyframes (N cards = N <style> idénticos). */
@keyframes nv-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ============ MAIN ============ */
.main { padding: var(--s-5) var(--s-6); max-width: 1400px; }
@media (max-width: 900px) { .main { padding: var(--s-4); } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--s-5);
  gap: var(--s-4);
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: var(--t-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  text-transform: uppercase;
  color: var(--fg);
  margin: 0;
}
.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(143,212,222,.35);
  margin-bottom: 8px;
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgba(143,212,222,.25);
  border-radius: var(--r-pill);
  background: rgba(143,212,222,.06);
}
.page-head .actions { display: flex; gap: var(--s-2); }

/* ============ BUTTONS ============ */
.btn {
  border: 1px solid var(--border);
  background: var(--ink-200);
  color: var(--fg);
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.btn:hover { background: var(--ink-300); border-color: var(--border-strong); }
.btn-primary {
  background: var(--neon-red);
  color: white;
  border-color: var(--neon-red);
}
.btn-primary:hover { background: var(--neon-red-glow); border-color: var(--neon-red-glow); box-shadow: var(--glow-red-sm); }
.btn-cyan {
  background: var(--neon-cyan);
  color: var(--ink-050);
  border-color: var(--neon-cyan);
}
.btn-cyan:hover { background: var(--neon-cyan-glow); box-shadow: var(--glow-cyan-sm); }
.btn-ghost { background: transparent; }
.btn-ghost.btn-cyan { background: var(--neon-cyan); color: var(--ink-050); border-color: var(--neon-cyan); }
.btn .icon { font-size: 14px; }
.btn-icon { padding: 9px 10px; }
.btn-icon svg { display: block; }

/* ============ CARDS ============ */
/* ===== Panel de Automatizaciones WhatsApp (Fase 1, read-only) ===== */
.auto-banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; line-height: 1.4; }
.auto-banner.warn { background: rgba(255,176,32,.12); border: 1px solid rgba(255,176,32,.4); color: #ffce7a; }
.auto-group { margin-bottom: 24px; }
.auto-group-h { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted, #8a93a3); margin: 0 0 12px; font-weight: 600; }
.auto-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.auto-card { padding: 14px 16px; }
.auto-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.auto-name { font-weight: 600; font-size: 14px; color: var(--fg, #e8eaed); }
.auto-badge { font-size: 9.5px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.auto-badge.on   { background: rgba(46,213,115,.16); color: #2ed573; }
.auto-badge.live { background: rgba(0,210,255,.16); color: #00d2ff; }
.auto-badge.done { background: rgba(120,144,156,.18); color: #b0bec5; }
.auto-badge.warn { background: rgba(255,176,32,.16); color: #ffb020; }
.auto-badge.off  { background: rgba(255,71,87,.14); color: #ff6b78; }
.auto-badge.idle { background: rgba(120,144,156,.12); color: #90a4ae; }
.auto-desc { font-size: 12.5px; color: var(--muted, #8a93a3); line-height: 1.45; margin-bottom: 8px; }
.auto-trigger { font-size: 11px; color: var(--muted, #8a93a3); opacity: .85; margin-bottom: 10px; }
.auto-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-stat { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--fg, #e8eaed); }
.auto-stat b { font-weight: 700; }
.auto-foot { margin-top: 16px; font-size: 11px; color: var(--muted, #8a93a3); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  box-shadow: var(--inner-card);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
  gap: var(--s-2);
}
.card-h h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: var(--tr-snug);
  color: var(--fg);
  text-transform: uppercase;
}
.card-h .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  letter-spacing: var(--tr-wide);
}

/* ============ KPI GRID ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at center, rgba(255,24,48,.08), transparent 70%);
  pointer-events: none;
}
.kpi.cyan::before { background: radial-gradient(circle at center, rgba(143,212,222,.08), transparent 70%); }
.kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: var(--tr-tight);
  color: var(--fg);
  line-height: 1;
}
.kpi-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 6px;
  color: var(--fg-faint);
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--neon-red); }

/* ============ TABLE ============ */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-toolbar input,
.table-toolbar select {
  background: var(--ink-100);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur-fast);
}
.table-toolbar input:focus,
.table-toolbar select:focus { border-color: var(--neon-cyan); }
.table-toolbar input[type=text] { min-width: 200px; }
.table-toolbar .right { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); letter-spacing: var(--tr-wide); }

table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.t th, table.t td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.t th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
  font-weight: 500;
  background: var(--ink-100);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.t th:hover { color: var(--fg); }
table.t th .sort { font-size: 9px; opacity: .5; margin-left: 4px; }
table.t th.sorted .sort { opacity: 1; color: var(--neon-cyan); }
table.t tr { transition: background var(--dur-fast); }
table.t tbody tr:hover { background: var(--ink-100); cursor: pointer; }
table.t td.num { font-family: var(--font-mono); text-align: right; }
table.t td.cliente { font-weight: 600; }
.empty-row td { text-align: center; color: var(--fg-faint); padding: 40px; font-style: italic; }

/* ============ PILL / BADGE ============ */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--ink-100);
  color: var(--fg-muted);
  white-space: nowrap;
}
.pill.green { background: rgba(74,222,128,.12); color: #6ef0a0; border-color: rgba(74,222,128,.3); }
.pill.amber { background: rgba(255,184,77,.12); color: #ffc97a; border-color: rgba(255,184,77,.3); }
.pill.red   { background: rgba(255,24,48,.12); color: #ff5a6e; border-color: rgba(255,24,48,.35); }
.pill.cyan  { background: rgba(143,212,222,.12); color: var(--neon-cyan); border-color: rgba(143,212,222,.3); }
.pill.muted { background: var(--ink-200); color: var(--fg-subtle); }
.pill.blue   { background: rgba(80,140,255,.14); color: #8ab4ff; border-color: rgba(80,140,255,.32); }
.pill.violet { background: rgba(155,92,255,.14); color: #c4a0ff; border-color: rgba(155,92,255,.32); }

.tag-d30 { background: rgba(74,222,128,.15); color: #6ef0a0; }
.tag-d60 { background: rgba(255,184,77,.15); color: #ffc97a; }
.tag-d90 { background: rgba(255,24,48,.18); color: #ff5a6e; }

/* ============ DRAWER ============ */
.drawer-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
  z-index: 50;
}
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(540px, 92vw);
  background: var(--ink-100);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-out);
  z-index: 60;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-h {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  position: sticky; top: 0; background: var(--ink-100); z-index: 1;
}
.drawer-h h2 { margin: 0; font-family: var(--font-display); font-size: 22px; letter-spacing: var(--tr-tight); text-transform: uppercase; color: var(--fg); }
.drawer-h .close { background: transparent; border: 1px solid var(--border); color: var(--fg); width: 32px; height: 32px; border-radius: var(--r-sm); font-size: 16px; line-height: 1; }
.drawer-h .close:hover { border-color: var(--neon-red); color: var(--neon-red); }
.drawer-body { padding: var(--s-5); flex: 1; }
.drawer-section { margin-bottom: var(--s-5); }
.drawer-section h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0 0 var(--s-3);
}
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--fg-subtle); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tr-wide); padding-top: 2px; }
.kv dd { margin: 0; color: var(--fg); }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}
.tl-item { position: relative; padding-bottom: var(--s-4); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-200);
  border: 2px solid var(--border-strong);
}
.tl-item.done::before { background: var(--success); border-color: var(--success); box-shadow: 0 0 8px rgba(74,222,128,.5); }
.tl-item.future::before { background: var(--ink-200); border-color: var(--border); }
.tl-item.now::before { background: var(--neon-red); border-color: var(--neon-red); box-shadow: var(--glow-red-sm); }
.tl-date { font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); letter-spacing: var(--tr-wide); text-transform: uppercase; }
.tl-title { font-size: 14px; font-weight: 600; margin: 2px 0; color: var(--fg); }
.tl-desc { font-size: 13px; color: var(--fg-muted); }

/* ============ CHARTS ============ */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .chart-grid { grid-template-columns: 1fr; } }

.chart-canvas {
  width: 100%;
  height: 240px;
  position: relative;
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink-100);
  border: 1px solid var(--neon-red);
  box-shadow: var(--glow-red-sm);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  z-index: 5;
  white-space: nowrap;
}
.chart-tooltip .tt-d { color: var(--fg-subtle); font-size: 10px; text-transform: uppercase; }
.chart-tooltip .tt-v { color: var(--fg); font-weight: 700; font-size: 13px; margin-top: 2px; }
.chart-tooltip .tt-sub { color: var(--neon-cyan); font-size: 10px; margin-top: 2px; }
.chart-svg .hover-line { stroke: var(--neon-red); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.chart-svg .hover-dot { fill: var(--neon-red); stroke: var(--bg-card); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(255,24,48,.8)); }
.chart-svg .hover-capture { cursor: crosshair; }
.chart-svg .wk-seg { transition: opacity var(--dur-fast); cursor: pointer; }
.chart-svg .wk-seg:hover { opacity: .85; filter: drop-shadow(0 0 6px currentColor); }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--fg-muted); margin-top: 2px; }
.chart-tooltip .tt-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-legend-row { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; padding: 0 4px; font-size: 11px; color: var(--fg-muted); }
.chart-legend-row .lg-i { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend-row .lg-d { width: 10px; height: 10px; border-radius: 2px; }

/* ============ CHART CAROUSEL ============ */
.chart-card .card-h { gap: var(--s-3); }
.chart-nav { display: flex; align-items: center; gap: 8px; }
.chart-arrow {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  padding: 0;
  transition: all var(--dur-fast);
}
.chart-arrow:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--glow-cyan-sm); }
.chart-dots { display: inline-flex; gap: 6px; }
.chart-dots .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-400);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.chart-dots .dot.active { background: var(--neon-red); box-shadow: var(--glow-red-sm); width: 18px; border-radius: 4px; }
.chart-dots .dot:hover:not(.active) { background: var(--ink-600); }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-svg .axis { stroke: var(--border); stroke-width: 1; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; opacity: .5; }
.chart-svg .label { fill: var(--fg-subtle); font-family: var(--font-mono); font-size: 10px; }
.chart-svg .bar { fill: var(--neon-cyan); }
.chart-svg .bar:hover { fill: var(--neon-cyan-glow); }
.chart-svg .line { fill: none; stroke: var(--neon-red); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(255,24,48,.5)); }
.chart-svg .point { fill: var(--neon-red); }
.chart-svg .area { fill: url(#redGrad); opacity: .85; }
.donut-cy { stroke-width: 18; fill: none; transform: rotate(-90deg); transform-origin: center; }
.donut-center { font-family: var(--font-display); font-size: 22px; fill: var(--fg); text-anchor: middle; dominant-baseline: central; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: var(--s-2); font-size: 11px; color: var(--fg-muted); }
.legend .lg-i { display: flex; align-items: center; gap: 6px; }
.legend .lg-d { width: 8px; height: 8px; border-radius: 50%; }

/* ============ ALERTS / SECTIONS ============ */
.alerts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-5); }
@media (max-width: 900px) { .alerts-grid { grid-template-columns: 1fr; } }

.alert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.alert-card .h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-3);
  gap: 8px;
}
.alert-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tr-snug);
}
.alert-card.red h3 { color: var(--neon-red); }
.alert-card.cyan h3 { color: var(--neon-cyan); }
.alert-card .count {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
}
.alert-list { list-style: none; padding: 0; margin: 0; max-height: 240px; overflow-y: auto; }
.alert-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.alert-list li:last-child { border-bottom: 0; }
.alert-list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-weight: 500; }
.alert-list .when { font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); }
.alert-list .go {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 4px 9px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--tr-wide);
}
.alert-list .go:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* ============ STATE ============ */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-subtle);
}
.loading .spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  background: rgba(255,24,48,.08);
  border: 1px solid rgba(255,24,48,.3);
  color: var(--neon-red-glow);
  padding: var(--s-4);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink-200);
  color: var(--fg);
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan-sm);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ MODAL (alert/confirm con estética NEON) ============ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease-out);
  padding: var(--s-4);
}
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--ink-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), var(--inner-card);
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(.97);
  transition: transform .18s var(--ease-out);
}
.modal-bg.open .modal { transform: translateY(0) scale(1); }
.modal--warn { border-color: var(--neon-red); box-shadow: 0 20px 60px rgba(0,0,0,.55), var(--glow-red-sm); }
.modal--success, .modal--login { border-color: var(--neon-cyan); box-shadow: 0 20px 60px rgba(0,0,0,.55), var(--glow-cyan-sm); }
.modal-h {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-h h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: var(--tr-snug);
  text-transform: uppercase;
  color: var(--fg);
}
.modal--warn .modal-h h3 { color: var(--neon-red); }
.modal--success .modal-h h3, .modal--login .modal-h h3 { color: var(--neon-cyan); }
.modal-body {
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
  overflow-y: auto;
  flex: 1;
  word-break: break-word;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--ink-100);
}

/* ============ Contact pill (Presupuestos: canal + tel/usuario) ============ */
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--ink-100);
  white-space: nowrap;
}
.contact-pill .contact-icon { font-size: 11px; line-height: 1; }
.contact-pill.wpp { border-color: rgba(74, 222, 128, .35); color: #b8e7c5; }
.contact-pill.ig  { border-color: rgba(255, 24, 48, .4); color: var(--neon-red-glow); }

/* Cell con contacto + botón FUP al lado */
.contact-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(74, 222, 128, .45);
  background: rgba(74, 222, 128, .08);
  color: #4ade80;
  text-decoration: none;
  cursor: pointer;
  transition: all .12s ease;
  user-select: none;
}
.fup-btn:hover {
  background: #25D366;
  color: #000;
  border-color: #25D366;
  box-shadow: 0 0 8px rgba(37, 211, 102, .4);
  transform: translateY(-1px);
}
.fup-btn:active { transform: translateY(0); }

/* ============ PERIOD SELECTOR (dashboard) ============ */
.period-selector {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.period-selector .ps-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
  padding-right: var(--s-2);
  border-right: 1px solid var(--border);
}
.period-selector .ps-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.ps-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.ps-chip:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}
.ps-chip.active {
  background: rgba(143,212,222,.12);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--glow-cyan-sm);
}
.period-selector .ps-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  margin-left: auto;
}

/* ============ USER PICKER ============ */
.user-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.user-pick-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-faint);
}
.user-pick-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.user-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 4px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: var(--tr-wide);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.user-chip:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.user-chip.active {
  background: var(--neon-cyan);
  color: var(--ink-050);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan-sm);
  font-weight: 700;
}
.user-chip.add { color: var(--fg-faint); padding: 4px 8px; }
.admin-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 8px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--ink-050);
  background: var(--neon-red);
  border-radius: var(--r-pill);
  font-weight: 700;
  box-shadow: var(--glow-red-sm);
}

/* ============ COTIZADOR ============ */
.cot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--s-3);
  margin-top: var(--s-2);
}
@media (max-width: 900px) { .cot-grid { grid-template-columns: 1fr 1fr; } }
.cot-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.cot-grid input, .cot-grid select {
  background: var(--ink-100);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.cot-grid input:focus, .cot-grid select:focus { border-color: var(--neon-cyan); }
.cot-results { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.cot-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); margin-bottom: var(--s-2); letter-spacing: var(--tr-wide); }
.cot-meta b { color: var(--fg); }
.cot-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-2); }
.cot-result {
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.cot-result.muted { opacity: .5; }
.cot-result .lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing: var(--tr-xwide); text-transform: uppercase; color: var(--fg-subtle); }
.cot-result .val { font-family: var(--font-display); font-size: 22px; color: var(--fg); margin-top: 4px; }

.cot-params-group { margin-bottom: var(--s-3); }
.cot-params-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 8px;
}
.cot-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-2);
}
.cot-param {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
.cot-param input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  padding: 4px 0;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
}
.cot-param input:focus { border-bottom-color: var(--neon-cyan); }

/* ============ HEATMAP ============ */
.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(1, 1fr);
  gap: 3px;
  padding: 4px 0;
}
.hm-cell {
  width: 100%;
  height: 28px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.04);
}

/* ============ SEGUIMIENTOS ============ */
.seg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.seg-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  text-align: left;
}
.seg-tab:hover { border-color: var(--neon-cyan); }
.seg-tab.active { border-color: var(--neon-red); box-shadow: var(--glow-red-sm); }
.seg-tab-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tr-snug);
  color: var(--fg);
}
.seg-tab-count {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  color: var(--fg);
}
.seg-tab.active .seg-tab-count { color: var(--neon-red); }

.seg-help {
  font-size: 12px;
  color: var(--fg-subtle);
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: var(--s-3);
  font-family: var(--font-mono);
  letter-spacing: var(--tr-wide);
}
.seg-help b { color: var(--fg-muted); }

.seg-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}

.seg-list { display: flex; flex-direction: column; gap: var(--s-2); }
.seg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--dur-fast);
}
.seg-card.tp-overdue { border-left-color: var(--neon-red); }
.seg-card.tp-due { border-left-color: var(--warning); }
.seg-card.tp-future { border-left-color: var(--ink-400); }
.seg-card.tp-done { border-left-color: var(--success); opacity: .7; }

.seg-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.seg-cliente {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}
.seg-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 3px;
  letter-spacing: var(--tr-wide);
}
.seg-current {
  text-align: right;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--ink-100);
  border: 1px solid var(--border);
  min-width: 90px;
}
.seg-current.tp-overdue { background: rgba(255,24,48,.08); border-color: rgba(255,24,48,.35); }
.seg-current.tp-due { background: rgba(255,184,77,.1); border-color: rgba(255,184,77,.35); }
.seg-current.tp-future { background: var(--ink-100); }
.seg-current.tp-done { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.35); }
.seg-current-id {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--tr-tight);
  color: var(--fg);
}
.seg-current-when {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-top: 2px;
}
.seg-current.tp-overdue .seg-current-when { color: var(--neon-red); }
.seg-current.tp-due .seg-current-when { color: var(--warning); font-weight: 700; }

.seg-tps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  border: 1px solid var(--border);
  background: var(--ink-100);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
  user-select: none;
}
.tp-pill:hover { border-color: var(--neon-cyan); }
.tp-pill .tp-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 10px;
  background: var(--ink-300);
  color: var(--fg);
}
.tp-pill .tp-id { font-weight: 700; color: var(--fg); }
.tp-pill .tp-date { color: var(--fg-subtle); }
.tp-pill.tp-done { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.4); }
.tp-pill.tp-done .tp-check { background: var(--success); color: var(--ink-050); }
.tp-pill.tp-done .tp-id, .tp-pill.tp-done .tp-date { color: var(--success); text-decoration: line-through; }
.tp-pill.tp-overdue { background: rgba(255,24,48,.08); border-color: rgba(255,24,48,.4); }
.tp-pill.tp-overdue .tp-check { background: var(--neon-red); color: white; }
.tp-pill.tp-due { background: rgba(255,184,77,.1); border-color: rgba(255,184,77,.45); }
.tp-pill.tp-due .tp-check { background: var(--warning); color: var(--ink-050); }
.tp-pill.is-current { box-shadow: 0 0 0 1px var(--neon-red); }
.tp-pill.is-current.tp-due { box-shadow: 0 0 0 1px var(--warning); }

.seg-actions {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  flex-wrap: wrap;
}

/* ============ USER PICKER ============ */
.user-picker-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  /* DEBE quedar por DEBAJO del modal de login (.modal-bg z-index:300) y de los
     toasts (.toast z-index:200). Cuando no hay sesión, este overlay es lo único
     que render() pinta en #app, así que no necesita z-index alto. Antes estaba
     en 9999 y tapaba por completo el prompt de contraseña: el modal se creaba
     y se abría, pero quedaba DETRÁS del overlay opaco → "toco el usuario y no
     aparece para poner la contraseña". Bug latente que solo aparecía al loguear
     sin token (después de limpiar cookies). */
  z-index: 100;
}
.user-picker-box {
  text-align: center;
  padding: var(--s-6);
}
.user-pick-big {
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.user-pick-big:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-cyan-sm);
}

/* ============ CHAT (WhatsApp Web style) ============ */
/* When chat is active, lock the entire app shell to viewport height */
.app.app--chat {
  /* --vvh la setea syncChatViewportHeight() al alto del viewport REALMENTE
     visible en móvil. El teclado virtual NO achica 100vh → el input quedaría
     tapado detrás del teclado. Fallback a 100vh en desktop / browsers sin
     VisualViewport (sin regresión respecto al comportamiento previo). */
  height: var(--vvh, 100vh);
  max-height: var(--vvh, 100vh);
  overflow: hidden;
}
/* Fullscreen chat: hide sidebar, take full width */
.app.app--chat-full { grid-template-columns: 1fr; }
.app.app--chat-full > .sidebar { display: none; }

/* Fullscreen toggle — NEON dashboard aesthetic, lives top-left of chat header */
.chat-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg-subtle);
  cursor: pointer;
  padding: 0;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.chat-fullscreen-btn:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan-deep);
  box-shadow: var(--glow-cyan-sm);
}
.app--chat-full .chat-fullscreen-btn {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan-deep);
  box-shadow: var(--glow-cyan-sm);
}
.main.main--chat {
  padding: 0 !important;
  max-width: none !important;
  overflow: hidden;
  height: 100%;
}
.chat-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}
.chat-layout > .chat-contacts { flex: 0 0 30%; max-width: 40%; }
.chat-layout > .chat-main { flex: 1 1 auto; }
@media (max-width: 900px) { .chat-layout { flex-direction: column; } .chat-layout > .chat-contacts { flex: none; max-width: none; } }

/* -- Scrollbar WA-style for chat panels -- */
.chat-contact-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-contact-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-contact-list::-webkit-scrollbar-thumb { background: #374045; border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: #374045; border-radius: 3px; }

/* -- Left panel (contacts) -- */
.chat-contacts {
  background: #111b21;
  border-right: 1px solid #222d34;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.chat-contacts-header {
  padding: 10px 10px 10px 16px;
  background: #202c33;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 59px;
  flex-shrink: 0;
}
.chat-contacts-header .btn-send {
  background: transparent;
  border: none;
  color: #aebac1;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .15s, background .15s;
  padding: 0;
  font-size: 14px;
}
.chat-contacts-header .btn-send:hover { color: #e9edef; background: rgba(255,255,255,.06); }
.chat-contacts-header .btn-send.active { color: var(--neon-cyan); background: rgba(143, 212, 222, .12); }
.chat-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--fg-subtle);
  font-size: 13px;
  line-height: 1.5;
}
.chat-empty-emoji { font-size: 36px; margin-bottom: 8px; opacity: .5; }
.archived-banner {
  background: rgba(143, 212, 222, .08);
  border-bottom: 1px solid rgba(143, 212, 222, .2);
  color: var(--neon-cyan);
  font-size: 11px;
  padding: 6px 12px;
  text-align: center;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.chat-contacts-header .btn-send svg { width: 18px; height: 18px; }
.chat-contacts-search {
  padding: 7px 10px;
  background: #111b21;
  flex-shrink: 0;
}
.chat-contacts-search input {
  width: 100%;
  background: #202c33;
  border: none;
  color: #e9edef;
  padding: 7px 12px 7px 32px;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238696a0' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px;
}
.chat-contacts-search input:focus { background-color: #2a3942; }
.chat-contacts-search input::placeholder { color: #8696a0; }
.chat-contact-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.chat-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  height: 72px;
  cursor: pointer;
  transition: background .15s;
  /* === PERF: content-visibility skipea layout/paint de items off-screen ===
     El sidebar tiene 1000+ contactos pero solo ~10 son visibles. Sin esto,
     CUALQUIER reflow forzado (tipear en el textarea, polling refresh, etc)
     re-mide los 1000 items → typing lag de cientos de ms.
     Con content-visibility:auto el browser saltea layout/paint de los
     contactos fuera del viewport. contain-intrinsic-size le dice al browser
     qué espacio reservar (alto fijo 72px), así el scrollbar queda correcto.
     Da hasta 7x mejora de rendering según web.dev. */
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}
.chat-contact:hover { background: #202c33; }
.chat-contact.active { background: #2a3942; }
/* Bottom border via inner wrapper */
.chat-contact-info {
  flex: 1;
  min-width: 0;
  border-bottom: 1px solid #222d34;
  padding: 13px 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.chat-contact.active .chat-contact-info,
.chat-contact:last-child .chat-contact-info { border-bottom-color: transparent; }

/* Avatar — polished WA Web style */
.chat-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.chat-avatar-text {
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.chat-avatar-icon {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-contact-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.chat-contact-name {
  font-size: 16px;
  color: #e9edef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.chat-contact-subname {
  font-size: 12px;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -1px;
}
/* Unread: bold name + green timestamp */
.chat-contact.has-unread .chat-contact-name { font-weight: 600; }
.chat-contact-time {
  font-size: 12px;
  color: #8696a0;
  flex-shrink: 0;
}
.chat-contact-time.unread { color: #00a884; }
.chat-contact-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.chat-contact.has-unread .chat-contact-preview { color: #d1d7db; }
.chat-contact-preview {
  font-size: 14px;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.chat-contact-unread {
  background: #00a884;
  color: #111b21;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* -- Right panel (conversation) -- */
.chat-main {
  display: flex;
  flex-direction: column;
  background: #0b141a;
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
/* WA doodle wallpaper */
.chat-main::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .06;
  background-color: #0d1418;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:%23fff;opacity:.4%7D%3C/style%3E%3C/defs%3E%3Cpath class='a' d='M20 5l3 3-3 3-3-3z'/%3E%3Ccircle class='a' cx='80' cy='15' r='2'/%3E%3Cpath class='a' d='M150 8l2 4h-4z'/%3E%3Crect class='a' x='38' y='50' width='4' height='4' rx='1'/%3E%3Ccircle class='a' cx='120' cy='55' r='1.5'/%3E%3Cpath class='a' d='M170 45l3 3-3 3-3-3z'/%3E%3Ccircle class='a' cx='15' cy='95' r='2'/%3E%3Cpath class='a' d='M60 90l2 4h-4z'/%3E%3Crect class='a' x='98' y='88' width='4' height='4' rx='1'/%3E%3Ccircle class='a' cx='160' cy='100' r='1.5'/%3E%3Cpath class='a' d='M30 140l3 3-3 3-3-3z'/%3E%3Ccircle class='a' cx='90' cy='135' r='2'/%3E%3Cpath class='a' d='M140 148l2 4h-4z'/%3E%3Crect class='a' x='178' y='140' width='4' height='4' rx='1'/%3E%3Ccircle class='a' cx='50' cy='180' r='1.5'/%3E%3Cpath class='a' d='M110 185l3 3-3 3-3-3z'/%3E%3Crect class='a' x='168' y='182' width='3' height='3' rx='1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}
.chat-main > * { position: relative; z-index: 1; }

.chat-header {
  padding: 10px 16px;
  background: #202c33;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 59px;
  flex-shrink: 0;
}
.chat-header-name {
  font-size: 16px;
  font-weight: 500;
  color: #e9edef;
}
.chat-header-phone {
  font-size: 13px;
  color: #8696a0;
  margin-top: 1px;
}
.chat-header-meta {
  font-size: 12px;
  color: #8696a0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-loading .spinner {
  width: 30px; height: 30px;
  border-width: 3px;
  display: inline-block;
  border-style: solid;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Messages area */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 63px 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
@media (max-width: 1100px) { .chat-messages { padding: 12px 16px 4px; } }
.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8696a0;
  font-size: 14px;
}
.chat-load-older-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 0 8px;
}
.chat-load-older-btn {
  background: rgba(143,212,222,.08);
  border: 1px solid rgba(143,212,222,.25);
  color: var(--accent-cyan, #8FD4DE);
  padding: 8px 18px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.chat-load-older-btn:hover:not(:disabled) {
  background: rgba(143,212,222,.18);
  border-color: var(--accent-cyan, #8FD4DE);
  transform: translateY(-1px);
}
.chat-load-older-btn:disabled { opacity: .6; cursor: wait; }

/* Date separator pill */
.chat-date-sep {
  text-align: center;
  padding: 6px 0 2px;
  align-self: center;
}
.chat-date-sep span {
  display: inline-block;
  background: #182229;
  color: rgba(233,237,239,.75);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 7px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
}

/* Bubbles */
.chat-msg {
  max-width: 65%;
  padding: 4px 7px 6px 9px;
  border-radius: 7.5px;
  font-size: 14.2px;
  line-height: 19px;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
  margin-bottom: 1px;
  clear: both;
  /* pan-y: el scroll vertical sigue funcionando, pero el gesto HORIZONTAL queda
     para nuestro handler (swipe-derecha para citar) en vez de que el navegador
     lo trate como scroll/atrás. Clave para que el swipe ande en mobile. */
  touch-action: pan-y;
  /* === PERF: idem .chat-contact — skipear layout de bubbles off-screen ===
     200+ bubbles en el listado, ~10 visibles. contain-intrinsic-size estima
     altura promedio (text: 50px) — el browser ajusta si el bubble entra al
     viewport. Bubbles más altos (imagen/audio/video) tienen su propia altura
     y el layout se corrige al hacer scroll. */
  content-visibility: auto;
  contain-intrinsic-size: auto 50px;
}
.chat-msg.inbound {
  align-self: flex-start;
  background: #202c33;
  color: #e9edef;
}
.chat-msg.inbound.has-tail {
  border-top-left-radius: 0;
  margin-top: 4px;
}
.chat-msg.inbound.has-tail::before {
  content: '';
  position: absolute;
  top: 0; left: -8px;
  width: 0; height: 0;
  border-width: 0 8px 8px 0;
  border-style: solid;
  border-color: transparent #202c33 transparent transparent;
}
.chat-msg.outbound {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
}
.chat-msg.outbound.has-tail {
  border-top-right-radius: 0;
  margin-top: 4px;
}
.chat-msg.outbound.has-tail::before {
  content: '';
  position: absolute;
  top: 0; right: -8px;
  width: 0; height: 0;
  border-width: 0 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent #005c4b;
}

/* Message text */
.chat-msg-body { white-space: pre-wrap; word-break: break-word; }

/* Media in bubbles */
.chat-msg-media {
  margin: -1px -3px 3px -5px;
}
.chat-msg.has-media {
  padding: 3px 3px 4px 3px;
}
.chat-msg.has-media .chat-msg-body {
  padding: 0 6px;
}
.chat-msg.has-media .chat-msg-footer {
  padding-right: 4px;
}
.chat-msg-media img {
  max-width: 330px;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  display: block;
}
.chat-msg-media .img-loading {
  width: 330px;
  height: 200px;
  background: rgba(0,0,0,.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8696a0;
  font-size: 13px;
}

/* Audio player WA-style */
.chat-msg-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 2px;
  min-width: 240px;
}
.chat-msg-audio .audio-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.chat-msg-audio .audio-play-btn {
  position: absolute;
  bottom: -2px; right: -4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #00a884;
  border: none;
  color: #111b21;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.chat-msg-audio .audio-wave {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-msg-audio .audio-bars {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 26px;
}
.chat-msg-audio .audio-bar {
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.4);
  min-height: 3px;
}
.chat-msg-audio .audio-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-msg-audio .audio-dur {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  font-variant-numeric: tabular-nums;
  flex: 1;
}
.chat-msg-audio .audio-speed,
.chat-msg-audio .audio-toggle-transcript {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.55);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  height: 20px;
  line-height: 1;
  transition: color .12s, border-color .12s, background .12s;
}
.chat-msg-audio .audio-speed:hover,
.chat-msg-audio .audio-toggle-transcript:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}
.chat-msg-audio .audio-toggle-transcript.active {
  color: var(--neon-cyan);
  background: rgba(143, 212, 222, .12);
  border-color: var(--neon-cyan);
}
.chat-msg-audio audio { display: none; }
/* Timestamp inline dentro del audio-row, alineado a la derecha (estilo WA Web). */
.chat-msg-audio-bubble .audio-row .chat-msg-footer {
  margin: 0 0 0 auto;
  float: none;
  padding-top: 0;
  flex-shrink: 0;
}
.chat-msg-audio .audio-toggle-transcript {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
}
/* Caption de imagen: padding correcto para que no se pegue al borde. */
.chat-msg.has-media .chat-msg-body {
  padding: 6px 6px 0;
}
.chat-msg-transcript {
  font-size: 12.5px;
  color: rgba(233,237,239,.65);
  font-style: italic;
  padding: 2px 4px 0;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 4px;
}

/* Video */
.chat-msg-video {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(0,0,0,.15);
  border-radius: 6px;
  min-width: 200px;
}
.chat-msg-video .v-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,168,132,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00a884;
  font-size: 18px;
  flex-shrink: 0;
}
.chat-msg-video a { color: #53bdeb; font-size: 13px; }

/* Document */
.chat-msg-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,.15);
  border-radius: 6px;
  min-width: 200px;
}
.chat-msg-doc .doc-icon {
  width: 36px; height: 42px;
  background: #8696a0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #111b21;
  flex-shrink: 0;
  text-transform: uppercase;
}
.chat-msg-doc .doc-name {
  font-size: 13px;
  color: #e9edef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Sticker */
.chat-msg.sticker-msg {
  background: transparent !important;
  box-shadow: none;
  padding: 0;
}
.chat-msg.sticker-msg::before { display: none; }
.chat-msg.sticker-msg img {
  max-width: 160px;
  max-height: 160px;
}

/* Hover actions: forward + react al lado del bubble (estilo WA Web) */
.chat-msg-actions {
  position: absolute;
  display: flex;
  gap: 4px;
  padding: 2px;
  background: #2a3942;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 6;
}
/* Toolbar SOBRE el bubble, en la esquina superior derecha. Antes iba a -76px al
   costado y en mensajes anchos el borde del contenedor la cortaba (solo se veía
   el primer botón). Ahora flota encima del mensaje y se ven los 3. */
.chat-msg.inbound .chat-msg-actions,
.chat-msg.outbound .chat-msg-actions { top: 4px; right: 6px; left: auto; transform: none; }
.chat-msg-actions::after { display: none; } /* el puente lateral ya no hace falta */
.chat-msg:hover .chat-msg-actions,
.chat-msg-actions:hover { opacity: 1; pointer-events: auto; }
.chat-msg-actions .cma-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: rgba(233,237,239,.85);
  cursor: pointer;
  padding: 0;
}
.chat-msg-actions .cma-btn:hover {
  background: rgba(255,255,255,.08);
  color: #e9edef;
}
.chat-msg-actions .cma-btn svg { display: block; }
/* Chevron (caret) que aparece al hover sobre el bubble y abre el menú de acciones
   (el mismo del click derecho) — estilo WhatsApp Web. Va DENTRO del bubble (no a
   -76px afuera como .chat-msg-actions), así no lo recorta el contenedor del chat. */
.chat-msg-caret {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 26px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(32, 44, 51, .55);
  color: #d1d7db;
  opacity: 0;
  cursor: pointer;
  display: none; /* oculto: la toolbar de acciones ya muestra los botones al hover */
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity .12s, background .12s;
  z-index: 4;
}
.chat-msg:hover .chat-msg-caret { opacity: .92; }
.chat-msg-caret:hover { opacity: 1; color: #fff; background: rgba(32, 44, 51, .8); }
.chat-msg-caret svg { display: block; }

/* Reaction picker — popover de emojis */
.reaction-picker {
  position: fixed;
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: #233138;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 28px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  z-index: 1000;
  opacity: 0;
  transform: translateY(4px) scale(.96);
  transition: opacity .12s ease, transform .12s ease;
}
.reaction-picker.open { opacity: 1; transform: translateY(0) scale(1); }
.reaction-picker .rp-emoji {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s ease, background .1s ease;
  color: #e9edef;
}
.reaction-picker .rp-emoji:hover {
  background: rgba(255,255,255,.08);
  transform: scale(1.2);
}
.reaction-picker .rp-more { font-size: 18px; color: rgba(233,237,239,.7); }

/* === Banner ventana de 24h cerrada — solo informativo === */
.window24-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 167, 38, .06);
  border-top: 1px solid rgba(255, 167, 38, .2);
  color: rgba(233,237,239,.75);
  font-size: 12px;
}
.window24-banner svg { color: rgba(255, 167, 38, .85); flex-shrink: 0; }
.window24-banner .w24-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window24-banner .w24-title {
  font-weight: 600;
  color: rgba(255, 167, 38, .9);
}
.window24-banner .w24-sub {
  color: rgba(233,237,239,.55);
}

/* === Quote / cita arriba del bubble (estilo WA Web) === */
.chat-msg-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: rgba(0,0,0,.18);
  border-left: 4px solid var(--neon-cyan, #8FD4DE);
  font-size: 12.5px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
}
.chat-msg-quote.mine { border-left-color: var(--neon-red, #FF1830); }
.chat-msg-quote .cmq-author {
  font-weight: 600;
  color: var(--neon-cyan, #8FD4DE);
  font-size: 12px;
}
.chat-msg-quote.mine .cmq-author { color: var(--neon-red, #FF1830); }
.chat-msg-quote .cmq-text {
  color: rgba(233,237,239,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Flash al hacer click en una cita y saltar al original */
.chat-msg.chat-msg-flash {
  animation: msg-flash 1.5s ease;
}
@keyframes msg-flash {
  0%, 100% { background-color: inherit; }
  20% { background-color: rgba(143, 212, 222, .25); }
}

/* === Reply banner (sobre el input cuando estás respondiendo) === */
.reply-banner {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px 14px;
  margin: 0 8px;
  background: #1f2c33;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--border);
}
.reply-banner-line {
  width: 4px;
  border-radius: 2px;
  background: var(--neon-cyan, #8FD4DE);
  flex-shrink: 0;
}
.reply-banner-content {
  flex: 1;
  min-width: 0;
}
.reply-banner .rb-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--neon-cyan, #8FD4DE);
}
.reply-banner .rb-text {
  font-size: 13px;
  color: rgba(233,237,239,.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-banner .rb-close {
  background: transparent;
  border: 0;
  color: rgba(233,237,239,.6);
  font-size: 16px;
  cursor: pointer;
  padding: 0 6px;
  align-self: center;
}
.reply-banner .rb-close:hover { color: #fff; }

/* === Image lightbox === */
.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease;
}
.img-lightbox.open { opacity: 1; }
.img-lightbox .lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  overflow: auto;
}
.img-lightbox #lb-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .15s ease;
  user-select: none;
}
.img-lightbox #lb-img.zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
  transform: scale(1.6);
}
.img-lightbox .lb-close,
.img-lightbox .lb-download,
.img-lightbox .lb-nav {
  position: absolute;
  background: rgba(255,255,255,.08);
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .12s ease, transform .12s ease;
  text-decoration: none;
}
.img-lightbox .lb-close { top: 18px; right: 18px; width: 40px; height: 40px; font-size: 22px; }
.img-lightbox .lb-download { top: 18px; right: 68px; width: 40px; height: 40px; }
.img-lightbox .lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; line-height: 1; }
.img-lightbox .lb-prev { left: 22px; }
.img-lightbox .lb-next { right: 22px; }
.img-lightbox .lb-close:hover,
.img-lightbox .lb-download:hover,
.img-lightbox .lb-nav:hover { background: rgba(255,255,255,.18); }
.img-lightbox .lb-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.5);
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 13px;
  pointer-events: none;
}

/* === PDF preview modal === */
.pdf-preview-modal .modal-h {
  padding: 12px 14px !important;
}
.pdf-preview-modal .pdf-close,
.pdf-preview-modal .btn-ghost {
  padding: 6px 10px;
  min-width: 36px;
}
.pdf-preview-modal iframe { background: #525659; }

/* === Media preview modal (drag/paste/attach) === */
.media-preview-modal .mp-stage {
  background: #0b141a;
  min-height: 320px;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.media-preview-modal .mp-stage img,
.media-preview-modal .mp-stage video {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}
.media-preview-modal .mp-doc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 24px;
  width: 100%;
  max-width: 480px;
  background: #182229;
  border-radius: 8px;
  margin: 16px;
}
.media-preview-modal .mp-doc-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--neon-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.media-preview-modal .mp-doc-name {
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}
.media-preview-modal .mp-doc-sub {
  color: var(--fg-subtle);
  font-size: 12px;
  margin-top: 2px;
}
.media-preview-modal .mp-empty {
  color: var(--fg-subtle);
  padding: 40px;
}
.media-preview-modal .mp-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #111b21;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.media-preview-modal .mp-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  background: #182229;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-preview-modal .mp-thumb.active { border-color: var(--neon-cyan, #8FD4DE); }
.media-preview-modal .mp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-preview-modal .mp-th-icon {
  font-size: 22px;
  color: rgba(255,255,255,.7);
}
.media-preview-modal .mp-th-rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: 0;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity .1s;
}
.media-preview-modal .mp-thumb:hover .mp-th-rm { opacity: 1; }
.media-preview-modal .mp-caption-wrap {
  padding: 10px 14px;
  background: #1f2c33;
}
.media-preview-modal #mp-caption {
  width: 100%;
  padding: 9px 12px;
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--fg);
  font-size: 14px;
  outline: none;
}
.media-preview-modal #mp-caption:focus { border-color: var(--neon-cyan, #8FD4DE); }

/* Reactions chip mostrado en el bubble */
.chat-msg-reactions {
  position: absolute;
  bottom: -10px;
  display: inline-flex;
  gap: 2px;
  padding: 2px 6px;
  background: #2a3942;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  font-size: 12px;
  line-height: 1;
  z-index: 3;
  white-space: nowrap;
}
.chat-msg.inbound .chat-msg-reactions { left: 8px; }
.chat-msg.outbound .chat-msg-reactions { right: 8px; }
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
}
.reaction-chip .rc-num {
  font-size: 11px;
  color: rgba(233,237,239,.75);
  margin-left: 2px;
}
/* Espacio extra abajo cuando el bubble tiene reacciones para que el chip no se solape con el siguiente. */
.chat-msg:has(.chat-msg-reactions) { margin-bottom: 12px; }

/* Timestamp + status */
.chat-msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: right;
  margin: 0 -1px -3px 8px;
  padding-top: 2px;
}
.chat-msg-time {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
}
.chat-msg-status { line-height: 1; display: inline-flex; }
.chat-msg-status svg { width: 16px; height: 11px; }
.chat-msg-status.sent svg { fill: rgba(255,255,255,.4); }
.chat-msg-status.delivered svg { fill: rgba(255,255,255,.5); }
.chat-msg-status.read svg { fill: #53bdeb; }
.chat-msg-status.failed { color: #ff4a5e; font-weight: 700; font-size: 11px; }

/* Input bar */
/* Modal "Reenviar a..." — items con avatar + nombre + checkbox */
.fwd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .12s;
}
.fwd-item:hover { background: var(--ink-100); }
.fwd-item input[type="checkbox"] { accent-color: var(--neon-cyan); width: 16px; height: 16px; flex-shrink: 0; }
.fwd-item-text { flex: 1; min-width: 0; }
.fwd-item-name { color: var(--fg); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwd-item-sub { color: var(--fg-subtle); font-size: 11px; margin-top: 2px; }

/* Drop zone overlay cuando arrastrás archivos sobre el chat */
.chat-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(143, 212, 222, .12);
  border: 2px dashed var(--neon-cyan);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.chat-drop-inner {
  font-size: 32px;
  color: var(--neon-cyan);
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: var(--tr-snug);
  text-shadow: var(--glow-cyan-sm);
}

.chat-input-bar {
  padding: 5px 10px;
  background: #202c33;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
  min-height: 52px;
}
.chat-input-bar .btn-send {
  background: transparent;
  border: none;
  color: #8696a0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: color .15s, background .15s;
  padding: 0;
}
.chat-input-bar .btn-send:hover { color: #e9edef; background: rgba(255,255,255,.06); }
.chat-input-bar .btn-send:disabled { opacity: .3; cursor: not-allowed; }
.chat-input-bar .btn-send svg { width: 22px; height: 22px; }

/* Scroll-to-bottom FAB */
.chat-scroll-down {
  position: absolute;
  bottom: 75px;
  right: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #202c33;
  border: none;
  color: #8696a0;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color .15s;
  font-size: 18px;
}
.chat-scroll-down.visible { display: flex; }
.chat-scroll-down:hover { color: #e9edef; }
.chat-scroll-down .unread-count {
  position: absolute;
  top: -6px; right: -2px;
  background: #00a884;
  color: #111b21;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* No conversation selected */
.chat-no-select {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
  color: #8696a0;
  font-size: 14px;
  text-align: center;
  padding: 40px;
  background: #222e35;
  border-bottom: 6px solid #00a884;
}
.chat-no-select h3 {
  color: #e9edef;
  font-size: 32px;
  font-weight: 300;
  margin: 0 0 4px;
}
.chat-no-select p {
  color: #8696a0;
  font-size: 14px;
  margin: 0;
  max-width: 500px;
  line-height: 1.5;
}

/* ============ CHAT INPUT WRAP ============ */
.chat-input-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}
.chat-input-wrap textarea {
  width: 100%;
  background: #2a3942;
  border: none;
  outline: none;
  color: #e9edef;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.35;
  /* Auto-resize NATIVO sin JS: el browser ajusta la altura al contenido sin
     forzar reflow. Reemplaza el patrón viejo de `style.height='auto'; el.scrollHeight`
     en cada keystroke, que con DOM grande tardaba 200-3000ms POR TECLA y bloqueaba
     el typing entero. Chrome ≥123 y Safari 17 lo soportan; browsers viejos caen
     a textarea fijo con scroll interno (degradación aceptable). */
  field-sizing: content;
}
.chat-input-wrap textarea::placeholder { color: #8696a0; }

/* Quick replies dropdown */
.qr-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0; right: 0;
  background: #233138;
  border-radius: 10px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.35);
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
  padding: 4px 0;
}
.qr-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: background .1s;
}
.qr-item:hover, .qr-item.active { background: rgba(255,255,255,.06); }
.qr-shortcut { color: #00a884; font-weight: 600; font-size: 13px; white-space: nowrap; min-width: 60px; }
.qr-preview { color: #8696a0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* Recording UI */
.rec-indicator {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e9edef;
  font-size: 16px;
  font-weight: 300;
  padding: 0 16px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.rec-dot {
  width: 12px; height: 12px;
  background: #ef5350;
  border-radius: 50%;
  animation: rec-pulse 1s infinite;
  flex-shrink: 0;
}
@keyframes rec-pulse { 0%,100% { opacity: 1; } 50% { opacity: .2; } }

/* Label chips */
.label-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  line-height: 16px;
  letter-spacing: .15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.chat-label-chips {
  display: flex;
  gap: 3px;
  padding: 0 16px 4px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.chat-header .chat-label-chips { padding: 0; margin-top: 2px; }
.chat-contact-bottom .label-chip { padding: 1px 6px; font-size: 9px; line-height: 14px; }

/* ============================================================
   Label filter bar — diseño tipo WhatsApp Web
   ============================================================
   Una sola fila compacta con chips fijos (Todos, No leídos) +
   un dropdown "Etiquetas ▾" que abre el listado de etiquetas
   custom. Reemplaza al diseño anterior que renderizaba TODAS
   las etiquetas como pills inline, lo cual ocupaba 2-4 filas
   verticales en desktop. */
.label-filter-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  align-items: center;
  flex-shrink: 0;
  background: #111b21;
  border-bottom: 1px solid #222d34;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: visible; /* el dropdown sale hacia abajo */
  scrollbar-width: none;
}
.label-filter-bar::-webkit-scrollbar { display: none; }

/* Chip fijo gris (Todos / No leídos) — color uniforme estilo WA Web. */
.label-filter-pill {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  border: 0;
  color: #aebac1;
  background: rgba(134, 150, 160, .12);
  cursor: pointer;
  font-family: 'Segoe UI', system-ui, sans-serif;
  white-space: nowrap;
  line-height: 1;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.label-filter-pill:hover { background: rgba(134, 150, 160, .2); color: #e9edef; }
.label-filter-pill.active {
  background: rgba(0, 168, 132, .18);
  color: #00d9a3;
}

/* Dropdown "Etiquetas ▾" — pill con caret. */
.label-filter-dd-wrap {
  position: relative;
  flex-shrink: 0;
}
.label-filter-dd-caret {
  font-size: 10px;
  opacity: .7;
  margin-left: 2px;
}
.label-filter-dd-menu {
  /* position: fixed para escapar del overflow:hidden de .chat-contacts.
     El top/left se calculan en JS via getBoundingClientRect del botón.
     z-index alto para quedar arriba de la lista de chats. */
  position: fixed;
  z-index: 9999;
  background: #233138;
  border: 1px solid #2a3942;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .65);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
}

/* Item de etiqueta dentro del dropdown — fila vertical estilo WhatsApp Web:
   cuadradito de color + nombre + check si está activa. */
.label-filter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #e9edef;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  font-family: 'Segoe UI', system-ui, sans-serif;
  transition: background .12s;
  line-height: 1.2;
}
.label-filter-item:hover { background: rgba(255, 255, 255, .04); }
.label-filter-item.active { background: rgba(0, 168, 132, .12); }
.label-filter-item-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
}
.label-filter-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.label-filter-item-check {
  color: #00a884;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 6px;
}

.label-filter-clear {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  border: 1px solid #3b4a54;
  color: #8696a0;
  background: transparent;
  cursor: pointer;
  font-family: 'Segoe UI', system-ui, sans-serif;
  margin-top: 4px;
  text-align: center;
}
.label-filter-clear:hover { background: #2a3942; color: #e9edef; }

/* Label picker popup */
.label-picker-popup {
  position: fixed;
  top: 60px;
  right: 16px;
  background: var(--ink-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55), var(--inner-card);
  z-index: 320;
  min-width: 220px;
  max-width: 280px;
  /* Con muchas etiquetas (20+) la lista crecía más que la pantalla y las de
     abajo quedaban fuera de vista sin scroll. Cap + scroll para verlas todas. */
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.label-picker-title {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-xwide);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ============ Modal Gestionar etiquetas ============ */
.manage-labels {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding-bottom: var(--s-3);
}
.manage-labels-section {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.manage-labels-section-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.manage-labels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.manage-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color .12s, background .12s;
}
.manage-label-row:hover { border-color: var(--border-strong); }
.manage-label-del {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  color: var(--fg-subtle);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all .12s;
  flex-shrink: 0;
}
.manage-label-del:hover {
  background: rgba(255, 24, 48, .12);
  border-color: var(--neon-red);
  color: var(--neon-red);
}
.manage-labels-empty {
  color: var(--fg-subtle);
  font-size: 13px;
  margin: 0;
}
.manage-labels-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.label-color-pick {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.label-color-pick:hover { transform: scale(1.08); }
.label-color-pick.active {
  border-color: var(--fg);
  box-shadow: 0 0 0 2px var(--ink-200), 0 0 0 4px var(--neon-cyan);
  transform: scale(1.1);
}
.manage-labels-add {
  display: flex;
  gap: 8px;
}
.manage-labels-add input {
  flex: 1;
  padding: 9px 12px;
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color .12s, box-shadow .12s;
}
.manage-labels-add input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan-sm);
}
.manage-labels-add input::placeholder { color: var(--fg-subtle); }
.manage-labels-add .btn { padding: 9px 16px; }

/* ============ Modal Respuestas rápidas ============ */
.manage-qr {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding-bottom: var(--s-3);
}
.manage-qr-hint {
  font-size: 12px;
  color: var(--fg-subtle);
  line-height: 1.5;
  margin: 0 0 var(--s-3);
}
.manage-qr-section { display: flex; flex-direction: column; gap: var(--s-3); }
.manage-qr-section-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.manage-qr-list { display: flex; flex-direction: column; gap: 6px; }
.manage-qr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.manage-qr-row:hover { border-color: var(--border-strong); }
.manage-qr-thumb {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: var(--r-xs);
  flex-shrink: 0;
}
.manage-qr-thumb-empty {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-200);
  border-radius: var(--r-xs);
  font-size: 18px;
  flex-shrink: 0;
  opacity: .5;
}
.manage-qr-text { flex: 1; min-width: 0; }
.manage-qr-shortcut {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.manage-qr-body {
  color: var(--fg-muted);
  font-size: 12.5px;
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manage-qr-section input[type="text"], .manage-qr-section textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-sans);
  resize: vertical;
  transition: border-color .12s, box-shadow .12s;
}
.manage-qr-section input[type="text"]:focus, .manage-qr-section textarea:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan-sm);
}
.manage-qr-image {
  display: flex;
  align-items: center;
  gap: 10px;
}
.manage-qr-image-name { font-size: 12px; color: var(--fg-subtle); }

/* QR dropdown items con thumbnail */
.qr-item img.qr-thumb {
  width: 32px; height: 32px;
  object-fit: cover;
  border-radius: var(--r-xs);
  flex-shrink: 0;
}
.qr-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Button label toggle */
.btn-label-toggle {
  background: transparent;
  border: none;
  color: #aebac1;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.btn-label-toggle:hover { color: #e9edef; background: rgba(255,255,255,.06); }
/* Tints sutiles para diferenciar los iconos del header del chat de un vistazo */
#btn-note { color: rgba(255, 248, 176, .85); }
#btn-note:hover { color: #fff8b0; background: rgba(255, 248, 176, .12); }
#btn-note.has-note { color: #fff8b0; background: rgba(255, 248, 176, .15); }
#btn-labels { color: rgba(143, 212, 222, .85); }
#btn-labels:hover { color: var(--neon-cyan); background: rgba(143, 212, 222, .12); }

/* ============ POST-IT de notas por contacto ============ */
.chat-main > .chat-postit { z-index: 5; }
.chat-postit {
  position: absolute;
  top: 70px;
  right: 14px;
  z-index: 5;
  background: #fff8b0;
  color: #2a2410;
  border-radius: var(--r-xs);
  padding: 10px 12px;
  width: 240px;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, .45),
    -2px -2px 0 rgba(0, 0, 0, .04) inset;
  transform: rotate(-1.5deg);
  cursor: pointer;
  user-select: none;
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.chat-postit-body { user-select: text; }
.chat-postit:hover { transform: rotate(0); box-shadow: 0 12px 24px rgba(0, 0, 0, .55); }
.chat-postit::before {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  width: 36px; height: 14px;
  background: rgba(255, 24, 48, .55);
  transform: translateX(-50%) rotate(-3deg);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.chat-postit-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b5d2a;
  margin-bottom: 6px;
}
.chat-postit-edit, .chat-postit-close {
  background: transparent;
  border: none;
  color: #6b5d2a;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.chat-postit-close { font-size: 18px; font-weight: 700; }
.chat-postit-edit:hover, .chat-postit-close:hover { color: #2a2410; }
.chat-postit-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Caveat', 'Patrick Hand', 'Comic Sans MS', cursive;
  font-size: 16px;
  line-height: 1.3;
}
.chat-postit--editing {
  cursor: default;
  transform: rotate(0);
  width: 280px;
}
.chat-postit-textarea {
  width: 100%;
  min-height: 110px;
  background: rgba(255, 255, 255, .55);
  border: 1px dashed rgba(0, 0, 0, .2);
  border-radius: 3px;
  padding: 8px;
  font-family: 'Caveat', 'Patrick Hand', cursive;
  font-size: 16px;
  color: #2a2410;
  resize: vertical;
}
.chat-postit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.chat-postit-btn {
  background: rgba(0, 0, 0, .08);
  border: 1px solid rgba(0, 0, 0, .15);
  color: #2a2410;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.chat-postit-btn:hover { background: rgba(0, 0, 0, .14); }
.chat-postit-btn--primary { background: #2a2410; color: #fff8b0; border-color: #2a2410; }
.chat-postit-btn--primary:hover { background: #000; }
.chat-postit-btn--danger { color: var(--neon-red-deep); border-color: rgba(255, 24, 48, .35); }

/* ============ Context menu (right-click sobre chat-contact) ============ */
.chat-context-menu {
  position: fixed;
  background: var(--ink-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 4px;
  min-width: 190px;
  z-index: 320;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55), var(--inner-card);
  opacity: 0;
  transform: scale(.96);
  transform-origin: top left;
  transition: opacity .12s var(--ease-out), transform .12s var(--ease-out);
}
.chat-context-menu.open { opacity: 1; transform: scale(1); }
.chat-context-menu .ccm-h {
  padding: 6px 10px 8px;
  font-size: 11px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-context-menu .ccm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.chat-context-menu .ccm-item:hover { background: var(--ink-300); color: var(--neon-cyan); }
.chat-context-menu .ccm-item svg { flex: 0 0 16px; opacity: .7; }
.chat-context-menu .ccm-item:hover svg { opacity: 1; }

/* Submenú (cascade) */
.chat-context-menu .ccm-item--has-sub { position: relative; }
.chat-context-menu .ccm-chevron {
  font-size: 10px;
  opacity: .6;
  margin-left: 6px;
}
.chat-context-menu .ccm-item--has-sub:hover .ccm-chevron { opacity: 1; }
.chat-context-menu .ccm-submenu {
  position: absolute;
  top: -4px;
  left: calc(100% + 4px);
  min-width: 220px;
  background: var(--ink-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55), var(--inner-card);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity .12s var(--ease-out), transform .12s var(--ease-out);
  z-index: 1;
}
.chat-context-menu .ccm-submenu--left {
  left: auto;
  right: calc(100% + 4px);
  transform: translateX(6px);
}
.chat-context-menu .ccm-item--has-sub:hover .ccm-submenu,
.chat-context-menu .ccm-submenu:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.chat-context-menu .ccm-sub-h {
  padding: 4px 8px 6px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.chat-context-menu .ccm-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s;
}
.chat-context-menu .ccm-sub-item:hover { background: var(--ink-300); }
.chat-context-menu .ccm-sub-item.active { background: rgba(143, 212, 222, .08); }
.chat-context-menu .ccm-sub-tick {
  margin-left: auto;
  width: 16px;
  text-align: center;
  color: var(--neon-cyan);
  font-weight: 700;
  font-size: 13px;
}
.chat-context-menu .ccm-sub-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  color: #2a2410;
}
.chat-context-menu .ccm-sub-empty {
  font-size: 12px;
  color: var(--fg-subtle);
  padding: 8px;
}

/* Bulk messaging section */
.bulk-section {
  background: #111b21;
  border-top: 1px solid #222d34;
  padding: 14px;
  flex-shrink: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.bulk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.bulk-header h4 { color: #e9edef; font-size: 15px; font-weight: 500; margin: 0; }
.bulk-labels { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.label-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Chip toggleable: la etiqueta misma es el botón. Inactiva = opaca y desaturada,
   activa = full color con glow + ✓. Sin pill envolvente, sin checkbox. */
.label-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--lc, var(--ink-300));
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  white-space: nowrap;
  cursor: pointer;
  opacity: .42;
  filter: saturate(.55);
  transition: opacity .12s var(--ease-out), filter .12s var(--ease-out), box-shadow .12s var(--ease-out), transform .12s var(--ease-out);
}
.label-toggle-chip:hover { opacity: .72; filter: saturate(.85); }
.label-toggle-chip.active {
  opacity: 1;
  filter: saturate(1);
  box-shadow: 0 0 0 2px var(--ink-100), 0 0 0 3px var(--lc, var(--neon-cyan));
}
.label-toggle-chip.active::after {
  content: '✓';
  font-size: 11px;
  font-weight: 900;
  margin-left: -2px;
  opacity: .9;
}
.bulk-textarea {
  width: 100%;
  padding: 10px 12px;
  background: #2a3942;
  border: none;
  outline: none;
  color: #e9edef;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.4;
}
.bulk-textarea::placeholder { color: #8696a0; }

/* Location message */
.chat-msg-location {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  cursor: pointer;
}
.chat-msg-location:hover { opacity: .85; }

/* Contact card message */
.chat-msg-contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}

/* Unsupported message */
.chat-msg-unsupported {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8696a0;
  font-size: 13px;
  font-style: italic;
  padding: 2px 0;
}

/* Attach & mic & schedule buttons */
.btn-attach, .btn-mic, .btn-schedule { flex-shrink: 0; }
.btn-schedule { color: #8696a0; }
.btn-schedule:hover { color: #00a884 !important; }

/* Schedule modal */
.schedule-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.schedule-modal {
  background: #1f2c34; border-radius: 12px; padding: 20px;
  width: 380px; max-width: 90vw; color: #e9edef;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.schedule-preview {
  background: #005c4b; border-radius: 8px; padding: 8px 12px;
  font-size: 13px; color: #e9edef; max-height: 120px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.schedule-modal label { display: block; margin-bottom: 4px; }
.schedule-modal input[type="date"],
.schedule-modal input[type="time"] { font-family: inherit; font-size: 14px; }
.schedule-modal .btn-action {
  border: none; padding: 8px 18px; border-radius: 8px;
  color: #fff; font-size: 14px; cursor: pointer;
}
.schedule-modal .btn-action:hover { filter: brightness(1.15); }

/* ============ FULL-TEXT SEARCH RESULTS en chat list ============ */
.search-section-header {
  padding: 8px 14px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(143, 212, 222, .8);
  font-weight: 700;
  border-top: 1px solid rgba(255,255,255,.05);
  background: rgba(143,212,222,.04);
  margin-top: 4px;
}
.search-msg-result {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.search-msg-result:hover {
  background: rgba(143,212,222,.08);
}
.search-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.search-msg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.search-msg-date {
  font-size: 10.5px;
  color: rgba(233,237,239,.45);
  font-family: ui-monospace, monospace;
}
.search-msg-body {
  font-size: 12.5px;
  color: rgba(233,237,239,.7);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-msg-dir {
  color: rgba(143,212,222,.7);
  font-weight: 700;
  margin-right: 2px;
}
.search-msg-body mark,
.search-msg-result mark {
  background: rgba(255, 196, 0, .35);
  color: #ffd966;
  padding: 0 2px;
  border-radius: 2px;
}
.search-loading {
  padding: 12px 14px;
  font-size: 12px;
  color: rgba(233,237,239,.5);
  text-align: center;
}

/* ============ PRIVACY TOGGLE (estilo billetera virtual) ============ */
.privacy-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  padding: 4px 8px !important;
  color: var(--fg-subtle);
  transition: all .15s ease;
}
.privacy-toggle:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}
.privacy-toggle.on {
  color: var(--neon-cyan);
  background: rgba(143,212,222,.12) !important;
  border-color: var(--neon-cyan) !important;
}
.privacy-toggle.on::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--neon-cyan);
  border-radius: 50%;
  margin-left: 5px;
  box-shadow: 0 0 6px var(--neon-cyan);
  animation: privacy-pulse 1.4s ease-in-out infinite;
}
@keyframes privacy-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ============ BUSINESS PANEL (Gaspar) ============ */
.bp-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--s-4);
  margin-top: var(--s-4);
}
@media (max-width: 1100px) {
  .bp-charts-row { grid-template-columns: 1fr; }
}
.bp-chart-wide #bp-chart-bars-line { height: 260px; }

.bp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bp-table th, .bp-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.bp-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--fg-subtle);
  font-weight: 600;
  background: rgba(255,255,255,.02);
}
.bp-table td.num, .bp-table th.num {
  text-align: right;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.bp-table tbody tr:hover { background: rgba(255,255,255,.02); }
.bp-table tr.total td {
  border-top: 2px solid var(--neon-cyan);
  font-weight: 700;
  background: rgba(143,212,222,.05);
}
.bp-table.compact th, .bp-table.compact td { padding: 7px 12px; }

.bp-vname {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.bp-vdot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.bp-bar-bg {
  background: rgba(255,255,255,.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.bp-bar-fg {
  height: 100%;
  border-radius: 3px;
  transition: width .25s ease;
}
.bp-pill {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--fg-subtle);
}
.bp-pill.muted { opacity: .5; }

/* Fila clickeable de vertical (drill-down al detalle) */
.bp-vertical-row {
  transition: background .12s ease;
}
.bp-vertical-row:hover {
  background: rgba(143,212,222,.08) !important;
}
.bp-vertical-row .bp-drill-hint {
  margin-left: 4px;
  color: var(--fg-mute, rgba(255,255,255,.35));
  font-weight: 700;
  transition: transform .15s ease, color .15s ease;
  display: inline-block;
}
.bp-vertical-row:hover .bp-drill-hint {
  color: var(--neon-cyan);
  transform: translateX(3px);
}

/* Flag "parcial" en KPIs cuando el tracking no cubre todo el período */
.partial-flag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,167,38,.18);
  color: #FFA726;
  margin-left: 4px;
  vertical-align: middle;
}
.bp-partial-banner {
  margin: 0 20px 12px;
  padding: 10px 14px;
  background: rgba(255,167,38,.06);
  border-left: 3px solid #FFA726;
  border-radius: 4px;
  font-size: 12.5px;
  color: rgba(255,225,200,.85);
  line-height: 1.4;
}
.bp-partial-banner b { color: #FFA726; }

/* Funnel del panel */
.bp-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bp-funnel-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bp-funnel-lbl {
  width: 200px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--fg-subtle);
}
.bp-funnel-bar-wrap {
  flex: 1;
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  height: 32px;
  overflow: hidden;
  position: relative;
}
.bp-funnel-bar {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: width .3s ease;
  position: relative;
}
.bp-funnel-num {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 14px;
  color: #000;
}
.bp-funnel-pct {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  font-size: 12px;
  color: rgba(0,0,0,.65);
}

/* SVG charts del panel */
.bp-svg .bp-bar { fill: var(--neon-cyan); opacity: .8; }
.bp-svg .bp-bar-g:hover .bp-bar { opacity: 1; }
.bp-svg .bp-bar-lbl,
.bp-svg .bp-bar-total {
  font-size: 10px;
  font-weight: 600;
  fill: rgba(143,212,222,.95);
  font-family: ui-monospace, monospace;
}
.bp-svg .bp-cost-line {
  fill: none;
  stroke: var(--neon-red);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bp-svg .bp-cost-dot { fill: var(--neon-red); stroke: var(--bg-0, #0A0A0F); stroke-width: 1.5; }
.bp-svg .bp-cost-lbl {
  font-size: 10px;
  fill: rgba(255,180,180,.85);
  font-weight: 600;
  font-family: ui-monospace, monospace;
}
.bp-svg .bp-stack-lbl {
  font-size: 9px;
  font-weight: 700;
  fill: rgba(0,0,0,.65);
  font-family: ui-monospace, monospace;
}
.bp-svg .bp-legend-inline text { font-size: 11px; fill: var(--fg-subtle); }

/* ============ MISC ============ */
.muted { color: var(--fg-subtle); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-050); }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ============================================================================
   MOBILE RESPONSIVE (iPhone-first, tablet también)
   ============================================================================
   Estrategia: bottom nav bar fija con scroll horizontal + top compact bar.
   Tablas pasan a scroll-x. KPI grid a 2 cols. Modales full-screen.
   Soporte de safe-area-inset para notch + home indicator de iPhone.
*/
@media (max-width: 768px) {
  body {
    /* Permitir text size adjustment al rotar */
    -webkit-text-size-adjust: 100%;
  }

  /* === SHELL: app grid pasa a stack vertical === */
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  /* === SIDEBAR → bottom nav bar fija === */
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 4px 6px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    border-right: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(17, 17, 24, .92);
    gap: 6px;
    overflow: visible;
  }

  /* Ocultar elementos no esenciales del sidebar */
  .sidebar .brand,
  .sidebar .sidebar-foot { display: none; }

  /* User-pick: compacto, va a la derecha del nav */
  .sidebar .user-pick {
    flex-shrink: 0;
    padding: 0;
    margin: 0 4px 0 0;
    border: 0;
  }
  .sidebar .user-pick-label { display: none; }
  .sidebar .user-pick-chips {
    /* En fila (no columna) para que la barra inferior sea fina (~52px) y no un
       bloque alto. Antes apilaba Abril/ojo/logout verticalmente = barra gorda. */
    flex-direction: row;
    align-items: center;
    gap: 3px;
    padding: 0;
  }
  .sidebar .user-pick-chips .user-chip {
    font-size: 9px;
    padding: 3px 6px;
    line-height: 1.2;
  }
  /* Solo mostrar el user activo + privacy toggle, los demás no caben */
  .sidebar .user-chip:not(.active):not(.privacy-toggle):not([data-logout]) { display: none; }
  .sidebar .user-chip.add[data-add-user] { display: none; }

  /* Nav: en horizontal con scroll si no entran */
  .sidebar .nav {
    flex-direction: row;
    flex: 1;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    padding: 6px 8px;
    min-width: 56px;
    text-align: center;
    white-space: nowrap;
    border-radius: 8px;
    border: 0;
    position: relative;
    scroll-snap-align: start;
  }
  .nav-item .icon {
    font-size: 18px;
    width: auto;
    line-height: 1;
    margin-bottom: 1px;
  }
  .nav-item .badge {
    position: absolute;
    top: 2px;
    right: 4px;
    margin-left: 0;
    font-size: 8px;
    padding: 0 5px;
    min-width: 14px;
    line-height: 1.4;
  }
  .nav-item.active {
    background: rgba(255, 24, 48, .12);
    color: var(--neon-red);
    box-shadow: none;
    border-color: transparent;
  }

  /* === MAIN: padding bottom para no taparse con bottom bar === */
  .main {
    padding: 12px 12px calc(80px + env(safe-area-inset-bottom)) 12px;
    max-width: 100vw;
  }
  .main.main--chat {
    padding: 0;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  /* === PAGE HEAD: stack y achicar título === */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }
  .page-head h1 { font-size: 26px; }
  .page-head .eyebrow { font-size: 9px; }
  .page-head .actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  .page-head .actions .btn { font-size: 12px; padding: 6px 10px; }

  /* === KPI GRID: 2 cols en mobile === */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 9px; }
  .kpi-delta { font-size: 10px; }

  /* === PERIOD SELECTOR: chips en scroll horizontal === */
  .period-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .period-selector .ps-label { font-size: 9px; }
  .period-selector .ps-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    width: 100%;
  }
  .period-selector .ps-chips::-webkit-scrollbar { display: none; }
  .ps-chip {
    flex-shrink: 0;
    font-size: 11px;
    padding: 5px 12px;
  }
  .period-selector .ps-meta { font-size: 10px; }

  /* === TABLAS GENÉRICAS: scroll horizontal === */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table { min-width: 600px; }
  .table-wrap th, .table-wrap td {
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap;
  }
  .table-toolbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }
  .table-toolbar input,
  .table-toolbar select {
    font-size: 12px;
    padding: 6px 8px;
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  /* === BUSINESS PANEL específico === */
  .bp-charts-row { grid-template-columns: 1fr; gap: 12px; }
  .bp-table {
    font-size: 11px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bp-table thead, .bp-table tbody { min-width: 540px; display: table; width: 100%; }
  .bp-table th, .bp-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }
  .bp-table .num { font-size: 11px; }
  .bp-bar-bg { width: 60px !important; }
  /* Chart canvas más bajo en mobile */
  .chart-card .chart-canvas,
  .bp-chart-wide #bp-chart-bars-line { height: 200px !important; }
  #bp-chart-stacked { height: 220px !important; }
  #bp-chart-donut { height: 180px !important; }
  #bp-vert-chart { height: 200px !important; }

  /* PnL table compacta */
  .pnl-table { font-size: 12px; }
  .pnl-table td { padding: 5px 10px; }

  /* Funnel */
  .bp-funnel-lbl { width: 120px; font-size: 11px; }
  .bp-funnel-bar { padding: 0 10px; }
  .bp-funnel-num { font-size: 12px; }
  .bp-funnel-pct { font-size: 10px; }

  /* Card headers */
  .card-h { padding: 12px 14px; }
  .card-h h3 { font-size: 13px; }
  .card-h .muted, .card-h .badge { font-size: 10px; }

  /* === MODALES: full-screen en mobile === */
  .modal-bg .modal {
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0;
  }
  .modal-bg .modal .modal-h { padding: 12px 14px; }
  .modal-bg .modal .modal-h h3 { font-size: 15px; }
  .modal-bg .modal .modal-body { padding: 12px 14px; }
  .modal-bg .modal .modal-actions {
    padding: 10px 14px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-bg .modal .modal-actions .btn { flex: 1; min-width: 0; }

  /* === ALERTS GRID: stack === */
  .alerts-grid { grid-template-columns: 1fr; gap: 12px; }

  /* === CHART GRID dashboard general === */
  .chart-grid { grid-template-columns: 1fr; gap: 12px; }
  .chart-grid .chart-canvas { height: 200px; }

  /* === CHAT: ajustes mobile === */
  .chat-msg { max-width: 88%; font-size: 14px; }
  .chat-input-bar {
    padding: 8px 8px max(8px, env(safe-area-inset-bottom)) 8px;
    gap: 6px;
  }
  .chat-input-wrap textarea {
    font-size: 16px; /* iOS no hace zoom si es ≥16px */
  }
  .chat-header {
    padding: 8px 12px;
  }
  .chat-header-name { font-size: 14px; }
  .chat-header-phone { font-size: 11px; }
  .chat-header-meta { gap: 6px; flex-wrap: wrap; }
  .chat-header-meta span { display: none; } /* "X msgs" se oculta */
  .chat-list { width: 100%; }
  .chat-messages { padding: 10px 12px 4px; }
  /* Hover actions en mobile siempre visibles, más chicas */
  .chat-msg-actions {
    opacity: 1 !important;
    pointer-events: auto !important;
    background: rgba(42, 57, 66, .92) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  .chat-msg.inbound .chat-msg-actions { right: auto; left: 100%; margin-left: 6px; }
  .chat-msg.outbound .chat-msg-actions { left: auto; right: 100%; margin-right: 6px; }
  .chat-msg-actions::after { display: none; } /* el puente no hace falta touch */
  /* En mobile el menú se abre con LONG-PRESS (mantener apretado), no con hover.
     Ocultamos el chevron (no hay hover) y matamos la selección/callout nativa de
     iOS para que mantener apretado abra el menú en vez de seleccionar texto.
     "Copiar texto" queda en el menú para no perder el copiar. */
  .chat-msg-caret { display: none; }
  .chat-msg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* === IMAGE LIGHTBOX === */
  .img-lightbox .lb-nav { width: 40px; height: 40px; font-size: 26px; }
  .img-lightbox .lb-prev { left: 8px; }
  .img-lightbox .lb-next { right: 8px; }
  .img-lightbox .lb-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
  .img-lightbox .lb-download { top: max(12px, env(safe-area-inset-top)); right: 60px; }

  /* === DRAWER (detalle de pedido) en mobile: full screen === */
  .drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  /* === SVG charts ajustes === */
  .chart-svg .label { font-size: 9px; }

  /* === Notas (post-it) === */
  .chat-postit { padding: 10px 14px; }

  /* === SCROLL TO BOTTOM FAB === */
  .chat-scroll-down { bottom: 80px; right: 12px; }

  /* === LISTA DE CHATS estilo WhatsApp: items más grandes, tipografía más clara === */
  .chat-contact { padding: 0 14px; gap: 12px; height: 78px; }
  .chat-contact-info { padding: 14px 0; }
  .chat-contact-name { font-size: 16px; }
  .chat-contact.has-unread .chat-contact-name { font-weight: 700; }
  .chat-contact-preview { font-size: 14px; }
  .chat-contact-time { font-size: 12px; }
  .chat-contact-unread {
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    font-size: 12px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  /* Avatar ligeramente más grande en mobile (visual jerarquía WA) — el width
     inline del HTML manda, pero forzamos el .chat-avatar a expandir. */
  .chat-contact .chat-avatar { width: 52px !important; height: 52px !important; }
  .chat-contact .chat-avatar-text { font-size: 19px !important; }

  /* === LABEL FILTER BAR: una sola fila scroll horizontal estilo WA chips === */
  .label-filter-bar {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .label-filter-bar::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
  .nav-item { font-size: 8px; min-width: 50px; padding: 5px 6px; }
  .nav-item .icon { font-size: 16px; }
  .kpi-grid { gap: 6px; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 16px; }
  .kpi-label { font-size: 8px; }
  .page-head h1 { font-size: 22px; }
  .bp-table { font-size: 10px; }
  .bp-table th, .bp-table td { padding: 6px 8px; }
}

/* === Standalone PWA (iOS app instalada) === */
/* Agrega padding al top para evitar overlap con el status bar de iOS */
.pwa-standalone .sidebar {
  padding-top: max(8px, env(safe-area-inset-top));
}
.pwa-standalone .main {
  padding-top: max(12px, env(safe-area-inset-top));
}
@media (max-width: 768px) {
  .pwa-standalone .main {
    padding-top: calc(max(12px, env(safe-area-inset-top)) + 4px);
  }
  /* Chat: sin top bar de pagina, hay que pegar el chat-header al safe-area */
  .pwa-standalone .main.main--chat .chat-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }
}

/* ===========================================================================
   CHAT MOBILE — estilo WhatsApp app (lista full-screen ↔ conversación full-screen)
   ===========================================================================
   En desktop el chat es split-view: lista a la izquierda + conversación a la
   derecha. En mobile (≤768px) eso es inusable: las dos columnas se apilan
   verticalmente y el input queda lejos.

   Solución estilo WhatsApp: en mobile, solo una de las dos vistas está visible
   a la vez. Las classes `chat-mobile-list` y `chat-mobile-conv` van en el `.app`
   raíz desde JS (ver _applyMobileChatClass). El back arrow del header
   (.chat-back-btn) está en el HTML siempre pero solo se ve en mobile.
   =========================================================================== */
/* Defaults — el media query mobile abajo overridea estos a display visible.
   Los dejamos acá (antes del @media) para que la specificity y orden de
   declaración no nos jueguen en contra. */
.chat-back-btn { display: none; }
.chat-mobile-title { display: none; }
.chat-archived-row { display: none; }

@media (max-width: 768px) {
  /* Override del flex-direction: column que pone .chat-layout en max-width: 900px.
     En mobile queremos UNO de los dos paneles ocupando todo, no apilados. */
  .chat-layout {
    flex-direction: row;
    height: 100%;
  }
  .chat-layout > .chat-contacts,
  .chat-layout > .chat-main {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
  }
  /* Por default (chat-mobile-list o sin class), ocultamos la conversación */
  .app.chat-mobile-list .chat-layout > .chat-main,
  .app:not(.chat-mobile-conv):not(.chat-mobile-list) .chat-layout > .chat-main {
    display: none;
  }
  /* En "conversation", ocultamos la lista y el sidebar nav (full-screen focus) */
  .app.chat-mobile-conv .chat-layout > .chat-contacts {
    display: none;
  }
  .app.chat-mobile-conv .sidebar {
    display: none;
  }
  /* Sin sidebar bottom-bar, el main no necesita el padding bottom para no taparse */
  .app.chat-mobile-conv .main,
  .app.chat-mobile-conv .main.main--chat {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* El back arrow visible solo cuando estás en mobile chat conversation */
  .chat-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #e9edef;
    cursor: pointer;
    padding: 6px;
    margin-right: 4px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .chat-back-btn:hover,
  .chat-back-btn:active { background: rgba(255,255,255,.08); }
  /* El back arrow queda visible SOLO durante la vista conversación
     (en lista no tiene sentido — ya estás en la "raíz" del chat). */
  .app.chat-mobile-list .chat-back-btn,
  .app:not(.chat-mobile-conv) .chat-back-btn { display: none; }

  /* ----- Título "Chats" estilo WhatsApp ----- */
  .chat-mobile-title {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #e9edef;
    margin: 0;
    padding: 14px 16px 6px;
    letter-spacing: -0.4px;
    background: #111b21;
    flex-shrink: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  }

  /* ----- Header del sidebar más compacto en mobile (botones a la derecha) ----- */
  .chat-contacts-header {
    padding: 4px 8px 8px;
    background: #111b21;
    justify-content: flex-end;
    gap: 4px;
  }
  /* El botón fullscreen no tiene sentido en mobile (ya está full). */
  .chat-contacts-header #chat-fullscreen { display: none; }
  .chat-contacts-header .btn-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  /* ----- Search más estilo WhatsApp (más redondeado, padding cómodo) ----- */
  .chat-contacts-search { padding: 4px 12px 10px; }
  .chat-contacts-search input {
    border-radius: 22px;
    padding: 10px 14px 10px 38px;
    font-size: 14px;
    background-color: #202c33;
    background-position: 14px center;
    background-size: 16px;
  }

  /* ----- Fila "Archivados · N" estilo WA ----- */
  .chat-archived-row {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 12px 20px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #222d34;
    color: #e9edef;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 15px;
    font-family: inherit;
    transition: background .15s;
  }
  .chat-archived-row:hover,
  .chat-archived-row:active { background: #1f2c33; }
  .chat-archived-label { flex: 1; color: #e9edef; }
  .chat-archived-count { color: #8696a0; font-size: 13px; }
}



/* ===== Insights IA dashboard ===== */
.ins-table { width:100%; border-collapse:collapse; font-size:13px }
.ins-table thead th { text-align:left; padding:6px 8px; border-bottom:1px solid #2a3942; opacity:.7; font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.04em }
.ins-table tbody td { padding:8px 8px; border-bottom:1px solid #1a2530; vertical-align:middle }
.ins-table tbody tr:hover { background:#1a2530 }
.ins-rank { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px }
.ins-rank li { display:flex; flex-direction:column; gap:4px }
.ins-rank-label { font-size:13px }
.ins-rank-bar { position:relative; height:18px; background:#1a2530; border-radius:4px; overflow:hidden; display:flex; align-items:center }
.ins-rank-fill { position:absolute; left:0; top:0; bottom:0; background:linear-gradient(90deg, #06b6d4, #22c55e); opacity:.5 }
.ins-rank-bar span { position:relative; padding-left:8px; font-size:12px; font-weight:600 }


.ins-tabs { display:flex; gap:4px; margin-bottom:24px; padding-bottom:12px; border-bottom:1px solid #2a3942 }
.ins-tab { padding:8px 16px; background:transparent; border:0; color:#9ca3af; cursor:pointer; font-size:14px; border-radius:6px 6px 0 0; transition:all .15s; font-family:inherit }
.ins-tab:hover { background:#1a2530; color:#e9edef }
.ins-tab.active { background:#06b6d4; color:#fff; font-weight:600 }


/* KPIs clickeables — drill-down zoom */
.kpi-clickable { cursor:pointer; text-align:left; font-family:inherit; transition: all .15s }
.kpi-clickable:hover { background:#1a2530; transform:translateY(-2px) }
.kpi-clickable.kpi-active { background:#0e7490; box-shadow: 0 4px 12px rgba(6,182,212,.3) }
.kpi-clickable.kpi-active .kpi-value { color:#fff !important }
.btn-sm { padding:4px 10px; font-size:12px }
.btn-ghost { background:transparent; border:1px solid #3b4a54; color:#9ca3af }
.btn-ghost:hover { background:#1a2530 }

/* ===== Copiloto: panel de sugerencia (Fase 2B) ===== */
.btn-suggest { font-size:20px; line-height:1 }
.suggest-panel { margin:0 8px 6px; padding:10px 12px; border-radius:10px; background:#1f2c34; border:1px solid #2a3942; color:#e9edef; font-size:14px; box-shadow:0 2px 12px rgba(0,0,0,.35) }
.suggest-loading { color:#8696a0; font-style:italic }
.suggest-head { display:flex; align-items:center; gap:8px; margin-bottom:7px }
.suggest-title { font-weight:600; color:#00a884; flex:1 }
.suggest-conf { font-size:12px; padding:1px 7px; border-radius:10px; font-weight:700 }
.suggest-conf.ok { background:rgba(0,168,132,.18); color:#00d9a3 }
.suggest-conf.warn { background:rgba(255,167,38,.18); color:#ffb74d }
.suggest-x { background:none; border:none; color:#8696a0; cursor:pointer; font-size:15px; padding:2px 6px }
.suggest-warn { background:rgba(255,167,38,.12); border-left:3px solid #ffb74d; color:#ffcc80; padding:7px 9px; border-radius:6px; margin-bottom:8px; font-size:13px; line-height:1.4 }
.suggest-draft { background:#2a3942; padding:9px 11px; border-radius:8px; white-space:pre-wrap; line-height:1.45 }
.suggest-src { color:#667781; font-size:11px; margin-top:6px }
.suggest-actions { display:flex; gap:8px; margin-top:9px }
.suggest-use { background:#00a884; color:#fff; border:none; border-radius:8px; padding:7px 16px; font-weight:600; cursor:pointer; font-size:14px }
.suggest-use:hover { background:#06cf9c }
.suggest-dismiss { background:transparent; color:#8696a0; border:1px solid #2a3942; border-radius:8px; padding:7px 14px; cursor:pointer; font-size:14px }
.suggest-err { color:#ff6b6b }
.suggest-row { display:flex; align-items:center; justify-content:space-between; gap:8px }
.copilot-cost { display:inline-flex; align-items:center; font-size:12px; color:#9ca3af; background:rgba(0,168,132,.12); padding:2px 8px; border-radius:10px; white-space:nowrap; cursor:default }
.copilot-cost:empty { display:none }
/* Fase 2C: propuestas de mejora al playbook */
.improve-item { background:#1f2c34; border:1px solid #2a3942; border-radius:10px; padding:12px 14px; margin-bottom:10px }
.improve-head { display:flex; align-items:center; gap:8px; margin-bottom:6px; flex-wrap:wrap }
.improve-title { font-weight:600; color:#e9edef; flex:1; font-size:14px }
.improve-vert { font-size:10px; text-transform:uppercase; letter-spacing:.05em; padding:2px 8px; border-radius:10px; font-weight:700; background:rgba(143,212,222,.15); color:#8fd4de }
.improve-vert-cursos { background:rgba(255,167,38,.15); color:#ffb74d }
.improve-vert-supernova { background:rgba(186,104,255,.15); color:#c79bff }
.improve-txt { font-size:13px; line-height:1.5; color:#cfd9de; margin-top:3px }
.improve-content { background:#0b141a; border:1px solid #2a3942; border-radius:8px; padding:10px; font-size:12px; white-space:pre-wrap; word-break:break-word; max-height:280px; overflow:auto; margin-top:6px; color:#cfd9de }
.improve-actions { display:flex; gap:8px; margin-top:10px }
/* Panel de costos del sitio */
.cost-item { background:#1f2c34; border:1px solid #2a3942; border-radius:10px; padding:11px 13px; margin-bottom:8px }
.cost-row1 { display:flex; align-items:center; gap:8px; flex-wrap:wrap }
.cost-cat { font-size:10px; text-transform:uppercase; letter-spacing:.04em; padding:2px 7px; border-radius:8px; font-weight:700; background:rgba(143,212,222,.15); color:#8fd4de; white-space:nowrap }
.cost-cat-ia { background:rgba(0,168,132,.18); color:#00d9a3 }
.cost-cat-mensajeria { background:rgba(37,211,102,.15); color:#25d366 }
.cost-cat-ads { background:rgba(255,167,38,.15); color:#ffb74d }
.cost-cat-almacenamiento { background:rgba(186,104,255,.15); color:#c79bff }
.cost-name { font-weight:600; color:#e9edef; flex:1; font-size:14px }
.cost-amt { font-weight:700; color:#e9edef; font-size:14px; white-space:nowrap }
.cost-usage { font-size:12px; color:#aebac1; margin-top:4px; line-height:1.4 }
.cost-cred { font-size:11px; color:#8696a0; margin-top:3px; word-break:break-word }
.cost-notes { font-size:11px; color:#7c8a93; margin-top:4px; font-style:italic; line-height:1.4 }
.cost-actions { display:flex; gap:8px; align-items:center; margin-top:8px; flex-wrap:wrap }
.cost-link { color:#8fd4de; font-size:12px; text-decoration:none }
.cost-btn { background:transparent; border:1px solid #2a3942; color:#aebac1; border-radius:7px; padding:4px 10px; cursor:pointer; font-size:12px }
.cost-btn:hover { background:rgba(255,255,255,.05) }
.cost-btn-del { color:#ff8a8a }
.cost-sep { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:#667781; margin:14px 0 8px }
.cost-rate { font-size:12px; color:#aebac1; margin-top:12px; display:flex; align-items:center; gap:6px; flex-wrap:wrap }
.cost-rate input, .cost-edit-grid input, .cost-edit-grid select, .cost-full input { background:#2a3942; border:1px solid #3b4a54; color:#e9edef; border-radius:7px; padding:6px 8px; font-size:13px }
.cost-editing { border-color:#00a884 }
.cost-edit-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; margin-top:8px }
.cost-edit-grid label, .cost-full { display:flex; flex-direction:column; gap:3px; font-size:11px; color:#8696a0 }
.cost-full { margin-top:8px }
.cost-full input { width:100% }
.cost-block-banner { background:rgba(255,68,68,.15); border:1px solid rgba(255,68,68,.4); color:#ffb4b4; border-radius:8px; padding:9px 11px; font-size:12px; line-height:1.4; margin-top:var(--s-3) }
.cost-block-banner a { color:#fff; text-decoration:underline }

/* ===== Nuevo chat: botón "+" del header + sugerencia de la barra de búsqueda ===== */
.new-chat-suggest { padding:6px 10px 2px }
.new-chat-suggest-btn { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:rgba(0,168,132,.10); border:1px solid rgba(0,168,132,.35); color:#e9edef; border-radius:10px; padding:10px 12px; cursor:pointer; font-size:14px; transition:background .12s }
.new-chat-suggest-btn:hover { background:rgba(0,168,132,.18) }
.new-chat-suggest-btn svg { color:#00a884; flex-shrink:0 }
.new-chat-suggest-btn strong { color:#00d9a6 }
.nc-exists { color:#8696a0; font-size:12px }
.new-chat-modal .modal-body { gap:14px }
.nc-note { font-size:12.5px; line-height:1.45; color:#aebac1; background:rgba(255,255,255,.04); border:1px solid #2a3942; border-radius:8px; padding:9px 11px }
.nc-note strong { color:#e9edef }
.nc-field { display:flex; flex-direction:column; gap:5px }
.nc-label { font-size:12px; color:#8696a0 }
.nc-input { background:#2a3942; border:1px solid #3b4a54; color:#e9edef; border-radius:8px; padding:9px 11px; font-size:14px; width:100%; box-sizing:border-box }
.nc-input:focus { outline:none; border-color:#00a884 }
select.nc-input { cursor:pointer }
.nc-hint { font-size:12px; color:#8696a0; min-height:14px }
.nc-hint.ok { color:#8fd4de }
.nc-hint.err { color:#ff8a8a }
/* Listado de plantillas estilo menú "/" dentro del modal de nuevo chat */
.nc-tpl-list { background:#233138; border:1px solid #2a3942; border-radius:10px; max-height:240px; overflow-y:auto; padding:4px 0 }
.nc-tpl-list .qr-item.nc-selected { background:rgba(0,168,132,.16); box-shadow:inset 3px 0 0 #00a884 }
.nc-empty { padding:14px; text-align:center; color:#8696a0; font-size:13px }
.nc-preview { white-space:pre-wrap; word-break:break-word; font-size:13px; line-height:1.45; color:#d7dde0; background:#0b141a; border:1px solid #2a3942; border-left:3px solid #00a884; border-radius:8px; padding:10px 12px; max-height:200px; overflow:auto }

/* ==========================================================================
   ACCESIBILIDAD
   ========================================================================== */
/* Respeta "Reducir movimiento" del SO: corta animaciones/transiciones largas
   (mejora el confort y ahorra CPU/batería en equipos lentos). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Foco visible al navegar por TECLADO (no en click/touch). Varios componentes
   hacen outline:none con foco custom; esto garantiza un anillo neón al tabular
   en los que no tienen ninguno, sin cambiar el look con mouse/touch. */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  /* iOS hace zoom automático al enfocar un campo con font-size < 16px. Forzamos
     16px en todos los campos de texto en móvil → sin zoom molesto al tipear.
     (checkbox/radio/color/range no disparan zoom ni llevan texto: excluidos.) */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
  textarea,
  select {
    font-size: 16px !important;
  }
  /* Stats del business panel (admin): 3 columnas se aprietan en pantalla chica
     → una por fila. El !important gana sobre el grid-template inline. */
  .bp-stat-grid { grid-template-columns: 1fr !important; }
  /* Modal "Cargar pedido" (hecho a mano con estilos inline): fullscreen en móvil
     en vez de tarjeta con márgenes → más espacio útil para el formulario. */
  #pm-backdrop { padding: 0 !important; }
  #pm-backdrop > div {
    max-width: 100vw !important;
    min-height: 100vh;
    border-radius: 0 !important;
    margin: 0 !important;
  }
}


/* ============ LOGÍSTICA · tabla tipo planilla (Siempre a Tiempo) ============
   Desktop-first: encabezado fijo dentro del scroll de la tabla + las 2 primeras columnas fijas (N° 46px y Cliente).
   Las celdas fijas necesitan fondo opaco (si no, se ve lo que pasa por debajo al scrollear de costado). */
.main.main--logi { max-width: none; min-width: 0; } /* item de grilla: sin min-width:0 la tabla ensancha la página */
.logi-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.logi-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logi-head h1 { margin: 0; font-size: 18px; line-height: 1.3; flex: 1; min-width: 220px; }
.logi-nav { display: flex; gap: 6px; }
.logi-nav button { border: 1px solid var(--border); background: var(--ink-100); color: var(--fg); width: 34px; height: 34px; border-radius: 9px; font-size: 18px; line-height: 1; }
.logi-nav button:disabled { opacity: .35; cursor: default; }
.logi-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--fg-mute); }
.logi-bar .btn { font-size: 13px; padding: 6px 11px; }
.logi-link { background: none; border: 0; padding: 0; color: var(--accent-cyan, #8FD4DE); font-size: 12px; text-decoration: underline; cursor: pointer; }
.logi-aviso { color: #f59e0b; font-size: 13px; }
.logi-vacio-box { padding: 22px; color: var(--fg-mute); border: 1px dashed var(--border); border-radius: 12px; text-align: center; }
.logi-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.logi-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.logi-chip { border: 1px solid var(--border); background: var(--ink-100); color: var(--fg-muted); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.logi-chip b { margin-left: 6px; color: var(--fg); font-variant-numeric: tabular-nums; }
.logi-chip:hover { border-color: var(--border-strong); color: var(--fg); }
.logi-chip.cero { opacity: .5; }
.logi-chip.on { background: var(--neon-cyan); border-color: var(--neon-cyan); color: var(--ink-050); opacity: 1; }
.logi-chip.on b { color: var(--ink-050); }
.logi-q { margin-left: auto; flex: 0 1 300px; min-width: 200px; background: var(--ink-100); border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px; color: var(--fg); font-size: 13px; }
.logi-q:focus { outline: none; border-color: var(--neon-cyan); }
.logi-tot { font-size: 12.5px; color: var(--fg-mute); }
.logi-ayuda { font-size: 11.5px; color: var(--fg-faint); }
.logi-scroll { position: relative; overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: 10px; background: var(--ink-100); outline: none; }
.logi-scroll:focus-visible { outline: none; }
.logi-t { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; line-height: 1.25; color: var(--fg); }
.logi-t th, .logi-t td { box-sizing: border-box; height: 34px; padding: 0 7px; border-right: 1px solid var(--ink-300); border-bottom: 1px solid var(--ink-300); background: var(--ink-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; text-align: left; }
.logi-t td { position: relative; }
.logi-t thead th { position: sticky; z-index: 2; background: var(--ink-200); color: var(--fg-muted); font-weight: 700; }
.logi-t thead tr.g th { top: 0; height: 24px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; text-align: center; color: var(--fg-subtle); border-top: 2px solid transparent; }
.logi-t thead tr.h th { top: 24px; height: 30px; font-size: 12px; white-space: normal; line-height: 1.1; }
.logi-t thead th.g-cli { border-top-color: #8FD4DE; }
.logi-t thead th.g-dir { border-top-color: #a78bfa; }
.logi-t thead th.g-paq { border-top-color: #f59e0b; }
.logi-t thead th.g-env { border-top-color: #22c55e; }
.logi-t .stk1 { position: sticky; left: 0; z-index: 1; border-left: 3px solid transparent; }
.logi-t .stk2 { position: sticky; left: 46px; z-index: 1; border-right: 1px solid var(--ink-400); }
.logi-t thead .stk1, .logi-t thead .stk2 { z-index: 3; }
.logi-t thead tr.g th.stk1 { border-right: 1px solid var(--ink-400); }
.logi-t .c-num, .logi-t .c-bultos, .logi-t .c-envio_pagado, .logi-t .c-enviado { text-align: center; }
.logi-t .c-envio_costo { text-align: right; font-variant-numeric: tabular-nums; }
.logi-t td.c-num b { font-size: 14px; font-variant-numeric: tabular-nums; }
.logi-t tbody tr:hover td { background: #15151f; }
.logi-t td.ed { cursor: cell; }
.logi-t td.sel { box-shadow: inset 0 0 0 2px var(--neon-cyan); }
.logi-t td.falta, .logi-t tbody tr:hover td.falta { background: color-mix(in srgb, #ef4444 14%, var(--ink-100)); }
.logi-t td.err, .logi-t tbody tr:hover td.err { background: color-mix(in srgb, #ef4444 32%, var(--ink-100)); color: #fecaca; }
.logi-t td.guardando { color: var(--fg-subtle); }
.logi-t td.guardando::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--neon-cyan); animation: pulse 1s infinite; pointer-events: none; }
.logi-t tr.r-impago td.stk1 { border-left-color: #ef4444; }
.logi-t tr.r-listo td.stk1 { border-left-color: #22c55e; }
.logi-t tr.r-sindef td.stk1 { border-left-color: #f59e0b; }
.logi-t tr.r-enviado td { color: var(--fg-subtle); }
.logi-t tr.r-enviado td > * { opacity: .6; }
.logi-t tr.logi-vacio td { height: auto; padding: 22px 16px; color: var(--fg-mute); white-space: normal; }
.logi-cli { display: flex; align-items: center; gap: 6px; min-width: 0; }
.logi-cli .nt { flex: 1; min-width: 0; line-height: 1.15; }
.logi-cli .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.logi-cli .t { font-size: 11px; color: var(--fg-subtle); overflow: hidden; text-overflow: ellipsis; }
.logi-wa { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; background: #25D366; color: #062b14; display: inline-flex; align-items: center; justify-content: center; }
.logi-wa:hover { filter: brightness(1.1); }
.logi-wa:disabled { opacity: .3; cursor: not-allowed; }
.logi-rojo { color: #f87171; }
.logi-ped { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.logi-pill { font-size: 10.5px; font-weight: 700; line-height: 14px; padding: 0 6px; border-radius: 6px; white-space: nowrap; }
.logi-pill.v { color: #22c55e; background: color-mix(in srgb, #22c55e 16%, transparent); }
.logi-pill.r { color: #f87171; background: color-mix(in srgb, #ef4444 18%, transparent); }
.logi-pill.a { color: #f59e0b; background: color-mix(in srgb, #f59e0b 16%, transparent); }
.logi-calle { display: flex; align-items: center; gap: 5px; min-width: 0; }
.logi-calle .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.logi-tag { flex: 0 0 auto; font-size: 9.5px; font-weight: 700; line-height: 14px; padding: 0 4px; border-radius: 5px; border: 1px solid currentColor; }
.logi-tag.c { color: var(--neon-cyan); }
.logi-tag.a { color: #f59e0b; }
.logi-ico { flex: 0 0 auto; width: 22px; height: 22px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--fg-subtle); padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.logi-ico:hover { border-color: var(--ink-400); color: var(--fg); background: var(--ink-200); }
.logi-mute { color: var(--fg-subtle); }
.logi-t .est { font-size: 10.5px; color: var(--fg-faint); }
.logi-t select.logi-sel { width: 100%; height: 26px; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 5px; color: inherit; font: inherit; font-size: 12.5px; padding: 0 2px; cursor: pointer; }
.logi-t select.logi-sel:hover, .logi-t select.logi-sel:focus { border-color: var(--ink-400); background: var(--ink-200); outline: none; }
.logi-t select.logi-sel option { background: var(--ink-200); color: var(--fg); font-style: normal; }
.logi-t select.ce-sin { color: var(--fg-subtle); }
.logi-t select.ce-escrito { color: #38bdf8; }
.logi-t select.ce-no_contesta { color: #f59e0b; }
.logi-t select.ce-confirmado { color: #22c55e; }
.logi-t td.sug select.logi-sel { color: var(--fg-subtle); font-style: italic; }
.logi-tr { display: flex; align-items: center; gap: 4px; min-width: 0; }
.logi-ok { flex: 0 0 auto; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid #22c55e; background: transparent; color: #22c55e; font-weight: 800; font-size: 12px; }
.logi-ok:hover { background: color-mix(in srgb, #22c55e 18%, transparent); }
.logi-t input.logi-chk { width: 17px; height: 17px; margin: 0; vertical-align: middle; accent-color: #22c55e; cursor: pointer; }
.logi-t input.logi-chk.bloq { opacity: .45; }
.logi-t input.logi-chk:disabled { cursor: not-allowed; }
.logi-ed { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; box-sizing: border-box; margin: 0; border: 2px solid var(--neon-cyan); border-radius: 0; background: var(--ink-050); color: var(--fg); font: inherit; font-size: 13px; padding: 0 6px; outline: none; }
.logi-pop { position: fixed; z-index: 250; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto; background: var(--ink-200); border: 1px solid var(--ink-400); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.55); padding: 12px 14px; font-size: 13px; color: var(--fg); }
.logi-pop-h { display: flex; align-items: center; gap: 8px; }
.logi-pop-h b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logi-x { border: 0; background: transparent; color: var(--fg-subtle); font-size: 20px; line-height: 1; padding: 0 4px; }
.logi-x:hover { color: var(--fg); }
.logi-pop .tit { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-subtle); margin: 12px 0 4px; }
.logi-pop pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: var(--ink-100); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.logi-pop .logi-h { font-size: 12px; color: var(--fg-muted); line-height: 1.6; }
.logi-pop .acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.logi-pop .acc .btn { font-size: 12.5px; padding: 6px 11px; }

/* Logística (12-oct): tabla de 7 columnas, sin la fila de grupos; Estado; formulario de dirección. */
.logi-t.sin-grupos thead tr.h th { top: 0; height: 34px; }
.logi-t select.est-sin { color: var(--fg-subtle); }
.logi-t select.est-contactado { color: #38bdf8; }
.logi-t select.est-enviado { color: #22c55e; }
.logi-t td.c-direccion { cursor: pointer; }
.logi-cli .n .logi-pill { margin-left: 4px; vertical-align: 1px; }
.logi-pop .logi-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.logi-pop .logi-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.logi-pop .logi-f.ancho { grid-column: 1 / -1; }
.logi-pop .logi-f > span { font-size: 11px; color: var(--fg-subtle); }
.logi-pop .logi-f input { box-sizing: border-box; width: 100%; height: 32px; background: var(--ink-100); border: 1px solid var(--border); border-radius: 7px; color: var(--fg); font: inherit; font-size: 13px; padding: 0 9px; }
.logi-pop .logi-f input:focus { outline: none; border-color: var(--neon-cyan); }
.logi-pop .logi-f.falta input { border-color: #ef4444; background: color-mix(in srgb, #ef4444 10%, var(--ink-100)); }
.logi-pop .logi-f input:disabled { opacity: .6; }

/* Logística como tablero (12-oct): mismo formato que el panel de Corte — un renglón por cliente. */
.lb-list { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--ink-100); }
.lb-vacio { padding: 24px; text-align: center; color: var(--fg-mute); }
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-row { box-shadow: inset 3px 0 0 transparent; }
.lb-row.r-impago { box-shadow: inset 3px 0 0 #ef4444; }
.lb-row.r-sindef { box-shadow: inset 3px 0 0 #f59e0b; }
.lb-row.r-enviado .lb-head { opacity: .62; }
.lb-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; min-height: 46px; box-sizing: border-box; }
.lb-head:hover { background: rgba(255,255,255,.025); }
.lb-tog { color: var(--fg-subtle); font-size: 11px; flex: 0 0 auto; display: inline-block; transition: transform .12s; }
.lb-row.abierto .lb-tog { transform: rotate(90deg); }
.lb-nom { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.lb-nom .n { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lb-nom .logi-pill { flex: 0 0 auto; }
.logi-pill.g { color: var(--fg-muted); background: color-mix(in srgb, #94a3b8 16%, transparent); }
.lb-meta { font-size: 11.5px; color: var(--fg-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.lb-meta .est { font-size: 10.5px; color: var(--fg-faint); }
.lb-head [data-lb-part="estado"], .lb-head [data-lb-part="transp"], .lb-head [data-lb-part="costo"], .lb-head [data-lb-part="wa"] { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.lb-head .guardando { opacity: .6; }
/* Etiquetas que se eligen (Estado / Transporte): select con cara de chip, como los del panel de Corte. */
select.lb-sel { -webkit-appearance: none; appearance: none; border: 0; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 700; line-height: 18px; padding: 2px 20px 2px 8px; cursor: pointer; max-width: 190px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 11px) 52%, calc(100% - 7px) 52%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
select.lb-sel:focus { outline: 1px solid var(--neon-cyan); outline-offset: 1px; }
select.lb-sel option { background: var(--ink-200); color: var(--fg); font-weight: 600; font-style: normal; }
select.lb-sel.est-sin { color: #94a3b8; background-color: color-mix(in srgb, #94a3b8 16%, transparent); }
select.lb-sel.est-contactado { color: #38bdf8; background-color: color-mix(in srgb, #38bdf8 16%, transparent); }
select.lb-sel.est-enviado { color: #22c55e; background-color: color-mix(in srgb, #22c55e 16%, transparent); }
select.lb-sel.tr { color: var(--fg); background-color: color-mix(in srgb, #94a3b8 14%, transparent); }
select.lb-sel.tr.sug, select.lb-sel.tr.vacio { color: var(--fg-subtle); font-style: italic; }
.lb-otro { width: 150px; height: 24px; box-sizing: border-box; background: var(--ink-200); border: 1px solid var(--neon-cyan); border-radius: 7px; color: var(--fg); font: inherit; font-size: 12px; padding: 0 8px; }
.lb-costo { width: 92px; height: 26px; box-sizing: border-box; text-align: right; background: transparent; border: 1px dashed var(--border); border-radius: 7px; color: var(--fg); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 0 8px; }
.lb-costo::placeholder { color: var(--fg-faint); }
.lb-costo:hover { border-color: var(--ink-400); }
.lb-costo:focus { outline: none; border-style: solid; border-color: var(--neon-cyan); background: var(--ink-200); }
.lb-costo.err { border-style: solid; border-color: #ef4444; background: color-mix(in srgb, #ef4444 14%, transparent); }
/* Renglón abierto: dirección (formulario) + texto original / paquete / historial. */
.lb-det { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; background: rgba(0,0,0,.16); border-top: 1px solid var(--border); padding: 12px 14px 14px 32px; font-size: 13px; }
.lb-tit { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-subtle); margin: 10px 0 5px; }
.lb-det-dir > .lb-tit:first-child, .lb-det-info > .lb-tit:first-child { margin-top: 0; }
.lb-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lb-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb-f.ancho { grid-column: 1 / -1; }
.lb-f > span { font-size: 11px; color: var(--fg-subtle); }
.lb-f input { box-sizing: border-box; width: 100%; height: 32px; background: var(--ink-100); border: 1px solid var(--border); border-radius: 7px; color: var(--fg); font: inherit; font-size: 13px; padding: 0 9px; }
.lb-f input:focus { outline: none; border-color: var(--neon-cyan); }
.lb-f.falta input { border-color: #ef4444; background: color-mix(in srgb, #ef4444 10%, var(--ink-100)); }
.lb-f input:disabled { opacity: .6; }
.lb-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.lb-acc .btn { font-size: 12.5px; padding: 6px 12px; }
.lb-det pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12.5px; background: var(--ink-100); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.lb-mini { font-size: 11.5px !important; padding: 4px 10px !important; margin-top: 6px; }
.lb-det .logi-h { font-size: 12px; color: var(--fg-muted); line-height: 1.6; }
@media (max-width: 760px) {
  .lb-head { flex-wrap: wrap; row-gap: 6px; }
  .lb-nom { flex: 1 1 calc(100% - 60px); }
  .lb-meta { order: 5; flex: 1 1 100%; padding-left: 21px; }
  .lb-det { grid-template-columns: 1fr; padding-left: 14px; }
}
/* Pestañas de Envíos ("📦 Alumnos (insumos)" / "🔴 Producción neón", como las de Neyen en Corte) y la lista de neón (reusa .lb-*) */
.logi-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.logi-tabs .btn { font-size: 13px; padding: 7px 14px; }
.ln-num { flex: 0 0 auto; font-size: 12px; font-weight: 800; line-height: 18px; padding: 0 7px; border: 1px solid var(--fg-mute); border-radius: 7px; font-variant-numeric: tabular-nums; }
.ln-hace { flex: 0 0 auto; font-size: 11.5px; color: var(--fg-subtle); white-space: nowrap; }
.ln-hace.viejo { color: #f87171; font-weight: 700; }
.lb-head .ln-acc { flex: 0 0 auto; font-size: 12.5px; padding: 5px 12px; }
.lb-head .ln-acc:disabled { opacity: .45; cursor: not-allowed; }
.ln-cartel { font-size: 13px; line-height: 1.55; }
.lb-tit.ln-sub { margin: 8px 0 0; }
.lb-det .sf-fotos { margin-top: 2px; }
@media (max-width: 760px) {
  .ln-row .lb-nom { flex: 1 1 calc(100% - 110px); flex-wrap: wrap; row-gap: 4px; }
  .ln-row .lb-nom .n { white-space: normal; }
  .ln-row .ln-hace { order: 6; padding-left: 21px; }
  .ln-row .ln-acc { order: 7; margin-left: auto; }
}

/* ===== Pedidos de corte de Sin Frontera (21-oct-2026): formulario rápido + lista (reusa .lb-*, .ln-num y .logi-pill) ===== */
.sfc-form { display: flex; flex-direction: column; gap: 14px; max-width: 760px; background: var(--ink-100); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.sfc-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 22px 14px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.sfc-drop:hover, .sfc-drop:focus-visible, .sfc-drop.sobre { border-color: var(--neon-cyan); background: color-mix(in srgb, var(--neon-cyan) 7%, transparent); outline: none; }
.sfc-drop-t { font-weight: 700; font-size: 15px; }
.sfc-drop-s { font-size: 12px; color: var(--fg-subtle); margin-top: 4px; }
.sfc-files { display: flex; flex-direction: column; gap: 6px; }
.sfc-files:empty { display: none; }
.sfc-file { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--ink-200); font-size: 13px; }
.sfc-file-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sfc-file-s { flex: 0 0 auto; font-size: 12px; color: var(--fg-subtle); font-variant-numeric: tabular-nums; }
.sfc-file.ok .sfc-file-s { color: #22c55e; }
.sfc-file.error { border-color: #ef4444; }
.sfc-file.error .sfc-file-s { color: #f87171; }
.sfc-bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; }
.sfc-bar i { display: block; height: 100%; background: var(--neon-cyan); transition: width .2s; }
.sfc-x { flex: 0 0 auto; background: none; border: 0; color: var(--fg-subtle); font-size: 14px; cursor: pointer; padding: 2px 4px; }
.sfc-x:hover { color: #f87171; }
.sfc-campo { display: flex; flex-direction: column; gap: 6px; }
.sfc-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-subtle); font-weight: 700; }
.sfc-lbl .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sfc-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sfc-chip { border: 1px solid var(--border); background: var(--ink-200); color: var(--fg); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sfc-chip:hover { border-color: var(--neon-cyan); }
.sfc-chip.on { background: var(--neon-cyan); border-color: var(--neon-cyan); color: var(--ink-050); }
/* Muestras de color (22-oct): círculo con el color; transparente cuadriculado; sin muestra, rayado. */
.sfc-chip { display: inline-flex; align-items: center; }
.sfc-sw { display: inline-block; flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%; background: var(--sw, transparent); border: 1px solid rgba(255,255,255,.4); margin-right: 7px; vertical-align: -2px; box-sizing: border-box; }
.sfc-sw.trans { background: conic-gradient(#b9bdc3 25%, #f5f6f7 0 50%, #b9bdc3 0 75%, #f5f6f7 0) 0 0 / 5px 5px; opacity: .85; }
.sfc-sw.nada { background: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 2px, transparent 2px 4px); }
.sfc-chip.on .sfc-sw { border-color: rgba(0,0,0,.45); }
.sfc-chip-nuevo { border-style: dashed; }
.sfc-nuevo { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px dashed var(--neon-cyan); border-radius: 12px; }
.sfc-picker { position: relative; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); cursor: pointer; }
.sfc-picker input[type=color] { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); border: 0; padding: 0; background: none; cursor: pointer; }
.sfc-nuevo-nom { flex: 1 1 220px; min-width: 0; }
.sfc-nuevo-ok { flex: 0 0 auto; }
.sfc-mat .sfc-sw { width: 11px; height: 11px; margin: 0 4px 0 1px; vertical-align: -1px; }
.sfc-otro { width: 104px; height: 37px; box-sizing: border-box; border: 1px dashed var(--border); border-radius: 999px; background: transparent; color: var(--fg); font: inherit; font-size: 14px; padding: 0 12px; }
.sfc-otro:focus, .sfc-otro.on { outline: none; border-style: solid; border-color: var(--neon-cyan); }
.sfc-fecha { max-width: 220px; }
.sfc-acl { resize: vertical; min-height: 70px; font: inherit; font-size: 14px; }
.sfc-err { color: #f87171; font-size: 13px; }
.sfc-err:empty { display: none; }
.sfc-enviar { align-self: flex-start; font-size: 15px; padding: 11px 22px; }
.sfc-abrir { font-size: 13px !important; padding: 7px 14px !important; }
.sfc-cargar { display: flex; flex-direction: column; gap: 8px; }
.sfc-cargar-h { display: flex; align-items: center; gap: 10px; max-width: 760px; }
.sfc-cargar-h b { flex: 1; font-size: 14px; }
.lb-tit.sfc-tit { margin: 14px 0 0; }
.sfc-head { cursor: default; }
.sfc-head:hover { background: transparent; }
.sfc-acc { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
.sfc-est-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 7px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); white-space: nowrap; }
select.lb-sel.sfc-est { color: var(--c); background-color: color-mix(in srgb, var(--c) 16%, transparent); }
.sfc-cancelar, .sfc-editar { font-size: 12px !important; padding: 4px 10px !important; }
.sfc-det { padding: 0 14px 12px 58px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sfc-row.r-enviado .sfc-det { opacity: .62; }
.sfc-archs { display: flex; flex-wrap: wrap; gap: 6px; }
.sfc-arch { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfc-arch:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.sfc-acl-txt { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg-muted); }
.sfc-meta { font-size: 11.5px; color: var(--fg-faint); }
/* Nombre del pedido como título (26-oct): material, color y espesor pasan a la primera línea del detalle. Sin nombre (los
   cargados antes) = el nombre de los archivos en cursiva + la marca "sin nombre", que se toca para ponérselo. */
.sfc-nombre { font-size: 15px; font-weight: 600; }
.sfc-head .lb-nom .n.sin-nombre { font-style: italic; font-weight: 600; color: var(--fg-muted); padding-right: .2em; }   /* sin el padding, overflow:hidden comía la última letra en cursiva */
.sfc-sinnom { flex: 0 0 auto; font: inherit; font-size: 10.5px; font-weight: 700; line-height: 14px; padding: 0 6px; border-radius: 6px; border: 1px dashed var(--fg-subtle); background: transparent; color: var(--fg-muted); white-space: nowrap; }
button.sfc-sinnom { cursor: pointer; }
button.sfc-sinnom:hover, button.sfc-sinnom:focus-visible { border-style: solid; border-color: var(--neon-cyan); color: var(--neon-cyan); outline: none; }
.sfc-mat { font-weight: 600; color: var(--fg); }
.sfc-cargar-nota { font-size: 12px; color: var(--fg-subtle); max-width: 760px; margin-top: -4px; }
@media (max-width: 760px) {
  .sfc-form { padding: 12px; }
  .sfc-enviar { align-self: stretch; }
  .sfc-row .lb-nom { flex: 1 1 calc(100% - 110px); flex-wrap: wrap; row-gap: 4px; }
  .sfc-row .lb-nom .n { white-space: normal; }
  /* "sin nombre ✎" en el celular (donde la usa Sin Frontera): área táctil de ~32 px y separada del chip del vencimiento. */
  button.sfc-sinnom { min-height: 32px; padding: 4px 10px; line-height: normal; font-size: 12px; margin-right: 4px; touch-action: manipulation; }
  .sfc-acc { margin-left: auto; }
  .sfc-det { padding-left: 14px; }
}

/* ===== Producción de neón: pantalla del productor (celular primero) + vista de Gaspar (15-oct-2026) ===== */
.prod-app{min-height:100vh;background:var(--ink-0,#0b0b10);color:var(--fg);grid-column:1 / -1;width:100%;min-width:0}
/* #app es una grilla de 2 columnas (menú + contenido): la pantalla del productor ocupa las dos (si no, quedaba en la del menú, 240 px) */
.prod-top{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--ink-50,#111118);border-bottom:1px solid var(--border)}
.prod-body{max-width:760px;margin:0 auto;padding:12px 12px 40px}
.prod-resumen{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 12px}
.prod-resumen>div{background:var(--ink-100);border:1px solid var(--border);border-radius:10px;padding:10px}
.prod-resumen .k{font-size:11px;color:var(--fg-mute);text-transform:uppercase;letter-spacing:.05em}
.prod-resumen .v{font-size:18px;font-weight:700;margin-top:2px}
.prod-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.prod-tab{background:var(--ink-100);border:1px solid var(--border);color:var(--fg);border-radius:999px;padding:7px 13px;font-size:13px;cursor:pointer}
.prod-tab span{opacity:.65;margin-left:4px}
.prod-tab.on{background:var(--accent-cyan,#00d3e0);border-color:transparent;color:#000;font-weight:700}
.prod-tabs-adm{align-items:center}
.prod-card{display:flex;gap:12px;background:var(--ink-100);border:1px solid var(--border);border-radius:12px;padding:10px;margin-bottom:12px}
.prod-card-img{flex:0 0 38%;max-width:240px}
.prod-card-img img{width:100%;border-radius:8px;display:block;cursor:zoom-in;background:#000}
.prod-card-body{flex:1;min-width:0}
.prod-card-title{font-size:16px;font-weight:700;line-height:1.2}
.prod-pill{font-size:11px;font-weight:700;border:1px solid;border-radius:999px;padding:3px 9px;white-space:nowrap}
.prod-mini{display:inline-block;font-size:10px;font-weight:600;border:1px solid;border-radius:999px;padding:1px 7px;margin-left:6px;white-space:nowrap;vertical-align:middle}
.prod-alerta{margin-top:8px;font-size:12px;font-weight:700;color:#FFB020}
.prod-chips{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:6px;margin-top:8px}
.prod-chips>div{background:var(--ink-50,#111118);border:1px solid var(--border);border-radius:8px;padding:5px 8px;font-size:13px;overflow-wrap:anywhere}
.prod-chips span{display:block;font-size:10px;color:var(--fg-mute);text-transform:uppercase;letter-spacing:.05em}
.prod-aclaracion{margin-top:8px;font-size:13px;background:rgba(255,176,32,.08);border-left:3px solid #FFB020;padding:7px 9px;border-radius:0 8px 8px 0}
.prod-monto{margin-top:10px;font-size:14px}
.prod-monto b{font-size:17px}
.prod-fotos{margin-top:10px}
.prod-fotos-grid{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.prod-foto{position:relative}
.prod-foto img{width:70px;height:70px;object-fit:cover;border-radius:8px;display:block;cursor:zoom-in}
.prod-foto button{position:absolute;top:-6px;right:-6px;width:22px;height:22px;border-radius:50%;border:none;background:#FF5566;color:#fff;font-size:12px;cursor:pointer;line-height:22px;padding:0}
.prod-foto-add{display:inline-flex;align-items:center;justify-content:center;height:70px;padding:0 14px;border:1px dashed var(--border);border-radius:8px;font-size:13px;cursor:pointer;color:var(--fg)}
.prod-foto-add.busy{opacity:.6;cursor:wait}
.prod-acciones{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.prod-acciones .btn{flex:1;min-width:130px;padding:10px 12px;font-size:14px}
.prod-bulk{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:6px 0 10px}
.prod-h3{font-size:14px;margin:18px 0 8px;color:var(--fg)}
@media (max-width:560px){
  .prod-card{flex-direction:column}
  .prod-card-img{max-width:none;flex:none}
  .prod-resumen .v{font-size:15px}
}
/* ===== Sin Frontera (usuario externo): reusa el tablero de logística (.logi-*, .lb-*) ===== */
.sf-num { font-size: 12px; font-weight: 700; color: var(--fg-subtle); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.sf-est { flex: 0 0 auto; display: inline-flex; align-items: center; }
select.lb-sel.sf-sel { max-width: 200px; }
.sf-det { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.sf-dato { display: flex; gap: 10px; font-size: 13px; line-height: 1.45; padding: 2px 0; }
.sf-dato > span { flex: 0 0 150px; color: var(--fg-subtle); font-size: 12px; }
.sf-dato > b { font-weight: 600; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.sf-fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.sf-foto { padding: 0; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--ink-200); cursor: zoom-in; }
.sf-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-hist { font-size: 12px; color: var(--fg-muted); line-height: 1.6; }
.sf-lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.sf-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; }
.sf-lightbox button { position: fixed; top: 16px; right: 20px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; cursor: pointer; }
.modal.sf-modal { max-width: 860px; max-height: 88vh; }
.sf-modal .modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sf-modal .modal-h .btn { font-size: 12.5px; padding: 6px 12px; }
.sf-resumen { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--ink-100); }
.sf-resumen > div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--fg); }
.sf-resumen > div > span { font-size: 10.5px; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .05em; }
.sf-cartel { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sf-cartel-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--ink-100); font-size: 14px; color: var(--fg); }
.sf-cartel-b { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; padding: 10px 12px; }
.sf-cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--border); color: var(--fg-muted); }
.sf-tabla { overflow-x: auto; }
@media (max-width: 760px) {
  .sf-det, .sf-cartel-b { grid-template-columns: 1fr; }
  .sf-dato > span { flex-basis: 110px; }
}

/* Producción en la tabla de Pedidos (columna Productor, admin) */
.prod-sel{background:var(--ink-100);border:1px solid var(--border);border-radius:var(--r-pill,999px);padding:3px 8px;font-size:12px;color:var(--fg);max-width:140px}
.prod-celda-linea{font-size:11px;margin-top:4px;color:var(--fg-mute);white-space:nowrap}
.prod-pagar{background:rgba(46,204,113,.14);border:1px solid rgba(46,204,113,.45);color:#6ef0a0;border-radius:999px;padding:1px 8px;font-size:11px;cursor:pointer}
.prod-resumen-filtro{font-size:13px;padding:8px 14px;border-bottom:1px solid var(--border);background:rgba(255,176,32,.05)}

/* Visor de fotos de producción (encima de todo, no cierra el detalle) */
.prod-visor{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center;padding:16px;cursor:zoom-out}
.prod-visor img{max-width:100%;max-height:100%;border-radius:8px;object-fit:contain}
.prod-visor button{position:absolute;top:12px;right:14px;width:36px;height:36px;border-radius:50%;border:none;background:rgba(255,255,255,.15);color:#fff;font-size:16px;cursor:pointer}

/* Tabla de Pedidos: más compacta para que entre con la columna Productor (16-oct). Si igual no entra (pantalla
   chica), se desplaza de costado dentro de la tarjeta en vez de cortarse. */
#table-pedidos { overflow-x: auto; }
table.t.t-pedidos th, table.t.t-pedidos td { padding: 10px 8px; }
table.t.t-pedidos th:first-child, table.t.t-pedidos td:first-child { padding-left: 14px; }
table.t.t-pedidos th:last-child, table.t.t-pedidos td:last-child { padding-right: 14px; }
table.t.t-pedidos td.cliente { max-width: 165px; }
table.t.t-pedidos td.td-corta { max-width: 105px; }
/* Desplegables de Pago y Estado más angostos (el estilo inline les pone padding 8px y letter-spacing) */
table.t.t-pedidos td select { padding-left: 6px !important; padding-right: 4px !important; letter-spacing: 0 !important; }
table.t.t-pedidos td.td-ad { max-width: 120px; }
/* Origen de la venta a confirmar (solo Gaspar): la fila queda roja hasta que la confirma. */
table.t.t-pedidos tbody tr.ped-origen-pend { background: rgba(255,40,60,.10); box-shadow: inset 3px 0 0 #ff4d5e; }
table.t.t-pedidos tbody tr.ped-origen-pend:hover { background: rgba(255,40,60,.17); }
table.t.t-pedidos td.td-prod { min-width: 112px; }
table.t.t-pedidos .prod-sel { max-width: 118px; }
table.t.t-pedidos .prod-celda-linea { white-space: normal; line-height: 1.35; }

/* ===== Sin Frontera · tablero de producción (kanban por etapa) ===== */
.sfk-wrap .logi-bar { row-gap: 8px; }
.sfk-q { flex: 0 1 240px; min-width: 160px; margin-left: 0; }
.sfk-board { display: grid; grid-template-columns: repeat(5, minmax(168px, 1fr)) minmax(150px, .75fr); gap: 8px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
.sfk-col { display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 220px); background: var(--ink-050, #0f0f15); border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: var(--r-md); }
.sfk-col-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.sfk-col-ent .sfk-col-h { cursor: pointer; }
.sfk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.sfk-col-h .t { min-width: 0; line-height: 1.25; }
.sfk-col-h .n { margin-left: auto; font: 600 12px var(--font-mono, monospace); color: var(--fg); background: var(--ink-200); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.sfk-sub { font-size: 11px; color: var(--fg-subtle); padding: 0 10px 6px; margin-top: -4px; }
.sfk-col-list { flex: 1; min-height: 60px; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.sfk-vacio { border: 1px dashed var(--border); border-radius: 10px; padding: 14px 10px; text-align: center; font-size: 12px; color: var(--fg-subtle); }
.sfk-arrastrando .sfk-col { border-style: dashed; }
.sfk-col.drop-ok { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--ink-050, #0f0f15)); }
.sfk-card { display: flex; flex-direction: column; flex: 0 0 auto; background: var(--ink-100); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .12s, opacity .12s; }
.sfk-card:hover { border-color: var(--border-strong); }
.sfk-card:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 1px; }
.sfk-card.u-roja { box-shadow: inset 4px 0 0 #ef4444; }
.sfk-card.u-ambar { box-shadow: inset 4px 0 0 #f59e0b; }
.sfk-card.is-match { outline: 2px solid var(--neon-cyan); outline-offset: 1px; }
.sfk-card.is-moviendo { opacity: .55; pointer-events: none; }
.sfk-card.is-nueva { animation: sfk-llega 1.6s ease-out; }
.sfk-card.arrastrada { opacity: .4; }
@keyframes sfk-llega { 0% { box-shadow: 0 0 0 2px var(--c), 0 0 18px var(--c); } 100% { box-shadow: 0 0 0 0 transparent; } }
.sfk-thumb { position: relative; height: 88px; background: #000; flex: 0 0 auto; }
.sfk-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sfk-thumb-n { position: absolute; right: 6px; bottom: 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,.65); border-radius: 6px; padding: 1px 6px; }
.sfk-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sfk-top { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sfk-num { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 700; color: var(--fg-subtle); }
.sfk-etq { display: none; font-size: 10.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border-radius: 6px; padding: 0 6px; }
.sfk-hace { margin-left: auto; font-size: 11.5px; color: var(--fg-subtle); white-space: nowrap; }
.sfk-hace.viejo { color: #f59e0b; }
.sfk-nom { font-size: 15.5px; font-weight: 800; line-height: 1.2; color: var(--fg); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sfk-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.sfk-med { font-size: 13.5px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sfk-tipo { font-size: 12.5px; color: var(--fg-muted); }
.sfk-extra:empty { display: none; }
.sfk-pasar { width: 100%; min-height: 44px; border: 0; border-top: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 16%, var(--ink-100)); color: var(--c); font: 800 13.5px/1.15 var(--font-sans, inherit); padding: 9px 12px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: background .12s, color .12s; }
.sfk-card:hover .sfk-pasar, .sfk-pasar:hover, .sfk-pasar:focus-visible { background: var(--c); color: var(--ink-050, #0b0b10); }
.sfk-pasar:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (hover: none) { .sfk-pasar { background: var(--c); color: var(--ink-050, #0b0b10); } }
.sfk-ent { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--ink-100); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; color: var(--fg); cursor: pointer; }
.sfk-ent .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sfk-ent .f { color: var(--fg-subtle); font-size: 11.5px; }
.sfk-ent:hover { border-color: var(--border-strong); }
.sfk-todos { align-self: center; }
.sfk-ent-lista { display: flex; flex-direction: column; gap: 6px; }
/* El filtro oculta con [hidden]: sin esto, el display:flex/grid de la tarjeta le gana y quedan a la vista. */
.sfk-wrap [data-sfk-card][hidden] { display: none !important; }
.sfk-nores { margin-top: 4px; }
.sfk-excl { font-size: 12px; color: var(--fg-subtle); line-height: 1.7; }
.sfk-excl b { color: var(--fg-muted); }
.sfk-excl-it { white-space: nowrap; }
.logi-chip[disabled] { opacity: .45; cursor: default; }
/* Celular en horizontal o notebooks con zoom: las columnas crecen y scrollea la página. */
@media (min-width: 761px) and (max-height: 560px) { .sfk-col { max-height: none; } .sfk-col-list { overflow: visible; } }
/* Pantallas medianas: Entregado queda como un riel finito (todo el riel abre la lista completa). */
@media (min-width: 761px) and (max-width: 1499px) {
  .sfk-board { grid-template-columns: repeat(5, minmax(168px, 1fr)) 56px; }
  .sfk-col-ent .sfk-col-h { flex-direction: column; align-items: center; gap: 10px; padding: 12px 4px; }
  .sfk-col-ent .sfk-col-h .t { writing-mode: vertical-rl; transform: rotate(180deg); }
  .sfk-col-ent .sfk-col-h .n { margin: 0; }
  .sfk-col-ent .sfk-sub, .sfk-col-ent .sfk-col-list { display: none; }
}
@media (min-width: 761px) and (max-width: 1279px) {
  .sfk-board { grid-template-columns: repeat(5, minmax(220px, 1fr)) 56px; scroll-snap-type: x proximity; }
  .sfk-col { scroll-snap-align: start; }
}
/* Celular: una pestaña por etapa y tarjetas horizontales. Con búsqueda, todas las etapas con resultados una abajo de otra. */
.sfk-tabs { display: none; }
@keyframes sfk-titila { 50% { transform: scale(1.08); } }
@media (max-width: 760px) {
  .sfk-tabs { display: flex; position: sticky; top: 0; z-index: 5; gap: 6px; overflow-x: auto; padding: 8px 0; background: var(--bg, #0A0A0F); scrollbar-width: none; }
  .sfk-tab { flex: 0 0 auto; min-height: 40px; border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border)); background: var(--ink-100); color: var(--fg); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; }
  .sfk-tab b { margin-left: 4px; color: var(--c); }
  .sfk-tab.on { background: var(--c); color: var(--ink-050, #0b0b10); border-color: var(--c); }
  .sfk-tab.on b { color: inherit; }
  .sfk-tab.cero { opacity: .5; }
  .sfk-tab.titila { animation: sfk-titila .4s ease-in-out 2; }
  .sfk-board { display: block; overflow: visible; }
  .sfk-col { display: none; max-height: none; border: 0; background: none; }
  .sfk-col.on-cel { display: flex; }
  .sfk-col-h, .sfk-sub { display: none; }
  .sfk-col-list { overflow: visible; padding: 0; }
  [data-sfk-zona].buscando .sfk-tabs { display: none; }
  [data-sfk-zona].buscando .sfk-col { display: flex; margin-bottom: 10px; }
  [data-sfk-zona].buscando .sfk-col.sin-res { display: none; }
  [data-sfk-zona].buscando .sfk-col-h { display: flex; padding: 4px 2px; }
  [data-sfk-zona].buscando .sfk-etq { display: inline-block; }
  .sfk-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); }
  .sfk-card:not(:has(.sfk-thumb)) { grid-template-columns: minmax(0, 1fr); }
  .sfk-thumb { height: auto; min-height: 92px; }
  .sfk-pasar { grid-column: 1 / -1; min-height: 52px; font-size: 16px; }
  .sfk-nom { font-size: 17px; }
  .sfk-q { flex: 1 1 100%; }
}
/* Panel de detalle (el ticket completo) */
.sfd-bg { position: fixed; inset: 0; z-index: 290; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .18s; }
.sfd-bg.open { opacity: 1; pointer-events: auto; }
.sfd { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 94vw); background: var(--ink-200); border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; transform: translateX(16px); transition: transform .18s; box-shadow: -12px 0 40px rgba(0,0,0,.45); }
.sfd-bg.open .sfd { transform: none; }
.sfd-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--border); }
.pwa-standalone .sfk-tabs { top: env(safe-area-inset-top, 0px); }
.sfd-tit { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; flex-wrap: wrap; }
.sfd-tit h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--fg); overflow-wrap: anywhere; }
.sfd-etq { font-size: 11.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border-radius: 7px; padding: 2px 8px; }
.sfd-nav { display: flex; gap: 4px; flex: 0 0 auto; }
.sfd-nav .btn { padding: 5px 10px; font-size: 14px; }
.sfd-body { flex: 1; overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.sfd-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.sfd-step { min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--ink-100); color: var(--fg-subtle); font-size: 11.5px; font-weight: 700; padding: 4px 2px; cursor: pointer; line-height: 1.15; }
.sfd-step.hecho { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.sfd-step.actual { background: var(--c); border-color: var(--c); color: var(--ink-050, #0b0b10); cursor: default; }
.sfd-step:not(.actual):hover { border-color: var(--c); color: var(--c); }
.sfd-avisos { gap: 6px; }
.sfd-media { display: flex; flex-direction: column; gap: 8px; }
.sfd-diseno { padding: 0; border: 1px solid var(--border); border-radius: 10px; background: #000; cursor: zoom-in; overflow: hidden; }
.sfd-diseno img { width: 100%; max-height: 280px; object-fit: contain; display: block; }
.sfd-orig { font-size: 12.5px; align-self: flex-start; }
.sfd-etapa { border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 7%, transparent); border-radius: 10px; padding: 10px 14px; }
.sfd-etapa .lb-tit { margin-top: 0; color: var(--c); }
.sfd-etapa .sf-dato > b { font-size: 15px; }
.sfd-sec > .lb-tit:first-child { margin-top: 0; }
.sfd-acc { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--ink-100); border-top: 1px solid var(--border); }
.sfd-acc:empty { display: none; }
.sfd-acc.is-moviendo { opacity: .55; pointer-events: none; }
.sfd-acc .sfd-pasar { flex: 1 1 240px; width: auto; border: 0; border-radius: 10px; background: var(--c); color: var(--ink-050, #0b0b10); min-height: 46px; font-size: 15px; }
.sfd-acc .btn { min-height: 46px; }
@media (max-width: 760px) {
  .sfd { width: 100vw; }
  .sfd-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sfd-acc .sfd-pasar { flex-basis: 100%; min-height: 52px; font-size: 16px; }
  .sfd-acc .btn { flex: 1; }
}

/* Tablero de producción de neón (nkb): mismas piezas que el de corpóreos (sfk-* / sfd-*), con 7 columnas. */
.nkb-wrap [data-nkb-card][hidden] { display: none !important; }
.sfk-board.nkb-board.n7 { grid-template-columns: repeat(6, minmax(164px, 1fr)) minmax(140px, .7fr); }
.sfk-board.nkb-board.n2 { grid-template-columns: minmax(260px, 1fr) minmax(220px, .7fr); max-width: 820px; }
/* Despachos de Neyen: Terminado · Esperando pago · Para enviar */
.sfk-board.nkb-board.n3 { grid-template-columns: repeat(3, minmax(240px, 1fr)); max-width: 1200px; }
@media (min-width: 761px) and (max-width: 1499px) { .sfk-board.nkb-board.n7 { grid-template-columns: repeat(6, minmax(176px, 1fr)) 56px; } }
@media (min-width: 761px) and (max-width: 1279px) { .sfk-board.nkb-board.n7 { grid-template-columns: repeat(6, minmax(220px, 1fr)) 56px; } }
@media (min-width: 761px) and (max-width: 1499px) {
  .sfk-board.nkb-board.n2 .sfk-col-ent .sfk-col-h { flex-direction: row; padding: 10px 10px 8px; }
  .sfk-board.nkb-board.n2 .sfk-col-ent .sfk-col-h .t { writing-mode: horizontal-tb; transform: none; }
  .sfk-board.nkb-board.n2 .sfk-col-ent .sfk-col-h .n { margin-left: auto; }
  .sfk-board.nkb-board.n2 .sfk-col-ent .sfk-sub, .sfk-board.nkb-board.n2 .sfk-col-ent .sfk-col-list { display: flex; }
  .sfk-board.nkb-board.n2 .sfk-col-ent .sfk-sub { display: block; }
}
.nkb-steps { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sfd-step.nkb-step-fijo { display: flex; align-items: center; justify-content: center; text-align: center; cursor: default; }
.nkb-mbtns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.nkb-mbtns .btn { width: 100%; min-height: 42px; }
@media (max-width: 760px) {
  .nkb-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [data-nkb-zona].buscando .sfk-tabs { display: none; }
  [data-nkb-zona].buscando .sfk-col { display: flex; margin-bottom: 10px; }
  [data-nkb-zona].buscando .sfk-col.sin-res { display: none; }
  [data-nkb-zona].buscando .sfk-col-h { display: flex; padding: 4px 2px; }
  [data-nkb-zona].buscando .sfk-etq { display: inline-block; }
}

/* ===== Cortes de Sin Frontera en tablero (26-oct-2026): columnas Pedido · En corte · Listo · Entregado con las piezas del de
   corpóreos (.sfk-col, .sfk-tabs) y los cancelados plegados abajo. La tarjeta es la fila de la lista (.sfc-row, sfcFilaHtml)
   adentro de .sfcb-card: sus cajas (.sfc-row, .sfc-head, .lb-nom, .sfc-det) pasan a display: contents y cada pieza se
   acomoda con order. Arriba: número, "sin nombre" y el plazo; el nombre; material; archivos; aclaraciones; quién y cuándo
   (un renglón); abajo a la derecha, Editar y el estado. ===== */
/* 168 px de mínimo: las cuatro columnas entran desde ~720 px de ancho (tablet vertical, 1024 con la barra lateral). */
.sfk-board.sfcb-board { grid-template-columns: repeat(4, minmax(168px, 1fr)); }
.sfcb-col .sfk-col-list { gap: 6px; padding: 0 6px 6px; }
.sfcb-card { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; flex: 0 0 auto; min-width: 0; padding: 6px 8px 7px; background: var(--ink-100); border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; transition: border-color .12s, opacity .12s; }
.sfcb-card:hover { border-color: var(--border-strong); }
/* Se agarra del número, el plazo, los bordes y el espacio libre; los textos se seleccionan (sfcbBindDrag). */
.sfcb-card[draggable], .sfcb-card[draggable] .ln-num, .sfcb-card[draggable] .lb-nom > .logi-pill { cursor: grab; }
.sfcb-card[draggable] .lb-nom .n, .sfcb-card[draggable] .sfc-mat, .sfcb-card[draggable] .sfc-acl-txt, .sfcb-card[draggable] .sfc-meta { cursor: text; }
.sfcb-card.u-roja { box-shadow: inset 4px 0 0 #ef4444; }
.sfcb-card.u-ambar { box-shadow: inset 4px 0 0 #f59e0b; }
.sfcb-card.fin { opacity: .8; }
.sfcb-card.is-moviendo { opacity: .5; pointer-events: none; }
.sfcb-card.is-nueva { animation: sfk-llega 1.6s ease-out; }
.sfcb-card.arrastrada { opacity: .4; }
.sfcb-card .sfc-row, .sfcb-card .sfc-head, .sfcb-card .lb-nom, .sfcb-card .sfc-det { display: contents; }
.sfcb-card .ln-num { order: 10; font-size: 11.5px; line-height: 17px; padding: 0 6px; }
.sfcb-card .sfc-sinnom { order: 20; }
.sfcb-card .lb-nom > .logi-pill { order: 30; margin-left: auto; white-space: normal; text-align: right; line-height: 15px; padding: 1px 6px; }
.sfcb-card .lb-nom .n { order: 40; flex: 1 1 100%; min-width: 0; font-size: 15px; font-weight: 800; line-height: 1.22; color: var(--fg); white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sfcb-card .sfc-mat { order: 50; flex: 1 1 100%; min-width: 0; font-size: 12.5px; color: var(--fg-muted); }
.sfcb-card .sfc-archs { order: 60; flex: 1 1 100%; min-width: 0; gap: 4px; }
.sfcb-card .sfc-arch { font-size: 11px; padding: 1px 7px; border-radius: 7px; }
.sfcb-card .sfc-acl-txt { order: 70; flex: 1 1 100%; min-width: 0; font-size: 12px; line-height: 1.35; }
.sfcb-card.acl-larga:not(.acl-abierta) .sfc-acl-txt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sfcb-mas { order: 75; margin-top: -3px; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--neon-cyan); cursor: pointer; }
.sfcb-mas:hover, .sfcb-mas:focus-visible { text-decoration: underline; outline: none; }
/* Quién y cuándo, en un renglón (entero en el title, sfcbTitulos: al lado de los botones quedaba en "Pedido el 18/10 0…"). */
.sfcb-card .sfc-meta { order: 80; flex: 1 1 100%; min-width: 0; font-size: 11px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfcb-card .sfc-acc { order: 90; flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin: 1px 0 0; padding: 0; border: 0; }
.sfcb-card select.lb-sel.sfc-est { font-size: 12px; line-height: 16px; padding: 2px 20px 2px 8px; }
.sfcb-card .sfc-cancelar, .sfcb-card .sfc-editar { font-size: 12px !important; line-height: 16px; padding: 2px 9px !important; }
/* Borrar (27-oct; solo Gaspar, en Pedido o Cancelado): discreto, rojo al pasar; en la tarjeta, a la izquierda, lejos del estado. */
.sfc-borrar { font-size: 12px !important; padding: 4px 10px !important; color: var(--fg-subtle) !important; border-color: transparent !important; }
.sfc-borrar:hover, .sfc-borrar:focus-visible { color: #ef4444 !important; border-color: color-mix(in srgb, #ef4444 55%, transparent) !important; background: color-mix(in srgb, #ef4444 10%, transparent) !important; outline: none; }
.sfcb-card .sfc-borrar { margin-right: auto; line-height: 16px; padding: 2px 9px !important; }
@media (max-width: 760px) { .sfcb-card .sfc-borrar { font-size: 13px !important; line-height: 20px; padding: 6px 12px !important; } }
.sfcb-col .sfk-todos { margin-top: 0; }
.sfcb-ayuda { margin-top: 2px; }
/* Cancelados: una barra plegable debajo del tablero; abierta, las tarjetas en grilla. */
.sfcb-canc { margin-top: 2px; background: var(--ink-050, #0f0f15); border: 1px solid var(--border); border-left: 3px solid var(--c); border-radius: var(--r-md); }
.sfcb-canc > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); user-select: none; }
.sfcb-canc > summary::-webkit-details-marker { display: none; }
.sfcb-canc > summary b { font: 600 12px var(--font-mono, monospace); color: var(--fg); background: var(--ink-200); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.sfcb-canc-ver { margin-left: auto; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--fg-subtle); }
.sfcb-canc-ver::after { content: ' ▸'; }
.sfcb-canc[open] .sfcb-canc-ver::after { content: ' ▾'; }
.sfcb-canc > summary:hover .sfcb-canc-ver { color: var(--fg); }
.sfcb-canc.drop-ok { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--ink-050, #0f0f15)); }
.sfcb-canc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; align-items: start; padding: 0 10px 10px; }
@media (max-width: 760px) {
  /* Las 4 pestañas siempre entran (360 px con contadores de dos o tres cifras): se achican y, si hace falta, el nombre se corta
     con "…" y el número queda entero. */
  .sfcb-tabs { gap: 4px; }
  .sfcb-tabs .sfk-tab { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; padding: 6px 7px; font-size: 12.5px; }
  .sfcb-tabs .sfk-tab .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sfcb-tabs .sfk-tab b { flex: 0 0 auto; margin-left: 4px; }
  .sfcb-col .sfk-col-list { gap: 8px; padding: 0; }
  .sfcb-card { padding: 11px 12px 12px; gap: 4px 6px; border-radius: 12px; font-size: 13px; }
  /* En el celular no hay mouse para ver el title: quién y cuándo, entero. Editar y el estado, separados por una raya. */
  .sfcb-card .sfc-meta { white-space: normal; }
  .sfcb-card .sfc-acc { gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
  .sfcb-card .lb-nom .n { font-size: 16.5px; }
  .sfcb-card .sfc-mat { font-size: 13px; }
  .sfcb-card select.lb-sel.sfc-est { font-size: 13px; line-height: 20px; padding: 6px 24px 6px 11px; }
  .sfcb-card .sfc-cancelar, .sfcb-card .sfc-editar { font-size: 13px !important; line-height: 20px; padding: 6px 12px !important; }
  .sfcb-canc-list { grid-template-columns: minmax(0, 1fr); padding: 0 8px 8px; }
}
@media (max-width: 359px) {
  /* Celulares de 320 px: pestañas un poco más chicas para que los nombres no queden en "L…". */
  .sfcb-tabs .sfk-tab { padding: 6px 5px; font-size: 11.5px; }
  .sfcb-tabs .sfk-tab b { margin-left: 3px; }
}
/* Filtro por material + color + espesor (27-oct-2026): un chip por combinación con lo que falta cortar; en la compu bajan de
   renglón, en el celular se deslizan de costado (sin mover la página). "🧩 Armar placas" a la derecha (abajo en el celular). */
.sfcb-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 8px 0 10px; }
.sfcb-fchips { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sfcb-fchip { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; border: 1px solid var(--border); background: var(--ink-100); color: var(--fg); border-radius: 999px; padding: 4px 5px 4px 11px; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 18px; cursor: pointer; white-space: nowrap; }
.sfcb-fchip:hover { border-color: var(--neon-cyan); }
.sfcb-fchip:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }
.sfcb-fchip .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sfcb-fchip .sfc-sw { width: 12px; height: 12px; margin-right: 6px; }
.sfcb-fchip b { flex: 0 0 auto; margin-left: 7px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink-200); color: var(--fg); font: 700 11.5px/18px var(--font-mono, monospace); text-align: center; }
.sfcb-fchip.cero { color: var(--fg-muted); }
.sfcb-fchip.cero b { color: var(--fg-subtle); background: transparent; }
.sfcb-fchip.on { background: var(--neon-cyan); border-color: var(--neon-cyan); color: var(--ink-050); }
.sfcb-fchip.on b { background: rgba(0,0,0,.2); color: var(--ink-050); }
.sfcb-fchip.on .sfc-sw { border-color: rgba(0,0,0,.45); }
.sfcb-armar { flex: 0 0 auto; margin-left: auto; font-size: 13px; padding: 7px 14px; }
/* Panel de "Armar placas" */
.modal.sfcb-armar-modal { max-width: 620px; max-height: 88vh; }
.sfcb-armar-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sfcb-ap-combo { display: flex; align-items: center; font-size: 15px; color: var(--fg); margin-bottom: 2px; }
.sfcb-ap-ayuda { font-size: 12.5px; color: var(--fg-subtle); margin-bottom: 10px; }
.sfcb-ap-lista { display: flex; flex-direction: column; gap: 8px; }
.sfcb-ap { border: 1px solid var(--border); border-radius: 10px; background: var(--ink-100); padding: 8px 10px; transition: opacity .12s; }
.sfcb-ap:not(.on) { opacity: .6; }
.sfcb-ap-h { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--fg); font-size: 14px; font-weight: 700; }
.sfcb-ap.nada .sfcb-ap-h { cursor: default; }
.sfcb-ap-h input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--neon-cyan); }
.sfcb-ap-h .ln-num { flex: 0 0 auto; }
.sfcb-ap-h .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sfcb-ap-h .n.sin-nombre { font-style: italic; color: var(--fg-muted); }
.sfcb-ap-archs { list-style: none; margin: 6px 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.sfcb-ap-archs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.sfcb-ap-archs .an { min-width: 0; overflow-wrap: anywhere; color: var(--fg); }
.sfcb-ap-archs .as { font-size: 12px; color: var(--fg-subtle); }
.sfcb-ap-archs li.no .an, .sfcb-ap-archs li.no .as { color: var(--fg-faint); }
.sfcb-ap-archs li.bajando .as { color: var(--neon-cyan); }
.sfcb-ap-archs li.hecho .as { color: #22c55e; }
.sfcb-ap-archs li.fallo .as { color: #f87171; }
.sfcb-ap-estado { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 13px; color: var(--fg); }
.sfcb-ap-estado:empty { display: none; }
.sfcb-ap-estado .err { color: #f87171; }
.sfcb-armar-pie { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); }
.sfcb-armar-pie .btn { min-height: 40px; }
.sfcb-armar-pie .btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 760px) {
  .sfcb-filtros { margin: 6px 0 2px; }
  .sfcb-fchips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 0; }
  .sfcb-fchips::-webkit-scrollbar { display: none; }
  .sfcb-fchip { flex: 0 0 auto; max-width: none; min-height: 36px; font-size: 13px; }
  .sfcb-armar { flex: 1 1 100%; justify-content: center; min-height: 42px; margin-left: 0; }
  .sfcb-armar-pie .btn { flex: 1 1 100%; justify-content: center; }
  .sfcb-ap-archs { margin-left: 0; }
}

/* Chat: en la compu los filtros (Todos, No leídos, Para cotizar, Por cobrar, Etiquetas, Servicio de corte) bajan a otra fila
   en vez de quedar cortados: la barra no tiene scroll visible y "Etiquetas" quedaba afuera (Gaspar 16-oct). En el celular
   sigue deslizandose de costado. */
@media (min-width: 769px) {
  .label-filter-bar { flex-wrap: wrap; white-space: normal; overflow: visible; row-gap: 6px; }
}

/* Productores en el switcher del admin (17-oct): apagados si todavía no tienen contraseña; aviso "estás viendo lo que ve…" */
.user-chip.off { opacity: .45; cursor: not-allowed; }
.user-chip.off:hover { border-color: var(--border); color: var(--fg-muted); }
.prod-ver-como { padding: 8px 14px 10px; font-size: 12px; color: var(--fg-muted); background: rgba(0, 229, 255, .06); border-bottom: 1px solid var(--border); }
.prod-ver-como .user-pick-chips { margin-top: 4px; }
/* Encargos de neón de Sin Frontera (30-oct) */
.sfe-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--ink-100); margin: 0 0 8px; max-width: 760px; }
.sfe-card-h { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sfe-card-d { font-size: 13px; color: var(--fg-mute); margin-top: 4px; overflow-wrap: anywhere; }
.sfe-card-d a { color: var(--neon-cyan); }
.sfe-fila { display: grid; grid-template-columns: 1fr 110px 1fr; gap: 12px; }
@media (max-width: 640px) { .sfe-fila { grid-template-columns: 1fr 1fr; } .sfe-fila .sfc-campo:last-child { grid-column: 1 / -1; } }
.sfe-banner { margin: 0 0 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--neon-cyan) 50%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--neon-cyan) 6%, transparent); }
.sfe-banner-h { font-weight: 700; margin: 0 0 8px; }
.sfe-modal-box { font-size: 12.5px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--neon-cyan) 8%, transparent); border: 1px solid color-mix(in srgb, var(--neon-cyan) 35%, var(--border)); overflow-wrap: anywhere; }
.sfe-modal-box a { color: var(--neon-cyan); }
.sfe-aviso-corte { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, #f5b942 50%, var(--border)); background: color-mix(in srgb, #f5b942 9%, transparent); font-size: 13.5px; max-width: 760px; }
