/* ============================================================================
   APM Terminals · Long Tail — sistema de diseño
   Colores Tobogan: morado (#7C3AED) + cian (#0891B2) sobre neutros lila
   claros, igual que la herramienta de Almirall. Estructura y patrones
   inspirados en ella (tarjetas, tablas, timeline, autonomía), no su contenido.
   ========================================================================== */
:root {
  /* Marca Tobogan: morado + cian (mismo criterio que la herramienta de Almirall) */
  --brand: #7C3AED; --brand-2: #6D28D9; --brand-3: #8B5CF6; --brand-4: #A78BFA;
  --brand-soft: #F4EFFF; --brand-soft-2: #EBE2FE; --brand-line: #DDD0FB; --brand-ink: #4C1D95;
  --teal: #0891B2; --teal-2: #0E7490; --teal-soft: #E7F6FA; --teal-line: #BCE6F0; --teal-ink: #0C5A6E;
  --ok: #15803D; --ok-soft: #EAF7EF; --ok-line: #BFE6CD;
  --no: #DC2626; --no-soft: #FDEFEF; --no-line: #F5C9C9;
  --amber: #D97706; --amber-soft: #FEF5E6; --amber-line: #F6DCAE; --amber-ink: #92400E;
  --info: #2563EB; --info-soft: #EDF3FE; --info-line: #C9DAFB;
  --pink: #DB2777; --pink-soft: #FDEEF6; --pink-line: #F7CCE0; --pink-ink: #9D174D;
  --slate: #64748B;

  --bg: #F4F3F9; --fondo: #F9F8FD; --panel: #FFFFFF;
  --tinta: #17132B; --tinta-2: #554E6F; --tinta-3: #8D88A4;
  --linea: #E7E4F1; --linea-2: #F0EEF7;

  --radio: 14px; --radio-sm: 10px; --radio-xs: 8px;
  --sombra-sm: 0 1px 2px rgba(23,19,43,.06);
  --sombra: 0 1px 2px rgba(23,19,43,.05), 0 10px 30px rgba(23,19,43,.07);
  --sombra-lg: 0 24px 60px rgba(23,19,43,.22);
  --sidebar-bg: linear-gradient(185deg, #1B1437 0%, #231A48 58%, #19122F 100%);
  --fuente: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--fuente); font-size: 14px; color: var(--tinta);
  background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.5;
}
::selection { background: var(--brand-soft-2); }
b, strong { font-weight: 700; }
.ic { width: 1em; height: 1em; flex: none; vertical-align: -.12em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.num, .roi-v, .kpi-v, .hc-v, .bs-v { font-variant-numeric: tabular-nums; }

/* ---- Botones ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; border-radius: var(--radio-sm); color: var(--tinta); background: var(--panel);
  border: 1px solid var(--linea); transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--tinta-3); }
.btn .ic { width: 15px; height: 15px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-primario { background: linear-gradient(180deg, var(--brand-3), var(--brand)); color: #fff;
  border: none; box-shadow: 0 2px 10px rgba(124,58,237,.30); }
.btn-primario:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--fondo); }

/* ---- Badges -------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; line-height: 1.4; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.badge-gris { background: #EEF2F2; color: var(--tinta-2); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-teal { background: var(--teal-soft); color: var(--teal-ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-no { background: var(--no-soft); color: var(--no); }
.badge-amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-pink { background: var(--pink-soft); color: var(--pink-ink); }

/* ---- Avatares ------------------------------------------------------------ */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; color: #fff; font-weight: 700; flex: none; }
.av-ini { font-size: .82em; }
.av-agente .av-ini { font-size: 15px; }
.av-ia { position: absolute; bottom: -4px; right: -4px; background: #fff; color: var(--teal-ink);
  font-size: 8px; font-weight: 800; padding: 1px 3px; border-radius: 5px; box-shadow: var(--sombra-sm); letter-spacing: .3px; }
.av-p { border-radius: 10px; font-size: 12px; }
.av-p0 { background: #0891B2; } .av-p1 { background: #7C3AED; } .av-p2 { background: #2563EB; }
.av-p3 { background: #15803D; } .av-p4 { background: #DB2777; } .av-p5 { background: #D97706; }

/* ---- Canal glyph --------------------------------------------------------- */
.chg { display: inline-flex; }
.chg svg { width: 14px; height: 14px; }

/* ---- Live dot ------------------------------------------------------------ */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(21,128,61,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.5); } 70% { box-shadow: 0 0 0 6px rgba(21,128,61,0); } 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); } }

/* ============================================================================
   LOGIN
   ========================================================================== */
