:root {
  --navy: #141C26; --navy-2: #1d2733; --slate: #3D4A5E; --lime: #E2DC54; --lime-2: #d2cb3c;
  --bg: #F8F7F3; --card: #ffffff; --line: #e6e3da; --line-2: #efede6; --ink: #141C26; --muted: #647084;
  --frio: #3f7bd1; --tibio: #d99a1e; --caliente: #d6453d; --ok: #2f9e62; --ia: #6b5bd6;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,28,38,.06), 0 4px 16px rgba(20,28,38,.05);
  --mono: "DejaVu Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cond: "DejaVu Sans Condensed", "Arial Narrow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--cond); letter-spacing: -.01em; margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--navy);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px); }
.login-card { width: 100%; max-width: 380px; background: var(--bg); border-radius: 16px; padding: 32px 28px; position: relative; }
.login-card::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: 11px; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--navy); display: grid; place-items: center; flex: none; }
.brand-text b { display: block; font-family: var(--cond); font-size: 17px; letter-spacing: .02em; }
.brand-text span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.login h1 { font-size: 26px; margin: 26px 0 4px; }
.login form { display: grid; gap: 12px; margin-top: 20px; }

/* ---------- Form ---------- */
label.f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--slate); }
label.f small { font-weight: 400; color: var(--muted); }
input.i, select.i, textarea.i { font-weight: 400; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; outline: none; transition: border .15s, box-shadow .15s; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--slate); box-shadow: 0 0 0 3px rgba(61,74,94,.12); }
textarea.i { resize: vertical; min-height: 80px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 13px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .15s, border .15s, transform .05s; text-decoration: none; }
.btn:hover { background: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--slate); }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--navy); }
.btn.lime:hover { background: var(--lime-2); }
.btn.danger { color: var(--caliente); }
.btn.sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: var(--caliente); font-size: 13px; min-height: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: grid; gap: 12px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd3da; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--navy); color: #cfd5de; display: flex; flex-direction: column; padding: 16px 12px; gap: 14px; overflow-y: auto;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px); }
.side .brand-text b { color: #fff; }
.side .brand-text span { color: #8e99aa; }
.side .brand-mark { background: #0d131a; border: 1px solid #2c3746; }
.tenant-pick { background: var(--navy-2); border: 1px solid #2c3746; color: #fff; border-radius: 9px; padding: 8px 10px; width: 100%; }
.tenant-pick option { color: #000; }
.side-label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7f8a9b; padding: 0 8px; margin-top: 4px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #cfd5de; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: var(--lime); color: var(--navy); font-weight: 700; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; font-size: 12px; color: #8e99aa; display: grid; gap: 6px; padding: 0 6px; }
.side-foot .btn { background: transparent; color: #cfd5de; border-color: #2c3746; }
.side-foot .btn:hover { background: rgba(255,255,255,.06); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--bg); min-height: 60px; }
.top h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top #topx { flex-wrap: nowrap; }
.top .sp { flex: 1; }
.menu-btn { display: none; }
.content { flex: 1; overflow-y: auto; padding: 22px; min-height: 0; }
.content.flush { padding: 0; overflow: hidden; display: flex; }
.demo-banner { background: #fff8d6; border-bottom: 1px solid #efe3a3; padding: 7px 22px; font-size: 12.5px; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--caliente); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--mono); }
.bell { position: relative; }
.bell .badge { position: absolute; top: -6px; right: -6px; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 15px; }
.card-b { padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .l { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi .v { font-family: var(--cond); font-size: 28px; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.alert { border-color: #f1c3bf; background: #fff6f5; }
.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.list { display: grid; }
.li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.li:last-child { border-bottom: 0; }
.li:hover { background: #fbfaf7; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.frio { color: var(--frio); background: #eaf1fb; }
.pill.tibio { color: #a8740c; background: #fcf3de; }
.pill.caliente { color: var(--caliente); background: #fceceb; }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; background: var(--line-2); color: var(--slate); white-space: nowrap; }
.tag.ia { background: #eeebfb; color: var(--ia); }
.tag.hum { background: #fceceb; color: var(--caliente); }
.tag.ok { background: #e6f5ec; color: var(--ok); }
.tag.lime { background: var(--lime); color: var(--navy); }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: 330px 1fr 320px; width: 100%; min-height: 0; }
.ib-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.ib-tools { padding: 12px; border-bottom: 1px solid var(--line-2); display: grid; gap: 9px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.ib-items { overflow-y: auto; flex: 1; }
.conv { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: start; }
.conv:hover { background: #fbfaf7; }
.conv.on { background: #f4f2ea; box-shadow: inset 3px 0 0 var(--lime-2); }
.conv.wait { background: #fff6f5; }
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; background: var(--slate); position: relative; }
.av i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.conv .n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .m { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .t { font-size: 11px; color: var(--muted); text-align: right; display: grid; gap: 4px; justify-items: end; }
.conv .tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #efeee8;
  background-image: radial-gradient(rgba(20,28,38,.035) 1px, transparent 1px); background-size: 14px 14px; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); min-height: 60px; }
.chat-h .who { min-width: 0; flex: 1; }
.chat-h .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { display: none; }
.handoff { margin: 10px 16px 0; padding: 10px 12px; border-radius: 10px; background: #fff1ef; border: 1px solid #f3c9c4; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.handoff b { color: var(--caliente); }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.b { max-width: min(78%, 560px); padding: 7px 10px 5px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.06); white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.b .meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.b.in { align-self: flex-start; background: #fff; border-top-left-radius: 3px; }
.b.out { align-self: flex-end; background: #e4f6d6; border-top-right-radius: 3px; }
.b.out.ai { background: #ecebfb; }
.b.out.fail { outline: 1px solid var(--caliente); }
.msgs > * { flex-shrink: 0; }
.b.sys { align-self: center; background: #fff8d6; font-size: 12px; max-width: 90%; text-align: center; color: #6a5b0c; }
.day { align-self: center; font-size: 11px; background: #fff; color: var(--muted); padding: 2px 10px; border-radius: 10px; margin: 8px 0; font-family: var(--mono); }
.composer { padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.composer .row { flex-wrap: nowrap; align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 140px; resize: none; }
.hint { font-size: 11.5px; color: var(--muted); }
.hint code { font-family: var(--mono); background: var(--line-2); padding: 0 4px; border-radius: 4px; }

.lead { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; min-height: 0; }
.lead section { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 10px; }
.lead h4 { margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.lead h4 .btn { margin-left: auto; }
.score { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.score i { display: block; height: 100%; background: linear-gradient(90deg, var(--frio), var(--tibio), var(--caliente)); }
.kv { display: grid; grid-template-columns: 82px 1fr; gap: 6px 10px; align-items: center; font-size: 13px; }
.kv > span { color: var(--muted); font-size: 12px; }
.kv input, .kv select { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 6px; width: 100%; }
.kv input:hover, .kv select:hover { border-color: var(--line); }
.kv input:focus, .kv select:focus { border-color: var(--slate); background: #fff; outline: none; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 4px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on.frio { background: var(--frio); color: #fff; }
.seg button.on.tibio { background: var(--tibio); color: #fff; }
.seg button.on.caliente { background: var(--caliente); color: #fff; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.actions .btn { white-space: normal; min-width: 0; text-align: center; line-height: 1.2; }
.mini { font-size: 13px; display: grid; gap: 6px; }
.mini .it { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; }
.summary { font-size: 13px; background: #f7f6fd; border: 1px solid #e5e2f8; border-radius: 9px; padding: 9px 11px; }

/* ---------- Pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; height: 100%; }
.col { background: #efede6; border-radius: 12px; display: flex; flex-direction: column; min-height: 200px; max-height: 100%; }
.col-h { padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.col-h .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.col-h .sum { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.col-b { padding: 0 8px 8px; display: grid; gap: 8px; align-content: start; overflow-y: auto; flex: 1; }
.col.drop { outline: 2px dashed var(--slate); outline-offset: -4px; }
.kcard { background: #fff; border-radius: 10px; padding: 10px 11px; border: 1px solid var(--line); cursor: grab; display: grid; gap: 6px; }
.kcard:hover { border-color: #cfcabb; }
.kcard .n { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.kcard .x { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fbfaf7; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* ---------- Tasks ---------- */
.tgroup h3 { font-size: 14px; margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.task { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; }
.task .tt { flex: 1; min-width: 0; }
.task .when { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.task .when.late { color: var(--caliente); font-weight: 700; }

/* ---------- Modal / toasts / dropdown ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,28,38,.45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: var(--bg); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 720px; }
.modal-h { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 17px; flex: 1; }
.modal-b { padding: 18px; display: grid; gap: 12px; }
.modal-f { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); width: 340px; max-width: 100%; cursor: pointer; animation: slide .2s; border-left: 4px solid var(--lime); }
.toast.humano { border-left-color: var(--caliente); }
.toast b { display: block; }
.toast span { font-size: 12.5px; color: #c7ceda; }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
.drop-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.15); z-index: 40; max-height: 70vh; overflow-y: auto; }
.al { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.al:hover { background: #fbfaf7; }
.al.unread { background: #fffdf0; }
.al .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--slate); }
.al .dot.humano { background: var(--caliente); } .al .dot.caliente { background: var(--tibio); } .al .dot.venta { background: var(--ok); } .al .dot.tarea { background: var(--frio); }

/* ---------- Simulator ---------- */
.sim { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; height: 100%; }
.phone { border-radius: 26px; border: 8px solid var(--navy); overflow: hidden; display: flex; flex-direction: column; min-height: 520px; max-height: 100%; background: #efeee8; }
.phone .chat-h { background: #1f5c4a; color: #fff; border: 0; }
.qr { width: 240px; height: 240px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.qr img { width: 100%; height: 100%; }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--navy); color: var(--lime); padding: 9px 11px; border-radius: 8px; word-break: break-all; }
.chart { width: 100%; height: 150px; display: block; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 4px; }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .inbox { grid-template-columns: 300px 1fr; }
  .inbox .lead { display: none; }
  .inbox.show-lead .lead { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 100vw); z-index: 30; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 45; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 12px; gap: 6px; }
  .top h1 { font-size: 17px; }
  .top .btn.sm { padding: 5px 8px; }
  .content { padding: 16px; }
  .inbox { grid-template-columns: 1fr; }
  .inbox .chat { display: none; }
  .inbox.open .ib-list { display: none; }
  .inbox.open .chat { display: flex; }
  .back { display: inline-flex; }
  .grid2 { grid-template-columns: 1fr; }
  .sim { grid-template-columns: 1fr; }
  .b { max-width: 88%; }
  .hide-m { display: none; }
}

/* ============ ACTC Registros ============ */
.rtabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.rtabs a { padding: 9px 14px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.rtabs a:hover { color: var(--ink); }
.rtabs a.on { color: var(--ink); border-bottom-color: var(--lime); }
.rfil label.f { min-width: 150px; }
.plan { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.plan th { position: sticky; top: 0; background: var(--navy); color: #fff; font: 600 10.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 9px 8px; text-align: left; white-space: nowrap; }
.plan td { padding: 7px 8px; border-top: 1px solid var(--line-2); white-space: nowrap; }
.plan td.w { white-space: normal; min-width: 180px; max-width: 320px; }
.plan .n { text-align: right; font-variant-numeric: tabular-nums; }
.plan tbody tr { cursor: pointer; }
.plan tbody tr:hover td { background: #fbfaf5; }
.plan tr.labor td { background: #f3faf5; }
.plan tr.labor td.prod { background: #1f9d55; color: #fff; font-weight: 600; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 12px; }
.rgrid .span2 { grid-column: span 2; }
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.eqc { padding: 14px 16px; display: grid; gap: 4px; }
.eqc.off { opacity: .55; }
.eqc dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0; font-size: 12.5px; }
.eqc dt { color: var(--muted); }
.eqc dd { margin: 0; text-align: right; font-weight: 600; }
.wa-burbuja { white-space: pre-wrap; background: #dcf8c6; border-radius: 10px; padding: 12px 14px; max-width: 560px; font-size: 14px; }
@media (max-width: 760px) { .rgrid .span2 { grid-column: auto; } }

/* ============ Chat de carga (ACTC Registros) ============ */
.content.regchat-wrap { display: flex; flex-direction: column; padding: 0; overflow: hidden; background: #efeee8; }
.regchat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.rc-b { max-width: min(82%, 600px); padding: 9px 12px 6px; border-radius: 12px; box-shadow: 0 1px 1px rgba(0,0,0,.06); font-size: 14.5px; word-wrap: break-word; }
.rc-b > div:first-child { white-space: pre-wrap; }
.rc-b.yo { align-self: flex-end; background: #dcf8c6; border-top-right-radius: 3px; }
.rc-b.bot { align-self: flex-start; background: #fff; border-top-left-radius: 3px; }
.rc-b.err { background: #fff1ef; }
.rc-b.pend { opacity: .8; }
.rc-meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; white-space: normal; }
.rc-trans { font-size: 13px; color: var(--slate); margin-top: 4px; }
.rc-acc { margin-top: 4px; }
.rc-img, .regchat-foto img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; }
.regchat-comp { display: flex; gap: 6px; align-items: flex-end; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.regchat-comp textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; border-radius: 21px; padding: 10px 14px; line-height: 1.35; }
.rc-ico { width: 42px; height: 42px; padding: 0; border-radius: 50%; flex: none; }
.regchat-rec { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.regchat-rec .muted { flex: 1; font-size: 12.5px; min-width: 140px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--caliente); animation: latido 1s infinite; }
@keyframes latido { 50% { opacity: .3; } }
.regchat-foto { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #fff; border-top: 1px solid var(--line); }
.regchat-foto img { max-width: 70px; max-height: 70px; }
.regchat-red { padding: 8px 14px; font-size: 13px; background: #fff8d6; border-bottom: 1px solid #efe3a3; }
.regchat-red.off { background: #fff1ef; border-bottom-color: #f3c9c4; }
.regchat-tip { padding: 8px 12px; font-size: 12.5px; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 8px; }
.regchat-tip .btn { color: #fff; margin-left: auto; flex: none; }
.regchat-tip span { flex: 1; }

/* ============ Consumo de IA (ACTC) ============ */
.cbars { display: flex; align-items: flex-end; gap: 4px; height: 160px; }
.cbar { flex: 1; max-width: 46px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 8px; }
.cbar i { width: 100%; background: var(--navy); border-radius: 4px 4px 0 0; display: block; }
.cbar:hover i { background: var(--lime-2); }
.cbar span { font: 10px var(--mono); color: var(--muted); }
#ptab td, #ptab th { padding: 6px 5px; }
