:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --accent: #e80053;
  --accent-ink: #ffffff;
  --lead: #f1f1ef;
  --me: #fde7f1;
  --pol: #e0f2fe;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --panel: #19191c;
    --ink: #f4f4f5;
    --muted: #a1a1aa;
    --line: #2a2a2e;
    --lead: #232327;
    --me: #3b1528;
    --pol: #0c2b3d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: inherit; }
button, .btn {
  font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%;
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

header.top {
  display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
header.top .brand { font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
header.top .brand span { color: var(--accent); }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.top nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
header.top nav a.on { background: var(--bg); color: var(--ink); font-weight: 600; }
header.top .spacer { flex: 1; }

main.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 6px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.flash { background: #dcfce7; color: #14532d; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { .flash { background: #14361f; color: #bbf7d0; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.stat { text-align: center; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }

.inbox { display: grid; grid-template-columns: 320px 1fr 280px; height: calc(100vh - 53px); }
.inbox > section { overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); }
.inbox .chat { background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.list-tools { padding: 10px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.contact { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; }
.contact.on { background: var(--bg); }
.contact .name { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.contact .preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.badge.reservado { color: var(--ok); border-color: var(--ok); }
.badge.cualificado { color: #1d4ed8; border-color: #1d4ed8; }
.badge.no_cualifica, .badge.perdido, .badge.baja { color: var(--bad); border-color: var(--bad); }
.badge.alert { background: var(--bad); color: #fff; border-color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--muted); }

.chat-head { padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-head .who { flex: 1; min-width: 160px; }
.chat-head .who b { display: block; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 75%; padding: 8px 11px; border-radius: 12px; word-wrap: break-word; line-height: 1.4; }
.msg .body { white-space: pre-wrap; }
.msg.in { background: var(--lead); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--me); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.out.pol { background: var(--pol); }
.msg .info { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg .err { color: var(--bad); }
.msg img { max-width: 220px; border-radius: 8px; display: block; }
.msg audio { max-width: 240px; display: block; }
.composer { display: flex; gap: 8px; padding: 10px; background: var(--panel); border-top: 1px solid var(--line); }
.composer textarea { min-height: 42px; height: 42px; font-family: inherit; font-size: 15px; }
.empty { margin: auto; color: var(--muted); text-align: center; padding: 30px; }

.side { padding: 14px; font-size: 14px; }
.side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 6px; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.side dt { color: var(--muted); }
.side dd { margin: 0; }
.attention { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; }
@media (prefers-color-scheme: dark) { .attention { background: #3a1414; border-color: #6b1d1d; color: #fecaca; } }

.test-wrap { max-width: 760px; margin: 0 auto; height: calc(100vh - 53px); display: flex; flex-direction: column; }
.test-wrap .messages { background: var(--bg); }

details.versions summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 8px; }
.check { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.check input { width: auto; }
code.url { display: block; background: var(--bg); border: 1px solid var(--line); padding: 8px; border-radius: 8px; word-break: break-all; font-size: 13px; }

@media (max-width: 1000px) {
  .inbox { grid-template-columns: 280px 1fr; }
  .inbox .side-col { display: none; }
}
@media (max-width: 700px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-chat .list-col { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .inbox .chat { height: calc(100vh - 53px); }
  .msg { max-width: 88%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
.back-link { display: none; }
@media (max-width: 700px) {
  .back-link { display: inline-block; }
  header.top { gap: 10px; padding: 8px 12px; }
  header.top nav { flex-wrap: nowrap; overflow-x: auto; }
  header.top nav a { padding: 6px 8px; white-space: nowrap; }
  .chat-head { padding: 8px 10px; gap: 8px; }
  .chat-head .who { min-width: 0; flex-basis: calc(100% - 60px); }
  .chat-head select, .chat-head button { padding: 6px 8px; font-size: 14px; }
}

/* ---------- Diseño v2: menú lateral, panel y bandeja ---------- */
:root { --sidebar: 220px; --accent-soft: #fdeaf3; --radius-lg: 18px; }
@media (prefers-color-scheme: dark) { :root { --accent-soft: #3a1426; } }
body { font-size: 15px; -webkit-font-smoothing: antialiased; }
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; background: var(--panel); border-right: 1px solid var(--line); }
.sidebar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; padding: 4px 8px; }
.sidebar .brand b { color: var(--accent); }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }
.sidebar nav a:hover { background: var(--bg); color: var(--ink); }
.sidebar nav a.on { background: var(--accent-soft); color: var(--accent); }
.sidebar .logout { margin-top: auto; padding: 8px 10px; color: var(--muted); font-size: 13px; text-decoration: none; }
.content { min-width: 0; }
main.page.wide { max-width: 1180px; }
.inbox { height: 100vh; }
.test-wrap { height: 100vh; }

.card { border-radius: var(--radius-lg); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 16px; }

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.dash-head p { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); }
.pill.off { color: var(--muted); }

.hero-card { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 24px; padding: 24px; margin-bottom: 16px; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(135deg, #e80053 0%, #9d174d 100%); }
.hero-main { display: flex; flex-direction: column; justify-content: center; }
.hero-label { font-size: 13px; opacity: .85; }
.hero-number { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin: 6px 0; }
.hero-sub { font-size: 13px; opacity: .85; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hero-stats div { background: rgba(255,255,255,.12); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.hero-stats b { font-size: 28px; line-height: 1.1; }
.hero-stats span { font-size: 12px; opacity: .85; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.dash-grid .card { margin-bottom: 16px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar { width: 100%; max-width: 28px; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; position: relative; transition: opacity .15s; }
.bar-col:hover .bar { opacity: .75; }
.bar-val { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.bar-x { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); }
.bar-mark { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%; background: #15803d; border: 2px solid var(--panel); }
.bar-mark.inline { position: static; display: inline-block; transform: none; vertical-align: middle; margin-right: 4px; }
.legend-line { margin-top: 28px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.mini-table th, .mini-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }

.funnel-row { margin-bottom: 16px; }
.funnel-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.funnel-track { height: 12px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 99px; background: var(--accent); }

.activity { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; text-decoration: none; }
.activity:hover { background: var(--bg); }
.activity-body { flex: 1; min-width: 0; }
.preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-card { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg); }

.avatar { position: relative; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; }
.avatar-ch { position: absolute; right: -3px; bottom: -3px; line-height: 0; border-radius: 50%; border: 2px solid var(--panel); background: var(--panel); }
.ch-icon { display: block; }

.contact { display: flex; gap: 10px; align-items: flex-start; }
.contact-body { flex: 1; min-width: 0; }
.contact .name { display: flex; align-items: center; gap: 6px; }
.contact .name .spacer { flex: 1; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact .meta { justify-content: flex-start; gap: 6px; margin-top: 4px; }
.contact.on { background: var(--accent-soft); }

.day-sep { text-align: center; margin: 10px 0 4px; }
.day-sep span { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; }
.msg { box-shadow: 0 1px 1px rgba(0,0,0,.04); }

@media (max-width: 1000px) {
  .dash-grid, .hero-card { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand span:last-child, .sidebar .logout { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .sidebar nav a { padding: 8px; }
  .sidebar nav a span { display: none; }
  .inbox, .test-wrap, .inbox .chat { height: calc(100vh - 53px); }
  .hero-number { font-size: 52px; }
}
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- Diseño v3: acabado profesional ---------- */
:root {
  --bg: #f5f5f3; --panel: #ffffff; --ink: #111114; --muted: #6b6b76; --line: #e7e7ea;
  --accent: #e80053; --accent-ink: #fff; --accent-soft: #fdeaf3; --ok: #15803d; --bad: #c0262d;
  --shadow: 0 1px 2px rgba(17,17,20,.04), 0 1px 1px rgba(17,17,20,.03);
  --radius: 12px; --radius-lg: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0e10; --panel: #17171a; --ink: #f2f2f4; --muted: #9a9aa4; --line: #26262b; --accent-soft: #33121f;
          --shadow: 0 1px 2px rgba(0,0,0,.3); }
}
body { font-size: 14.5px; line-height: 1.45; }
h1, h2, h3 { letter-spacing: -0.015em; }
.card { box-shadow: var(--shadow); border-color: var(--line); padding: 18px 20px; }
button, .btn { border-radius: 10px; padding: 8px 14px; font-weight: 500; transition: background .15s, border-color .15s, opacity .15s; }
button:hover, .btn:hover { border-color: #c9c9cf; }
button.primary:hover, .btn.primary:hover { opacity: .9; }
button:disabled { opacity: .55; cursor: default; }
input, textarea, select { border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
a { color: inherit; }
.card-head a, a.link { color: var(--accent); text-decoration: none; font-weight: 500; }
.badge { font-weight: 600; letter-spacing: .01em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Cabecera de página y selector de periodo */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }
.page-head p { margin: 0; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg a.on { background: var(--ink); color: var(--panel); }

/* Tarjetas de cifras */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid.inner { margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.kpi.soft { background: var(--bg); box-shadow: none; }
.kpi.accent { background: linear-gradient(135deg, #e80053, #9d174d); border-color: transparent; color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: rgba(255,255,255,.85); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-help { font-size: 11.5px; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }

/* Barras horizontales (embudos, tiempos, motivos) */
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.multiple h3, .chart-title { font-size: 14px; margin: 0 0 10px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); min-width: 2px; }
.hbar-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two-col > .card { margin-bottom: 16px; }
details.as-table { margin-top: 10px; }
details.as-table summary, details.versions summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* Columnas verticales (leads por día) */
.cols { display: grid; grid-template-columns: 28px 1fr; gap: 8px; height: 200px; margin-top: 6px; }
.cols-grid { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; padding-bottom: 20px; }
.cols-plot { display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid var(--line); padding-bottom: 0; position: relative; height: calc(100% - 20px);
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 50%; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.col-bar { width: 100%; max-width: 22px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; display: block; }
.col:hover .col-bar { opacity: .75; }
.col-x { position: absolute; bottom: -19px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.mini-table { font-size: 13px; }
.mini-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.mini-table td, .mini-table th { padding: 8px 8px; }
.funnel-table td { vertical-align: middle; }
.ch-cell { display: inline-flex; align-items: center; gap: 8px; }
.form-dot { width: 14px; height: 14px; border-radius: 4px; background: #6b6b76; display: inline-block; }

/* Estados vacíos */
.empty-state { text-align: center; padding: 26px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-state b { color: var(--ink); font-size: 14.5px; }
.empty-state p { margin: 0; font-size: 13px; max-width: 360px; }
.empty-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }

/* Bandeja: escribir, nota de voz y foto */
.composer-wrap { background: var(--panel); border-top: 1px solid var(--line); }
.composer-wrap .composer { border-top: 0; align-items: flex-end; }
.icon-btn { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 12px; flex: none; color: var(--muted); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.attach-panel, .rec-panel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.attach-panel[hidden], .rec-panel[hidden] { display: none; }
.attach-panel { flex-direction: column; align-items: stretch; }
.attach-media img { max-height: 180px; max-width: 100%; border-radius: 10px; display: block; }
.attach-media audio { width: 100%; }
.attach-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.attach-actions .err { margin-right: auto; color: var(--bad); }
.rec-panel .spacer { flex: 1; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }

/* Chat */
.messages { padding: 18px 22px; gap: 4px; }
.msg { padding: 8px 12px; border-radius: 14px; font-size: 14.5px; }
.msg .info { font-size: 11px; opacity: .8; }
.msg.out { background: var(--accent-soft); }
@media (prefers-color-scheme: dark) { .msg.in { background: #212126; } }
.chat-head { padding: 12px 16px; }
.side h3 { font-size: 11.5px; }

@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .multiples, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main.page { padding: 16px 16px 48px; }
  .kpi-value { font-size: 24px; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .hbar-row { grid-template-columns: minmax(70px, 34%) 1fr auto; }
  .messages { padding: 12px; }
}

/* Leads */
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 8px; align-items: center; }
.filters input { grid-column: span 1; }
.filters .row { grid-column: 1 / -1; }
.leads-table tr.clickable { cursor: pointer; }
.leads-table tr.clickable:hover td { background: var(--bg); }
.leads-table td { vertical-align: top; }
.lead-cell { display: inline-flex; align-items: center; gap: 10px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
.steps { padding-left: 18px; margin: 6px 0 12px; } .steps li { margin: 4px 0; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 12.5px; }
.evo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.small-cols { height: 150px; }
@media (max-width: 760px) { .evo-grid { grid-template-columns: 1fr; } }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.tpl-body { white-space: pre-wrap; font-size: 13.5px; color: var(--ink); margin: 8px 0; }
button.small { padding: 4px 10px; font-size: 12.5px; }
.err { color: var(--bad); }
.chips-check { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; color: var(--ink); cursor: pointer; }
.chip-check input { width: auto; }
.audience { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.audience b { font-size: 20px; color: var(--accent); }
.sidebar nav { overflow-y: auto; }
.copilot-msg { max-width: 82%; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.chip-btn { font-size: 12.5px; padding: 6px 10px; border-radius: 99px; }
.proposal { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin: 8px 0; }
.proposal pre { white-space: pre-wrap; font-size: 12px; max-height: 300px; overflow: auto; background: var(--panel); padding: 10px; border-radius: 8px; }
.call-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.call-item audio, .call-row audio { width: 100%; margin-top: 6px; }
.call-row { border-bottom: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.call-row:last-child { border-bottom: 0; }
.call-scores { display: flex; gap: 6px; flex-wrap: wrap; }
.outcome { display: grid; gap: 6px; }

/* Conexiones */
.progress-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 16px 10px 10px; box-shadow: var(--shadow); }
.progress-card b { display: block; font-size: 18px; }
.section-title { font-size: 15px; margin: 26px 0 10px; }
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.svc-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0; scroll-margin-top: 16px; }
.svc-card.wide { margin-bottom: 16px; }
.svc-card header { display: flex; align-items: center; gap: 12px; }
.svc-card header > div { flex: 1; min-width: 0; }
.svc-card h3 { margin: 0; font-size: 15.5px; }
.svc-card header p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.svc-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--ink); }
.svc-claude { background: #fbe9df; color: #d97757; }
.svc-calendar { background: #e7efff; color: #2563eb; }
.svc-form { background: #eef0f3; color: #52525b; }
.svc-telegram { background: #e3f2fd; color: #229ed9; }
.svc-phone { background: #fde7ea; color: #e11d48; }
.svc-mic { background: #eceaf6; color: #6d28d9; }
.svc-meta { background: #e7f0ff; color: #0866ff; }
.svc-instagram, .svc-whatsapp { background: transparent; }
@media (prefers-color-scheme: dark) {
  .svc-claude, .svc-calendar, .svc-form, .svc-telegram, .svc-phone, .svc-mic, .svc-meta { background: #232329; }
}
.svc-status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.svc-status.ok { color: #15803d; background: #dcfce7; }
.svc-status.todo { color: #b45309; background: #fef3c7; }
.svc-status.partial { color: #1d4ed8; background: #dbeafe; }
.svc-status.off { color: var(--muted); background: var(--bg); }
@media (prefers-color-scheme: dark) {
  .svc-status.ok { background: #14361f; color: #86efac; } .svc-status.todo { background: #3a2a0c; color: #fcd34d; }
  .svc-status.partial { background: #172554; color: #93c5fd; }
}
.svc-card details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.svc-card details[open] summary { margin-bottom: 8px; }
.svc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 200px; }
.account { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.account img { border-radius: 50%; }
.account span { display: block; }
.copy-list { margin: 0; }
.copy-list dt { font-size: 12.5px; margin-top: 10px; color: var(--ink); font-weight: 500; }
.copy-list dd { margin: 4px 0 0; }
.copy-field { display: flex; align-items: center; gap: 6px; min-width: 0; }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 9px; font-size: 12.5px; }
.copy-btn { padding: 6px 10px; font-size: 12px; flex: none; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: 1fr; } }

/* Instagram */
.ig-head header { flex-wrap: wrap; }
.ig-pic { border-radius: 50%; object-fit: cover; }
.master { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; padding: 10px 12px; background: var(--bg); border-radius: 12px; color: var(--ink); font-size: 14px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.master .switch-row { margin: 0; }
.switch { appearance: none; -webkit-appearance: none; width: 42px !important; height: 24px; padding: 0 !important; border-radius: 99px; background: #d4d4d8; position: relative; cursor: pointer; flex: none; border: 0 !important; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rule p { margin: 4px 0; }
.media-strip { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.media-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.svc-grid { align-items: start; }

/* ---------------- Asistentes */
.as-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.as-dot { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; box-shadow: 0 0 0 2px var(--panel); }
.split-bar { display: flex; gap: 2px; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 4px 0 14px; }
.split-bar span { min-width: 4px; }
.split-form { display: flex; flex-direction: column; gap: 8px; }
.split-item { display: grid; grid-template-columns: minmax(110px, 160px) auto auto 1fr; align-items: center; gap: 12px; }
.split-pct { display: inline-flex; align-items: center; gap: 4px; }
.split-pct input { width: 72px; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.as-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--as); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; scroll-margin-top: 16px; }
.as-card header { display: flex; align-items: center; gap: 12px; }
.as-title { flex: 1; min-width: 0; }
.as-title h3 { margin: 0; font-size: 18px; }
.as-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.win { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #fef3c7; color: #92400e; white-space: nowrap; }
.win.soft { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.as-meta { display: flex; justify-content: space-between; gap: 8px; }
.as-hero b { font-size: 34px; letter-spacing: -.03em; line-height: 1; display: block; }
.as-funnel { display: flex; flex-direction: column; gap: 6px; }
.as-step { display: grid; grid-template-columns: 92px 1fr 70px; align-items: center; gap: 8px; font-size: 13px; }
.as-step .lbl { color: var(--muted); }
.as-step .trk { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.as-step .fill { display: block; height: 100%; background: var(--as); border-radius: 0 4px 4px 0; min-width: 2px; }
.as-step .val { text-align: right; font-variant-numeric: tabular-nums; }
.as-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.as-stats dt { font-size: 11px; color: var(--muted); }
.as-stats dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.as-actions { gap: 6px; }
.as-actions form { margin: 0; }
.as-edit summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 14px; }
.as-text { min-height: 320px; font-family: inherit; font-size: 14px; }
.color-in { width: 52px; height: 38px; padding: 2px; }
.cmp-table td:first-child { color: var(--muted); }
.cmp-table b.best { color: var(--ok); }
.cmp-form { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.cmp-form textarea { min-height: 130px; font-family: inherit; font-size: 14px; }
.cmp-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(240px, 1fr)); gap: 12px; overflow-x: auto; margin-top: 12px; }
.cmp-col { border: 1px solid var(--line); border-top: 4px solid var(--as); border-radius: 14px; display: flex; flex-direction: column; min-width: 0; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cmp-msgs { max-height: 560px; padding: 12px; }
.cmp-msgs .msg { max-width: 92%; font-size: 14px; white-space: pre-wrap; }
.cmp-foot { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.report-lead { font-size: 17px; line-height: 1.5; margin: 6px 0 14px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.report-col { border: 1px solid var(--line); border-left: 4px solid var(--as); border-radius: 12px; padding: 12px 14px; }
.report-col h3 { margin: 0 0 6px; font-size: 15px; }
.report-col ul { margin: 2px 0 8px; padding-left: 18px; font-size: 14px; }
.report-col blockquote { margin: 6px 0; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.report-col blockquote.good { background: #ecfdf5; color: #065f46; }
.report-col blockquote.bad { background: #fef2f2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .win { background: #3a2a07; color: #fcd34d; }
  .report-col blockquote.good { background: #052e1f; color: #6ee7b7; }
  .report-col blockquote.bad { background: #3a0d0d; color: #fca5a5; }
}
@media (max-width: 760px) {
  .cmp-form { grid-template-columns: 1fr; }
  .split-item { grid-template-columns: 1fr auto auto; }
  .split-item > .small { grid-column: 1 / -1; }
}

/* =====================================================================
   Diseño v4 — acabado profesional (menú oscuro, tipografía, controles)
   ===================================================================== */
:root {
  --bg: #f4f4f6; --panel: #ffffff; --ink: #0f0f12; --muted: #6b6b78; --line: #e6e6eb; --line-strong: #d5d5dd;
  --accent: #e80053; --accent-2: #c20046; --accent-soft: #fdeaf3;
  --side-bg: #0f0f12; --side-ink: #a6a6b2; --side-ink-strong: #ffffff; --side-hover: rgba(255,255,255,.06); --side-line: rgba(255,255,255,.08);
  --shadow: 0 1px 2px rgba(15,15,18,.05), 0 1px 3px rgba(15,15,18,.04);
  --shadow-md: 0 4px 16px -4px rgba(15,15,18,.10), 0 2px 4px -2px rgba(15,15,18,.06);
  --radius: 10px; --radius-lg: 14px; --sidebar: 236px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-feature-settings: "cv11", "ss01";
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0b0d; --panel: #141417; --ink: #f2f2f5; --muted: #9696a3; --line: #232328; --line-strong: #31313a;
          --accent-soft: #3a1226; --side-bg: #08080a; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 6px 20px -6px rgba(0,0,0,.6); }
}
html { background: var(--bg); }
body { font-size: 14px; line-height: 1.5; letter-spacing: -0.003em; text-rendering: optimizeLegibility; }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3 { color: var(--ink); font-weight: 650; }
.muted, .small.muted { color: var(--muted); }

/* --- Menú lateral oscuro */
.sidebar { background: var(--side-bg); border-right: 0; padding: 16px 12px 12px; gap: 14px; color: var(--side-ink); }
.sidebar .brand { padding: 6px 8px 10px; gap: 11px; border-bottom: 1px solid var(--side-line); border-radius: 0; margin: 0 -4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { color: var(--side-ink-strong); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.brand-text small { color: var(--side-ink); font-size: 11.5px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #ff2d7a 0%, #e80053 45%, #9d174d 100%);
        box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 6px 16px -6px rgba(232,0,83,.7); font-size: 16px; }
.sidebar nav { gap: 1px; scrollbar-width: none; }
.sidebar nav::-webkit-scrollbar { display: none; }
.nav-group { display: block; margin: 14px 10px 4px; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #5d5d69; }
.sidebar nav a { color: var(--side-ink); padding: 7px 10px; border-radius: 8px; font-size: 13.5px; position: relative; transition: background .12s, color .12s; }
.sidebar nav a svg { opacity: .8; }
.sidebar nav a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.sidebar nav a.on { background: rgba(255,255,255,.09); color: var(--side-ink-strong); }
.sidebar nav a.on svg { color: #f472b6; opacity: 1; }
.sidebar nav a.on::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 2px; border-top: 1px solid var(--side-line); }
.me { display: flex; align-items: center; gap: 9px; min-width: 0; }
.me > span:last-child { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me b { color: var(--side-ink-strong); font-size: 13px; font-weight: 600; }
.me small { color: var(--side-ink); font-size: 11.5px; }
.me-pic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #26262c; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.sidebar .logout { margin: 0; padding: 7px; border-radius: 8px; color: var(--side-ink); display: grid; place-items: center; }
.sidebar .logout:hover { background: var(--side-hover); color: #fff; }

/* --- Página */
main.page { padding: 28px 28px 64px; }
.page-head, .dash-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head h1, .dash-head h1, main.page > h1 { font-size: 24px !important; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 4px !important; }
.page-head p, .dash-head p { font-size: 13.5px; max-width: 760px; }
.section-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 26px 0 10px; }

/* --- Tarjetas */
.card, .svc-card, .kpi, .as-card { border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card { padding: 20px 22px; }
.card h2, .card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.card-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.kpi { padding: 16px 18px; transition: box-shadow .15s, transform .15s; }
.kpi:hover, .svc-card:hover, .as-card:hover { box-shadow: var(--shadow-md); }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.kpi.accent, .hero-card { background: radial-gradient(120% 140% at 0% 0%, #ff2d7a 0%, #e80053 40%, #831843 100%); box-shadow: 0 10px 30px -12px rgba(232,0,83,.55); }

/* --- Botones */
button, .btn { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font-size: 13.5px; font-weight: 550; line-height: 1;
  box-shadow: 0 1px 1px rgba(15,15,18,.04); white-space: nowrap; }
button:hover, .btn:hover { background: var(--bg); border-color: var(--line-strong); }
button.primary, .btn.primary { background: linear-gradient(180deg, #ff1f6b 0%, var(--accent) 100%); border-color: var(--accent-2); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 1px 2px rgba(194,0,70,.35); }
button.primary:hover, .btn.primary:hover { background: linear-gradient(180deg, #e80053 0%, var(--accent-2) 100%); opacity: 1; }
button.small, .btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; }
button.danger { color: var(--bad); }
button.danger:hover { background: #fef2f2; border-color: #fecaca; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { height: 32px; width: 32px; padding: 0; }

/* --- Campos */
input, textarea, select { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px; font-size: 13.5px; background: var(--panel);
  box-shadow: 0 1px 1px rgba(15,15,18,.03); }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select { min-height: 36px; }
input:hover, textarea:hover, select:hover { border-color: #c4c4cd; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,0,83,.15); }
select { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238a8a96' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
textarea { font-family: inherit; font-size: 13.5px; line-height: 1.55; }
label { font-size: 12.5px; font-weight: 550; color: var(--muted); }
input[type=checkbox]:not(.switch) { accent-color: var(--accent); width: 16px; height: 16px; }
.switch:checked { background: var(--accent); }
input::placeholder, textarea::placeholder { color: #a3a3ad; }

/* --- Tablas */
.mini-table { border-collapse: separate; border-spacing: 0; }
.mini-table th { background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line); padding: 10px 12px; }
.mini-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.mini-table tbody tr { transition: background .1s; }
.mini-table tbody tr:hover { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.mini-table tbody tr:last-child td { border-bottom: 0; }
.table-wrap { border-radius: var(--radius-lg); overflow: auto; }

/* --- Etiquetas de estado */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: #f1f1f4; color: #52525e; border: 0; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.nuevo { background: #f1f1f4; color: #52525e; }
.badge.en_curso { background: #eff6ff; color: #1d4ed8; }
.badge.cualificado { background: #f5f3ff; color: #6d28d9; }
.badge.reservado { background: #ecfdf3; color: #047857; }
.badge.no_cualifica, .badge.perdido, .badge.baja { background: #fef2f2; color: #b91c1c; }
.badge.alert { background: var(--bad); color: #fff; }
.badge.alert::before { display: none; }
@media (prefers-color-scheme: dark) {
  .badge, .badge.nuevo { background: #222228; color: #b4b4c0; }
  .badge.en_curso { background: #0f1e3a; color: #93b4ff; }
  .badge.cualificado { background: #22173d; color: #c4b5fd; }
  .badge.reservado { background: #0b2a1e; color: #6ee7b7; }
  .badge.no_cualifica, .badge.perdido, .badge.baja { background: #341214; color: #fca5a5; }
  button.danger:hover { background: #341214; border-color: #5b1d20; }
  input:hover, textarea:hover, select:hover { border-color: #43434d; }
}

/* --- Avisos */
.flash { background: #ecfdf3; color: #065f46; border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.attention { border-radius: 10px; padding: 10px 14px; }
@media (prefers-color-scheme: dark) { .flash { background: #0b2a1e; color: #a7f3d0; border-color: #14532d; } }

/* --- Chips, filtros y pestañas */
.chip, .pill, .chip-check { border-radius: 8px; border-color: var(--line-strong); font-weight: 550; }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.seg { border-radius: 10px; background: var(--bg); border-color: var(--line); }
.seg a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.filters { gap: 8px; }

/* --- Bandeja y chat */
.inbox .list-col { background: var(--panel); border-right: 1px solid var(--line); }
.contact { border-radius: 10px; margin: 2px 8px; transition: background .1s; }
.contact.on { background: var(--accent-soft); }
.chat-head { background: var(--panel); border-bottom: 1px solid var(--line); }
.messages { background: var(--bg); }
.msg { font-size: 14px; border-radius: 16px; padding: 9px 13px; box-shadow: 0 1px 1px rgba(15,15,18,.05); }
.msg.in { background: var(--panel); border: 1px solid var(--line); }
.msg.out { background: linear-gradient(180deg, #ff1f6b, #e80053); color: #fff; border: 0; }
.msg.out .info, .msg.out a { color: rgba(255,255,255,.8); }
.msg.out.pol { background: #1d4ed8; color: #fff; }
.msg.out.tpl { background: #6d28d9; color: #fff; }
.composer { background: var(--panel); border-top: 1px solid var(--line); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.avatar { box-shadow: 0 0 0 1px rgba(15,15,18,.06); }

/* --- Asistentes */
.as-card { border-top-width: 3px; }
.win { background: linear-gradient(180deg, #fde68a, #fcd34d); color: #78350f; }
.split-bar { height: 10px; }

/* --- Menú en móvil (barra superior oscura) */
@media (max-width: 760px) {
  main.page { padding: 18px 16px 48px; }
  .sidebar { background: var(--side-bg); padding: 8px 10px; }
  .sidebar .brand { border: 0; padding: 0; margin: 0; }
  .brand-text, .nav-group, .side-foot .me { display: none !important; }
  .side-foot { border: 0; padding: 0; margin: 0; }
  .sidebar nav a.on::before { display: none; }
}
.sidebar .brand-text b { color: var(--side-ink-strong); }
.sidebar .brand-text small { color: var(--side-ink); }

/* --- Colores de estado: verde = reservó la IA, morado = reservó por otra vía, azul = en curso, ámbar = cualificado, rojo = no */
.badge.cualificado { background: #fffbeb; color: #b45309; }
.badge.reservado_fuera { background: #f5f3ff; color: #7c3aed; }
@media (prefers-color-scheme: dark) {
  .badge.cualificado { background: #3a2a07; color: #fcd34d; }
  .badge.reservado_fuera { background: #22173d; color: #c4b5fd; }
}
.booking-box { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  background: #ecfdf3; border: 1px solid #a7f3d0; color: #065f46; }
.booking-box.reservado_fuera { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.booking-box b { font-size: 15px; color: var(--ink); }
.bk-label { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.bk-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
@media (prefers-color-scheme: dark) {
  .booking-box { background: #0b2a1e; border-color: #14532d; color: #6ee7b7; }
  .booking-box.reservado_fuera { background: #22173d; border-color: #3b2a6b; color: #c4b5fd; }
}

/* --- Etiquetas y celdas que no deben partirse */
.badge { white-space: nowrap; height: auto; min-height: 21px; line-height: 1.2; padding: 3px 8px; max-width: 100%; }
.nowrap, .ch-cell, .as-chip, .chip, .pill, .kpi-label, .seg a, .win, .svc-status { white-space: nowrap; }
.leads-table td { vertical-align: top; }
.leads-table td:nth-child(3) { min-width: 170px; }
.leads-table .link.small { font-size: 12.5px; }
.ch-cell { display: inline-flex; align-items: center; gap: 6px; }
.contact .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-head form, .chat-head select { max-width: 100%; }

/* --- Leads: ficha compacta (el detalle se lee dentro del lead) */
.ficha-cell { width: 190px; max-width: 190px; }
.ficha-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 3px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { color: #047857; background: #ecfdf3; border-color: #a7f3d0; }
.tag.no { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.ficha-line { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leads-table td.num, .leads-table td:last-child { white-space: nowrap; }
@media (prefers-color-scheme: dark) { .tag.ok { background: #0b2a1e; border-color: #14532d; color: #6ee7b7; } .tag.no { background: #341214; border-color: #5b1d20; color: #fca5a5; } }

/* =====================================================================
   Diseño v5 — aspecto SaaS: barra superior, chats enmarcados, interruptores
   ===================================================================== */
:root { --topbar: 56px; }
.content { display: flex; flex-direction: column; min-height: 100vh; }
.page-body { flex: 1; min-width: 0; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: .6; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-body { animation: none; } }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 600; }
.top-search { flex: 1; max-width: 420px; margin-left: auto; position: relative; display: flex; align-items: center; }
.top-search svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.top-search input { padding-left: 33px; padding-right: 44px; min-height: 34px !important; height: 34px; background: var(--bg); border-color: var(--line); box-shadow: none; }
.top-search input:focus { background: var(--panel); }
.top-search kbd { position: absolute; right: 8px; font: 600 11px/1 inherit; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 5px; background: var(--panel); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.top-status:hover { background: var(--bg); color: var(--ink); }

/* Pantallas de alto completo (bandeja y chats) bajo la barra superior */
.inbox, .inbox .chat { height: calc(100vh - var(--topbar)); }
.test-wrap { height: calc(100vh - var(--topbar) - 48px); max-width: 860px; margin: 24px auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.test-wrap .chat-head { padding: 14px 18px; justify-content: space-between; }
.test-wrap .chat-head .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.test-wrap .chat-head .who b { font-size: 15px; }
.test-wrap .chat-head form.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.test-wrap .chat-head form.row select { width: auto; max-width: 240px; }
.test-wrap .attention { margin: 12px 16px 0 !important; }
.test-wrap .messages { padding: 20px; }
.composer { padding: 12px 14px; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 42px; height: 42px; max-height: 160px; border-radius: 12px; font-size: 14px; resize: none; padding: 10px 14px; }
.composer button { height: 42px; border-radius: 12px; padding: 0 18px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--line); }
.chip-btn { height: auto; min-height: 32px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: normal; text-align: left; background: var(--bg); }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Casillas de ajustes como interruptores */
.check { gap: 12px; padding: 8px 0; }
.check input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 38px !important; height: 22px; flex: none; margin: 0; padding: 0 !important;
  border-radius: 99px; background: #d4d4d8; position: relative; cursor: pointer; border: 0 !important; box-shadow: none; transition: background .15s; min-height: 0 !important; }
.check input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.check input[type=checkbox]:checked { background: var(--accent); }
.check input[type=checkbox]:checked::after { transform: translateX(16px); }
.check label { color: var(--ink) !important; font-size: 13.5px !important; font-weight: 500; }
@media (prefers-color-scheme: dark) { .check input[type=checkbox], .switch { background: #3a3a42; } }

/* Ajustes y páginas de formulario: cabecera y botón fijo */
main.page > h1 + .flash, main.page > h1 + p { margin-top: 4px; }
main.page > h1 { padding-bottom: 6px; }
main.page form > p:last-child > button.primary:only-child { position: sticky; bottom: 16px; box-shadow: 0 8px 24px -8px rgba(232,0,83,.6); }

/* Pequeños acabados */
html { scrollbar-color: #c9c9d1 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfcfd6; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9a9b3; background-clip: content-box; }
.empty-icon { box-shadow: 0 0 0 6px var(--accent-soft); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .15s; font-weight: 700; }
details[open] > summary::before { transform: rotate(90deg); }

@media (max-width: 760px) {
  :root { --topbar: 52px; }
  .topbar { padding: 0 12px; gap: 8px; top: 52px; }
  .crumbs, .top-status, .top-search kbd { display: none; }
  .top-search { max-width: none; margin: 0; }
  .test-wrap { margin: 0; border-radius: 0; border: 0; height: calc(100vh - 104px); }
  .inbox, .inbox .chat { height: calc(100vh - 104px); }
}

/* --- Ajustes: campos alineados con unidad y ayuda */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 4px 0 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.unit-in { position: relative; display: flex; align-items: center; }
.unit-in input { padding-right: 70px; -moz-appearance: textfield; }
.unit-in input::-webkit-outer-spin-button, .unit-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-in span { position: absolute; right: 12px; font-size: 12.5px; color: var(--muted); pointer-events: none; }
.switch-list { border-top: 1px solid var(--line); padding-top: 6px; }
.unit-in span { top: 50%; transform: translateY(-50%); line-height: 1; } .unit-in input { margin: 0; }

/* --- Biblioteca de audios y fotos */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.lib-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); min-width: 0; }
.lib-item.off { opacity: .6; }
.lib-item audio { width: 100%; height: 36px; }
.lib-item p { margin: 0; }
.lib-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-kind { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.lib-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; }
.lib-new summary { font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.lib-file input[type=file] { flex: 1; min-width: 200px; }

/* =====================================================================
   Móvil — barra inferior, menú lateral desplegable y nada que se salga
   ===================================================================== */
.shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.tabbar, .nav-scrim { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { font-size: 15px; }
  .shell { display: block; }
  .content { min-height: 100vh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* Menú lateral → cajón que sale desde la izquierda */
  .sidebar { position: fixed !important; inset: 0 auto 0 0; z-index: 60; width: 270px; height: 100vh !important; flex-direction: column !important;
    align-items: stretch !important; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)) !important; gap: 12px !important;
    transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto; border: 0; }
  .sidebar .brand { padding: 6px 8px 10px !important; border-bottom: 1px solid var(--side-line) !important; margin: 0 -4px !important; }
  .brand-text, .nav-group, .side-foot .me { display: flex !important; }
  .nav-group { display: block !important; }
  .side-foot { border-top: 1px solid var(--side-line) !important; padding: 10px 6px 2px !important; margin-top: auto !important; }
  .sidebar nav { flex-direction: column !important; overflow: visible !important; }
  .sidebar nav a { padding: 10px !important; }
  .sidebar nav a span { display: inline !important; }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .nav-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); }
  body.nav-open .nav-scrim { display: block; }

  /* Barra inferior tipo app */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: auto; padding: 4px 0; border: 0; background: none;
    box-shadow: none; color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; border-radius: 10px; }
  .tabbar a.on { color: var(--accent); }

  /* Barra superior compacta */
  .topbar { top: 0 !important; height: 52px; padding: 0 12px !important; gap: 10px; }
  .crumbs { display: flex !important; }
  .crumbs > a, .crumbs > span { display: none; }
  .crumbs b { font-size: 16px; font-weight: 700; }
  .top-search { margin-left: auto; max-width: 170px; }
  .top-search kbd, .top-status, .top-actions .btn { display: none !important; }

  /* Páginas */
  main.page, main.page.wide { padding: 16px 14px 32px !important; max-width: 100%; }
  .page-head, .dash-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head h1, .dash-head h1, main.page > h1 { font-size: 22px !important; }
  .dash-head > div:last-child, .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .card, .svc-card, .as-card { padding: 16px !important; border-radius: 14px; }
  .kpi-grid, .kpi-grid.inner, .hero-stats, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 24px; }
  .hero-card { grid-template-columns: 1fr !important; padding: 18px; gap: 14px; }
  .hero-number { font-size: 48px !important; }
  .dash-grid, .two-col, .multiples, .evo-grid, .cols-grid, .svc-grid, .grid2, .as-grid, .report-grid, .lib-grid, .field-grid,
  .cmp-form, .small-cols { grid-template-columns: minmax(0, 1fr) !important; }
  .cmp-grid { grid-template-columns: repeat(var(--cols), 85%) !important; scroll-snap-type: x mandatory; }
  .cmp-col { scroll-snap-align: start; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters > input, .filters > .row { grid-column: 1 / -1; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mini-table td, .mini-table th { padding: 9px 8px; }
  .split-item { grid-template-columns: 1fr auto auto !important; }

  /* Leads: en el móvil solo lo importante (el resto, entrando al lead) */
  .leads-table th:nth-child(2), .leads-table td:nth-child(2),
  .leads-table th:nth-child(4), .leads-table td:nth-child(4),
  .leads-table th:nth-child(5), .leads-table td:nth-child(5),
  .leads-table th:nth-child(7), .leads-table td:nth-child(7),
  .leads-table th:nth-child(8), .leads-table td:nth-child(8),
  .leads-table th:nth-child(9), .leads-table td:nth-child(9) { display: none; }
  .leads-table td:nth-child(3) { min-width: 0; }

  /* Bandeja y chats a pantalla completa */
  .inbox { display: block; height: calc(100vh - 52px - 64px) !important; }
  .inbox .list-col { height: 100%; overflow-y: auto; border: 0; }
  .inbox .chat { height: calc(100vh - 52px - 64px) !important; display: flex; flex-direction: column; }
  .inbox.has-chat .list-col, .inbox .side-col { display: none !important; }
  .inbox:not(.has-chat) .chat { display: none !important; }
  .chat-head { flex-wrap: wrap; }
  .chat-head form { flex: 1 1 auto; }
  .chat-head select { width: 100%; }
  .msg { max-width: 86%; }
  .test-wrap { height: calc(100vh - 52px - 64px) !important; margin: 0 !important; border-radius: 0; border: 0; }
  .test-wrap .chat-head form.row select { max-width: none; flex: 1; }
  .composer textarea { font-size: 16px; }  /* evita el zoom automático del iPhone */
  input, select, textarea { font-size: 16px !important; }
}
@media (max-width: 760px) {
  .list-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .list-tools .chips::-webkit-scrollbar { display: none; }
  .list-tools .chip { flex: none; }
  .inbox .stats { padding: 10px 6px; }
}

/* --- Logo nuevo (cerdito) */
.logo-img { width: 34px; height: 34px; border-radius: 9px; flex: none; box-shadow: 0 6px 16px -6px rgba(232,0,83,.7); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.login-brand img { border-radius: 14px; box-shadow: 0 10px 24px -10px rgba(232,0,83,.7); }
.login-brand h2 { margin: 0; font-size: 20px; }
.login-brand p { margin: 2px 0 0; }

/* --- Marca PiggFlow */
.wordmark { font-weight: 800; letter-spacing: -0.035em; }
.wordmark span { color: var(--accent); }
.sidebar .brand-text b.wordmark { font-size: 17px; color: #fff; }
.sidebar .brand-text b.wordmark span { color: #ff2d7a; }
.login-brand h2.wordmark { font-size: 26px; }

/* --- En directo */
.live-pulse, .live-dot { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.live-pulse::after, .top-status .live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22c55e; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-pulse::after, .top-status .live-dot::after { animation: none; } }
.live-card h2 { display: flex; align-items: center; gap: 10px; }
.live-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.live-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-tile span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.live-tile b { font-size: 24px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.live-tile small { font-size: 11.5px; color: var(--muted); }
.live-tile.hi { background: var(--accent-soft); border-color: transparent; }
.live-tile.hi b { color: var(--accent); }
.live-feed { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; border-top: 1px solid var(--line); }
.live-feed li { border-bottom: 1px solid var(--line); }
.live-feed a { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 9px 4px; text-decoration: none; }
.live-feed a:hover { background: var(--bg); }
.ev-ico { font-size: 16px; line-height: 1.3; }
.ev-body { min-width: 0; font-size: 13.5px; }
.ev-label { color: var(--muted); }
.ev-text { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-reserva_ia .ev-label { color: #047857; font-weight: 650; }
.ev-reserva_fuera .ev-label { color: #7c3aed; font-weight: 650; }
.ev-nuevo .ev-label { color: var(--accent); font-weight: 650; }
.live-feed li.is-new { animation: flash-in 2.4s ease-out; }
@keyframes flash-in { from { background: var(--accent-soft); } to { background: transparent; } }

.toasts { position: fixed; top: 64px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); text-decoration: none; font-size: 13.5px; animation: toast-in .25s ease-out; transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast.t-reserva_ia { border-left: 4px solid #059669; }
.toast.t-reserva_fuera { border-left: 4px solid #7c3aed; }
.toast.t-nuevo { border-left: 4px solid var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .live-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toasts { top: 60px; left: 12px; right: 12px; max-width: none; }
}

/* --- Varias cuentas de Instagram */
.acc-chip { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ig-acc { border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.ig-acc > summary { display: flex; align-items: center; gap: 10px; list-style: none; }
.ig-acc > summary::before { display: none; }
.ig-acc > summary img { border-radius: 50%; }
.ig-acc-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--acc); flex: none; }
.ig-acc-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ig-acc-form { margin-top: 10px; }
.ig-add { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 12px; }
.ig-add summary { font-weight: 600; color: var(--accent); }
.ig-add ol { padding-left: 18px; }

/* --- Dinero */
.last-sale { display: flex; gap: 14px; align-items: center; text-decoration: none; border-left: 4px solid #059669; }
.ls-ico { font-size: 26px; }
b.money { color: #047857; }
.money-table td:first-child { max-width: 320px; }
.card.soon { background: var(--bg); border-style: dashed; box-shadow: none; }
.card.soon h2 { font-size: 15px; }
.live-tile.money { background: #ecfdf3; border-color: transparent; }
.live-tile.money b { color: #047857; }
.sound-btn { width: 34px; height: 34px; padding: 0; font-size: 15px; }
.sound-btn.off { opacity: .55; }
.ev-venta .ev-label { color: #047857; font-weight: 750; }
.toast.t-venta { border-left: 4px solid #059669; font-weight: 600; }
@media (prefers-color-scheme: dark) { .live-tile.money { background: #0b2a1e; } .live-tile.money b, b.money { color: #6ee7b7; } }
