/* NEXORA CRM — estilos específicos de módulos */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-3); font-weight: 600; }
.boot svg { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
.link-btn.left { text-align: left; }
.btn.disabled, label.btn.disabled { opacity: .5; pointer-events: none; }
.file-btn { cursor: pointer; }
.pre { white-space: pre-line; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.card-more { font-size: var(--fs-xs); font-weight: 600; }
.mini-progress { min-width: 110px; display: flex; flex-direction: column; gap: 3px; }
.mini-progress small, .sla-cell small { font-size: 11px; font-weight: 600; }
.sla-cell { min-width: 120px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Mini KPIs y vistas guardadas ---------- */
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: var(--sp-4); }
.mini-kpi { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-align: left; color: var(--text); min-width: 0; box-shadow: var(--shadow-xs); }
button.mini-kpi { transition: border-color var(--dur), box-shadow var(--dur); }
button.mini-kpi:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow-sm); }
.mini-kpi > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.mini-kpi strong { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-kpi small { font-size: 11.5px; color: var(--text-3); }
.saved-views { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; color: var(--amber-text); }
.sv-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; overflow: hidden; }
.sv-chip > button { border: 0; background: none; padding: 4px 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.sv-chip.active { border-color: var(--warning); background: var(--warning-50); }
.sv-chip .sv-x { padding: 4px 7px 4px 0; color: var(--text-3); }
.kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-btn { text-align: left; font: inherit; cursor: pointer; }
.kpi-btn:disabled { cursor: default; }

/* ---------- Puntaje de leads ---------- */
.score { display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 8px; border-radius: 7px; font-weight: 750; font-size: 13px; font-variant-numeric: tabular-nums; cursor: help; }
.score small { font-size: 10px; font-weight: 700; opacity: .8; }
.score-a { background: var(--success-50); color: var(--green-text); }
.score-b { background: var(--warning-50); color: var(--amber-text); }
.score-c { background: var(--surface-3); color: var(--gray-text); }
.score-big { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.score-big > strong { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score-big.score-a > strong { color: var(--success); } .score-big.score-b > strong { color: var(--warning); } .score-big.score-c > strong { color: var(--text-3); }
.score-big span { display: flex; flex-direction: column; }
.score-big small { color: var(--text-3); font-size: var(--fs-xs); }
.criteria { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.criteria li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); padding: 3px 0; }
.criteria li span { flex: 1; }
.criteria li b { font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.criteria li.hit { color: var(--text); } .criteria li.hit .ico { color: var(--success); }
.criteria li.miss b { color: var(--red-text); } .criteria li.hit b { color: var(--green-text); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); transition: all var(--dur); }
.qa .ico { color: var(--primary); }
.qa:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-50); color: var(--blue-text); }
.qa:disabled { opacity: .5; cursor: not-allowed; }
.steps-mini { margin: 0 0 14px; padding-left: 18px; font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- Actividades ---------- */
.act-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: all var(--dur); }
button.act-check:hover { border-color: var(--success); background: var(--success-50); }
.act-check.checked { background: var(--success); border-color: var(--success); color: #fff; }
.act-open { background: none; border: 0; padding: 0; text-align: left; color: inherit; min-width: 0; }
.act-open:hover strong { color: var(--primary); }
.list-item.done .grow strong { text-decoration: line-through; color: var(--text-3); }

/* ---------- Contactos / empresas ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 4px 18px 18px; }
.contact-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: center; background: var(--surface); transition: box-shadow var(--dur), transform var(--dur); }
.contact-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cc-main { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); text-decoration: none !important; }
.cc-main strong { margin-top: 6px; }
.cc-main small { color: var(--text-3); font-size: var(--fs-xs); }
.cc-co { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--blue-text); font-weight: 600; }
.cc-tags { min-height: 24px; margin: 8px 0; }
.cc-actions { display: flex; justify-content: center; gap: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.profile-hero { overflow: hidden; }
.ph-main { display: flex; align-items: center; gap: 18px; padding: 20px; flex-wrap: wrap; background: var(--gradient-soft); }
.ph-info { flex: 1; min-width: 220px; }
.ph-info h2 { font-size: 21px; }
.ph-info p { color: var(--text-2); margin: 4px 0 8px; }
.ph-contact { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.ph-contact a, .ph-contact span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.ph-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.company-mini { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.company-mini span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.company-mini small { color: var(--text-3); font-size: var(--fs-xs); }
.co-logo { --av: #2563EB; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 12px; background: color-mix(in srgb, var(--av) 14%, var(--surface)); color: var(--av); flex-shrink: 0; }
.conv-mini { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.bubble-mini { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: var(--fs-sm); margin: 8px 0 0; }
.bubble-mini.in { background: var(--surface-3); }
.bubble-mini.out { background: var(--primary-50); margin-left: auto; }
.bubble-mini time { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.tab-body { min-height: 120px; }

/* ---------- Oportunidades ---------- */
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; }
.risk { display: inline-flex; vertical-align: middle; margin-left: 6px; cursor: help; }
.risk-high { color: var(--danger); } .risk-medium { color: var(--warning); }
.stagebar { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; }
.stagebar li { flex: 1; min-width: 92px; }
.stagebar button { width: 100%; height: 46px; border: 0; background: var(--surface-3); color: var(--text-3); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); padding: 0 14px; transition: background var(--dur); }
.stagebar li:first-child button { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.stagebar li:last-child button { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); border-radius: 0 8px 8px 0; }
.stagebar button small { font-size: 10.5px; opacity: .8; }
.stagebar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stagebar button:not(:disabled):hover { background: var(--primary-100); color: var(--blue-text); }
.stagebar li.done button { background: color-mix(in srgb, var(--primary) 22%, var(--surface)); color: var(--blue-text); }
.stagebar li.current button { background: var(--primary); color: #fff; }
.stagebar li.current.st-won button { background: var(--success); }
.stagebar li.current.st-lost button { background: var(--danger); }
.stagebar button:disabled { cursor: default; }
.reasons { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.reasons li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-sm); color: var(--amber-text); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 130px 150px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); align-items: start; }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--text-3); font-size: var(--fs-xs); }
.stage-picker { display: grid; gap: 6px; }
.stage-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: left; }
.stage-opt span { flex: 1; font-weight: 600; }
.stage-opt small { color: var(--text-3); }
.stage-opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-50); }
.stage-opt:disabled { opacity: .55; }

