/* ─────────────────────────────────────────────────────────────
   Centralita — panel de campañas
   Referencia visual: un cuadro de conmutación telefónico.
   Latón para lo que está vivo, verde señal para lo que salió bien.
   ───────────────────────────────────────────────────────────── */

/* ── Temas ────────────────────────────────────────────────────
   Oscuro por defecto (es un panel que se mira durante horas) y claro
   para quien lo prefiera o para enseñarlo en una reunión con proyector.
   Cambia solo el color: la estructura y la tipografía son las mismas.   */

:root, [data-tema="oscuro"] {
  color-scheme: dark;
  --ink:      #0B111B;
  --panel:    #131C2A;
  --panel-2:  #0F1724;
  --line:     #223148;
  --line-2:   #2E4160;
  --brass:    #F0A93B;
  --signal:   #45D6A0;
  --coral:    #FF6B5E;
  --text:     #E7EEF8;
  --muted:    #7E90AC;
  --consola-tx: #B9C7DB;
  --consola-ts: #4B5C79;
  --consola-tag: #5E7397;
  --seg-off:  #56698A;
  --scrim:    rgba(5,9,15,.72);
  --sombra:   none;

  --display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'Consolas', ui-monospace, monospace;

  --r: 4px;
}

[data-tema="claro"] {
  color-scheme: light;
  --ink:      #F4F6FA;
  --panel:    #FFFFFF;
  --panel-2:  #FBFCFE;
  --line:     #DDE3ED;
  --line-2:   #C3CCDB;
  --brass:    #B87209;   /* más oscuro que en el tema oscuro: sobre blanco necesita contraste */
  --signal:   #12855C;
  --coral:    #C43B2C;
  --text:     #16202E;
  --muted:    #5C6B80;
  --consola-tx: #2B3646;
  --consola-ts: #93A0B2;
  --consola-tag: #6B7A8E;
  --seg-off:  #A8B4C4;
  --scrim:    rgba(22,32,46,.35);
  --sombra:   0 1px 2px rgba(22,32,46,.06);
  --consola-fondo: #F7F9FC;
}

* { box-sizing: border-box; }

/* El atributo hidden manda sobre cualquier display de clase */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

::selection { background: var(--brass); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* ───────── Barra superior ───────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: 52px; padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.brand { display: flex; align-items: baseline; gap: 10px; }

.brand-name {
  font-family: var(--display); font-weight: 700; font-size: 17px;
  letter-spacing: .16em; text-transform: uppercase;
}

.brand-sub {
  font-size: 11px; color: var(--muted);
  letter-spacing: .1em; text-transform: uppercase;
}

/* La clavija: el único adorno, y encima parpadea cuando hay línea */
.jack {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--line-2);
  align-self: center;
  transition: background .3s, border-color .3s, box-shadow .3s;
}
body.en-llamada .jack {
  background: var(--brass); border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(240,169,59,.16);
}

.topbar-right { display: flex; align-items: center; gap: 18px; }
.trunk { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.trunk.sim { color: var(--brass); letter-spacing: .04em; }
/* En simulación el borde superior queda a rayas: imposible confundirse */
body.simulacion .topbar {
  border-bottom: 2px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--brass) 0 14px, transparent 14px 28px) 2;
}

.link { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.link .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.link.ok .dot { background: var(--signal); }
.link.ok span { color: var(--signal); }
.link.warn .dot { background: var(--brass); }
.link.err .dot { background: var(--coral); }
.link.err span { color: var(--coral); }

/* ───────── Estructura ───────── */
.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  height: calc(100% - 52px);
}

.rail {
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  padding: 14px;
  overflow-y: auto;
}

.rail-title {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin: 22px 0 8px;
}

.rail-block { border-top: 1px solid var(--line); margin-top: 22px; }

.hint { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

.stage { overflow-y: auto; padding: 16px 20px 40px; }

/* ───────── Lista de campañas ───────── */
.camp-list { display: flex; flex-direction: column; gap: 6px; }

.camp-item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--r);
  padding: 9px 10px;
  cursor: pointer;
  background: transparent;
  text-align: left; width: 100%;
  color: inherit; font: inherit;
  transition: border-color .15s, background .15s;
}
.camp-item:hover { background: var(--panel); }
.camp-item.is-on { border-color: var(--line-2); border-left-color: var(--brass); background: var(--panel); }
.camp-item.corriendo { border-left-color: var(--signal); }