/* Login partido (diseño Tool_ATS): hero oscuro a la izquierda + tarjeta a la derecha */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: #140F2B; }
.login-hero { position: relative; overflow: hidden; color: #ECE8FA; padding: 52px 60px; display: flex; flex-direction: column; justify-content: space-between; background: var(--sidebar-bg); }
.login-hero::before { content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.30), transparent 62%); top: -200px; right: -180px; }
.login-hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(8,145,178,.30), transparent 60%); bottom: -220px; left: -160px; }
.login-hero > * { position: relative; z-index: 1; }
.login-top { display: flex; align-items: center; justify-content: space-between; }
.login-by { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #B8AEDD; }
.login-tob { height: 44px; width: auto; vertical-align: middle; }
.login-hero-mid { max-width: 560px; margin: auto 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #C4B5FD; background: rgba(139,92,246,.14); border: 1px solid rgba(167,139,250,.3); padding: 6px 12px; border-radius: 999px; }
.eyebrow .ic { width: 14px; height: 14px; }
.login-hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -1px; margin: 22px 0 16px; font-weight: 800; color: #fff; }
.login-hero h1 span { background: linear-gradient(90deg, #C4B5FD, #67E8F9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { font-size: 15.5px; line-height: 1.6; color: #BDB4DC; margin: 0; }
.login-team { display: flex; gap: 12px; margin-top: 28px; }
.login-agent { flex: 1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 13px; display: flex; gap: 11px; align-items: center; }
.la-name { font-weight: 700; color: #fff; font-size: 13.5px; }
.la-role { font-size: 11.5px; color: #B3A9D6; margin-top: 1px; }
.login-hero-foot { font-size: 12px; color: #8D83B5; display: flex; gap: 18px; flex-wrap: wrap; }
.login-panel { background: var(--panel); display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 23px; margin: 0 0 5px; letter-spacing: -.4px; }
.login-lead { color: var(--tinta-2); font-size: 14px; margin: 0 0 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--tinta-2); margin-bottom: 6px; }
.input, .select { width: 100%; padding: 11px 12px; border: 1px solid var(--linea); border-radius: var(--radio-sm); color: var(--tinta); background: var(--fondo); outline: none; font-family: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(124,58,237,.14); background: #fff; }
.sso-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; border: 1px solid var(--linea); border-radius: var(--radio-sm); background: #fff; font-weight: 650; font-size: 14px; cursor: pointer; margin-bottom: 14px; color: var(--tinta); }
.sso-btn:hover { background: var(--fondo); }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--tinta-3); font-size: 12px; margin: 4px 0 14px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--linea); }
.login-btn { width: 100%; margin-top: 6px; padding: 13px; border: 0; border-radius: var(--radio-sm); cursor: pointer; background: linear-gradient(180deg, #8B5CF6, #7C3AED); color: #fff; font-weight: 750; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 24px rgba(124,58,237,.32); }
.login-btn:hover { box-shadow: 0 12px 28px rgba(124,58,237,.42); }
.login-btn .ic { width: 16px; height: 16px; }
.login-hint { font-size: 12px; color: var(--tinta-3); text-align: center; margin-top: 18px; line-height: 1.6; }
@media (max-width: 960px) { .login { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ============================================================================
   SHELL
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }
.side { width: 256px; flex: none; background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.side-top { padding: 4px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 12px; }
.logo { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: #fff; }
.logo b { font-weight: 800; }
.logo-apm { display: inline-flex; align-items: center; background: #fff; padding: 5px 9px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.logo-apm img { display: block; }
.side-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.foot-by { opacity: .55; font-size: 10.5px; }
.tobogan-logo { height: 32px; vertical-align: middle; }
.side-mod { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 6px; padding-left: 2px; letter-spacing: .3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; color: rgba(255,255,255,.78);
  font-size: 13.5px; font-weight: 500; text-align: left; transition: .13s; }
.nav-i .ic { width: 18px; height: 18px; opacity: .85; }
.nav-i:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-i.on { background: rgba(139,92,246,.18); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav-i.on .ic { opacity: 1; color: var(--brand-4); }
.nav-i .nav-lbl { flex: 1; }
.nav-badge { flex: none; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.nav-group-h { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: rgba(255,255,255,.42); padding: 15px 10px 7px; font-weight: 700; }
.nav-n { flex: none; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nav-i.on .nav-n { background: var(--brand); }
.side-team { margin-top: auto; padding-top: 16px; }
.side-team-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.45); padding: 0 6px 8px; }
.side-ag { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-radius: 9px; width: 100%; text-align: left; transition: .13s; }
.side-ag:hover { background: rgba(255,255,255,.07); }
.side-ag-n { font-size: 13px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 6px; }
.side-ag-r { font-size: 11px; color: rgba(255,255,255,.55); }
.side-foot { padding: 12px 6px 2px; font-size: 11px; color: rgba(255,255,255,.4); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; flex: none; background: rgba(255,255,255,.86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea); display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20; }
.crumbs { font-size: 13px; color: var(--tinta-3); display: flex; gap: 7px; align-items: center; }
.crumbs b { color: var(--tinta); } .crumbs span { opacity: .5; }
.top-right { display: flex; align-items: center; gap: 16px; }
.pill { font-size: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 20px;
  background: var(--fondo); color: var(--tinta-2); border: 1px solid var(--linea); font-variant-numeric: tabular-nums; }
.pill-live .live-dot { background: var(--ok); }
.pill-live.syncing { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.pill-live.syncing .live-dot { background: var(--brand); animation: pulse 1s infinite; }
.top-user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.scroll { flex: 1; overflow-y: auto; }

/* ============================================================================
   PÁGINA
   ========================================================================== */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 26px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 11px; }
.h2-num { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(180deg, var(--brand-3), var(--brand)); color: #fff;
  font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 2px 8px rgba(124,58,237,.3); }
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--radio); padding: 15px 18px; margin-top: 22px; cursor: pointer; transition: .15s; }
.next-step:hover { background: var(--brand-soft-2); }
.next-step-t { font-size: 13.5px; color: var(--brand-ink); }
.next-step-t b { font-weight: 700; }
.next-step .btn { flex: none; }
.page-sub { color: var(--tinta-2); font-size: 14.5px; margin-top: 5px; max-width: 760px; }
.block { margin-bottom: 26px; }
.block-h { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; margin-bottom: 13px; }
.block-h .ic { color: var(--brand); width: 18px; height: 18px; }
.block-h-sub { font-size: 12.5px; font-weight: 500; color: var(--tinta-3); }
.count { background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; min-width: 20px; height: 20px;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

/* ---- Grids --------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; } }

/* ---- Cards --------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra-sm); overflow: hidden; }
.card.click { cursor: pointer; transition: .15s; }
.card.click:hover { box-shadow: var(--sombra); transform: translateY(-1px); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--linea-2); }
.card-h .ic { color: var(--brand); width: 17px; height: 17px; }
.card-h-sub { font-size: 12px; font-weight: 500; color: var(--tinta-3); }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.card-b.center { display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---- KPI ----------------------------------------------------------------- */
.kpi-grid { display: grid; gap: 14px; margin-bottom: 20px; }
.kpi-grid.k3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.k4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .kpi-grid.k3, .kpi-grid.k4 { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 15px 16px; position: relative; overflow: hidden; box-shadow: var(--sombra-sm); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kc); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-l { font-size: 12px; color: var(--tinta-2); font-weight: 600; }
.kpi-ic { color: var(--kc); } .kpi-ic .ic { width: 18px; height: 18px; }
.kpi-v { font-size: 25px; font-weight: 800; margin: 8px 0 3px; letter-spacing: -.02em; }
.kpi-s { font-size: 12px; color: var(--tinta-3); }

/* ---- Callout ------------------------------------------------------------- */
.callout { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: var(--radio-sm);
  background: var(--fondo); border: 1px solid var(--linea); font-size: 13.5px; line-height: 1.55; margin-bottom: 16px; }
.callout .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout.small { font-size: 12.5px; padding: 11px 13px; margin: 12px 0 0; }
.callout.ok { background: var(--ok-soft); border-color: var(--ok-line); } .callout.ok > .ic { color: var(--ok); }
.callout.info { background: var(--info-soft); border-color: var(--info-line); } .callout.info > .ic { color: var(--info); }
.callout.warn { background: var(--amber-soft); border-color: var(--amber-line); } .callout.warn > .ic { color: var(--amber); }
.callout.no { background: var(--no-soft); border-color: var(--no-line); } .callout.no > .ic { color: var(--no); }
.callout.ia { background: var(--teal-soft); border-color: var(--teal-line); }

/* ============================================================================
   HITL (decisiones)
   ========================================================================== */
.hitl-list { display: flex; flex-direction: column; gap: 11px; }
.hitl { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--panel);
  border: 1px solid var(--linea); border-radius: var(--radio); padding: 15px 17px; box-shadow: var(--sombra-sm); }
.hitl.prio { border-left: 3px solid var(--amber); }
.hitl-l { display: flex; gap: 13px; align-items: flex-start; }
.hitl-t { font-weight: 700; font-size: 14.5px; }
.hitl-meta { font-size: 12px; color: var(--tinta-3); display: flex; align-items: center; gap: 5px; margin: 3px 0 6px; }
.hitl-rec { font-size: 13px; color: var(--tinta-2); max-width: 620px; }
.hitl-r { text-align: right; flex: none; }
.hitl-amount { font-weight: 800; font-size: 15px; color: var(--ok); margin-bottom: 9px; }
.hitl-btns { display: flex; gap: 7px; justify-content: flex-end; }
@media (max-width: 760px) { .hitl { flex-direction: column; align-items: stretch; } .hitl-r { text-align: left; } .hitl-btns { justify-content: flex-start; } }

/* ---- Equipo de agentes --------------------------------------------------- */
.ag-card { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 17px;
  box-shadow: var(--sombra-sm); border-top: 3px solid var(--agc); display: flex; flex-direction: column; }
.ag-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ag-n { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.ag-r { font-size: 12.5px; color: var(--agc); font-weight: 600; }
.ag-claim { font-size: 13px; color: var(--tinta-2); line-height: 1.55; flex: 1; }
.ag-now { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tinta-2); background: var(--fondo);
  border: 1px solid var(--linea-2); border-radius: 9px; padding: 8px 10px; margin: 12px 0 10px; }
.ag-now .ic { color: var(--agc); width: 15px; height: 15px; }
.ag-ch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.ag-chg { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--tinta-2);
  background: var(--fondo); border: 1px solid var(--linea); border-radius: 7px; padding: 4px 8px; }
.ag-mail { font-family: var(--mono); font-size: 11.5px; color: var(--tinta-3); }

/* ---- ROI ribbon ---------------------------------------------------------- */
.roi-ribbon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--linea);
  border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
@media (max-width: 900px) { .roi-ribbon { grid-template-columns: repeat(2, 1fr); } }
.roi-cell { background: var(--panel); padding: 16px 17px; }
.roi-v { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.roi-l { font-size: 12.5px; color: var(--tinta-2); font-weight: 600; margin-top: 4px; }
.roi-s { font-size: 11.5px; color: var(--tinta-3); margin-top: 2px; }
.ribbon-foot { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-size: 12.5px; font-weight: 600;
  color: var(--brand-ink); margin-top: 10px; cursor: pointer; }
.ribbon-foot .ic { width: 15px; height: 15px; }

/* ---- Feed ---------------------------------------------------------------- */
.feed { display: flex; flex-direction: column; }
.feed-i { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--linea-2); }
.feed-i:last-child { border-bottom: none; }
.feed-i.click { cursor: pointer; transition: .12s; } .feed-i.click:hover { background: var(--fondo); }
.feed-txt { font-size: 13.5px; line-height: 1.5; }
.feed-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tinta-3); margin-top: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-ia { background: var(--teal); } .dot-ok { background: var(--ok); } .dot-no { background: var(--no); } .dot-humano { background: var(--amber); }

/* ============================================================================
   PIPELINE (las 3 secciones como flujo)
   ========================================================================== */
.pipeline { display: flex; align-items: stretch; gap: 8px; margin-bottom: 24px; }
.pipe-step { flex: 1 1 0; display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--linea); border-radius: var(--radio); cursor: pointer; transition: .15s; box-shadow: var(--sombra-sm); min-width: 0; min-height: 66px; }
.pipe-step:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.pipe-step.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--sombra); background: var(--brand-soft); }
.pipe-n { width: 30px; height: 30px; border-radius: 9px; background: var(--linea-2); color: var(--tinta-3); font-weight: 800; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pipe-step.on .pipe-n { background: var(--brand); color: #fff; }
.pipe-b { min-width: 0; }
.pipe-t { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-s { font-size: 11.5px; color: var(--tinta-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-arrow { display: flex; align-items: center; color: var(--tinta-3); font-size: 20px; flex: none; }
@media (max-width: 860px) { .pipeline { flex-direction: column; } .pipe-arrow { transform: rotate(90deg); align-self: center; } .pipe-t, .pipe-s { white-space: normal; } }

/* ============================================================================
   VISIBILIDAD
   ========================================================================== */
.hero-contrast { display: flex; align-items: stretch; gap: 14px; margin-bottom: 22px; }
.hc-before, .hc-after { flex: 1; display: flex; gap: 13px; align-items: center; padding: 18px 20px; border-radius: var(--radio); }
.hc-before { background: var(--panel); border: 1px solid var(--linea); color: var(--tinta-2); }
.hc-before .ic { color: var(--slate); width: 26px; height: 26px; }
.hc-after { background: linear-gradient(120deg, #3B1E7A, #7C3AED); color: #fff; }
.hc-after .ic { color: var(--brand-4); width: 26px; height: 26px; }
.hc-k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .7; }
.hc-v { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.hc-s { font-size: 12px; opacity: .8; margin-top: 2px; }
.hc-arrow { display: flex; align-items: center; color: var(--tinta-3); } .hc-arrow .ic { width: 24px; height: 24px; }
@media (max-width: 760px) { .hero-contrast { flex-direction: column; } .hc-arrow { transform: rotate(90deg); justify-content: center; } }

/* ---- Bars horizontales --------------------------------------------------- */
.barsh { display: flex; flex-direction: column; gap: 9px; }
.barsh-row { display: grid; grid-template-columns: 1fr 100px auto; align-items: center; gap: 12px; }
.barsh-row.click { cursor: pointer; } .barsh-row.click:hover .barsh-lab span { color: var(--brand-ink); }
.barsh-lab { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.barsh-lab .ic { color: var(--teal); width: 16px; height: 16px; flex: none; }
.barsh-lab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barsh-track { height: 9px; background: var(--linea-2); border-radius: 6px; overflow: hidden; }
.barsh-fill { display: block; height: 100%; border-radius: 6px; }
.barsh-val { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; min-width: 54px; }

/* ---- Donut + legend ------------------------------------------------------ */
.donut-wrap { position: relative; display: inline-flex; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dc-top { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.dc-bot { font-size: 11px; color: var(--tinta-3); }
.legend { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.legend-i { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tinta-2); }
.legend-i b { margin-left: auto; color: var(--tinta); font-variant-numeric: tabular-nums; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---- Tabla --------------------------------------------------------------- */
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--tinta-3);
  font-weight: 700; padding: 11px 14px; background: var(--fondo); border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabla th.num, .tabla td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla td { padding: 12px 14px; border-bottom: 1px solid var(--linea-2); }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tr.click { cursor: pointer; } .tabla tr.click:hover td { background: var(--brand-soft); }
.tabla .fuerte { font-weight: 700; }
.td-ic { display: inline-flex; margin-right: 8px; color: var(--teal); } .td-ic .ic { width: 16px; height: 16px; vertical-align: -.2em; }

/* ---- Trend --------------------------------------------------------------- */
.trend { font-size: 11.5px; font-weight: 700; }
.trend-up { color: var(--no); } .trend-down { color: var(--ok); } .trend-flat { color: var(--tinta-3); }

/* ============================================================================
   OPORTUNIDADES
   ========================================================================== */
.op-list { display: flex; flex-direction: column; gap: 12px; }
.op { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra-sm); overflow: hidden; }
.op-leak { border-left: 3px solid var(--no); }
.op-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; cursor: pointer; }
.op-head:hover { background: var(--fondo); }
.op-head-l { display: flex; gap: 13px; align-items: center; min-width: 0; }
.op-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--teal-soft); color: var(--teal); flex: none; } .op-ic .ic { width: 20px; height: 20px; }
.op-t { font-weight: 700; font-size: 14.5px; }
.op-sub { font-size: 12px; color: var(--tinta-3); margin-top: 2px; }
.op-head-r { display: flex; align-items: center; gap: 14px; flex: none; }
.op-ahorro { text-align: right; } .op-ahorro span { font-weight: 800; font-size: 15px; color: var(--ok); }
.op-ahorro small { display: block; font-size: 10.5px; color: var(--tinta-3); }
.op-body { display: none; padding: 0 17px 17px; }
.op.open .op-body { display: block; border-top: 1px solid var(--linea-2); padding-top: 14px; }
.op-det { font-size: 13.5px; color: var(--tinta-2); line-height: 1.6; }
.op-tags { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 12px 0; }
.op-ag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tinta-2); font-weight: 600; margin-left: auto; }
.op-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.op-noact { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tinta-3); }
.op-noact .ic { width: 14px; height: 14px; }
.pilot-note { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--tinta-3);
  background: var(--fondo); border: 1px dashed var(--linea); border-radius: var(--radio-sm); padding: 11px 13px; margin-top: 22px; }
.pilot-note .ic { width: 15px; height: 15px; color: var(--tinta-3); flex: none; margin-top: 1px; }
.pilot-note b { color: var(--tinta-2); }
@media (max-width: 700px) { .op-head { flex-direction: column; align-items: flex-start; } .op-head-r { align-self: stretch; justify-content: space-between; } }

/* ============================================================================
   EJECUCIÓN / evidencia
   ========================================================================== */
.evid-card { padding: 15px; }
.evid-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.evid-ch svg { width: 18px; height: 18px; }
.evid-t { font-weight: 700; font-size: 14px; }
.evid-m { font-size: 12px; color: var(--tinta-3); margin-top: 3px; }
.evid-open { margin-bottom: 22px; }
.evid-open .card-h { justify-content: space-between; }
.evid-close { margin-left: auto; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.email { border: 1px solid var(--linea); border-radius: var(--radio-sm); overflow: hidden; }
.email-h { display: flex; align-items: baseline; gap: 8px; padding: 10px 13px; background: var(--fondo); font-size: 12.5px; color: var(--tinta-2); }
.email-d { margin-left: auto; font-size: 11.5px; color: var(--tinta-3); font-family: var(--mono); }
.email-asunto { padding: 9px 13px 0; font-weight: 700; font-size: 13.5px; }
.email-body { padding: 8px 13px 13px; font-size: 13px; color: var(--tinta-2); line-height: 1.6; }
.email-body p { margin-bottom: 7px; } .email-body p:last-child { margin-bottom: 0; }
.call-meta { padding: 12px 16px; font-size: 12.5px; color: var(--tinta-2); border-bottom: 1px solid var(--linea-2); display: flex; align-items: center; gap: 7px; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.tr { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.tr-ia { align-self: flex-start; } .tr-prov { align-self: flex-end; text-align: right; }
.tr-q { font-size: 11px; font-weight: 700; color: var(--tinta-3); }
.tr-t { font-size: 13px; line-height: 1.5; padding: 9px 13px; border-radius: 12px; }
.tr-ia .tr-t { background: var(--brand-soft); color: var(--brand-ink); border-bottom-left-radius: 3px; }
.tr-prov .tr-t { background: var(--teal-soft); color: var(--teal-ink); border-bottom-right-radius: 3px; }

/* ---- Timeline / consola -------------------------------------------------- */
.run-card { padding: 16px; border-top: 3px solid var(--agc); }
.run-h { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.run-n { font-weight: 700; font-size: 14px; } .run-w { font-size: 11.5px; color: var(--tinta-3); }
.timeline { display: flex; flex-direction: column; }
.tl { position: relative; padding: 0 0 15px 24px; }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 0; width: 2px; background: var(--linea); }
.tl-node { position: absolute; left: 1px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--panel); background: var(--slate); }
.tl-ia { background: var(--teal); } .tl-ok { background: var(--ok); } .tl-no { background: var(--no); } .tl-humano { background: var(--amber); }
.tl-top { display: flex; align-items: baseline; gap: 8px; }
.tl-sys { font-size: 11px; font-weight: 700; color: var(--teal-ink); background: var(--teal-soft); padding: 1px 7px; border-radius: 6px; }
.tl-time { font-size: 11px; color: var(--tinta-3); font-family: var(--mono); margin-left: auto; }
.tl-txt { font-size: 12.5px; color: var(--tinta-2); line-height: 1.5; margin-top: 4px; }
.tl-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--brand-ink); margin-top: 5px; }
.tl-link .ic { width: 13px; height: 13px; }

/* ============================================================================
   ROI (detalle)
   ========================================================================== */
.funnel { display: flex; align-items: stretch; gap: 8px; margin-bottom: 4px; }
.funnel-step { flex: 1; position: relative; background: color-mix(in srgb, var(--fc) 10%, white); border: 1px solid color-mix(in srgb, var(--fc) 30%, white);
  border-radius: var(--radio-sm); padding: 15px 14px; text-align: center; }
.funnel-v { font-size: 20px; font-weight: 800; color: var(--fc); letter-spacing: -.02em; }
.funnel-k { font-size: 11.5px; color: var(--tinta-2); font-weight: 600; margin-top: 3px; }
.funnel-arrow { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--tinta-3); z-index: 1; }
@media (max-width: 760px) { .funnel { flex-direction: column; } .funnel-arrow { display: none; } }

.kpi-grid.kauto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ---- Impacto: KPI + su reparto por terminal, en la misma columna --------- */
.kpi-grid.imp-cols { align-items: stretch; margin-bottom: 8px; }
.imp-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.imp-col .kpi { flex: 1 0 auto; }
.bd-under { border: 1px solid var(--linea); border-radius: 12px; padding: 11px 12px; background: #fff; }
.bd-row { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.bd-row:last-child { margin-bottom: 0; }
.bd-term { font-size: 11.5px; color: var(--tinta-2); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bd-tchip { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bd-track { height: 8px; background: var(--linea-2); border-radius: 5px; overflow: hidden; }
.bd-fill { display: block; height: 100%; border-radius: 5px; }
.bd-v { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tinta); text-align: right; display: inline-flex; align-items: baseline; gap: 5px; justify-content: flex-end; }
.bd-pct { font-size: 10.5px; font-weight: 600; color: var(--tinta-3); min-width: 28px; text-align: right; }
.bd-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tstage-note { margin: 4px 0 20px; font-size: 11.5px; line-height: 1.55; color: var(--tinta-3); }

/* ---- Impacto: chatbot de personalización --------------------------------- */
.imp-chat { margin: 0; }
.imp-chat-now { font-size: 12px; color: var(--tinta-2); margin: 10px 2px 4px; }
.imp-chat-now b { color: var(--tinta); }

.palancas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
@media (max-width: 720px) { .palancas-grid { grid-template-columns: 1fr; } }
.palancas { display: flex; flex-direction: column; gap: 12px; }
.palanca { display: flex; gap: 12px; align-items: center; }
.palanca > .ic { color: var(--teal); width: 20px; height: 20px; flex: none; }
.palanca-k { font-size: 13px; font-weight: 600; }
.palanca-v { font-size: 12.5px; display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.palanca-v .ic { width: 13px; height: 13px; color: var(--tinta-3); }
.pal-antes { color: var(--tinta-3); text-decoration: line-through; }
.pal-ahora { color: var(--ok); font-weight: 700; }
.big-stat { text-align: center; padding: 8px 0 4px; }
.bs-v { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.bs-l { font-size: 12.5px; color: var(--tinta-2); max-width: 340px; margin: 6px auto 0; }
.path-card .card-b { padding-top: 6px; }
.path-intro { font-size: 13.5px; color: var(--tinta-2); line-height: 1.6; margin: 10px 0 16px; }
.path-steps { display: flex; flex-direction: column; gap: 12px; }
.path-step { display: flex; gap: 13px; align-items: flex-start; font-size: 13.5px; color: var(--tinta-2); line-height: 1.55; }
.ps-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.casos { display: flex; flex-direction: column; gap: 13px; }
.caso { border-left: 3px solid var(--teal-line); padding: 2px 0 2px 13px; }
.caso-f { font-size: 12px; font-weight: 700; color: var(--teal-ink); }
.caso-t { font-size: 13px; color: var(--tinta-2); line-height: 1.55; margin-top: 3px; }

/* ============================================================================
   AUTONOMÍA
   ========================================================================== */
.auton { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--linea-2); }
.auton:last-child { border-bottom: none; }
.auton-l { display: flex; gap: 11px; align-items: center; min-width: 0; }
.auton-t { font-weight: 600; font-size: 13.5px; }
.auton-m { font-size: 12px; color: var(--tinta-3); }
.auton-r { display: flex; align-items: center; gap: 14px; flex: none; }
.auton-int { font-size: 11.5px; color: var(--amber-ink); display: flex; align-items: center; gap: 5px; max-width: 200px; }
.auton-int .ic { width: 14px; height: 14px; }
.seg { display: inline-flex; background: var(--fondo); border: 1px solid var(--linea); border-radius: 9px; padding: 2px; }
.seg-o { font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 7px; color: var(--tinta-2); transition: .13s; }
.seg-o:disabled { opacity: .35; cursor: not-allowed; }
.seg-o.on { color: #fff; }
.seg-o.on-manual { background: var(--amber); } .seg-o.on-copilot { background: var(--teal); } .seg-o.on-auto { background: var(--ok); }
.seg-lock { opacity: .95; }
.firmas { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.firmas li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--tinta-2); }
.firmas li .ic { color: var(--ok); width: 16px; height: 16px; flex: none; margin-top: 2px; }
@media (max-width: 760px) { .auton { flex-direction: column; align-items: flex-start; } .auton-r { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* ============================================================================
   MODAL + TOAST
   ========================================================================== */
.modal-bg { position: fixed; inset: 0; background: rgba(6,34,40,.5); backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--panel); border-radius: var(--radio); width: 100%; max-width: 720px; max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--sombra-lg); animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-h { display: flex; align-items: center; gap: 9px; padding: 16px 18px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--linea); }
.modal-x { margin-left: auto; font-size: 18px; color: var(--tinta-3); width: 30px; height: 30px; border-radius: 8px; }
.modal-x:hover { background: var(--fondo); }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-b .kpi-grid { margin-bottom: 14px; }
.mini-op { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--linea); border-radius: var(--radio-sm); margin-bottom: 8px; cursor: pointer; transition: .12s; }
.mini-op:hover { border-color: var(--brand); background: var(--brand-soft); }
.mini-op-s { font-size: 11.5px; color: var(--tinta-3); margin-top: 2px; }
.mini-op-a { font-weight: 800; color: var(--ok); font-size: 13.5px; white-space: nowrap; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 9px; background: #1B1437; color: #fff; padding: 12px 18px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--sombra-lg); opacity: 0; transform: translateY(12px); transition: .3s; max-width: 460px; }
.toast .ic { color: #A78BFA; width: 17px; height: 17px; flex: none; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================================
   PRODUCCIÓN — componentes nuevos
   ========================================================================== */
.kpi-grid.k5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1080px) { .kpi-grid.k5 { grid-template-columns: repeat(3, 1fr); } }
.btn-danger { background: var(--no-soft); color: var(--no); border-color: var(--no-line); }
.btn-danger:hover { background: #FCE0E0; }
.empty { padding: 26px; text-align: center; color: var(--tinta-3); font-size: 13.5px; }
.empty .ic { color: var(--ok); vertical-align: -.15em; margin-right: 5px; }
.empty-cell { text-align: center; color: var(--tinta-3); padding: 22px; }
.ok-txt { color: var(--ok); } .warn-txt { color: var(--amber-ink); font-weight: 700; }
.mono { font-family: var(--mono); font-size: 12px; }

/* actor avatars (humano/sistema/proveedor) */
.av-hum, .av-sys, .av-prov { border-radius: 10px; color: #fff; font-weight: 800; }
.av-hum .av-ini, .av-sys .av-ini, .av-prov .av-ini { font-size: 11px; letter-spacing: .3px; }

/* Panel: acción requerida + agentes + feed */
.req { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--linea-2); cursor: pointer; transition: .12s; }
.req:last-child { border-bottom: none; } .req:hover { background: var(--fondo); }
.req-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.req-t { font-weight: 600; font-size: 13.5px; } .req-s { font-size: 12px; color: var(--tinta-2); margin-top: 2px; }
.req-r { display: flex; align-items: center; gap: 10px; flex: none; } .req-go { color: var(--tinta-3); } .req-go .ic { width: 16px; height: 16px; }
.ag-row { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--linea-2); }
.ag-row:last-child { border-bottom: none; }
.ag-row-n { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.ag-row-s { font-size: 12px; color: var(--tinta-2); margin-top: 2px; }
.livefeed { display: flex; flex-direction: column; }
.badge-nuevo { background: var(--brand); color: #fff; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 5px; letter-spacing: .4px; }
.mini-node { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.mini-ia { background: var(--teal); } .mini-humano { background: var(--amber); } .mini-no { background: var(--slate); }

/* Filtros del explorador */
.filtros { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--linea);
  border-radius: var(--radio); padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--sombra-sm); }
.filtro { display: flex; flex-direction: column; gap: 4px; }
.filtro label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--tinta-3); font-weight: 700; }
.filtro select, .filtro input { font-family: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--linea); border-radius: 9px; background: var(--fondo); color: var(--tinta); }
.filtro-q { flex: 1; min-width: 180px; } .filtro-q input { width: 100%; }
.filtro-exp { margin-left: auto; }

/* Migas del drill */
.drill-crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.dc-i { color: var(--tinta-3); cursor: pointer; } .dc-i:hover { color: var(--brand-ink); } .dc-i.on { color: var(--tinta); font-weight: 700; cursor: default; }
.dc-sep { color: var(--tinta-3); opacity: .6; }

/* Tabla de líneas (densa, tipo ERP) */
.tabla-lineas { font-size: 12.5px; }
.tabla-lineas td { padding: 9px 12px; }

/* Insights */
.insight { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--linea-2); cursor: pointer; transition: .12s; }
.insight:last-child { border-bottom: none; } .insight:hover { background: var(--fondo); }
.insight-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); flex: none; }
.insight-ic .ic { width: 18px; height: 18px; }
.insight-t { font-weight: 600; font-size: 13.5px; } .insight-s { font-size: 12px; color: var(--tinta-2); margin-top: 2px; }
.insight-b { flex: 1; min-width: 0; }
.insight-go { font-size: 12px; color: var(--brand-ink); font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.insight-go .ic { width: 13px; height: 13px; }

/* Tabs (sección 2) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linea); margin-bottom: 16px; }
.tab { font-size: 13.5px; font-weight: 600; color: var(--tinta-2); padding: 10px 14px; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--tinta); } .tab.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab-n { background: var(--linea-2); color: var(--tinta-2); font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.tab.on .tab-n { background: var(--brand-soft-2); color: var(--brand-ink); }

/* Categorías de decisión (KPIs que también son el filtro) */
.oppcats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 820px) { .oppcats { grid-template-columns: 1fr; } }
.oppcat { text-align: left; background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 15px 16px; position: relative; overflow: hidden; box-shadow: var(--sombra-sm); transition: .14s; cursor: pointer; }
.oppcat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kc); opacity: .55; }
.oppcat:hover { border-color: var(--tinta-3); }
.oppcat.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--sombra); background: var(--brand-soft); }
.oppcat.on::after { opacity: 1; }
.oppcat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.oppcat-l { font-size: 12.5px; color: var(--tinta-2); font-weight: 600; }
.oppcat.on .oppcat-l { color: var(--brand-ink); }
.oppcat-ic { color: var(--kc); } .oppcat-ic .ic { width: 18px; height: 18px; }
.oppcat-v { font-size: 25px; font-weight: 800; margin: 8px 0 3px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.oppcat-s { font-size: 12px; color: var(--tinta-3); }

/* Sustento de oportunidad */
.op-evid { display: flex; gap: 9px; align-items: flex-start; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--radio-sm); padding: 11px 13px; margin: 12px 0; font-size: 13px; color: var(--tinta-2); line-height: 1.5; }
.op-evid .ic { width: 16px; height: 16px; color: var(--brand); flex: none; margin-top: 2px; }
.op-evid-l { font-weight: 700; color: var(--brand-ink); }
.op-sustento { background: var(--fondo); border: 1px solid var(--linea-2); border-radius: var(--radio-sm); padding: 12px 14px; margin: 12px 0; }
.sus-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--tinta-2); }
.sus-bar { height: 8px; background: var(--linea-2); border-radius: 5px; margin: 7px 0; overflow: hidden; }
.sus-bar span { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.op-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tinta-2); }
.op-note .ic { width: 15px; height: 15px; }