/* ---------- Kanban ---------- */
.pipe-toolbar { margin-bottom: var(--sp-4); }
.pipe-toolbar .filters { margin-bottom: 12px; }
.pipe-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.kcol { background: var(--surface-3); border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 290px); min-height: 220px; scroll-snap-align: start; border-top: 3px solid var(--col); }
:root[data-theme="dark"] .kcol { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.kcol-head { padding: 12px 12px 8px; }
.kcol-head strong { font-size: var(--fs-sm); }
.kcount { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--surface); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.kcol-meta { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-3); margin-top: 4px; font-weight: 600; }
.kcol-body { flex: 1; overflow-y: auto; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; border-radius: 0 0 14px 14px; transition: background var(--dur), box-shadow var(--dur); min-height: 80px; }
.kcol-body.drop-over { background: color-mix(in srgb, var(--col) 12%, transparent); box-shadow: inset 0 0 0 2px var(--col); }
.kanban.is-dragging .kcol-body { outline: 1px dashed var(--border-strong); outline-offset: -4px; }
.kempty { text-align: center; color: var(--text-3); font-size: var(--fs-xs); padding: 20px 6px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.kmore { text-align: center; font-size: var(--fs-xs); font-weight: 600; padding: 6px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 11px; padding: 10px 11px; box-shadow: var(--shadow-xs); cursor: grab; transition: box-shadow var(--dur), transform var(--dur), opacity var(--dur); }
.kcard:hover { box-shadow: var(--shadow-md); }
.kcard:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard.prio-b-alta { border-left-color: var(--danger); } .kcard.prio-b-media { border-left-color: var(--warning); } .kcard.prio-b-baja { border-left-color: var(--border-strong); }
.kcard.at-risk { background: linear-gradient(0deg, var(--danger-50), var(--danger-50)), var(--surface); }
.kcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.kcard-title { font-weight: 650; font-size: 13.5px; color: var(--text); line-height: 1.3; }
.kmove { margin: -4px -6px 0 0; }
.kcard-co { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--text-3); margin: 3px 0 6px; }
.kcard-val { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kcard-meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--text-3); margin: 6px 0; flex-wrap: wrap; }
.kcard-meta span { display: inline-flex; align-items: center; gap: 3px; }
.kprob { font-weight: 700; color: var(--blue-text); }
.kcard-foot { display: flex; align-items: center; gap: 6px; padding-top: 7px; border-top: 1px solid var(--border); }