.camp-item-name { font-weight: 600; font-size: 13px; }
.camp-item-meta {
  display: flex; gap: 8px; margin-top: 4px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

.bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 7px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .b-ok { background: var(--signal); }
.bar .b-fail { background: var(--coral); }

/* ───────── Tira de línea (elemento firma) ───────── */
.strip {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.strip[data-active="true"] { border-color: rgba(240,169,59,.45); }

.strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.strip-num {
  font-size: 24px; font-weight: 600; letter-spacing: .02em;
  color: var(--muted);
}
.strip[data-active="true"] .strip-num { color: var(--text); }

.strip-meta { display: flex; align-items: center; gap: 12px; }
#stripTimer { font-size: 15px; color: var(--muted); }
.strip[data-active="true"] #stripTimer { color: var(--brass); }

/* Segmentos: se encienden según avanza el diálogo SIP */
.segs {
  list-style: none; display: flex; gap: 4px;
  margin: 14px 0 10px; padding: 0;
}
.segs li {
  flex: 1; position: relative;
  padding-top: 12px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--seg-off);
}
.segs li::before {
  content: ''; position: absolute; top: 0; left: 0; right: 4px;
  height: 4px; border-radius: 2px; background: var(--line);
  transition: background .25s ease;
}
.segs li.done::before { background: var(--line-2); }
.segs li.done { color: var(--muted); }
.segs li.live::before { background: var(--brass); }
.segs li.live { color: var(--brass); }
.segs li.live::after {
  content: ''; position: absolute; top: 0; left: 0; right: 4px; height: 4px;
  border-radius: 2px; background: var(--brass);
  animation: pulso 1.4s ease-in-out infinite;
}

@keyframes pulso { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.strip-foot { font-size: 12px; color: var(--muted); }

/* ───────── Cabecera de campaña ───────── */
.camp-head {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.camp-head h1 {
  font-family: var(--display); font-size: 18px; font-weight: 700;
  margin: 0 0 3px; letter-spacing: .01em;
}
.camp-head .sub { font-size: 12px; color: var(--muted); }

.kpis { display: flex; flex-wrap: wrap; gap: 22px; margin: 14px 0; }
.kpi-num { font-family: var(--mono); font-size: 20px; font-weight: 600; line-height: 1; }
.kpi-lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.kpi.ok .kpi-num { color: var(--signal); }
.kpi.fail .kpi-num { color: var(--coral); }
.kpi.live .kpi-num { color: var(--brass); }

.acciones { display: flex; flex-wrap: wrap; gap: 7px; }

/* ───────── Pestañas ───────── */
.tabs {
  display: flex; align-items: center; gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: 13px;
  padding: 9px 14px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); border-bottom-color: var(--brass); }
.tabs-right { margin-left: auto; display: flex; gap: 7px; align-items: center; padding-bottom: 6px; }

/* ───────── Botones y campos ───────── */
.btn {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 7px 13px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { background: var(--line); border-color: var(--line-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: #1A1204; font-weight: 600; }
[data-tema="claro"] .btn-primary { color: #FFFFFF; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: transparent; border-color: rgba(255,107,94,.5); color: var(--coral); }
.btn-danger:hover { background: rgba(255,107,94,.12); border-color: var(--coral); }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel); color: var(--text); }
.block { width: 100%; }

.inp {
  font: inherit; width: 100%;
  background: var(--ink); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 7px 10px;
}
.inp:focus { border-color: var(--brass); outline: none; }
.inp.sm { width: 118px; }
.ta { resize: vertical; line-height: 1.6; font-size: 13px; }

.lbl {
  display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 6px; font-weight: 600;
}
.lbl-hint { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; margin-top: 3px; font-size: 11px; }

.row-inline { display: flex; gap: 7px; align-items: center; }
.unit { color: var(--muted); font-size: 12px; }
.chk { width: 16px; height: 16px; accent-color: var(--brass); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.usuario { display: flex; align-items: center; gap: 8px; }
.usuario .mono { font-size: 11px; color: var(--muted); }
.pais { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pais .bandera { font-size: 13px; margin-right: 4px; }
.tag.pt { border-color: #7FB2E8; color: #7FB2E8; }

/* ───────── Tablas ───────── */
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla thead th {
  text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  padding: 7px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--ink);
}
.tabla td { padding: 8px 10px; border-bottom: 1px solid rgba(34,49,72,.6); vertical-align: middle; }
.tabla tbody tr:hover { background: var(--panel); }
.tabla tbody tr.clicable { cursor: pointer; }
.tabla tbody tr.activa { background: rgba(240,169,59,.08); }
.tabla td.num { font-family: var(--mono); white-space: nowrap; }
.col-fina { width: 1%; white-space: nowrap; }

/* ───────── Etiquetas de estado ───────── */
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  padding: 2px 7px; border-radius: 2px;
  border: 1px solid var(--line-2); color: var(--muted);
  white-space: nowrap;
}
.tag.pendiente { }
.tag.llamando { border-color: var(--brass); color: var(--brass); }
.tag.hecha { border-color: rgba(69,214,160,.5); color: var(--signal); }
.tag.fallida { border-color: rgba(255,107,94,.5); color: var(--coral); }
.tag.omitida { opacity: .55; }
.tag.cual { border-color: var(--signal); color: var(--signal); background: rgba(69,214,160,.1); }

.estrellas { color: var(--brass); font-size: 12px; letter-spacing: 1px; }
.estrellas .off { color: var(--line-2); }

.prio { font-family: var(--mono); font-size: 11px; }
.prio.alta { color: var(--signal); }
.prio.media { color: var(--brass); }
.prio.baja, .prio.descartar { color: var(--muted); }

/* ───────── Consola de log ───────── */
.consola {
  background: var(--consola-fondo, var(--panel-2)); border: 1px solid var(--line); border-radius: var(--r);
  height: 62vh; overflow-y: auto; padding: 10px 12px;
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
}
.log-ln { display: flex; gap: 10px; }
.log-ts { color: var(--consola-ts); flex: none; }
.log-tag { color: var(--consola-tag); flex: none; width: 88px; }
.log-tx { color: var(--consola-tx); word-break: break-word; }
.log-ln.ok .log-tx { color: var(--signal); }
.log-ln.warn .log-tx { color: var(--brass); }
.log-ln.error .log-tx { color: var(--coral); }
.log-ln.data .log-tx { color: #7FD2E8; }
.log-ln.debug .log-tx { color: var(--muted); }

/* ───────── Vacíos ───────── */
.vacio {
  border: 1px dashed var(--line-2); border-radius: var(--r);
  padding: 34px 22px; text-align: center; color: var(--muted);
}
.vacio strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; font-family: var(--display); }

/* ───────── Filtros ───────── */
.filtros { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 12px; }
.filtros .inp { width: 220px; }
.chip {
  font: inherit; font-size: 12px; cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--muted); padding: 4px 11px;
}
.chip:hover { color: var(--text); }
.chip.is-on { border-color: var(--brass); color: var(--brass); background: rgba(240,169,59,.1); }

/* ───────── Ficha del lead ───────── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100%;
  background: var(--panel-2); border-left: 1px solid var(--line);
  z-index: 40; display: flex; flex-direction: column;
  animation: entra .18s ease-out;
}
@keyframes entra { from { transform: translateX(24px); opacity: 0; } }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.drawer-name { font-family: var(--display); font-size: 17px; font-weight: 700; }
.drawer-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer-body { overflow-y: auto; padding: 16px; }

.aviso {
  border-left: 2px solid var(--brass); background: rgba(240,169,59,.08);
  padding: 7px 11px; margin-bottom: 6px; font-size: 12px; color: var(--brass);
}
.aviso.err { border-color: var(--coral); background: rgba(255,107,94,.08); color: var(--coral); }

.veredicto {
  border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 11px 13px; margin-bottom: 16px;
}
.veredicto.si { border-color: rgba(69,214,160,.5); background: rgba(69,214,160,.07); }
.veredicto-t { font-family: var(--display); font-size: 15px; font-weight: 700; }
.veredicto.si .veredicto-t { color: var(--signal); }
.veredicto-s { font-size: 12px; color: var(--muted); margin-top: 3px; }

.secc { margin-bottom: 18px; }
.secc h3 {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.dl { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 5px 12px; font-size: 13px; }
.dl dt { color: var(--muted); font-size: 12px; }
.dl dd { margin: 0; word-break: break-word; }
.dl dd.si { color: var(--signal); }
.dl dd.no { color: var(--muted); }

.resumen-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 13px; font-size: 13px; line-height: 1.6;
}

audio { width: 100%; margin-top: 8px; }
[data-tema="oscuro"] audio { filter: invert(.9) hue-rotate(180deg); }

.transcript {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px; font-family: var(--mono); font-size: 12px; line-height: 1.7;
  white-space: pre-wrap; max-height: 320px; overflow-y: auto; color: var(--consola-tx);
}

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 35; }

/* ───────── Modal ───────── */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: var(--scrim);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-card {
  width: 620px; max-width: 100%;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 20px 22px 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-family: var(--display); font-size: 19px; margin: 0; font-weight: 700; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
}

.preview {
  font-size: 12px; color: var(--muted);
  border-left: 2px solid var(--brass);
  padding: 6px 10px; margin-top: 8px; background: var(--panel);
}
.preview b { color: var(--text); font-weight: 600; }

.dropzone {
  border: 1px dashed var(--line-2); border-radius: var(--r);
  padding: 14px; text-align: center; color: var(--muted); font-size: 12px;
  margin-top: 8px;
}
.dropzone.hover { border-color: var(--brass); color: var(--brass); }
.link-file { color: var(--brass); cursor: pointer; text-decoration: underline; }

/* ───────── Avisos flotantes ───────── */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 7px; align-items: center; }
.toast {
  background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--brass);
  border-radius: var(--r); padding: 9px 14px; font-size: 13px;
  animation: entra .16s ease-out;
}
.toast.err { border-left-color: var(--coral); }
.toast.ok { border-left-color: var(--signal); }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { padding: 14px; }
  .grid3, .grid4 { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .segs li span { font-size: 9px; }
}

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

/* ─────────────────────────────────────────────────────────────
   Resumen: la cara amable del panel. Más aire y números grandes,
   porque aquí también miran marketing y comercial.
   ───────────────────────────────────────────────────────────── */

.kpis-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 14px;
}

.tarjeta-kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sombra);
  border-top: 2px solid var(--line-2);
  padding: 14px 16px 12px;
}
.tarjeta-kpi.ok { border-top-color: var(--signal); }
.tarjeta-kpi.live { border-top-color: var(--brass); }