/* Ejecución: layout kanban + side */
.grid-main-side { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .grid-main-side { grid-template-columns: 1fr; } }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kan-col { flex: 1 1 0; min-width: 200px; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--radio); padding: 10px; }
.kan-col-h { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; }
.kan-col-n { background: var(--panel); border: 1px solid var(--linea); color: var(--tinta-2); font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.kan-col-d { font-size: 10.5px; color: var(--tinta-3); margin: 3px 0 10px; }
.kan-col-val { font-size: 12px; font-weight: 700; color: var(--ok); margin: 2px 0 11px; }
.kan-card.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.wf-hint { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; padding: 30px; background: var(--panel); border: 1px dashed var(--linea); border-radius: var(--radio); color: var(--tinta-3); font-size: 13.5px; }
.wf-hint .ic { color: var(--brand); width: 18px; height: 18px; }
.wf-detail { margin-top: 18px; overflow: hidden; }
.wf-detail-h { display: flex; align-items: center; gap: 11px; padding: 14px 18px; border-bottom: 1px solid var(--linea); }
.wf-detail-t { font-weight: 700; font-size: 15px; flex: 1; }
.wf-detail-b { padding: 18px; }
.wf-detail-b .wf-timeline { margin-bottom: 0; }
.wf-events { align-self: start; }
.kan-empty { text-align: center; color: var(--tinta-3); font-size: 12px; padding: 10px 0; }
.kan-card { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio-sm); padding: 11px 12px; margin-bottom: 9px; cursor: pointer; transition: .13s; box-shadow: var(--sombra-sm); }
.kan-card:hover { transform: translateY(-1px); box-shadow: var(--sombra); border-color: var(--brand-line); }
.kan-alert { border-left: 3px solid var(--amber); }
.kan-card-t { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.kan-prog { height: 5px; background: var(--linea-2); border-radius: 4px; overflow: hidden; margin: 9px 0; }
.kan-prog span { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.kan-card-m { display: flex; align-items: center; justify-content: space-between; }
.kan-ahorro { font-size: 12px; font-weight: 800; color: var(--tinta-2); }
.kan-req { font-size: 11px; color: var(--amber-ink); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.kan-req .ic { width: 13px; height: 13px; }
.kan-next { font-size: 11px; color: var(--tinta-3); margin-top: 8px; }
.livecard { position: sticky; top: 76px; }

/* Workflow drawer / timeline */
.modal.wide { max-width: 860px; }
.wf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.wf-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.wf-next { font-size: 13px; color: var(--tinta-2); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wf-next-l { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--tinta-3); font-weight: 700; }
.wf-cta { display: flex; gap: 7px; flex: none; }
.wf-evid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-evid { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--teal-ink); background: var(--teal-soft); border: 1px solid var(--teal-line); border-radius: 20px; padding: 5px 11px; }
/* Comunicaciones con proveedores (emails y llamadas del flujo) */
.wf-comms { background: var(--teal-soft); border: 1px solid var(--teal-line); border-radius: var(--radio); padding: 14px 16px; margin-bottom: 16px; }
.wf-comms-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--teal-ink); margin-bottom: 10px; }
.wf-comms-h .ic { width: 17px; height: 17px; }
.wf-comms-n { background: var(--teal); color: #fff; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.wf-comms-empty { background: var(--fondo); border: 1px dashed var(--linea); color: var(--tinta-3); font-size: 12.5px; display: flex; align-items: center; gap: 9px; }
.wf-comms-empty .ic { color: var(--tinta-3); width: 16px; height: 16px; flex: none; }
.comm-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--teal-line); border-radius: var(--radio-sm); padding: 11px 13px; margin-bottom: 8px; cursor: pointer; transition: .13s; }
.comm-row:last-child { margin-bottom: 0; }
.comm-row:hover { border-color: var(--teal); box-shadow: var(--sombra-sm); }
.comm-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--teal-soft); flex: none; }
.comm-ic svg { width: 17px; height: 17px; }
.comm-b { flex: 1; min-width: 0; }
.comm-t { font-weight: 600; font-size: 13.5px; }
.comm-m { font-size: 12px; color: var(--tinta-3); margin-top: 2px; }
.comm-go { font-size: 12.5px; font-weight: 600; color: var(--teal-ink); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.comm-go .ic { width: 14px; height: 14px; }

/* Leyenda de color IA / humano / proveedor */
.wf-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 0 16px; border-bottom: 1px solid var(--linea-2); margin-bottom: 16px; }
.leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tinta-2); font-weight: 600; }
.legdot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.leg-ia { background: var(--teal); } .leg-hum { background: var(--amber); } .leg-prov { background: var(--slate); }

