/* Envíos — diseño 2026-11: claro y aireado, lateral verde profundo, acentos en serif itálica.
   Todo sale de los tokens de :root; el modo oscuro sólo los redefine. */
:root {
  --fondo: #f5f6f2;
  --panel: #ffffff;
  --panel2: #f0f2ed;
  --borde: #e3e6df;
  --borde2: #d3d8cf;
  --texto: #10201a;
  --tenue: #6a766f;
  --verde: #16a34a;
  --verde-vivo: #22c55e;
  --verde-osc: #0f7a37;
  --verde-suave: #e6f6ea;
  --naranja: #d97706;
  --naranja-suave: #fdf3e2;
  --rojo: #dc2626;
  --rojo-suave: #fdecec;
  --azul: #2563eb;
  --azul-suave: #e9effd;
  --tinta: #0c1f17;            /* lateral */
  --tinta2: #14302a;
  --tinta-texto: #d8e6dd;
  --tinta-tenue: #8aa597;
  --burbuja-yo: #dcf8d6;
  --burbuja-el: #ffffff;
  --chat-fondo: #efeae2;
  --sombra: 0 1px 2px rgba(16, 32, 26, .04), 0 4px 14px rgba(16, 32, 26, .05);
  --sombra-alta: 0 24px 60px rgba(16, 32, 26, .18);
  --radio: 14px;
  --serif: 'Instrument Serif', Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #0b1411; --panel: #111c18; --panel2: #17241f; --borde: #213129; --borde2: #2c3f36;
    --texto: #e7efe9; --tenue: #8fa298; --verde: #22c55e; --verde-osc: #4ade80; --verde-suave: rgba(34, 197, 94, .13);
    --naranja: #f59e0b; --naranja-suave: rgba(245, 158, 11, .13); --rojo: #f87171; --rojo-suave: rgba(239, 68, 68, .13);
    --azul: #60a5fa; --azul-suave: rgba(96, 165, 250, .13);
    --tinta: #08100d; --tinta2: #112019; --burbuja-yo: #134e2c; --burbuja-el: #17241f; --chat-fondo: #0d1714;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3); --sombra-alta: 0 24px 60px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 14px/1.5 Geist, system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex; -webkit-font-smoothing: antialiased;
}
a { color: var(--verde); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel2); border: 1px solid var(--borde); padding: 0 6px; border-radius: 6px; font-size: 12.5px; }
h1 { font-size: 30px; margin: 0; letter-spacing: -.025em; font-weight: 600; line-height: 1.15; }
h1 em, h2 em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
h3 { font-size: 14.5px; margin: 0 0 14px; font-weight: 600; letter-spacing: -.01em; }
.sub { color: var(--tenue); margin: 6px 0 0; max-width: 720px; }
.tenue { color: var(--tenue); font-weight: 400; }
[hidden] { display: none !important; }
::selection { background: var(--verde-suave); }