/* ---------- Calendario ---------- */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-title { font-size: 18px; margin-left: 6px; text-transform: capitalize; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-month { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-wd span { padding: 8px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; text-align: center; }
.cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; transition: background var(--dur); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-daynum { color: var(--text-3); opacity: .6; }
.cal-cell.drop-over, .cal-slot.drop-over { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-daynum { align-self: flex-end; width: 26px; height: 26px; border-radius: 50%; border: 0; background: none; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cal-daynum:hover { background: var(--surface-3); }
.cal-cell.today .cal-daynum { background: var(--primary); color: #fff; }
.cal-ev { --ev: #2563EB; display: flex; gap: 4px; align-items: center; width: 100%; padding: 2px 6px; border: 0; border-left: 3px solid var(--ev); border-radius: 5px; background: color-mix(in srgb, var(--ev) 12%, var(--surface)); color: var(--text); font-size: 11.5px; text-align: left; overflow: hidden; cursor: pointer; }
.cal-ev:hover { background: color-mix(in srgb, var(--ev) 22%, var(--surface)); }
.cal-ev.done { opacity: .55; } .cal-ev.done .cal-ev-title { text-decoration: line-through; }
.cal-ev.late { box-shadow: inset 0 0 0 1px var(--danger); }
.cal-ev-time { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cal-ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { border: 0; background: none; font-size: 11px; color: var(--primary); font-weight: 600; text-align: left; padding: 0 4px; }
.cal-grid-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(110px, 1fr)); min-width: 100%; }
.cal-day { min-width: 0; }
.cal-gh { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 6px; text-align: center; z-index: 1; }
.cal-gh button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; margin: 0 auto; color: var(--text-2); }
.cal-gh small { font-size: 11px; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.cal-gh strong { font-size: 17px; }
.cal-gh.today strong { color: var(--primary); }
.cal-hour { font-size: 11px; color: var(--text-3); padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: right; }
.cal-slot { min-height: 52px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.cal-slot:hover { background: var(--surface-2); }

/* ---------- Interruptor ---------- */
.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: var(--border-strong); transition: background var(--dur); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.switch input:disabled + span { opacity: .5; }

/* ---------- Cotizaciones ---------- */
.items-table input { min-height: 34px; padding: 6px 8px; }
.items-table td { vertical-align: top; }
.in-num { width: 74px; text-align: right; }
.in-money { width: 130px; text-align: right; }
input.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.2) !important; }
.items-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.items-add select { max-width: 360px; }
.totals { margin-left: auto; max-width: 340px; display: grid; gap: 4px; font-size: var(--fs-sm); padding-top: 8px; }
.totals > div { display: flex; justify-content: space-between; gap: 20px; }
.totals > div span { color: var(--text-3); }
.totals .grand { font-size: 17px; border-top: 2px solid var(--text); padding-top: 6px; margin-top: 4px; }
.totals .grand span { color: var(--text); font-weight: 700; }
.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.quote-preview-wrap { position: sticky; top: 0; }
.preview-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.quote-doc { background: #fff; color: #0F172A; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 34px 36px; font-size: 12.5px; line-height: 1.5; }
.quote-doc h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #64748B; margin: 0 0 6px; }
.qd-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 3px solid #2563EB; flex-wrap: wrap; }
.qd-brand { display: flex; gap: 12px; align-items: flex-start; }
.qd-brand strong { font-size: 15px; display: block; color: #0F172A; }
.qd-brand small { color: #64748B; font-size: 11px; line-height: 1.5; }
.qd-logo { width: 46px; height: 46px; object-fit: contain; }
.qd-num { text-align: right; }
.qd-num span { display: block; font-size: 11px; letter-spacing: .14em; color: #7C3AED; font-weight: 800; }
.qd-num strong { display: block; font-size: 20px; color: #172554; }
.qd-num small { color: #64748B; }
.qd-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.qd-parties p { margin: 4px 0 0; color: #334155; }
.qd-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.qd-table th { background: #F1F5F9; color: #334155; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px; text-align: left; border-bottom: 1px solid #CBD5E1; }
.qd-table td { padding: 8px; border-bottom: 1px solid #E2E8F0; color: #0F172A; }
.qd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.qd-sum { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-top: 18px; }
.qd-terms p { color: #334155; font-size: 11.5px; }
.qd-totals > div { display: flex; justify-content: space-between; padding: 4px 0; color: #334155; font-variant-numeric: tabular-nums; }
.qd-totals .grand { border-top: 2px solid #0F172A; margin-top: 4px; padding-top: 8px; font-size: 16px; font-weight: 800; color: #0F172A; }
.qd-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid #E2E8F0; color: #64748B; font-size: 11px; }
.qd-disclaimer { font-size: 10px; color: #94A3B8; margin-top: 6px; }

/* ---------- Dashboard ---------- */
.dash-filters { margin-bottom: var(--sp-4); }
.dash-filters .card-body { padding: 12px 16px; margin: 0; }
.dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-summary .card-title .ico { color: var(--violet); }
.ai-summary p { font-size: 14.5px; line-height: 1.65; color: var(--text-2); margin: 10px 0 12px; max-width: 1100px; }

/* ---------- Notificaciones ---------- */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; border-radius: 8px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--primary-50); }
.notif-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; color: var(--text); text-decoration: none !important; }
.notif-body strong { font-size: var(--fs-sm); }
.notif-body span { font-size: var(--fs-xs); color: var(--text-2); }
.notif-body time { font-size: 11px; color: var(--text-3); }
.notif-page li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.notif-page li.unread { background: var(--primary-50); }
.notif-actions { display: flex; gap: 2px; }

/* ---------- Marketing ---------- */
.seg-cards, .form-cards, .landing-list, .team-grid, .terr-grid, .integ-grid, .role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--sp-4); }
.role-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.seg-card h3 { margin: 10px 0 6px; }
.seg-count { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.seg-count strong { font-size: 30px; font-weight: 800; color: var(--primary); }
.seg-count span { color: var(--text-3); font-size: var(--fs-xs); }
.seg-filters { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--text-2); }
.seg-filters li { display: flex; gap: 6px; align-items: center; }
.sb-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.sb-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.seg-preview { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--gradient-soft); }
.seg-preview strong { font-size: 26px; color: var(--primary); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tpl-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tpl-thumb { background: var(--surface-2); border-radius: 8px; padding: 12px; min-height: 120px; font-size: var(--fs-xs); border: 1px dashed var(--border); }
.tpl-thumb strong { display: block; margin-bottom: 6px; }
.tpl-thumb p { color: var(--text-3); }
details.hist { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
details.hist summary { cursor: pointer; font-size: var(--fs-sm); }
details.hist[open] summary { margin-bottom: 10px; }
.email-editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.email-prev { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; color: #0F172A; }
.ep-head { padding: 12px 14px; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; display: flex; flex-direction: column; gap: 2px; }
.ep-head small { color: #64748B; font-size: 11px; }
.ep-head strong { font-size: 14px; margin-top: 4px; }
.ep-body { padding: 18px 16px; font-size: 13.5px; line-height: 1.6; min-height: 160px; }
.ep-foot { padding: 10px 16px; font-size: 10.5px; color: #94A3B8; border-top: 1px solid #E2E8F0; }

/* ---------- Formularios y landing ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
.fb-fields { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.fb-field { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.fb-order { display: flex; flex-direction: column; }
.fb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fb-main input { min-height: 32px; padding: 5px 8px; }
.fb-preview { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); max-height: 70vh; overflow-y: auto; }
.consent { align-items: flex-start; font-size: var(--fs-xs); color: var(--text-2); }
.landing { background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
.landing-copy h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 14px 0; letter-spacing: -.03em; }
.landing-copy .lead { font-size: 17px; color: var(--text-2); max-width: 520px; }
.bullets { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.bullets li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.bullets .ico { color: var(--accent); }
.landing-proof { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.landing-proof div { display: flex; flex-direction: column; }
.landing-proof strong { font-size: 26px; font-weight: 800; color: var(--accent); }
.landing-proof span { font-size: var(--fs-xs); color: var(--text-3); }
.landing-card { box-shadow: var(--shadow-lg); }
.landing-card h2 { font-size: 20px; }
.pf-done { text-align: center; padding: 24px 6px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--success-50); color: var(--success); display: flex; align-items: center; justify-content: center; }
.lp-thumb { --accent: #2563EB; height: 130px; border-radius: 14px 14px 0 0; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #000), var(--accent)); color: #fff; padding: 18px; display: flex; justify-content: space-between; gap: 12px; }
.lp-thumb div { display: flex; flex-direction: column; gap: 4px; max-width: 65%; }
.lp-thumb strong { font-size: 15px; line-height: 1.2; }
.lp-thumb small { opacity: .85; font-size: 11px; }
.lp-form { width: 70px; border-radius: 8px; background: rgba(255,255,255,.85); }
.landing-item .card-body h3 { font-size: 15px; }

/* ---------- Automatizaciones ---------- */
.rule-card { margin-bottom: var(--sp-4); }
.rule-card.inactive { opacity: .72; }
.rule-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rule-head h3 { font-size: 15px; }
.rule-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.flow { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.flow-block { flex: 1; min-width: 200px; border-radius: 12px; padding: 10px 12px; font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid; }
.flow-block ul { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 4px; }
.flow-block li { display: flex; gap: 6px; align-items: flex-start; }
.flow-block.when { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.flow-block.if { background: var(--warning-50); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.flow-block.then { background: var(--success-50); border-color: color-mix(in srgb, var(--success) 35%, transparent); flex: 1.5; }
.flow-tag { font-size: 10px; font-weight: 800; letter-spacing: .1em; padding: 2px 7px; border-radius: 5px; background: var(--surface); color: var(--text-2); width: max-content; }
.flow-arrow { display: flex; align-items: center; color: var(--text-3); }
.catalog { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.catalog li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.catalog li span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.catalog li small { color: var(--text-3); font-size: var(--fs-xs); }
.catalog li.na { opacity: .62; }
.steps-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.steps-log li { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.flow-editor { display: flex; flex-direction: column; }
.fe-block { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fe-block header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-sm); }
.fe-block.when { background: var(--primary-50); } .fe-block.if { background: var(--warning-50); } .fe-block.then { background: var(--success-50); }
.fe-arrow { display: flex; justify-content: center; color: var(--text-3); padding: 4px 0; }
.fe-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fe-row > select, .fe-row > input { flex: 1; min-width: 140px; }
.fe-action { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); display: grid; gap: 8px; }
.fe-params { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); min-width: 120px; flex: 1; }
.mini-field input, .mini-field select { min-height: 34px; padding: 6px 9px; }

/* ---------- Secuencias ---------- */
.seq-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; }
.seq-item .grow { display: flex; flex-direction: column; }
.seq-item small { color: var(--text-3); font-size: var(--fs-xs); }
.seq-item.active { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-50); }
.seq-steps { list-style: none; margin: 10px 0 0; padding: 0; position: relative; }
.seq-steps::before { content: ""; position: absolute; left: 50px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.seq-steps li { display: flex; gap: 10px; align-items: center; padding: 8px 0; position: relative; }
.seq-steps li span:last-child { display: flex; flex-direction: column; }
.seq-steps small { color: var(--text-3); font-size: var(--fs-xs); }
.seq-day { width: 44px; font-size: 11px; font-weight: 700; color: var(--violet-text); text-align: right; }

/* ---------- Bandeja omnicanal ---------- */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr) 290px; height: calc(100vh - 210px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs); }
.ib-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.ib-tools { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.ib-tools .search-inline { position: relative; }
.ib-tools .search-inline input { width: 100%; padding-left: 34px; min-height: 36px; }
.ib-tools .search-inline .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.ib-tools .seg { width: 100%; } .ib-tools .seg-btn { flex: 1; justify-content: center; padding: 0 6px; }
.ib-chips { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ib-items { flex: 1; overflow-y: auto; }
.ib-item { display: flex; gap: 10px; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; position: relative; color: var(--text); }
.ib-item:hover { background: var(--surface-2); }
.ib-item.active { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
.ib-item.unread strong { font-weight: 800; }
.ib-av { position: relative; flex-shrink: 0; }
.ib-ch { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid var(--surface); background: var(--text-3); }
.ch-whatsapp { background: #16A34A; } .ch-correo { background: #2563EB; } .ch-chat-web { background: #7C3AED; } .ch-sms { background: #F59E0B; } .ch-llamada { background: #0891B2; }
.ib-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ib-txt strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-txt time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ib-subj { font-size: 11.5px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-snip { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-dot { position: absolute; right: 12px; bottom: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.ib-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ib-head .grow { display: flex; flex-direction: column; min-width: 120px; }
.ib-head small { color: var(--text-3); font-size: var(--fs-xs); display: inline-flex; gap: 4px; align-items: center; }
.ib-head select { max-width: 170px; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.ib-day { text-align: center; margin: 8px 0; }
.ib-day span { font-size: 11px; color: var(--text-3); background: var(--surface); padding: 3px 10px; border-radius: 10px; border: 1px solid var(--border); }
.bubble { max-width: 72%; padding: 10px 13px; border-radius: 14px; font-size: var(--fs-sm); box-shadow: var(--shadow-xs); }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.in { background: var(--surface); border-bottom-left-radius: 4px; align-self: flex-start; border: 1px solid var(--border); }
.bubble.out { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.bubble.sys { align-self: center; background: var(--warning-50); color: var(--amber-text); font-size: var(--fs-xs); }
.b-meta { display: flex; align-items: center; gap: 3px; justify-content: flex-end; font-size: 10.5px; opacity: .75; margin-top: 4px; }
.ib-compose { border-top: 1px solid var(--border); padding: 8px 12px 10px; display: grid; gap: 6px; }
.ib-compose-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.ib-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.ib-compose-row textarea { min-height: 52px; resize: none; }
.ib-info { border-left: 1px solid var(--border); padding: 14px; overflow-y: auto; min-height: 0; }
.ib-info-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ib-profile { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; margin-bottom: 12px; }
.ib-profile small { color: var(--text-3); font-size: var(--fs-xs); }
.mini-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: var(--fs-xs); color: var(--text); text-decoration: none !important; width: 100%; }
.mini-link:hover { background: var(--surface-3); }
.mini-link span { display: inline-flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tickets ---------- */
.thread { display: grid; gap: 12px; }
.msg { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.msg p { margin: 8px 0 0; white-space: pre-wrap; font-size: var(--fs-sm); }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); }
.msg-head time { margin-left: auto; font-size: 11px; color: var(--text-3); }
.msg-customer { background: var(--surface-2); }
.msg-reply { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.msg-internal { background: var(--warning-50); border-color: color-mix(in srgb, var(--warning) 35%, transparent); border-style: dashed; }
.t-compose { margin-top: 16px; display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.sla-big { display: flex; flex-direction: column; margin-bottom: 8px; }
.sla-big strong { font-size: 22px; }
.sla-big span { color: var(--text-3); font-size: var(--fs-sm); }
.sla-ok strong, .sla-met strong { color: var(--success); } .sla-risk strong { color: var(--warning); } .sla-breached strong, .sla-missed strong { color: var(--danger); }

/* ---------- Base de conocimiento ---------- */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.kb-card h3 { font-size: 14.5px; margin-top: 4px; }
.kb-card h3 a { color: var(--text); }
.kb-title { text-align: left; font-size: 14.5px; color: var(--text); }
.article p { font-size: 15px; line-height: 1.7; color: var(--text-2); margin-bottom: 12px; }
.article h1 { font-size: 26px; margin-bottom: 4px; }
.help-hero { text-align: center; padding: clamp(24px, 6vw, 64px) 0 30px; }
.help-hero h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 18px; }
.help-search { display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow-md); }
.help-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; flex: 1; min-width: 0; }
.help-search > .ico { color: var(--text-3); }
.help-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.help-cats h2 { margin-bottom: 8px; }
.help-article-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; margin-top: 10px; }
.helpful { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: var(--fs-sm); }

/* ---------- Encuestas ---------- */
.survey-wrap { max-width: 720px; }
.survey-card h1 { font-size: 22px; margin: 6px 0 10px; }
.survey-card .ico.text-green { color: var(--success); }
.rating { border: 0; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rate-opt input, .nps-opt input { position: absolute; opacity: 0; }
.rate-opt span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; text-align: center; transition: all var(--dur); }
.rate-opt b { font-size: 22px; }
.rate-opt small { font-size: 11px; color: var(--text-3); }
.rate-opt input:checked + span { border-color: var(--primary); background: var(--primary-50); box-shadow: var(--ring); }
.rate-opt input:focus-visible + span, .nps-opt input:focus-visible + span { box-shadow: var(--ring); }
.nps-scale { border: 0; padding: 0; margin: 16px 0 6px; display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; }
.nps-opt span { display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--border); border-radius: 9px; font-weight: 700; cursor: pointer; }
.nps-opt:nth-child(-n+7) input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.nps-opt:nth-child(n+8):nth-child(-n+9) input:checked + span { background: var(--warning); border-color: var(--warning); color: #fff; }
.nps-opt:nth-child(n+10) input:checked + span { background: var(--success); border-color: var(--success); color: #fff; }

/* ---------- Customer success ---------- */
.health-dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.h-alto { background: var(--danger-50); color: var(--red-text); } .h-medio { background: var(--warning-50); color: var(--amber-text); } .h-bajo { background: var(--success-50); color: var(--green-text); }
.health-big { display: flex; align-items: baseline; gap: 10px; padding: 14px; border-radius: 12px; margin-bottom: 10px; }
.health-big strong { font-size: 42px; font-weight: 800; }

/* ---------- Forecast ---------- */
.scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.scenario .card-body { display: grid; gap: 8px; }
.scenario strong { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.scenario small { font-weight: 600; }
.assumptions { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- Asistente ---------- */
.ai-chat { display: flex; flex-direction: column; gap: 10px; height: 100%; }
#aiBox { height: 100%; }
.drawer-body #aiBox .ai-chat { height: calc(100dvh - 120px); }
.ai-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; min-height: 200px; }
.ai-page .ai-msgs { max-height: 560px; }
.ai-welcome { text-align: center; padding: 20px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ai-avatar { width: 28px; height: 28px; border-radius: 9px; background: var(--gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-avatar.lg { width: 52px; height: 52px; border-radius: 16px; }
.ai-q { align-self: flex-end; background: var(--primary); color: #fff; padding: 9px 13px; border-radius: 14px 14px 4px 14px; max-width: 85%; font-size: var(--fs-sm); }
.ai-a { display: flex; gap: 8px; align-items: flex-start; }
.ai-answer { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 12px; font-size: var(--fs-sm); flex: 1; min-width: 0; }
.ai-answer > p { margin-bottom: 8px; line-height: 1.55; }
.ai-items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.ai-items a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.ai-items a:hover { border-color: var(--primary); }
.ai-items .grow { display: flex; flex-direction: column; min-width: 0; }
.ai-items strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-items small { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-items b { font-size: 12px; white-space: nowrap; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips .chip { height: auto; min-height: 28px; white-space: normal; text-align: left; padding: 5px 10px; }
.ai-why { margin-top: 8px; font-size: var(--fs-xs); color: var(--text-3); }
.ai-why summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--violet-text); }
.ai-why ul { margin: 6px 0 0; padding-left: 18px; }
.ai-form { display: flex; gap: 8px; }
.ai-form input { flex: 1; }
.ai-note { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; margin: 0; }

/* ---------- Admin y configuración ---------- */
.avatar-stack { display: flex; }
.avatar-stack > span { margin-left: -8px; } .avatar-stack > span:first-child { margin-left: 0; }
.avatar-stack .avatar { border: 2px solid var(--surface); }
.perm-table th, .perm-table td { padding: 6px 4px; font-size: 11.5px; }
.perm-table td:first-child, .perm-table th:first-child { padding-left: 14px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.perm-table thead tr:first-child th { border-bottom: 0; }
.perm-table tbody td:nth-child(5n+2) { border-left: 1px solid var(--border); }
.terr-card { border-top: 3px solid var(--terr); }
.terr-card h3 { display: flex; align-items: center; gap: 6px; }
.cf-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cf-row .grow { display: flex; flex-direction: column; }
.cf-row small { font-size: var(--fs-xs); color: var(--text-3); }
.stage-flow { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.stage-chip { --sc: #2563EB; min-width: 140px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--sc) 10%, var(--surface)); border-left: 4px solid var(--sc); display: flex; flex-direction: column; }
.stage-chip small { color: var(--text-3); font-size: 11px; }
.stage-edit { padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.stage-edit input[type="color"] { width: 40px; height: 34px; }
.integ-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--gradient-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.integ h3 { margin: 12px 0 4px; }
.integ p { min-height: 40px; }
.logo-prev { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.diag { list-style: none; margin: 0; padding: 0; }
.diag li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); }
.diag li small { color: var(--text-3); text-align: right; }
.diag li.ok > .ico { color: var(--success); } .diag li.fail > .ico { color: var(--danger); } .diag li.fail { color: var(--red-text); }
.user-switch { display: grid; gap: 4px; }
.user-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: left; width: 100%; }
.user-option span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.user-option small { color: var(--text-3); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-option:hover { border-color: var(--primary); background: var(--primary-50); }
.user-option.current { border-color: var(--primary); }
.quote-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 1560px) { .quote-layout { grid-template-columns: minmax(0, 1fr); } .quote-preview-wrap { position: static; max-width: 900px; } }
.items-table td:first-child { min-width: 200px; }
.items-table .in-num { width: 70px; }
.ai-chat, .ai-msgs, .ai-a, .ai-answer, .ai-items, .ai-items li { min-width: 0; }
.ai-items a { min-width: 0; overflow: hidden; }
.quote-doc { overflow-x: auto; }
@media (max-width: 480px) { .qd-table { font-size: 10.5px; } .qd-table th, .qd-table td { padding: 5px 4px; } }
.scenario .badge { justify-self: start; }