/* Flujo agrupado por tipo de actividad */
.wf-flow { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.wf-group-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--tinta); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.wf-group-h .ic { width: 16px; height: 16px; color: var(--tinta-3); }
.wf-group-n { background: var(--linea-2); color: var(--tinta-2); font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.wf-step { display: flex; gap: 12px; padding: 11px 13px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio-sm); border-left-width: 3px; }
.wf-step.wf-ia { border-left-color: var(--teal); }
.wf-step.wf-hum { border-left-color: var(--amber); }
.wf-step.wf-prov { border-left-color: var(--slate); }
.wf-step.step-pend { opacity: .6; }
.wf-node { flex: none; }
.wf-step-b { flex: 1; min-width: 0; }
.wf-step-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wf-step-t { font-weight: 700; font-size: 13.5px; }
.wf-step-meta { display: flex; align-items: center; gap: 7px; flex: none; }
.wf-when { font-size: 11px; color: var(--tinta-3); font-family: var(--mono); }
.wf-actor { font-size: 11.5px; color: var(--tinta-3); margin: 3px 0 5px; display: flex; align-items: center; gap: 6px; }
.actor-tag { font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; letter-spacing: .3px; }
.actor-agente { background: var(--teal-soft); color: var(--teal-ink); }
.actor-humano { background: var(--amber-soft); color: var(--amber-ink); }
.actor-proveedor { background: #EEF2F2; color: var(--slate); }
.wf-step-d { font-size: 12.5px; color: var(--tinta-2); line-height: 1.5; margin-bottom: 8px; }
.wf-step-foot { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* Chatbot para ajustar el flujo */
.wf-chat { border: 1px solid var(--brand-line); border-radius: var(--radio); overflow: hidden; margin-top: 4px; }
.wf-chat-h { display: flex; align-items: center; gap: 8px; padding: 12px 15px; background: var(--brand-soft); font-size: 13.5px; font-weight: 700; color: var(--brand-ink); }
.wf-chat-h .ic { width: 17px; height: 17px; }
.wf-chat-sub { font-size: 11.5px; font-weight: 500; color: var(--tinta-2); }
.wf-chat-log { max-height: 240px; overflow-y: auto; padding: 14px 15px; display: flex; flex-direction: column; gap: 10px; background: var(--fondo); }
.chat-hint { font-size: 12.5px; color: var(--tinta-3); font-style: italic; line-height: 1.5; }
.cmsg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.cmsg-ia { align-self: flex-start; }
.cmsg-user { align-self: flex-end; flex-direction: row; }
.cbub { font-size: 13px; line-height: 1.5; padding: 9px 13px; border-radius: 13px; }
.cmsg-ia .cbub { background: var(--teal-soft); color: var(--teal-ink); border-bottom-left-radius: 3px; }
.cmsg-user .cbub { background: var(--brand); color: #fff; border-bottom-right-radius: 3px; }
.wf-chat-in { display: flex; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--linea); background: var(--panel); }
.wf-chat-in input { flex: 1; font-family: inherit; font-size: 13.5px; padding: 9px 12px; border: 1px solid var(--linea); border-radius: 9px; background: var(--fondo); }
.wf-chat-in input:focus { outline: none; border-color: var(--brand); }

/* Impacto */
.impacto-extra { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linea-2); font-size: 12.5px; color: var(--tinta-2); }
.impacto-extra span { display: inline-flex; align-items: center; gap: 5px; }
.impacto-extra b { color: var(--tinta); }
.funnel-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tinta-2); margin-top: 14px; }
.funnel-note .ic { width: 16px; height: 16px; color: var(--info); flex: none; }
.escala { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.escala-b { background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--radio-sm); padding: 13px 18px; text-align: center; }
.escala-v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; } .escala-l { font-size: 11.5px; color: var(--tinta-3); margin-top: 2px; }
.escala-x, .escala-eq { font-size: 18px; color: var(--tinta-3); font-weight: 700; }
.escala-goal { background: var(--ok-soft); border-color: var(--ok-line); } .escala-goal .escala-v { color: var(--ok); }