.kpi-grande {
  font-family: var(--display); font-size: 27px; font-weight: 700;
  line-height: 1; letter-spacing: -.01em;
}
.tarjeta-kpi.ok .kpi-grande { color: var(--signal); }
.tarjeta-kpi.live .kpi-grande { color: var(--brass); }

.paneles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.panel-caja {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sombra);
  padding: 15px 16px 16px;
}
.panel-caja.ancho { grid-column: 1 / -1; }
.panel-caja.centrado { display: flex; flex-direction: column; }
.panel-caja h3 {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 14px;
}
.panel-caja .nota { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

.leyenda { display: flex; gap: 16px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.leyenda i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* Barras horizontales */
.barras { display: flex; flex-direction: column; gap: 8px; }
.barra-fila { display: grid; grid-template-columns: 132px minmax(0, 1fr) 34px; gap: 10px; align-items: center; }
.barra-lbl { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-pista { background: var(--ink); border-radius: 2px; height: 9px; overflow: hidden; }
.barra-pista i { display: block; height: 100%; border-radius: 2px; transition: width .4s ease; }
.barra-val { font-size: 12px; text-align: right; color: var(--text); }

/* Anillos de conversión */
.anillos { display: flex; gap: 26px; justify-content: center; align-items: center; flex: 1; flex-wrap: wrap; }
.anillo { text-align: center; }
.anillo-lbl { font-size: 11px; color: var(--muted); margin-top: 6px; max-width: 110px; }

/* Últimos leads */
.lista-leads { display: flex; flex-direction: column; gap: 2px; }
.lead-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid rgba(34,49,72,.6);
  padding: 8px 4px;
}
.lead-fila:last-child { border-bottom: 0; }
.lead-fila:hover { background: var(--panel-2); }
.lead-nombre { font-size: 13px; font-weight: 500; }
.lead-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

@media (max-width: 1100px) {
  .paneles { grid-template-columns: 1fr; }
  .panel-caja.ancho { grid-column: auto; }
}

/* Gráfica de actividad diaria, en HTML para que las etiquetas no se deformen */
.grafica-dias { display: flex; align-items: flex-end; gap: 6px; height: calc(var(--alto) + 20px); }
.dia { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.dia-barras {
  flex: 1; width: 100%; max-width: 42px; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 2px;
}
.dia-barras i { display: block; width: 100%; border-radius: 2px; min-height: 0; }
.dia-barras .seg-leads { background: var(--signal); }
.dia-barras .seg-resto { background: var(--line-2); }
.dia:hover .dia-barras .seg-resto { background: var(--line-2); }
.dia-lbl { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 6px; }
.dia-lbl.oculta { visibility: hidden; }

.lista-leads.dos-columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
@media (max-width: 900px) { .lista-leads.dos-columnas { grid-template-columns: 1fr; } }


/* ── Interruptor de tema ───────────────────────────────────── */
.tema-btn {
  background: none; border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--muted); cursor: pointer;
  width: 30px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.tema-btn:hover { color: var(--brass); border-color: var(--brass); }
.tema-btn svg { width: 15px; height: 15px; }
/* Se ve el icono de lo que vas a activar, no el del tema actual */
[data-tema="oscuro"] .tema-btn .icono-sol { display: block; }
[data-tema="oscuro"] .tema-btn .icono-luna { display: none; }
[data-tema="claro"]  .tema-btn .icono-sol { display: none; }
[data-tema="claro"]  .tema-btn .icono-luna { display: block; }
