/* MDS CONTROL — estilos. Base visual de la maqueta aprobada (menú oscuro, interfaz clara). */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --ink: #18323a; --muted: #6e8186; --deep: #123b43; --teal: #137f78; --mint: #e5f4ef;
  --line: #e2e9e8; --line-soft: #edf0ef; --bg: #f5f7f6; --white: #fff;
  --amber: #b5741a; --amber-bg: #fff3dc; --red: #ae554a; --red-bg: #fff0ed; --blue: #456ca0; --blue-bg: #eaf1fa;
  --green: #2f7d5b; --green-bg: #e3f4e9; --violet: #7a62a0; --violet-bg: #f4effa;
  --shadow: 0 12px 40px rgba(17, 53, 59, .07); --radius: 12px;
}
* { box-sizing: border-box }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: 'DM Sans', Arial, sans-serif; font-size: 14px; line-height: 1.4 }
body.no-scroll { overflow: hidden }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
button:disabled { opacity: .5; cursor: not-allowed }
:focus-visible { outline: 3px solid #82c5b4; outline-offset: 2px }
[hidden] { display: none !important }

/* ---------- Estructura ---------- */
.app-shell { display: flex; min-height: 100vh }
.sidebar { width: 244px; flex: 0 0 244px; background: var(--deep); color: #e6f1ef; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; overflow-y: auto }
.brand { display: flex; align-items: center; gap: 11px; padding: 30px 23px 38px; font-family: Manrope, sans-serif }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #dbeddf; color: var(--deep); font-weight: 800; font-size: 22px }
.brand strong { display: block; font-size: 13px; letter-spacing: .02em }
.brand small { display: block; font-size: 11px; color: #a8c4c5; margin-top: 2px }
.side-caption { font-size: 10px; font-weight: 700; letter-spacing: .15em; color: #83a8a9; padding: 0 24px 12px }
.side-caption.later { padding-top: 22px }
.side-nav { padding: 0 10px }
.nav-link { display: flex; align-items: center; gap: 13px; border: 0; background: transparent; color: #bbd3d2; text-align: left; width: 100%; padding: 12px 14px; border-radius: 9px; margin-bottom: 4px; font-weight: 600 }
.nav-link:hover, .nav-link.active { color: #fff; background: #25525a }
.nav-link.active:before { content: ''; width: 3px; height: 17px; background: #b8dfc8; border-radius: 3px; margin-left: -14px; margin-right: 11px }
.nav-link.disabled { color: #7fa0a2; cursor: default }
.nav-link.disabled:hover { background: transparent; color: #7fa0a2 }
.nav-icon { font-size: 17px; width: 18px; text-align: center; font-weight: 400 }
.nav-count { margin-left: auto; font-size: 11px; color: #b8d3d1 }
.nav-count.alert { background: #e9a24a; color: #2b1d05; border-radius: 10px; padding: 1px 7px; font-weight: 800 }
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50% }
.nav-dot.error { background: #e0776a }
.soon-tag { margin-left: auto; font-size: 9px; letter-spacing: .06em; border: 1px solid #42646a; border-radius: 10px; padding: 2px 7px }
.side-bottom { margin-top: auto; padding: 16px }
.demo-side { border: 1px solid #42646a; border-radius: 10px; padding: 13px; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: #c7dbd9; line-height: 1.7 }
.demo-side strong { display: block; font-size: 12px; letter-spacing: 0; color: #fff }
.demo-side small { display: block; font-size: 10px; letter-spacing: 0; font-weight: 500; color: #9dbcbb; line-height: 1.4; margin-top: 4px }
.demo-dot { display: inline-block; background: #b7dabc; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px }
.reset-link { border: 0; background: none; color: #bad1d0; font-size: 12px; margin: 14px 2px 0; padding: 5px }
.reset-link:hover { text-decoration: underline }
.sidebar-scrim { display: none }
.main-wrap { flex: 1; min-width: 0 }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 38px; position: sticky; top: 0; z-index: 20 }
.top-left, .top-right { display: flex; align-items: center; gap: 14px }
.breadcrumb { color: #7d8f91; font-size: 12px }
.breadcrumb span { padding: 0 9px; color: #b9c7c8 }
.breadcrumb strong { color: #30535a }
.top-demo { font-size: 11px; color: #597b71; background: #eaf5ee; padding: 7px 11px; border-radius: 20px; font-weight: 700 }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; background: #dcece9; border: 1px solid #c4ded8; color: #23595b; border-radius: 50%; font-weight: 800 }
.menu-button { display: none !important }
main { max-width: 1510px; margin: auto; padding: 32px 40px 70px }

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .15em }
.page-head h1 { font: 800 28px/1.25 Manrope, sans-serif; letter-spacing: -.035em; margin: 0 }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px }
.head-controls { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap }
.period-control, .updated, .health { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px }
.period-control { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap }
.period-control select { display: block; border: 0; background: none; font-size: 12px; font-weight: 700; outline: 0; padding: 0; margin-top: 2px }
.updated { display: flex; align-items: center; gap: 9px }
.updated small, .health small { display: block; font-size: 9px; letter-spacing: .09em; font-weight: 700; color: #8ba0a0 }
.updated strong { font-size: 12px; display: block; margin-top: 2px }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3da584; box-shadow: 0 0 0 4px #e8f5ed }
.health { text-align: left }
.health:hover { border-color: #b9d3cc }
.health-list { display: flex; gap: 10px; margin-top: 3px; flex-wrap: wrap }
.hl { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700 }
.hl i { width: 8px; height: 8px; border-radius: 50%; background: #3da584 }
.hl.delay i { background: var(--amber) } .hl.error i { background: var(--red) } .hl.off i, .hl.planned i { background: #b4bdbd }
.notice { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: #edf6f3; border: 1px solid #d3e9e1; border-radius: 9px; color: #47746e; font-size: 12px; margin-bottom: 24px }
.notice button { margin-left: auto; border: 0; background: none; color: #63837e; font-size: 21px; line-height: 1 }
.view { display: none } .view.active { display: block }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; flex-wrap: wrap }
.section-heading h2, .panel-head h2, .data-guide h2 { font: 800 15px/1.3 Manrope, sans-serif; letter-spacing: -.015em; margin: 0 }
.section-heading h2:first-letter { text-transform: uppercase }
.section-heading p, .panel-head p { color: var(--muted); font-size: 12px; margin: 5px 0 0 }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap }

/* ---------- Botones ---------- */
.primary-button, .outline-button { border-radius: 8px; padding: 10px 14px; font-size: 12px; font-weight: 800; white-space: nowrap }
.primary-button { background: var(--deep); border: 1px solid var(--deep); color: #fff }
.primary-button:hover { background: #1e5660 }
.outline-button { background: #fff; border: 1px solid #cbded8; color: #2c6d68 }
.outline-button:hover { background: #f0f8f4 }
.compact { padding: 7px 11px; font-size: 11px }
.full { width: 100%; margin-top: 12px }
.text-button { border: 0; background: none; color: var(--teal); font-size: 11px; font-weight: 800; white-space: nowrap; padding: 2px }
.text-button:hover { text-decoration: underline }
.text-button span { font-size: 15px; margin-left: 3px }
.mini-button { border: 1px solid #d5e3df; background: #fff; color: #2f6c66; border-radius: 7px; padding: 6px 9px; font-size: 11px; font-weight: 700; white-space: nowrap }
.mini-button:hover { background: #f0f8f4 }
.mini-button.strong { background: var(--green-bg); border-color: #bfe0cc; color: var(--green) }
.subtle-button { border: 0; background: none; color: #43897e; font-size: 11px; font-weight: 700 }
.icon-button { border: 0; background: transparent; color: #6e8585; font-size: 24px; line-height: 1; padding: 3px 6px }
.icon-button.small { font-size: 18px }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 12px; font-size: 12px; font-weight: 700; color: #4b6a6c; white-space: nowrap }
.chip span { color: #8fa3a3; font-weight: 700; margin-left: 3px }
.chip:hover { border-color: #b9d3cc }
.chip.active { background: var(--deep); border-color: var(--deep); color: #fff }
.chip.active span { color: #b8d3d1 }
.chip.metric-chip { background: var(--amber-bg); border-color: #efd7bb; color: #8a5a15 }
.scope-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px }
.scope-chips.small .chip { padding: 5px 10px; font-size: 11px }

/* ---------- Paneles y métricas ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 14px rgba(22, 52, 57, .025); min-width: 0 }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 20px 12px }
.panel-foot { font-size: 11px; color: var(--muted); margin: 10px 2px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.panel .panel-foot { padding: 0 20px 18px }
.metric-section { margin-bottom: 16px }
.metric-caption { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap }
.metric-caption strong { font: 800 13px Manrope, sans-serif; color: var(--ink) }
.metric-caption .text-button { margin-left: auto }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px }
.metric { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 14px 15px 13px; text-align: left; min-height: 104px; transition: transform .15s, box-shadow .15s }
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow) }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; color: #647a7d; font-size: 11px; font-weight: 700; min-height: 28px }
.metric-icon { width: 24px; height: 24px; display: grid; place-items: center; background: #eff6f3; border-radius: 7px; color: #29847c; font-size: 13px; flex: 0 0 auto; font-weight: 800 }
.metric-value { display: block; font: 800 26px/1.2 Manrope, sans-serif; margin: 6px 0 2px; letter-spacing: -.04em }
.metric-sub { display: block; color: #849699; font-size: 10.5px }
.metric.urgent { border-color: #efd7bb; background: #fffdf9 }
.metric.urgent .metric-icon { color: var(--amber); background: #fff1dd }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 16px; margin-bottom: 16px }
.source-bars { padding: 4px 20px 0 }
.source-line { margin: 4px 0 16px }
.source-line-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 7px }
.bar-track { height: 7px; background: #edf1ef; border-radius: 20px; overflow: hidden }
.bar-fill { height: 100%; border-radius: 20px; background: #56a795 }
.bar-fill.google { background: #7c9ac2 } .bar-fill.other { background: #b8a484 } .bar-fill.unknown { background: #b4bdbd }
.source-note { font-size: 11px; color: #7b8e90; padding: 0 20px 18px; line-height: 1.5 }
.connector-mini { padding: 0 12px 12px }
.cm-row { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; text-align: left; padding: 10px 8px; border-top: 1px solid var(--line-soft) }
.cm-row:hover { background: #fafcfb }
.cm-main { flex: 1; min-width: 0 }
.cm-main strong { display: block; font-size: 12px }
.cm-main small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.cm-state { font-size: 11px; font-weight: 800; color: var(--green) }
.cm-state.delay { color: var(--amber) } .cm-state.error { color: var(--red) } .cm-state.off { color: #8a9899 }
.empty-state { padding: 30px; text-align: center; color: var(--muted); font-size: 12px }
.empty-state.small { padding: 14px 20px 20px; text-align: left }

/* ---------- Tareas ---------- */
.task-list { padding: 0 20px 12px }
.task-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line-soft); min-width: 0 }
.task-row.done .row-title { text-decoration: line-through; color: #8a9b9c }
.task-row-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0 }
.task-row-main:hover .row-title { text-decoration: underline }
.row-title { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.row-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.task-type { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #eef5f2; color: #2e7d73; flex: 0 0 auto; font-size: 13px }
.task-type.visita { background: var(--violet-bg); color: var(--violet) } .task-type.presupuesto { background: var(--amber-bg); color: var(--amber) }
.task-type.llamada { background: var(--blue-bg); color: var(--blue) }
.due { font-size: 11px; font-weight: 700; white-space: nowrap; color: #798d90 }
.due.late { color: #c0592e } .due.today { color: var(--teal) }
.check { position: relative; flex: 0 0 auto; width: 20px; height: 20px; cursor: pointer }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer }
.check span { display: block; width: 20px; height: 20px; border: 2px solid #b9cfca; border-radius: 6px; background: #fff }
.check input:checked + span { background: var(--teal); border-color: var(--teal) }
.check input:checked + span:after { content: '✓'; color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; height: 100%; line-height: 1 }
.check input:focus-visible + span { outline: 3px solid #82c5b4; outline-offset: 2px }
.attention-icon { width: 28px; height: 28px; display: grid; place-items: center; background: var(--amber-bg); color: var(--amber); border-radius: 8px; flex: 0 0 auto; font-weight: 800 }
.attention-icon.teal { background: #e9f5f1; color: var(--teal) }
.agenda-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px }
.strip-item { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px }
.strip-item strong { display: block; font: 800 22px Manrope, sans-serif }
.strip-item span { font-size: 11px; color: var(--muted); font-weight: 700 }
.strip-item.late { border-color: #f0cdbd; background: #fffaf7 } .strip-item.late strong { color: #c0592e }
.strip-item.today strong { color: var(--teal) }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start }
.agenda-main, .agenda-side { display: grid; gap: 14px }
.agenda-group.late { border-color: #f0cdbd }
.agenda-group.late h2 { color: #b1502a }
.side-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left }
.task-line { display: flex; align-items: center; gap: 8px }
.task-line .task-row { flex: 1 }

/* ---------- Tabla comercial ---------- */
.table-panel { overflow: hidden }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 16px 18px 12px; flex-wrap: wrap }
.toolbar select, .date-range input { border: 1px solid #dce6e3; background: #fff; border-radius: 8px; padding: 9px 10px; font-size: 12px; outline: none }
.search-wrap { display: flex; align-items: center; gap: 6px; border: 1px solid #dce6e3; border-radius: 8px; padding: 0 10px; min-width: 260px; flex: 1 }
.search-wrap span { font-size: 18px; color: #8ba09b }
.search-wrap input { border: 0; outline: 0; width: 100%; min-width: 0; padding: 9px 0; font-size: 12px; background: none }
.search-wrap:focus-within, .toolbar select:focus { border-color: #65ad9d; box-shadow: 0 0 0 3px #e2f2eb }
.date-range { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted) }
.table-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 19px 10px; color: #8a999a; font-size: 11px }
.table-wrap { overflow-x: auto }
.opp-table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; min-width: 960px }
.opp-table th { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8a9d9e; font-weight: 800; background: #fafbfa; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 11px 10px; white-space: nowrap }
.opp-table th:nth-child(1) { width: 7% } .opp-table th:nth-child(2) { width: 15% } .opp-table th:nth-child(3) { width: 11% } .opp-table th:nth-child(4) { width: 14% }
.opp-table th:nth-child(5) { width: 13% } .opp-table th:nth-child(6) { width: 11% } .opp-table th:nth-child(7) { width: 14% } .opp-table th:nth-child(8) { width: 15% }
.opp-table td { border-bottom: 1px solid var(--line-soft); padding: 11px 10px; font-size: 12px; vertical-align: middle; overflow-wrap: anywhere }
.opp-table tbody tr { cursor: pointer }
.opp-table tbody tr:hover { background: #f8fbfa }
.opp-table tr:last-child td { border-bottom: 0 }
.cell-date { font-weight: 700; font-size: 11.5px }
.cell-sub { display: block; font-size: 10.5px; color: #89999a; margin-top: 3px }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 0 }
.person-initials { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e5efeb; color: #36685e; font-weight: 800; font-size: 10px; flex: 0 0 auto }
.person-link { border: 0; background: none; text-align: left; padding: 0; font-weight: 800; font-size: 12px }
.person-link:hover { text-decoration: underline; color: var(--teal) }
.origin-badge, .status-badge, .data-label { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 4px 8px; font-size: 10.5px; line-height: 1.15; font-weight: 700 }
.origin-badge .lock { font-size: 9px }
.origin-badge { white-space: nowrap }
.side-stack { display: grid; gap: 16px; align-content: start }
.preview-panel.full { margin-bottom: 16px; overflow: hidden }
.origin-badge.meta { background: #edf0fb; color: #5369a3 } .origin-badge.google { background: #eaf3fa; color: #4c75a1 }
.origin-badge.other { background: #f4f1e9; color: #86724a } .origin-badge.unknown { background: #f1f3f2; color: #6f8082 }
.status-badge { background: #eef4f1; color: #467465 }
.status-badge.historic { background: #f0f2f2; color: #6f8082; box-shadow: inset 0 0 0 1px #dfe5e4 }
.historic-panel { background: #f7f9f9 }
.status-badge.historic.review { background: #fff4e5; color: #a8732c; box-shadow: inset 0 0 0 1px #f0d9b5 }
.review-panel { border-left: 4px solid #d9a441 }
.review-panel .review-why { color: var(--muted, #5b6f72); font-size: 13px; margin: 4px 0 10px }
.class-help { font-size: 12px; color: #5b6f72; margin-top: 6px }
.status-badge.new { background: #e7f1fb; color: #3e6aa0 } .status-badge.waiting { background: #edf2fa; color: #5673a1 }
.status-badge.visit { background: var(--violet-bg); color: var(--violet) } .status-badge.budget { background: #fff4e5; color: #a8732c }
.status-badge.accepted { background: #e6f5ee; color: #2e7f67; box-shadow: inset 0 0 0 1px #bfe3cf }
.status-badge.won { background: #2f7d5b; color: #fff } .status-badge.lost { background: #f9eeee; color: #a8625e }
.status-edit { position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; cursor: pointer; border-radius: 20px }
.status-edit .status-caret { font-size: 11px; color: #7a9090 }
.status-edit select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0 }
.status-edit:hover .status-badge { filter: brightness(.96) }
.status-edit:focus-within { outline: 3px solid #82c5b4; outline-offset: 2px }
.response-icons { display: flex; gap: 4px; flex-wrap: wrap }
.response-icons span { font-size: 10px; padding: 3px 6px; border-radius: 5px; background: #e6f3ec; color: #3d7258; white-space: nowrap; font-weight: 700 }
.response-icons .no { background: #fff1e4; color: #aa7640 } .response-icons .unknown { background: #f1f3f2; color: #8b9898; font-weight: 500 }
.action-link { border: 0; background: none; color: #22766f; font-weight: 700; text-align: left; font-size: 12px; padding: 0 }
.action-link:hover { text-decoration: underline }
.action-link + .due { display: block; margin-top: 2px; font-size: 10.5px }
.waiting-note { font-size: 11.5px; color: var(--blue); font-weight: 700 }
.missing-note { font-size: 11.5px; color: #b36a2a; font-weight: 700 }
.plain-table { width: 100%; border-collapse: collapse; font-size: 12px }
.plain-table th { text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8a9d9e; padding: 9px 12px; background: #fafbfa; border-bottom: 1px solid var(--line-soft); white-space: nowrap }
.plain-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top }
.err-text { color: var(--red); font-weight: 700 } .ok-text { color: var(--green); font-weight: 800 }

/* ---------- Fuentes ---------- */
.connector-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px }
.connector-card { padding: 17px; border: 1px solid var(--line); background: #fff; border-radius: 11px; display: flex; flex-direction: column }
.connector-card.error { border-color: #efc9c1 }
.connector-top { display: flex; align-items: center; justify-content: space-between; gap: 5px }
.connector-symbol { width: 34px; height: 34px; border-radius: 9px; background: #eaf2ef; color: #318275; display: grid; place-items: center; font-size: 14px; font-weight: 800 }
.connector-symbol.small { width: 30px; height: 30px; font-size: 12px; flex: 0 0 auto }
.connector-card h3 { font: 800 13px Manrope, sans-serif; margin: 14px 0 6px }
.connector-card p { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 8px 0 0 }
.state-pill { font-size: 10px; font-weight: 800; border-radius: 20px; padding: 4px 9px; background: var(--green-bg); color: var(--green) }
.state-pill.delay { background: var(--amber-bg); color: var(--amber) } .state-pill.error { background: var(--red-bg); color: var(--red) }
.state-pill.off, .state-pill.planned { background: #f0f2f2; color: #6f8082 }
.caps { display: flex; gap: 4px; flex-wrap: wrap } .caps span { font-size: 10px; background: #f2f6f5; color: #5d7577; border-radius: 5px; padding: 2px 6px }
.conn-facts { margin: 12px 0 0; display: grid; gap: 7px }
.conn-facts div { font-size: 11.5px } .conn-facts dt { color: #8a9b9d; font-size: 10.5px; font-weight: 700 } .conn-facts dd { margin: 1px 0 0 }
.conn-note { display: block; margin-top: 12px; font-size: 11px; color: var(--muted) }
.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; background: #f7faf9; border-radius: 8px; padding: 9px }
.mini-metrics strong { display: block; font: 800 14px Manrope, sans-serif } .mini-metrics span { font-size: 10px; color: var(--muted) }
.mini-metrics small { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted) }
.lab { margin-bottom: 16px; border-style: dashed; border-color: #c9ddd7 }
.lab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 20px 20px }
.lab-button { border: 1px solid var(--line); background: #fbfdfc; border-radius: 10px; padding: 12px 14px; text-align: left }
.lab-button:hover { border-color: #9ccabd; background: #f2f9f6 }
.lab-button strong { display: block; font-size: 12.5px } .lab-button span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px }
.panel + .panel, .lab + .panel { margin-bottom: 16px }
#view-fuentes > .panel { margin-bottom: 16px }
.future-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 0 20px 6px }
.future-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px }
.future-card > div { flex: 1; min-width: 0 } .future-card strong { display: block; font-size: 12px; margin-bottom: 4px }
.data-guide { padding: 20px }
.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; margin-top: 15px }
.guide-grid p { font-size: 11.5px; line-height: 1.5; color: var(--muted); margin: 8px 0 0 }
.data-label.known { background: #e6f3eb; color: #45815c } .data-label.unavailable { background: #f0f2f2; color: #708184 }
.data-label.unanswered { background: #fff2df; color: #a2702c } .data-label.unsynced { background: #eaf0fb; color: #5b78a5 }

/* ---------- Ficha lateral ---------- */
.drawer-scrim, .modal-scrim { position: fixed; inset: 0; background: rgba(8, 34, 39, .45); z-index: 39 }
.detail-drawer { position: fixed; z-index: 40; right: 0; top: 0; bottom: 0; width: min(820px, 100vw); background: #f7f9f8; box-shadow: -20px 0 45px #0c303833; overflow-y: auto }
.drawer-header { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 24px 0; position: sticky; top: 0; z-index: 2 }
.drawer-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px }
.drawer-person { display: flex; align-items: center; gap: 12px; min-width: 0 }
.drawer-person .person-initials { width: 44px; height: 44px; font-size: 13px }
.drawer-header h2 { margin: 0; font: 800 20px Manrope, sans-serif; letter-spacing: -.02em }
.drawer-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px }
.drawer-head-actions { display: flex; align-items: center; gap: 6px }
.opp-switch { display: flex; gap: 7px; overflow-x: auto; margin: 14px 0 4px; padding-bottom: 2px }
.opp-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 10px; white-space: nowrap; font-size: 12px }
.opp-pill.active { border-color: #7fbaa9; background: #f3faf7; box-shadow: inset 0 0 0 1px #7fbaa9 }
.drawer-tabs { display: flex; gap: 2px; overflow-x: auto; margin-top: 8px }
.drawer-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 11px; color: #6f8587; font-size: 12px; font-weight: 800; white-space: nowrap }
.drawer-tab.active { color: var(--teal); border-color: var(--teal) }
.drawer-body { padding: 18px 24px 40px }
.drawer-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; display: block }
.drawer-panel h3, details.drawer-panel summary h3 { font: 800 13px Manrope, sans-serif; margin: 0 0 12px; display: inline-block }
details.drawer-panel summary { cursor: pointer }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px }
.panel-title-row h3 { margin: 0 !important }
.panel-help { font-size: 11.5px; color: var(--muted); margin: -4px 0 12px; line-height: 1.5 }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px }
.fact.wide { grid-column: 1 / -1 }
.fact-label { display: block; font-size: 10.5px; color: #86989a; font-weight: 700; margin-bottom: 4px }
.fact-value { font-size: 12.5px; font-weight: 600; line-height: 1.5 }
.multiline { white-space: pre-wrap; font-weight: 500 }
.empty-value { color: #a0adae; font-weight: 500 }
.contact-line { display: block } .contact-line small { color: var(--muted); font-weight: 500 }
.original-hint { margin-top: 4px; font-size: 10.5px; color: #8a6d3b; background: #fdf7ea; border-radius: 5px; padding: 3px 7px; display: inline-block }
.status-panel { border-color: #cfe3dc }
.status-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap }
.status-row > .form-field { flex: 1; min-width: 240px }
.big-select { font-weight: 800; font-size: 13px; padding: 10px 11px; border-radius: 8px; border: 1px solid #cddfd9; background: #fff; width: 100% }
.big-select.won { background: var(--green-bg) } .big-select.lost { background: #fbf2f1 } .big-select.accepted { background: #eef8f3 } .big-select.waiting { background: #f1f5fb }
.status-help { display: block; font-size: 11px; color: var(--muted); margin-top: 5px }
.responded { display: grid; gap: 6px }
.toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; cursor: pointer }
.toggle input { width: 16px; height: 16px; accent-color: var(--teal) }
.next-box { margin-top: 14px; padding: 10px 12px; background: #f6faf8; border-radius: 8px; font-size: 12.5px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap }
.next-box .fact-label { margin: 0 }
.quick-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px }
.origin-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 10px }
.origin-hero .origin-badge { font-size: 12px; padding: 6px 11px }
.origin-hero p { margin: 0; font-size: 12px }
.override-box { background: #fff7e8; border: 1px solid #f0d9ae; border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5 }
.evidence-item { background: #f7faf8; border: 1px solid #e6eeea; border-radius: 8px; padding: 10px 12px; font-size: 12px; margin-bottom: 8px }
.ev-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 3px }
.ev-head span { font-size: 11px; color: var(--muted) }
.kv { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px }
.kv span { background: #fff; border: 1px solid #e3ece8; border-radius: 5px; padding: 2px 7px; font-size: 11px }
.kv em { font-style: normal; color: var(--muted); margin-right: 3px }
.auto-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #6d8a86; background: #eaf3f0; border-radius: 4px; padding: 1px 5px }
.same-tag { font-size: 10px; color: #6f8082; background: #f0f2f2; border-radius: 10px; padding: 2px 7px; font-weight: 700 }
.edited-tag { font-size: 10px; color: #8a5a15; background: var(--amber-bg); border-radius: 10px; padding: 2px 7px; font-weight: 800 }
.compare td:nth-child(2) { color: #7a6a4a }
.chat { display: flex; flex-direction: column; gap: 9px; max-height: 460px; overflow-y: auto; padding: 4px 2px }
.bubble { max-width: 82%; border-radius: 12px; padding: 8px 11px; background: #f1f5f4; align-self: flex-start }
.bubble.out { align-self: flex-end; background: #e2f3ea }
.bubble-meta { font-size: 10.5px; color: var(--muted); margin-bottom: 3px }
.bubble-text { font-size: 12.5px; white-space: pre-wrap }
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 8px; border-left: 1px solid #d9e8e2 }
.timeline li { position: relative; padding: 0 0 15px 17px }
.timeline li:before { content: ''; position: absolute; left: -13px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #81bba7; border: 3px solid #fff }
.timeline li.tl-estados:before { background: var(--violet) } .timeline li.tl-cambios:before { background: var(--amber) } .timeline li.tl-notas:before { background: #9aa7a8 }
.timeline time { display: block; color: #8d9d9d; font-size: 10.5px; margin-bottom: 3px }
.timeline strong { display: block; font-size: 12px }
.timeline p { margin: 3px 0 0; font-size: 12px; color: #52686b; line-height: 1.45; overflow-wrap: anywhere }
.note-item { border-top: 1px solid #e9efed; padding: 11px 0; font-size: 12.5px; line-height: 1.5 }
.note-item:first-of-type { border-top: 0 }
.note-text { white-space: pre-wrap }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px }
.note-meta small { color: #899a9a }
.versions { margin-top: 6px; font-size: 11.5px; color: var(--muted) }
.versions summary { cursor: pointer; font-weight: 700 }
.versions p { margin: 5px 0 0; padding-left: 10px; border-left: 2px solid #e3ece8 }
.src-tag { font-size: 10px; color: #6d8a86; background: #eaf3f0; border-radius: 4px; padding: 2px 6px; white-space: nowrap }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px }
.form-grid.four { grid-template-columns: 1fr 2fr 1fr .8fr }
.form-grid.four .wide { grid-column: span 1 }
.form-field { display: grid; gap: 5px; min-width: 0; align-content: start }
.form-field.wide, .form-grid > .wide { grid-column: 1 / -1 }
.form-field.inline { display: flex; align-items: center; gap: 10px; margin-top: 10px }
.form-field > label, .form-block-head strong { font-size: 11px; font-weight: 800; color: #5d787b }
.form-field input, .form-field select, .form-field textarea, .contact-row input, .contact-row select, .note-item textarea {
  border: 1px solid #d8e4e0; background: #fff; border-radius: 8px; padding: 9px 10px; font-size: 12.5px; outline: none; width: 100%; min-width: 0 }
.form-field textarea, .note-item textarea { resize: vertical }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .contact-row input:focus, .note-item textarea:focus { border-color: #65ad9d; box-shadow: 0 0 0 3px #e2f2eb }
.input-wrap { display: flex; gap: 6px; align-items: stretch }
.input-wrap > input, .input-wrap > textarea, .input-wrap > select:first-child { flex: 1 }
.kind-select { flex: 0 0 auto; width: auto !important; max-width: 46%; font-size: 11px !important; color: #7a6a4a; background: #fdfaf3 !important }
.input-wrap input:not(:placeholder-shown) ~ .kind-select, .input-wrap textarea:not(:placeholder-shown) ~ .kind-select { display: none }
.form-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft) }
.form-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px }
.contact-rows { display: grid; gap: 7px }
.contact-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) auto auto auto; gap: 7px; align-items: center }
.primary-radio { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap }
.form-help { font-size: 11px; color: var(--muted); margin: 10px 0 0; line-height: 1.5 }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px }
.form-actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, #f7f9f8 30%); padding: 18px 0 4px }
.form-error { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 9px 11px; font-size: 12px; font-weight: 700; margin-top: 12px }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600 }
.check-line input { width: 16px; height: 16px; accent-color: var(--teal) }
.dup-warning { background: var(--amber-bg); border: 1px solid #efd7bb; border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.task-edit { padding: 12px 0; border-top: 1px solid var(--line-soft) }

/* ---------- Ventanas y avisos ---------- */
.modal-scrim { z-index: 49 }
.modal { position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 13px; box-shadow: 0 20px 70px #0b343640; padding: 22px }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px }
.modal h2 { font: 800 19px Manrope, sans-serif; margin: 0 }
.modal-text { font-size: 12.5px; color: #4d6568; line-height: 1.55; margin: 0 0 14px }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px }
.toast { position: fixed; z-index: 80; bottom: 23px; left: 50%; transform: translateX(-50%) translateY(20px); max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; background: #173c41; color: #fff; border-radius: 9px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); text-align: center }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }
.toast.error { background: #8c3b31 }

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 1250px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .connector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .guide-grid, .lab-grid { grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 1000px) {
  .dashboard-grid, .agenda-layout { grid-template-columns: 1fr }
  .agenda-strip { grid-template-columns: repeat(3, 1fr) }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -250px; transition: left .2s }
  body.menu-open .sidebar { left: 0 }
  body.menu-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(8, 34, 39, .45); z-index: 25 }
  .menu-button { display: block !important }
  .topbar { padding: 0 18px }
  main { padding: 24px 18px 55px }
  .page-head { align-items: flex-start }
}
@media (max-width: 650px) {
  .topbar { height: 56px; padding: 0 12px }
  .top-demo, .avatar { display: none }
  main { padding: 20px 14px 50px }
  .page-head { display: block; margin-bottom: 16px }
  .page-head h1 { font-size: 24px }
  .head-controls { margin-top: 14px; gap: 7px }
  .period-control, .updated { flex: 1 1 40%; min-width: 0 }
  .health { flex: 1 1 100% }
  .metric-grid, .metric-grid.results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
  .metric { min-height: 96px; padding: 12px }
  .metric-value { font-size: 22px }
  .panel-head { padding: 16px 14px 10px }
  .task-list, .source-bars, .connector-mini { padding-left: 14px; padding-right: 14px }
  .source-note, .panel .panel-foot { padding-left: 14px; padding-right: 14px }
  .connector-grid, .guide-grid, .lab-grid { grid-template-columns: 1fr }
  .lab-grid { padding: 0 14px 14px }
  .agenda-strip { grid-template-columns: repeat(2, 1fr) }
  .toolbar { padding: 12px }
  .toolbar select { flex: 1 1 45% }
  .search-wrap { flex-basis: 100%; min-width: 0 }
  .heading-actions { width: 100% }
  .heading-actions > * { flex: 1 1 auto }
  /* Tabla en forma de tarjetas */
  .opp-wrap { overflow: visible }
  .opp-table { min-width: 0; display: block; table-layout: auto }
  .opp-table thead { display: none }
  .opp-table tbody { display: block }
  .opp-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 8px; padding: 13px 14px; border-top: 1px solid var(--line) }
  .opp-table tbody tr:first-child { border-top: 0 }
  .opp-table td { display: block; border: 0; padding: 0; min-width: 0 }
  .opp-table td:nth-child(2) { grid-column: 1; grid-row: 1 }
  .opp-table td:nth-child(7) { grid-column: 2; grid-row: 1; justify-self: end; text-align: right }
  .opp-table td:nth-child(4) { grid-column: 1; grid-row: 2 }
  .opp-table td:nth-child(1) { grid-column: 2; grid-row: 2; text-align: right }
  .opp-table td:nth-child(3) { grid-column: 1; grid-row: 3 }
  .opp-table td:nth-child(6) { grid-column: 2; grid-row: 3; justify-self: end }
  .opp-table td:nth-child(8) { grid-column: 1 / -1; grid-row: 4; padding-top: 6px; border-top: 1px dashed var(--line-soft) }
  .opp-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 5; color: var(--muted); font-size: 11px }
  .opp-table td:nth-child(5) .cell-sub, .opp-table td:nth-child(1) .cell-sub { display: inline; margin-left: 5px }
  .opp-table td:nth-child(3) .cell-sub { display: none }
  /* Ficha */
  .drawer-header { padding: 14px 14px 0 }
  .drawer-header h2 { font-size: 17px }
  .drawer-head-actions .outline-button { display: none }
  .drawer-body { padding: 14px 12px 40px }
  .drawer-panel { padding: 14px }
  .fact-grid, .form-grid, .form-grid.four { grid-template-columns: 1fr }
  .form-grid.four .wide { grid-column: 1 / -1 }
  .contact-row { grid-template-columns: 1fr auto auto; }
  .contact-row input:not([type=radio]) { grid-column: 1 / -1 }
  .kind-select { max-width: 55% }
  .bubble { max-width: 92% }
  .task-line { align-items: flex-start; flex-direction: column; gap: 0 }
  .task-line > .mini-button { margin: 0 0 8px 31px }
  .task-row .mini-button { display: none }
  .modal { padding: 18px 16px }
}

/* Elementos sólo del entorno de pruebas: no aparecen en producción */
body[data-mode="production"] .demo-only { display: none !important }

/* ---------- Pantalla de acceso ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--deep); padding: 20px }
.login-card { background: #fff; border-radius: 14px; padding: 32px 30px; width: min(400px, 100%); box-shadow: 0 20px 60px #0b343655 }
.login-brand { padding: 0 0 24px; color: var(--ink) }
.login-brand small { color: var(--muted) }
.login-card h1 { font: 800 24px Manrope, sans-serif; margin: 0 0 6px }
.login-text, .login-help { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 18px }
.login-help { font-size: 11.5px; margin: 16px 0 0 }
.login-button { display: block; text-align: center; text-decoration: none; padding: 12px 14px; font-size: 13px }
.login-card .form-error { margin: 0 0 14px }

/* Google Ads */
.ads-accounts { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 12px }
.ads-account { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; min-width: 200px; background: var(--white) }
.ads-account.ok { border-left-color: var(--teal) } .ads-account.error { border-left-color: var(--red) }
.ads-account small { color: var(--muted) } .ads-account .auto-tag { align-self: flex-start; margin-top: 2px }
.ads-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 4px 20px 20px; padding-top: 6px; border-bottom: 1px solid var(--line) }
.ads-bars span { flex: 1; min-width: 3px; background: var(--deep); opacity: .78; border-radius: 3px 3px 0 0 }
.ads-bars span:hover { opacity: 1 }
.ads-click { margin-top: 6px }
.ads-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px }
.ads-axis { display: flex; justify-content: space-between; margin: -12px 20px 18px; color: var(--muted); font-size: 11px }
.ads-demo-notice { background: var(--amber-bg); border-color: #efd7bb; color: #7a5316 }
.alert-list { list-style: none; margin: 0 0 6px; padding: 0 20px 14px; display: grid; gap: 8px }
.alert-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--white) }
.alert-list li small { display: block; color: var(--muted); margin-top: 2px }
.alert-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--muted) }
.alert-error { border-color: #f1c9c6 !important; background: var(--red-bg) !important } .alert-error .alert-icon { background: var(--red) }
.alert-aviso { border-color: #efd7bb !important; background: var(--amber-bg) !important } .alert-aviso .alert-icon { background: var(--amber) }
.alert-info .alert-icon { background: var(--teal) }
.ads-table td, .ads-table th { white-space: nowrap } .ads-table td:first-child { white-space: normal; min-width: 220px }
.plain-table tr.clickable { cursor: pointer } .plain-table tr.clickable:hover td { background: var(--mint) }
.ads-back { margin-bottom: 14px }
.ads-facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: 0 20px 18px }
#view-google .panel-head .scope-chips { margin: 0 }
.ads-toolbar { padding: 0 20px 16px }
#view-google > .panel, #view-google > section.panel { margin-bottom: 18px }
#view-google .metric-section { margin-bottom: 18px }
.ads-real-notice { background: var(--mint); border-color: #cfe7df; color: #2f6a5d }
.ads-campaign-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 16px }
.ads-campaign-actions small { color: var(--muted) }
.ads-toggle { display: block; margin-top: 4px; font-size: 11px }
.ads-approve-actions { display: flex; gap: 8px; margin-top: 8px }
/* Gestión de campañas */
.text-button.danger { color: var(--red) }
.ads-target-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 22px; padding: 0 20px 18px }
.ads-target-block h3 { font: 800 13px Manrope, sans-serif; margin: 0 0 8px; display: flex; align-items: center; gap: 8px }
.ads-target-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; font-size: 12.5px }
.ads-target-block li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft) }
.ads-wizard h3 { font: 800 14px Manrope, sans-serif; margin: 18px 0 8px; color: var(--deep) }
.ads-geo-search { display: flex; gap: 8px } .ads-geo-search input { flex: 1 }
.ads-geo-results { display: grid; gap: 4px; margin: 8px 0 10px; max-height: 180px; overflow-y: auto }
.ads-counter { font-size: 11px; color: var(--muted) }
.modal:has(.ads-wizard) { width: min(760px, calc(100vw - 24px)) }

/* ---------- WhatsApp / conciliación (datos de prueba) ---------- */
.wa-banner { background: var(--amber-bg); border-color: #efd7bb; color: #7a4f10; font-size: 13px }
.wa-banner.ok { background: var(--green-bg); border-color: #cfe7d6; color: var(--green) }
.wa-flag { font-size: 14px; letter-spacing: .04em }
.wa-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 14px }
.wa-account { padding-bottom: 16px }
.wa-account > p, .wa-account > .wa-counts, .wa-account > .wa-history { margin-left: 20px; margin-right: 20px }
.wa-last { font-size: 12px; color: var(--muted); margin-top: 0; margin-bottom: 8px }
.wa-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 12px }
.wa-counts b, .wa-facts b, .wa-summary b { color: var(--ink); font-size: 14px }
.wa-counts .bad, .wa-counts .bad b { color: var(--red) }
.wa-history { border-top: 1px solid var(--line-soft); padding-top: 12px }
.wa-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px }
.wa-bar { height: 8px; background: #eef2f1; border-radius: 8px; overflow: hidden }
.wa-bar i { display: block; height: 100%; background: var(--teal); border-radius: 8px }
.wa-steps { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 9px 0 }
.wa-steps li { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 12px; background: #f0f2f2; color: #8a999a }
.wa-steps li.done { background: var(--mint); color: var(--teal) } .wa-steps li.on { background: var(--deep); color: #fff } .wa-steps li.on.err, .wa-steps li.err.on { background: var(--red) }
.wa-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin: 6px 0 0 }
.wa-errors { margin: 8px 0 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--red) }
.wa-summary { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin: 0 2px 22px }
.wa-list { display: grid; gap: 12px }
.wa-row { padding: 16px 20px }
.wa-row.pending { border-left: 4px solid var(--amber) }
.wa-row-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start }
.wa-row-head h3 { margin: 0 0 2px; font-size: 15px } .wa-row-head h3 small { font-weight: 500; color: var(--muted) }
.wa-phone { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums } .wa-phone.masked { letter-spacing: .02em }
.wa-convs { list-style: none; padding: 0; margin: 12px 0 8px; display: grid; gap: 8px }
.wa-conv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 11px; background: #f8faf9; border: 1px solid var(--line-soft); border-radius: 9px }
.wa-acc { font-weight: 700; font-size: 12px; color: var(--deep) } .wa-time { font-size: 11px; color: var(--muted) }
.wa-preview { flex: 1 1 100%; font-size: 12px; color: #4b6a6c; font-style: italic; quotes: none }
.wa-conv .compact { margin-left: auto }
.wa-origin { font-size: 12.5px; margin: 8px 0 }
.wa-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px }
.wa-channels { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); background: var(--blue-bg); border-radius: 8px; padding: 7px 10px }
.wa-channels strong { color: var(--blue); font-size: 11px; letter-spacing: .04em } .wa-channels b { color: var(--ink) }
.wa-class-list { display: grid; gap: 6px; margin-bottom: 12px }
.wa-class { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer }
.wa-class small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px }
.wa-class:has(input:checked) { border-color: var(--teal); background: var(--mint) }
.wa-purge-warn { background: var(--red-bg); border: 1px solid #f0cfc9; color: #8a3e35; border-radius: 9px; padding: 10px 12px; font-size: 12px; margin-bottom: 12px }
.wa-purge-warn ul { margin: 6px 0 8px 18px; padding: 0 } .wa-purge-warn .check-line { font-weight: 700 }
.wa-results { display: grid; gap: 4px; margin-top: 6px } .wa-pick { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12px }
.wa-pick:hover { border-color: var(--teal); background: var(--mint) }

.mail-thread { margin: 8px 0; border: 1px solid var(--line, #dfe3e8); border-radius: 8px; padding: 8px 12px }
.mail-thread summary { cursor: pointer }
.mail-incomplete { margin-top: 6px }