/* Configuración de agentes */
.set-agent { margin-bottom: 16px; }
.set-agent-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linea-2); }
.set-agent-n { font-weight: 700; font-size: 15px; } .set-agent-r { font-size: 12.5px; color: var(--tinta-2); }
.set-task { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--linea-2); }
.set-task:last-child { border-bottom: none; }
.set-task-l { min-width: 0; } .set-task-t { font-weight: 600; font-size: 13.5px; } .set-task-m { font-size: 12px; color: var(--tinta-3); margin-top: 2px; }
.set-task-firma { font-size: 11.5px; color: var(--amber-ink); margin-top: 4px; display: flex; align-items: center; gap: 5px; } .set-task-firma .ic { width: 13px; height: 13px; }
.set-audit { font-size: 11.5px; color: var(--tinta-3); margin-top: 4px; padding: 4px 2px; }
.set-lock-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); flex: none; }
.set-lock-ic .ic { width: 18px; height: 18px; }
.set-add-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex: none; }
.set-add-ic .ic { width: 18px; height: 18px; }
.set-agent-h { position: relative; }
.set-add-btn { margin-left: auto; }
.regla-row .set-task-t { display: flex; align-items: center; gap: 7px; }
.regla-row .set-task-t .ic { width: 15px; height: 15px; color: var(--brand); }
.icon-x { width: 28px; height: 28px; border-radius: 8px; color: var(--tinta-3); font-size: 15px; flex: none; }
.icon-x:hover { background: var(--no-soft); color: var(--no); }
.firma-lock { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--amber-ink); background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 9px; padding: 8px 13px; white-space: nowrap; flex: none; }
.firma-lock .ic { width: 14px; height: 14px; }