/* ---------- Lateral ---------- */
.lateral {
  width: 248px; flex-shrink: 0; background: var(--tinta); color: var(--tinta-texto);
  display: flex; flex-direction: column; padding: 18px 14px 14px; height: 100vh; position: sticky; top: 0;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-weight: 600; font-size: 17px; color: #fff; letter-spacing: -.01em; }
.marca em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 21px; color: #b7f5c8; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #34d375, #0f9c48); box-shadow: 0 6px 18px rgba(34, 197, 94, .35); }
.logo svg { width: 17px; height: 17px; }
.cuenta-sel { display: flex; align-items: center; gap: 10px; background: var(--tinta2); border: 1px solid rgba(255, 255, 255, .06); border-radius: 12px; padding: 9px 10px; margin-bottom: 16px; cursor: pointer; width: 100%; color: inherit; font: inherit; text-align: left; }
.cuenta-sel:hover { border-color: rgba(255, 255, 255, .14); }
.cuenta-sel .av { width: 30px; height: 30px; border-radius: 9px; background: #1f4535; color: #b7f5c8; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.cuenta-sel .tx { min-width: 0; flex: 1; }
.cuenta-sel b { display: block; color: #fff; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuenta-sel small { color: var(--tinta-tenue); font-size: 11.5px; }
.cuenta-sel .flecha { color: var(--tinta-tenue); font-size: 11px; }
nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
nav .grupo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--tinta-tenue); padding: 14px 10px 6px; opacity: .8; }
nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--tinta-texto);
  font-weight: 500; transition: background .15s, color .15s; text-decoration: none !important;
}
nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
nav a.activo { background: rgba(34, 197, 94, .14); color: #b7f5c8; }
nav a.activo svg { opacity: 1; }
.globo { margin-left: auto; background: var(--verde-vivo); color: #052e16; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.globo.naranja { background: #fbbf24; color: #422006; }
.lateral-pie { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; }
.horario { font-size: 12px; color: var(--tinta-tenue); padding: 10px 12px; border-radius: 12px; background: var(--tinta2); line-height: 1.45; }
.horario b { color: #fff; font-weight: 600; }
.usuario { display: flex; align-items: center; gap: 10px; padding: 6px 4px 0; }
.usuario .av { width: 30px; height: 30px; border-radius: 50%; background: #e8f5ec; color: #0c1f17; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex-shrink: 0; }
.usuario .tx { min-width: 0; flex: 1; font-size: 12.5px; line-height: 1.3; }
.usuario .tx b { display: block; color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario .tx span { color: var(--tinta-tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.usuario button { background: none; border: 0; color: var(--tinta-tenue); cursor: pointer; padding: 6px; border-radius: 8px; font: inherit; font-size: 12px; }
.usuario button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.punto.vivo { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: latido 2s infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

main { flex: 1; min-width: 0; height: 100vh; overflow: auto; }
.vista { padding: 34px 40px 72px; max-width: 1240px; animation: entra .25s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.vista > header { margin-bottom: 26px; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Botones e inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); color: var(--texto); border: 1px solid var(--borde2); border-radius: 10px;
  padding: 8px 15px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: var(--tenue); }
.btn:active { transform: translateY(1px); }
.btn.primario { background: var(--tinta); color: #fff; border-color: var(--tinta); font-weight: 600; box-shadow: 0 2px 8px rgba(12, 31, 23, .18); }
.btn.primario:hover { background: #163a2c; }
.btn.verde { background: var(--verde); border-color: var(--verde); color: #fff; font-weight: 600; }
.btn.peligro { color: var(--rojo); }
.btn.peligro:hover { border-color: var(--rojo); background: var(--rojo-suave); }
.btn.chico { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.grande { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primario { background: var(--verde); border-color: var(--verde); color: #052e16; } }
input, select, textarea {
  background: var(--panel); color: var(--texto); border: 1px solid var(--borde2); border-radius: 10px;
  padding: 9px 12px; font: inherit; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-suave); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input[type=checkbox] { width: auto; accent-color: var(--verde); }
input[type=color] { padding: 3px; height: 40px; }
input[type=file] { padding: 8px; background: var(--panel2); border-style: dashed; }

.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; margin-bottom: 18px; box-shadow: var(--sombra); }
.aviso { background: var(--naranja-suave); border: 1px solid color-mix(in srgb, var(--naranja) 30%, transparent); color: var(--texto); padding: 11px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 13px; }
.aviso a { color: var(--naranja); text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel2); color: var(--tenue); white-space: nowrap; border: 1px solid var(--borde); }
.chip.verde { background: var(--verde-suave); color: var(--verde-osc); border-color: transparent; }
.chip.naranja { background: var(--naranja-suave); color: var(--naranja); border-color: transparent; }
.chip.rojo { background: var(--rojo-suave); color: var(--rojo); border-color: transparent; }
.chip.azul { background: var(--azul-suave); color: var(--azul); border-color: transparent; }

/* ---------- Panel ---------- */
.saludo { margin-bottom: 26px; }
.saludo h1 { font-size: 34px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px 18px; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.kpi:first-child { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.kpi:first-child .t, .kpi:first-child .d, .kpi:first-child .n small { color: var(--tinta-tenue); }
.kpi .t { color: var(--tenue); font-size: 12.5px; font-weight: 500; }
.kpi .n { font-size: 32px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .n small { font-size: 15px; color: var(--tenue); font-weight: 500; }
.kpi .d { font-size: 12px; color: var(--tenue); margin-top: 4px; }
.grilla2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grilla2 { grid-template-columns: 1fr; } }
.lista-lineas .ll { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.lista-lineas .ll:last-child { border: 0; padding-bottom: 0; }
.lista-lineas .ll:first-child { padding-top: 0; }
.barra { grid-column: 1 / -1; height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); border-radius: 99px; transition: width .5s; }
.grafico { display: flex; align-items: flex-end; gap: 7px; height: 190px; padding-top: 10px; }
.grafico .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.grafico .col i { width: 100%; max-width: 30px; background: var(--verde); border-radius: 6px 6px 3px 3px; min-height: 3px; opacity: .85; transition: height .5s; }
.grafico .col:last-child i { opacity: 1; background: var(--tinta); }
.grafico .col span { font-size: 10.5px; color: var(--tenue); }
.grafico .col b { font-size: 11px; font-weight: 600; }

/* Primeros pasos */
.pasos { background: linear-gradient(135deg, var(--tinta), #173d2e); color: #fff; border-radius: 18px; padding: 24px 26px; margin-bottom: 22px; position: relative; overflow: hidden; }
.pasos::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 197, 94, .35), transparent 70%); }
.pasos h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.pasos h2 em { color: #b7f5c8; }
.pasos p { margin: 0 0 18px; color: var(--tinta-tenue); }
.pasos ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; position: relative; z-index: 1; }
.pasos li { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); border-radius: 13px; padding: 14px; display: grid; gap: 4px; cursor: pointer; transition: background .15s; }
.pasos li:hover { background: rgba(255, 255, 255, .1); }
.pasos li .num { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); display: grid; place-items: center; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.pasos li.hecho .num { background: var(--verde-vivo); border-color: var(--verde-vivo); color: #052e16; }
.pasos li.hecho b { text-decoration: line-through; opacity: .7; }
.pasos li span { color: var(--tinta-tenue); font-size: 12.5px; }

/* ---------- Líneas ---------- */
.tarjetas-lineas { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.linea { background: var(--panel); border: 1px solid var(--borde); border-radius: 16px; padding: 18px; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.linea::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c, var(--verde)); }
.linea .cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; }
.linea .nom { font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; }
.linea .tel { color: var(--tenue); font-size: 13px; font-variant-numeric: tabular-nums; }
.linea .det { font-size: 12.5px; color: var(--naranja); background: var(--naranja-suave); border-radius: 9px; padding: 7px 10px; margin: 12px 0 0; }
.linea .datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.linea .datos div { background: var(--panel2); border-radius: 11px; padding: 9px 11px; }
.linea .datos span { display: block; font-size: 11.5px; color: var(--tenue); }
.linea .datos b { font-size: 17px; font-variant-numeric: tabular-nums; }
.linea .acc { display: flex; flex-wrap: wrap; gap: 6px; }
.linea.agregar { display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--borde2); box-shadow: none; background: transparent; cursor: pointer; min-height: 210px; color: var(--tenue); transition: border-color .15s, background .15s; }
.linea.agregar::before { display: none; }
.linea.agregar:hover { border-color: var(--verde); background: var(--verde-suave); color: var(--verde-osc); }
.linea.agregar .mas { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.qr { display: grid; place-items: center; gap: 16px; text-align: center; }
.qr img { background: white; padding: 12px; border-radius: 16px; width: 280px; height: 280px; box-shadow: var(--sombra); border: 1px solid var(--borde); }
.qr ol { text-align: left; color: var(--tenue); margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* ---------- Inbox ---------- */
.vista-inbox { display: grid; grid-template-columns: 350px 1fr; padding: 0; max-width: none; height: 100vh; animation: none; }
.chats { border-right: 1px solid var(--borde); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.chats-top { padding: 16px 14px 12px; display: grid; gap: 9px; border-bottom: 1px solid var(--borde); }
.chats-top h2 { margin: 0 0 2px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.filtros { display: flex; gap: 4px; background: var(--panel2); padding: 3px; border-radius: 10px; }
.filtros button { flex: 1; background: none; border: 0; color: var(--tenue); border-radius: 8px; padding: 5px 4px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.filtros button.activo { background: var(--panel); color: var(--texto); box-shadow: var(--sombra); }
.filtros button b { color: var(--naranja); }
#lista-chats { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
#lista-chats li { padding: 10px 12px; border-radius: 11px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 1px; }
#lista-chats li:hover { background: var(--panel2); }
#lista-chats li.sel { background: var(--verde-suave); }
#lista-chats .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lista-chats .h { font-size: 11.5px; color: var(--tenue); }
#lista-chats .p { color: var(--tenue); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lista-chats li.nl .n, #lista-chats li.nl .p { color: var(--texto); }
#lista-chats li.nl .h { color: var(--verde); font-weight: 600; }
#lista-chats .m { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.conversacion { display: flex; flex-direction: column; min-height: 0; background: var(--chat-fondo); background-image: radial-gradient(color-mix(in srgb, var(--texto) 5%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.conversacion .vacio { margin: auto; color: var(--tenue); text-align: center; display: grid; gap: 6px; }
.conversacion .vacio b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 26px; color: var(--texto); }
.conv-cab { padding: 12px 18px; border-bottom: 1px solid var(--borde); background: var(--panel); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.conv-cab .quien { flex: 1; min-width: 180px; }
.conv-cab .volver { display: none; font-size: 18px; padding: 4px 12px; }
.conv-cab .quien b { font-size: 15.5px; }
.conv-cab .quien div { color: var(--tenue); font-size: 12.5px; }
.conv-cab select { width: auto; padding: 5px 10px; font-size: 13px; }
.mensajes { flex: 1; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 5px; }
.burbuja { max-width: 68%; padding: 7px 11px 6px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; position: relative; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); font-size: 14px; }
.burbuja.el { background: var(--burbuja-el); align-self: flex-start; border-top-left-radius: 4px; }
.burbuja.yo { background: var(--burbuja-yo); align-self: flex-end; border-top-right-radius: 4px; }
.burbuja small { display: block; font-size: 10.5px; color: var(--tenue); margin-top: 2px; text-align: right; }
.dia-sep { align-self: center; font-size: 11.5px; color: var(--tenue); background: var(--panel); padding: 3px 12px; border-radius: 8px; margin: 10px 0; box-shadow: var(--sombra); }
.redactar { border-top: 1px solid var(--borde); padding: 12px 16px; background: var(--panel); position: relative; }
.redactar form { display: flex; gap: 8px; align-items: flex-end; }
.redactar textarea { min-height: 44px; max-height: 160px; height: 44px; border-radius: 22px; padding: 11px 16px; }
.redactar .btn { border-radius: 22px; height: 44px; }
.atajos { position: absolute; bottom: 100%; left: 16px; right: 16px; background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; max-height: 240px; overflow-y: auto; box-shadow: var(--sombra-alta); }
.atajos div { padding: 9px 12px; cursor: pointer; font-size: 13px; }
.atajos div b { color: var(--verde); margin-right: 8px; }
.atajos div.sel, .atajos div:hover { background: var(--panel2); }
.baja-aviso { background: var(--rojo-suave); color: var(--rojo); font-size: 12.5px; padding: 8px 18px; }

/* ---------- Agente ---------- */
.agente { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.agente .tarjeta { margin: 0; }
.agente .espacio { margin-top: 14px; }
.simulador { display: flex; flex-direction: column; position: sticky; top: 16px; }
.simulador h3 { margin: 0; }
.sim-ayuda { font-size: 12.5px; margin: 8px 0 12px; }
.sim-datos { display: grid; gap: 10px; margin-bottom: 12px; }
.sim-datos label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
.sim-datos textarea { min-height: 62px; }
.sim-chat { flex: none; height: 400px; background: var(--chat-fondo); border: 1px solid var(--borde); border-radius: 12px; padding: 14px; }
.sim-nota { align-self: center; max-width: 92%; text-align: center; font-size: 11.5px; color: var(--tenue); margin: 4px 0 8px; background: var(--panel); padding: 3px 10px; border-radius: 8px; }
.sim-form { display: flex; gap: 8px; margin-top: 10px; }
.agente-barra { display: flex; align-items: center; gap: 10px; padding: 7px 18px; border-bottom: 1px solid var(--borde); background: var(--panel); font-size: 12.5px; }
.agente-barra .tenue { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.borrador { border-top: 2px solid var(--azul); background: var(--azul-suave); padding: 10px 18px; display: grid; gap: 6px; }
.borrador .fila { justify-content: flex-start; gap: 10px; font-size: 13px; }
.borrador textarea { min-height: 70px; }
.borrador-ayuda { font-size: 11.5px; }
.borrador-acc { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 1000px) { .agente { grid-template-columns: 1fr; } .simulador { position: static; } }
.sim-botones { display: flex; gap: 6px; flex-wrap: wrap; }
.transcripcion { display: block; margin-top: 4px; font-size: 13px; color: var(--tenue); }

/* Alerta de líneas */
.alerta-lineas { background: var(--rojo-suave); border-bottom: 1px solid color-mix(in srgb, var(--rojo) 25%, transparent); color: var(--rojo); padding: 9px 40px; font-size: 13px; }
.alerta-lineas a { color: var(--rojo); text-decoration: underline; margin-left: 6px; font-weight: 600; }
main:has(.alerta-lineas:not([hidden])) .vista-inbox { height: calc(100vh - 40px); }

/* ---------- Métricas ---------- */
.met-acc { display: flex; gap: 8px; }
.met-acc select { width: auto; }
.met-embudo { display: grid; gap: 11px; }
.paso-embudo { display: grid; grid-template-columns: 150px 1fr 52px 46px; align-items: center; gap: 12px; font-size: 13px; }
.paso-embudo b { text-align: right; font-variant-numeric: tabular-nums; }
.paso-embudo .tenue { text-align: right; font-variant-numeric: tabular-nums; }
.pista { height: 12px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.pista i { display: block; height: 100%; min-width: 0; background: linear-gradient(90deg, var(--verde-osc), var(--verde-vivo)); border-radius: 99px; transition: width .5s; }
.met-tabla { overflow-x: auto; }
.tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.met-ejemplo { font-size: 12px; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .paso-embudo { grid-template-columns: 96px 1fr 36px 36px; gap: 8px; } }

/* ---------- Campañas ---------- */
.campana { background: var(--panel); border: 1px solid var(--borde); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--sombra); }
.campana .cab { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.campana .nom { font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; }
.embudo { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 16px 0 12px; }
.embudo div { background: var(--panel2); border-radius: 11px; padding: 9px 11px; }
.embudo span { display: block; font-size: 11.5px; color: var(--tenue); }
.embudo b { font-size: 18px; font-variant-numeric: tabular-nums; }
.progreso { height: 7px; background: var(--panel2); border-radius: 99px; overflow: hidden; display: flex; }
.progreso i { display: block; height: 100%; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th { text-align: left; color: var(--tenue); font-weight: 500; padding: 9px 8px; border-bottom: 1px solid var(--borde); position: sticky; top: 0; background: var(--panel); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tabla td { padding: 10px 8px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.paso { margin-bottom: 20px; }
.paso > b { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.paso > b::before { content: attr(data-n); width: 22px; height: 22px; border-radius: 50%; background: var(--tinta); color: #fff; display: grid; place-items: center; font-size: 11.5px; }
.columnas { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.columnas button { background: var(--azul-suave); color: var(--azul); border: 0; border-radius: 8px; padding: 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer; font-weight: 500; }
.muestra { background: var(--burbuja-yo); border-radius: 12px; border-top-right-radius: 4px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; margin-top: 8px; }
.muestra .q { color: var(--tenue); font-size: 11.5px; margin-bottom: 4px; }
.err { color: var(--rojo); font-size: 13px; }

/* ---------- CRM ---------- */
.tablero { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.columna { background: var(--panel2); border: 1px solid var(--borde); border-radius: 14px; padding: 10px; min-height: 320px; transition: border-color .15s, background .15s; }
.columna.sobre { border-color: var(--verde); background: var(--verde-suave); }
.columna h4 { margin: 2px 4px 10px; font-size: 13px; display: flex; justify-content: space-between; }
.columna h4 span { color: var(--tenue); font-weight: 500; background: var(--panel); border-radius: 99px; padding: 0 8px; }
.tarjeta-c { background: var(--panel); border-radius: 11px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; border: 1px solid var(--borde); border-left: 3px solid var(--c, var(--borde2)); box-shadow: var(--sombra); }
.tarjeta-c .n { font-weight: 600; font-size: 13px; }
.tarjeta-c .t { font-size: 12px; color: var(--tenue); }
.tarjeta-c .chip { margin-top: 6px; }
.recs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.rec { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; font-size: 13px; box-shadow: var(--sombra); }

/* ---------- Plantillas ---------- */
.lista-plantillas { display: grid; gap: 10px; }
.plantilla { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: start; box-shadow: var(--sombra); }
.plantilla b { color: var(--verde); font-family: ui-monospace, monospace; font-size: 13px; }
.plantilla p { margin: 0; white-space: pre-wrap; color: var(--tenue); }

/* ---------- Ajustes y formularios ---------- */
.form .campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.form label.ancho { grid-column: 1 / -1; }
.form label.check { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; font-weight: 400; }
.form small { color: var(--tenue); font-weight: 400; font-size: 12px; }
.form h3 { padding-top: 4px; }
.dias { display: flex; gap: 6px; margin: -8px 0 24px; flex-wrap: wrap; }
.dias label { display: flex; align-items: center; gap: 6px; background: var(--panel2); padding: 6px 11px; border-radius: 9px; font-weight: 500; cursor: pointer; border: 1px solid var(--borde); }
.acciones-form { display: flex; align-items: center; gap: 12px; }
.ok { color: var(--verde); font-weight: 500; }

/* ---------- Equipo y admin ---------- */
.personas { display: grid; gap: 2px; }
.persona { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--borde); }
.persona:last-child { border: 0; }
.persona .av { width: 36px; height: 36px; border-radius: 50%; background: var(--verde-suave); color: var(--verde-osc); display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.persona .tx { flex: 1; min-width: 0; }
.persona .tx span { color: var(--tenue); font-size: 12.5px; display: block; }
.link-copia { display: flex; gap: 8px; margin-top: 10px; }
.link-copia input { font-family: ui-monospace, monospace; font-size: 12px; background: var(--panel2); }
.cuentas-admin td b { display: block; }

/* ---------- Modal y toast ---------- */
dialog { background: var(--panel); color: var(--texto); border: 1px solid var(--borde); border-radius: 20px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: var(--sombra-alta); }
dialog[open] { animation: aparece .18s ease; }
@keyframes aparece { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(8, 18, 14, .45); backdrop-filter: blur(4px); }
#modal-cuerpo { padding: 26px; }
#modal-cuerpo h2 { margin: 0 0 18px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.modal-acc { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--tinta); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 50; box-shadow: var(--sombra-alta); max-width: calc(100vw - 32px); animation: aparece .18s ease; }
#toast.error { background: var(--rojo); }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  body { flex-direction: column; }
  .lateral { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; padding: 10px 12px 8px; }
  .marca { padding: 0 2px 8px; }
  .cuenta-sel { display: none; }
  nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  nav .grupo { display: none; }
  nav a { flex-shrink: 0; padding: 7px 11px; }
  .lateral-pie { display: none; }
  main { height: auto; overflow: visible; }
  .vista { padding: 22px 16px 48px; }
  h1, .saludo h1 { font-size: 26px; }
  .vista-inbox { grid-template-columns: 1fr; height: auto; }
  .plantilla { grid-template-columns: 1fr; }
  .vista-inbox:not(.con-chat) .conversacion { display: none; }
  .vista-inbox.con-chat .conversacion { position: fixed; inset: 0; z-index: 40; height: 100dvh; }
  .conv-cab { padding: 10px 12px; gap: 8px; }
  .conv-cab .volver { display: inline-flex; }
  .conv-cab .quien { min-width: 0; flex: 1 1 calc(100% - 64px); }
  .conv-cab .quien b { font-size: 17px; }
  .mensajes { padding: 14px 12px; }
  .burbuja { max-width: 85%; }
  .alerta-lineas { padding: 9px 16px; }
  textarea, input, select { font-size: 16px; }
}
