:root {
  --bg: #f7f8fa; --card: #fff; --text: #141c2b; --text-2: #4d5868; --text-3: #8791a0;
  --sep: #e7eaef; --accent: #12306f; --accent-2: #4a78c2; --link: #12306f; --navy: #0b1f45; --cta: #c96a12;
  --green: #1d8558; --red: #c43d32; --orange: #c47412; --blue: #4a78c2; --purple: #5f54a8; --teal: #3a8ea6;
  --track: #eef0f4; --seg-bg: #f1f3f6; --seg-active: #fff; --field: #f6f7f9;
  --shadow: none; --bar: #0b1f45;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111c; --card: #141b2a; --text: #e9ecf2; --text-2: #aab3c2; --text-3: #7f899a;
    --sep: #252e40; --accent: #8fb0ee; --accent-2: #6f97dc; --link: #9dbaf0; --navy: #e9ecf2; --cta: #e08a3c;
    --green: #47b483; --red: #e76f64; --orange: #e08a3c; --blue: #6f97dc; --purple: #9c91df; --teal: #5cb0c6;
    --track: #222b3c; --seg-bg: #1b2333; --seg-active: #141b2a; --field: #1a2231;
    --shadow: none; --bar: #0a1120;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: Poppins, "Helvetica Neue", Arial, sans-serif; font-size: 14px; }
button, input, select, textarea { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; padding: 24px 16px; min-height: 100dvh; overflow: hidden; }
.orb { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .5; pointer-events: none; animation: float 18s ease-in-out infinite alternate; }
.orb.a { width: 46vmax; height: 46vmax; background: #0a8f9c; top: -18vmax; left: -12vmax; }
.orb.b { width: 40vmax; height: 40vmax; background: #0b6e99; bottom: -16vmax; right: -10vmax; animation-delay: -6s; }
.orb.c { width: 24vmax; height: 24vmax; background: #ff9f0a; bottom: 8vmax; left: 10vmax; opacity: .25; animation-delay: -12s; }
@keyframes float { to { transform: translate(4vmax, 3vmax) scale(1.08); } }
.login-card { position: relative; width: 100%; max-width: 390px; background: color-mix(in srgb, var(--card) 75%, transparent);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12); padding: 40px 32px 28px; text-align: center; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.logo { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 18px; background: linear-gradient(160deg, #13b5c2, #0b6e99);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(10,143,156,.35); }
.logo svg { width: 42px; height: 42px; }
.login-card h1 { font-size: 27px; margin: 0 0 4px; letter-spacing: -.025em; }
.login-card .sub { color: var(--text-2); margin: 0 0 26px; font-size: 15px; }
.fields { border: 1px solid var(--sep); border-radius: 12px; overflow: hidden; background: var(--card); text-align: left; }
.fields input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; padding: 15px 16px; }
.fields input + input { border-top: 1px solid var(--sep); }
.fields:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.primary { width: 100%; height: 50px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: .6; }
.error { color: var(--red); font-size: 14px; min-height: 20px; margin: 12px 0 0; }
.foot { margin-top: 22px; font-size: 12px; color: var(--text-3); }

/* ---------- App ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); }
.bar-inner { max-width: 1240px; margin: 0 auto; height: 52px; padding: 0 22px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; white-space: nowrap; }
.brand .mini { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(160deg, #13b5c2, #0b6e99); display: grid; place-items: center; }
.brand .mini svg { width: 16px; height: 16px; }
.nav { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.nav a.active { color: var(--text); background: var(--seg-bg); font-weight: 600; }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text); font-size: 14px; cursor: pointer; padding: 4px 8px; border-radius: 980px; }
.user:hover { background: var(--seg-bg); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(160deg, #13b5c2, #0b6e99); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.role { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }

main { max-width: 1240px; margin: 0 auto; padding: 30px 22px 60px; }
h1.title { font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -.025em; margin: 0; }
.subtitle { color: var(--text-2); font-size: 16px; margin: 6px 0 0; }
.demo { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); padding: 4px 10px; border-radius: 980px; margin-left: 10px; vertical-align: middle; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 24px 0 22px; padding: 12px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--seg-bg); }
.segmented button { border: 0; background: transparent; color: var(--text); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.segmented button.active { background: var(--seg-active); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.select, .date { height: 32px; border: 0; border-radius: 8px; background: var(--seg-bg); color: var(--text); font-size: 13px; padding: 0 10px; outline: 0; }
.fl { font-size: 12px; color: var(--text-3); margin-right: -4px; }
.btn { border: 0; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; height: 34px; padding: 0 14px; border-radius: 980px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn.plain { background: var(--seg-bg); color: var(--text); }
.btn.small { height: 28px; font-size: 13px; padding: 0 11px; }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.row2 { grid-template-columns: 2fr 1fr; margin-top: 18px; }
.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.card h3 { margin: 0 0 14px; font-size: 17px; font-weight: 600; letter-spacing: -.015em; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card h3 small { font-size: 13px; color: var(--text-3); font-weight: 400; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.kpi-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi-icon svg { width: 16px; height: 16px; }
.i-accent { background: var(--accent); } .i-blue { background: var(--blue); } .i-orange { background: var(--orange); } .i-green { background: var(--green); }
.kpi-value { font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.02em; margin-top: 12px; }
.kpi-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 980px; }
.delta.up { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.delta.down { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.delta.flat { color: var(--text-3); background: var(--seg-bg); }

.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); font-weight: 400; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.c-leads { background: var(--accent); } .c-meta { background: var(--blue); } .c-pot { background: var(--orange); } .c-cli { background: var(--green); }
svg.chart { width: 100%; height: 260px; display: block; overflow: visible; }
svg.chart text { fill: var(--text-3); font-size: 11px; }

.funnel { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.f-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.f-top b { font-weight: 600; }
.f-track { height: 26px; border-radius: 8px; background: var(--track); overflow: hidden; }
.f-fill { height: 100%; border-radius: 8px; width: 0; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.f-note { font-size: 12px; color: var(--text-3); margin-top: 14px; line-height: 1.45; }

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.t th { text-align: right; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
table.t td { text-align: right; padding: 10px 8px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t tr:last-child td { border-bottom: 0; }
.minibar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--track); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.minibar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.statusline { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 22px; font-size: 13px; color: var(--text-3); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--text-3); }
.dot.ok { background: var(--green); } .dot.warn { background: var(--orange); } .dot.err { background: var(--red); }

.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 980px; white-space: nowrap; background: var(--seg-bg); color: var(--text-2); }
.pill.k-destino { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill.k-origen { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.pill.k-estado { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.pill.k-sin_clasificar { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.pill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pill.err { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

.banner { background: color-mix(in srgb, var(--orange) 14%, var(--card)); border-radius: 16px; padding: 14px 18px; font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.banner a { color: var(--link); }
.empty { color: var(--text-3); font-size: 15px; padding: 26px; text-align: center; }
.inline-input { height: 30px; border: 0; border-radius: 7px; background: var(--seg-bg); color: var(--text); padding: 0 9px; font-size: 13px; width: 150px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }

/* diálogos */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px 16px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.backdrop.is-open { opacity: 1; pointer-events: auto; }
.dialog { width: 100%; max-width: 440px; background: var(--card); border-radius: 22px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.3); transform: scale(.97); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.backdrop.is-open .dialog { transform: none; }
.dialog h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.dialog p { color: var(--text-2); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.dialog .fields { margin-bottom: 4px; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; background: var(--seg-bg); padding: 12px; border-radius: 10px; text-align: center; user-select: all; word-break: break-all; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; transition: all .3s cubic-bezier(.2,.8,.2,1); background: rgba(29,29,31,.92); color: #fff; padding: 11px 18px; border-radius: 980px; font-size: 14px; font-weight: 500; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) { .kpis { grid-template-columns: repeat(2, 1fr); } .row2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  main { padding: 20px 16px 50px; } .bar-inner { padding: 0 16px; gap: 10px; } .brand span.txt, .user .uname { display: none; }
  .kpis { gap: 12px; } .card { padding: 16px; } .table-wrap { margin: 0 -16px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.mt { margin-top: 18px; }
.f2 { margin-top: -10px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--seg-bg); height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--accent); }
.dd { position: relative; }
.dd-btn { cursor: pointer; min-width: 170px; text-align: left; }
.dd-panel { position: absolute; top: 38px; left: 0; z-index: 30; background: var(--card); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 8px; min-width: 240px; max-height: 360px; overflow-y: auto; }
.dd-panel label { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.dd-panel label:hover { background: var(--field); }
.dd-panel input { accent-color: var(--accent); }
.dd-actions { display: flex; justify-content: space-between; padding: 6px 6px 2px; border-top: .5px solid var(--sep); margin-top: 4px; }
.linkbtn { border: 0; background: none; color: var(--link); font-size: 13px; cursor: pointer; padding: 4px; }
.i-cold { background: var(--teal); }
.c-frio { background: var(--teal); }
.minis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; padding: 0; }
.mini { padding: 16px 18px; border-right: .5px solid var(--sep); min-width: 0; }
.mini:last-child { border-right: 0; }
.mini .l { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .v { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.mini .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.btn.small:disabled { opacity: .6; cursor: default; }
@media (max-width: 960px) { .minis { grid-template-columns: repeat(3, 1fr); } .mini:nth-child(3) { border-right: 0; } .mini:nth-child(-n+3) { border-bottom: .5px solid var(--sep); } }
@media (max-width: 640px) { .minis { grid-template-columns: repeat(2, 1fr); } .mini { border-right: 0; border-bottom: .5px solid var(--sep); } }
.c-none { background: var(--text-3); } .pill.k-producto { color: var(--purple); background: color-mix(in srgb, var(--purple) 14%, transparent); } .pill.k-ignorar { color: var(--text-3); }
.f-inner { box-shadow: none; padding: 0; margin: 0 0 14px; background: transparent; }
.inline-input.wide { width: 280px; height: 32px; }
.c-meta { background: var(--blue); }
table.tree td:first-child { white-space: normal; min-width: 320px; }
.tree .lvl1 td:first-child { padding-left: 34px; } .tree .lvl2 td:first-child { padding-left: 60px; }
.tree .lvl1 { background: color-mix(in srgb, var(--field) 50%, transparent); } .tree .lvl2 { background: var(--field); }
.tree .nm { display: inline-flex; align-items: flex-start; gap: 8px; }
.tree .exp { border: 0; background: none; color: var(--text-3); cursor: pointer; width: 18px; padding: 0; font-size: 12px; flex-shrink: 0; }
.tree input[type=checkbox] { accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.st { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 980px; }
.st.on { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.st.off { color: var(--text-3); background: var(--seg-bg); }
.destcell { border: 0; background: none; color: inherit; font: inherit; cursor: default; padding: 0; text-align: left; }
.destcell.edit { cursor: pointer; color: var(--link); }
.sugg { font-size: 12px; color: var(--orange); }
.inh { font-size: 12px; color: var(--text-3); }
.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; }
.results .mini { border-bottom: .5px solid var(--sep); }
.results .mini:nth-child(4n) { border-right: 0; }
.results .big .v { font-size: 30px; color: var(--accent); }
.results .wide-row { grid-column: 1 / -1; padding: 16px 18px; border-right: 0; }
.segmented.full { display: flex; width: 100%; margin: 4px 0 12px; } .segmented.full button { flex: 1; }
.wide-dialog { max-width: 560px; }
.dest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; }
.dest-grid label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--field); font-size: 14px; }
.dest-grid input[type=number] { width: 64px; margin-left: auto; height: 26px; border: 0; border-radius: 6px; background: var(--card); color: var(--text); padding: 0 6px; }
@media (max-width: 960px) { .results { grid-template-columns: repeat(2, 1fr); } .results .mini:nth-child(2n) { border-right: 0; } }
.recarga { font-size: 12px; color: var(--text-3); text-align: right; line-height: 1.3; white-space: nowrap; }
.recarga b { color: var(--text-2); font-weight: 600; }
.recarga .old { color: var(--orange); }
@media (max-width: 900px) { .recarga { display: none; } }
.minis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; color: var(--text-3); }
.small-n { width: 70px; margin: 0 4px; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--field); }
.tags { white-space: normal !important; max-width: 260px; text-align: left !important; font-size: 13px; }
.ct-dialog { max-width: 980px; max-height: 92vh; overflow-y: auto; }
.ct-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0; }
.kv div { background: var(--field); border-radius: 10px; padding: 10px 12px; }
.kv span { display: block; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.kv b { font-size: 14px; font-weight: 600; word-break: break-word; }
.sec { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.chips2 { display: flex; flex-wrap: wrap; gap: 5px; }
.chips2 span { font-size: 12px; background: var(--field); padding: 3px 8px; border-radius: 980px; }
.ev-add { color: var(--green); font-weight: 600; } .ev-rem { color: var(--red); font-weight: 600; }
.diff { color: var(--red); font-weight: 600; } .same { color: var(--green); font-weight: 600; }
.explain { background: color-mix(in srgb, var(--accent) 10%, var(--card)); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.who { white-space: normal !important; min-width: 190px; } .who b { font-weight: 600; } .ct-head h2 .mono { font-size: 12px; font-weight: 400; }
table.t caption.cap { caption-side: bottom; text-align: left; font-size: 12px; color: var(--text-3); padding-top: 10px; }
/* --- Ajustes de pantalla --- */
.statusbar { background: var(--bar); border-bottom: .5px solid var(--sep); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.statusbar-inner { max-width: 1240px; margin: 0 auto; padding: 5px 22px; font-size: 12px; color: var(--text-3); white-space: normal; text-align: left; }
.statusbar-inner b { color: var(--text-2); font-weight: 600; }
.statusbar-inner .old { color: var(--orange); }
.bar-inner { min-width: 0; }
.nav { flex: 1 1 auto; min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex-shrink: 0; }
.bar-inner > .spacer { flex: 0 0 auto; }
.user { flex-shrink: 0; max-width: 200px; }
.user .uname { text-align: left; line-height: 1.15; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1360px) { .user .role { display: none; } }
@media (max-width: 1100px) { .brand .txt { display: none; } .user .uname { display: none; } }
/* Filtros: nunca se salen; los grupos largos se desplazan en horizontal */
.filters { min-width: 0; }
.filters .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filters .segmented::-webkit-scrollbar { display: none; }
.filters .segmented button { flex-shrink: 0; }
@media (max-width: 760px) {
  .filters > * { max-width: 100%; }
  .filters .spacer { display: none; }
  .inline-input.wide { width: 100%; }
  .dd, .dd-btn { width: 100%; }
  .dd-panel { width: 100%; }
  .statusbar-inner { padding: 5px 16px; }
}
table.t td.who { text-align: left; }
#va-table th:nth-child(2), #va-table th:nth-child(3) { text-align: left; }
.mini .l { white-space: normal; overflow: visible; line-height: 1.25; min-height: 2.5em; }

/* Oportunidades y comparación etiquetas / mensajes (17/10/2026) */
.c-info { background: var(--purple); }
.minis.in-card { grid-template-columns: repeat(3, 1fr); background: var(--field); border-radius: 12px; }
.minis.in-card .mini:nth-child(3n) { border-right: 0; }
.minis.in-card .mini:nth-child(-n+3) { border-bottom: .5px solid var(--sep); }
.cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cmp table.t, #op-dest, #op-origen { min-width: 0; width: 100%; }
.cmp table.t td:first-child { width: 70%; }
.cmp table.t td:nth-child(3) { width: 1%; padding-left: 4px; }
.op-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.cmp h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.cmp .t td:first-child { white-space: normal; }
.cmp .hint { font-size: 12px; color: var(--text-3); line-height: 1.4; margin: 6px 0 0; }
@media (max-width: 1200px) { .cmp, .op-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .minis.in-card { grid-template-columns: repeat(2, 1fr); } .minis.in-card .mini { border-right: 0; } }
#op-dest th, #op-dest td:first-child { white-space: normal; }
#op-dest th, #op-dest td { padding-left: 6px; padding-right: 6px; }
#op-dest td .muted { display: block; font-size: 12px; }

/* Descripciones emergentes de los KPI */
.info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--seg-bg); color: var(--text-3);
  cursor: help; flex-shrink: 0; vertical-align: -3px; margin-left: 2px; outline: none; transition: background .15s, color .15s; }
.info::before { content: "i"; font: italic 700 11px/1 Georgia, "Times New Roman", serif; }
.info:hover, .info:focus-visible { background: var(--accent); color: #fff; }
.tip { position: fixed; z-index: 200; max-width: min(300px, calc(100vw - 16px)); background: rgba(29,29,31,.96); color: #fff; font-size: 13px;
  font-weight: 400; line-height: 1.45; padding: 10px 12px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none;
  opacity: 0; transform: translateY(-2px); transition: opacity .15s, transform .15s; letter-spacing: 0; text-transform: none; white-space: normal; }
.tip.show { opacity: 1; transform: none; }

/* 3 · Ventas Contactur */
.vt-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 12px; font-size: 13px; }
.vt-versions { display: flex; flex-direction: column; gap: 2px; color: var(--text-2); }
.vt-ver.on { color: var(--text); font-weight: 600; }
.vt-prev { background: var(--field); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: 13px; line-height: 1.5; }
.vt-prev p { margin: 0 0 6px; }
.vt-prev details { margin: 4px 0; } .vt-prev ul { margin: 6px 0; padding-left: 18px; max-height: 180px; overflow: auto; }
.warn { color: var(--orange); }
.minis.in-card.vt-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.minis.in-card.vt-kpis .mini { border-right: .5px solid var(--sep); border-bottom: 0; }
.minis.in-card.vt-kpis .mini:nth-child(4n) { border-right: 0; }
.minis.in-card.vt-kpis .mini:nth-child(-n+4) { border-bottom: .5px solid var(--sep); }
.vt-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--track); }
.vt-stack span { height: 100%; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.vt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-top: 8px; color: var(--text-2); }
.vt-legend.inline { display: inline-flex; margin: 0 0 0 10px; font-size: 12px; }
.vt-legend i, .vt-key { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.vt-c1 { background: var(--accent); } .vt-c2 { background: var(--text-3); } .vt-c3 { background: var(--track); } .vt-c4 { background: var(--orange); } .vt-c5 { background: var(--blue); }
.vt-f1 { fill: var(--accent); } .vt-f2 { fill: var(--text-3); } .vt-f5 { fill: var(--blue); fill-opacity: .7; }
.vt-bars { text-align: left !important; white-space: nowrap; }
.vt-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.vt-bar span { display: block; height: 100%; }
.vt-total td { font-weight: 600; border-top: 1px solid var(--sep); }
.vt-chart { height: 200px; }
@media (max-width: 960px) { .minis.in-card.vt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .minis.in-card.vt-kpis .mini { border-right: 0; } }

/* Clientes */
.tabs-row { margin: 4px 0 14px; }
.count { font-size: 13px; color: var(--text-3); }
#cl-table td { vertical-align: top; }
#cl-table td.cl-who { text-align: left; min-width: 170px; }
#cl-table .cl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#cl-table .pill.k-estado { white-space: nowrap; }
.cl-why { font-size: 12px; color: var(--text-3); }

/* Interfaz simplificada: lo secundario, plegado */
details.more-filters { margin: -4px 0 14px; }
details.more-filters > summary, details.more-block > summary { cursor: pointer; font-size: 13px; color: var(--link); list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
details.more-filters > summary::-webkit-details-marker, details.more-block > summary::-webkit-details-marker { display: none; }
details.more-filters > summary::before, details.more-block > summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
details[open].more-filters > summary::before, details[open].more-block > summary::before { transform: rotate(90deg); }
details.more-filters[open] > .filters, details.more-filters[open] > .vt-upload { margin-top: 8px; }
details.more-block { margin-top: 18px; }
details.more-block.flat { margin-top: 10px; }
details.more-block[open] > summary { margin-bottom: 6px; }
.kpi-sub:empty { display: none; }
/* 6 cifras principales en Meta Ads: 3 por fila */
.results { grid-template-columns: repeat(3, 1fr); }
.results .mini:nth-child(4n) { border-right: .5px solid var(--sep); }
.results > .mini:nth-child(3n) { border-right: 0; }
.results .wide-row .minis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 8px; background: var(--field); border-radius: 12px; }
.results .wide-row .mini { border-bottom: 0; }
@media (max-width: 960px) { .results { grid-template-columns: repeat(2, 1fr); } .results > .mini:nth-child(3n) { border-right: .5px solid var(--sep); } .results > .mini:nth-child(2n) { border-right: 0; } }
.f-note:empty { display: none; }

/* ---------- Acabado: sobrio. Una tinta, un acento, líneas finas y aire ---------- */
body { line-height: 1.45; }
h1.title { font-size: 26px; font-weight: 500; letter-spacing: -.01em; color: var(--navy); }
.subtitle { font-size: 14px; color: var(--text-3); margin-top: 4px; }
main { padding-top: 36px; }
/* Cabecera */
.bar { background: var(--bar); backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
.bar-inner { height: 64px; gap: 28px; }
.brand img { height: 32px; width: auto; display: block; }
.nav { gap: 4px; margin-left: 0; }
.nav a { color: rgba(255,255,255,.66); font-size: 13.5px; font-weight: 400; border-radius: 0; padding: 22px 10px 20px; border-bottom: 2px solid transparent; transition: color .15s; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; background: none; font-weight: 500; border-bottom-color: #fff; }
.user { color: #fff; } .user:hover { background: rgba(255,255,255,.08); }
.role { color: rgba(255,255,255,.55); letter-spacing: 0; text-transform: none; }
.avatar { background: rgba(255,255,255,.14); }
.statusbar { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
.statusbar-inner { padding-top: 12px; padding-bottom: 0; color: var(--text-3); }
.statusbar-inner b { font-weight: 500; }
.alerta-sync { background: var(--red); color: #fff; font-size: 14px; font-weight: 500; text-align: center; padding: 10px 16px; }
/* Tarjetas */
.card { border-radius: 10px; border: 1px solid var(--sep); box-shadow: none; padding: 24px; animation: none; }
.card h3 { font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: 0; margin-bottom: 18px; }
.grid { gap: 16px; } .mt { margin-top: 16px; } .row2 { margin-top: 16px; }
/* Cifras */
.kpi-icon { display: none; }
.kpi-label { font-size: 13px; font-weight: 400; color: var(--text-2); gap: 4px; }
.kpi-value { font-size: 34px; font-weight: 500; letter-spacing: -.02em; color: var(--navy); margin-top: 10px; line-height: 1.15; }
.kpi-sub { font-size: 12.5px; margin-top: 8px; }
.delta { font-weight: 500; border-radius: 4px; padding: 1px 6px; }
.mini .l { font-size: 12.5px; color: var(--text-2); }
.mini .v { font-size: 22px; font-weight: 500; letter-spacing: -.01em; color: var(--navy); }
.results .big .v { font-size: 22px; color: var(--navy); }
.minis.in-card, .results .wide-row .minis { background: none; border: 1px solid var(--sep); border-radius: 8px; }
/* Filtros y controles */
.filters { background: none; border: 0; box-shadow: none; padding: 0; margin: 22px 0 16px; border-radius: 0; gap: 10px; }
.f2 { margin-top: 10px; } .f-inner { margin-top: 0; }
.segmented { background: var(--seg-bg); border: 0; border-radius: 7px; padding: 3px; }
.segmented button, .cfg-tabs a { border: 0; border-radius: 5px; padding: 5px 11px; color: var(--text-2); font-size: 13px; font-weight: 400; background: none; }
.segmented button + button { border: 0; }
.segmented button.active, .cfg-tabs a.active { background: var(--seg-active); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--sep); }
.cfg-tabs { margin: 20px 0 22px; display: inline-flex; }
.cfg-tabs a { text-decoration: none; white-space: nowrap; }
.select, .date, .inline-input, .chk { height: 33px; border: 1px solid var(--sep); border-radius: 7px; background: var(--card); font-size: 13px; color: var(--text); }
.select:focus, .date:focus, .inline-input:focus { border-color: var(--accent-2); outline: 0; }
.btn { background: var(--accent); color: #fff; border-radius: 7px; height: 33px; padding: 0 14px; font-size: 13px; font-weight: 500; box-shadow: none; transition: opacity .15s; }
.btn:hover { opacity: .9; }
.btn.plain { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--sep); }
.btn.plain:hover { opacity: 1; background: var(--field); }
.btn.small { height: 29px; font-size: 12.5px; padding: 0 11px; }
.btn.danger { background: none; color: var(--red); box-shadow: inset 0 0 0 1px var(--sep); }
details.more-filters { margin: 0 0 16px; }
details.more-filters > summary, details.more-block > summary { color: var(--text-2); font-weight: 400; }
details.more-filters > summary::before, details.more-block > summary::before { color: var(--text-3); }
details.more-filters[open] > .filters { margin: 10px 0 0; }
/* Tablas */
table.t { font-size: 13.5px; }
table.t th { font-size: 12px; font-weight: 400; color: var(--text-3); background: none; padding: 0 12px 12px; border-bottom: 1px solid var(--sep); }
table.t td { padding: 14px 12px; border-bottom: 1px solid var(--sep); vertical-align: top; }
table.t th:first-child, table.t td:first-child { padding-left: 0; }
table.t th:last-child, table.t td:last-child { padding-right: 0; }
table.t tbody tr:hover > td { background: none; }
table.t tr.click:hover td { background: var(--field); }
table.t td b, .who b { font-weight: 500; }
th.ordenable { cursor: pointer; user-select: none; transition: color .12s; }
th.ordenable:hover, th.ordenable:focus-visible { color: var(--text); outline: 0; }
th.ordenable[aria-sort] { color: var(--text); font-weight: 500; }
th.ordenable[aria-sort=ascending]::after { content: " ↑"; }
th.ordenable[aria-sort=descending]::after { content: " ↓"; }
#user-table th, #user-table td, #act-table th, #act-table td, #run-table th, #run-table td, #err-table th, #err-table td, #lab-table th, #lab-table td { text-align: left; }
#cl-table th, #cl-table td, #va-table th, #va-table td, #ct-body table.t th, #ct-body table.t td, #vt-exp table.t th, #vt-exp table.t td { text-align: left; }
#cl-table td.num, #cl-table th:nth-child(5) { text-align: right; }
#cl-table td:last-child { width: 1%; }
#cl-table td:nth-child(3) { white-space: normal; min-width: 150px; }
#cl-table td.cl-who { cursor: pointer; }
.linkbtn { color: var(--accent); }
#cl-table .cl-hist { font-weight: 500; padding: 0; }
.tree .lvl1, .tree .lvl2 { background: none; }
/* Etiquetas de estado */
.pill, .st, .demo, .chips2 span { border-radius: 4px; font-weight: 500; font-size: 11.5px; padding: 2px 7px; }
.pill.p-alta { background: color-mix(in srgb, var(--cta) 13%, transparent); color: var(--cta); }
.pill.p-media { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.pill.p-normal { background: var(--seg-bg); color: var(--text-2); }
.pill.p-pronto { background: color-mix(in srgb, var(--red) 11%, transparent); color: var(--red); }
#cl-table td:first-child .pill { white-space: normal; display: inline-block; max-width: 120px; line-height: 1.3; }
.cl-why { color: var(--text-3); margin-top: 2px; }
/* Prioridades de Seguimiento */
.prio-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 4px 0 8px; }
.prio-card { text-align: left; border: 1px solid var(--sep); background: var(--card); border-radius: 10px; padding: 14px 16px; cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 3px; transition: border-color .15s; }
.prio-card:hover { border-color: var(--text-3); }
.prio-card.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pc-l { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.pc-l::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sep); }
.p-alta .pc-l::before { background: var(--cta); } .p-media .pc-l::before { background: var(--accent); }
.p-normal .pc-l::before { background: var(--text-3); } .p-pronto .pc-l::before { background: var(--red); }
.pc-v { font-size: 24px; font-weight: 500; letter-spacing: -.01em; color: var(--navy); line-height: 1.25; }
.pc-s { font-size: 11.5px; color: var(--text-3); }
.prio-foot { font-size: 12.5px; color: var(--text-3); margin: 0 0 14px; }
@media (max-width: 1100px) { .prio-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .prio-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pc-v { font-size: 20px; } }
.tabs-row { margin: 20px 0 0; }
/* Avisos, fichas y ventanas */
.banner { background: var(--card); border: 1px solid var(--sep); border-radius: 8px; color: var(--text-2); font-size: 13.5px; }
.explain, .vt-prev, .kv div { background: var(--field); border-radius: 8px; }
.kv span { text-transform: none; letter-spacing: 0; font-size: 12px; }
.kv b { font-weight: 500; }
.sec { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 500; color: var(--text); margin: 24px 0 10px; }
.dd-panel { border: 1px solid var(--sep); border-radius: 8px; box-shadow: 0 8px 24px rgba(11,31,69,.09); }
.info { background: none; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--sep); width: 15px; height: 15px; }
.info:hover, .info:focus-visible { background: var(--field); color: var(--text); }
.tip { background: var(--navy); border-radius: 7px; box-shadow: 0 8px 24px rgba(11,31,69,.18); }
@media (prefers-color-scheme: dark) { .tip { background: #2a3448; } .toast { background: #2a3448 !important; } }
.backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(11,31,69,.32); }
.dialog { border-radius: 12px; box-shadow: 0 16px 48px rgba(11,31,69,.18); padding: 28px; }
.dialog h2 { font-size: 18px; font-weight: 500; letter-spacing: 0; }
.fields { border-radius: 7px; }
.toast { background: var(--navy); border-radius: 7px; font-weight: 400; }
/* Inicio de sesión */
.login-body { background: var(--bar); }
.orb { display: none; }
.login-card { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 12px; box-shadow: none; animation: none; }
.login-logo { display: block; width: 190px; max-width: 80%; height: auto; margin: 0 auto 12px; }
.login-card .sub { margin-bottom: 26px; font-size: 14px; color: var(--text-3); }
.fields input { font-size: 15px; }
.primary { border-radius: 7px; background: var(--accent); font-size: 14px; font-weight: 500; height: 46px; }
@media (prefers-color-scheme: dark) { .login-logo.color { display: none; } .btn { color: #0c111c; } .btn.plain, .btn.danger { color: var(--text); } .btn.danger { color: var(--red); } .primary { color: #0c111c; } }
@media (prefers-color-scheme: light) { .login-logo.blanco { display: none; } }
@media (max-width: 760px) { .brand img { height: 28px; } .bar-inner { gap: 14px; } .nav a { padding: 22px 8px 20px; } }
@media (max-width: 640px) { .card { padding: 16px; } main { padding-top: 24px; } }
.table-wrap { margin: 0; padding: 0; }