/* Modales de formulario */
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--linea); }
.modal-intro { font-size: 13.5px; color: var(--tinta-2); line-height: 1.55; margin-bottom: 16px; }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row label { font-size: 12.5px; font-weight: 600; color: var(--tinta-2); }
.form-row input[type=number] { font-family: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--linea); border-radius: 9px; background: var(--fondo); max-width: 220px; }
.form-row.check label { flex-direction: row; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.motivos { display: flex; flex-direction: column; gap: 9px; }
.motivo { display: flex; align-items: center; gap: 9px; font-size: 13.5px; padding: 10px 12px; border: 1px solid var(--linea); border-radius: var(--radio-sm); cursor: pointer; }
.motivo:hover { border-color: var(--brand-line); }

/* ============================================================================
   RESPONSIVE — pantallas estrechas: el sidebar pasa a barra superior
   ========================================================================== */
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; padding: 10px 12px; }
  .side-top, .side-mod, .side-team, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; -webkit-overflow-scrolling: touch; }
  .nav-i { flex: none; padding: 8px 12px; white-space: nowrap; }
  .nav-i .nav-lbl { flex: none; }
  .top { padding: 0 16px; }
  .crumbs { display: none; }
  .top-right { width: 100%; justify-content: space-between; }
  .page { padding: 20px 16px 50px; }
  .page-head h2 { font-size: 22px; }
  .roi-ribbon { grid-template-columns: 1fr 1fr; }
}
