:root {
  color-scheme: light;
  --ink:#142f36;
  --petrol:#10353e;
  --muted:#52676d;
  --quiet:#65777d;
  --line:#e1ebe7;
  --soft:#f3f7f6;
  --paper:#fff;
  --green:#059669;
  --green-deep:#087657;
  --green-soft:#e7f8ef;
  --shadow:0 12px 32px #163b3210;
  --radius:14px;
  font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*,*::before,*::after {box-sizing:border-box}
body {margin:0;color:var(--ink);background:#f5f8f7}
button,input,select,textarea {font:inherit;color:inherit}
button {cursor:pointer}
button:disabled {cursor:default;opacity:.45}
a {color:inherit;text-decoration:none}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible {
  outline:2px solid var(--green);outline-offset:3px
}
[hidden] {display:none!important}
h1,h2,h3,p,dl,dd {margin:0}
p {overflow-wrap:anywhere}
small {font-size:.82rem;color:var(--muted)}
.icon {width:19px;height:19px;flex:none;vertical-align:middle}
.btn {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 13px;
  border:1px solid #dce7e3;border-radius:9px;background:white;color:var(--petrol);font-weight:650;font-size:.88rem;line-height:1.3;text-align:center;
  transition:background .15s,border .15s,box-shadow .15s}
.btn:hover {background:#f1f7f4;border-color:#bcd6cc}
.btn.primary {background:var(--green-deep);border-color:var(--green-deep);color:#fff}
.btn.primary:hover {background:#076448;border-color:#076448;box-shadow:0 3px 10px #057a5529}
.btn.danger {color:#a02b36;border-color:#f1d4d9}
.btn.danger:hover {background:#fff0f1}
.btn.large {min-height:48px;padding:12px 18px;font-size:1rem}
.btn.small {min-height:31px;padding:6px 9px;font-size:.8rem}
.btn.small .icon {width:15px;height:15px}
.icon-btn {display:inline-grid;place-items:center;flex:none;width:35px;height:35px;border:1px solid transparent;background:transparent;border-radius:8px}
.icon-btn:hover {background:#eaf2ee;color:var(--green-deep)}
.text-btn {padding:0;border:0;background:none;color:var(--green-deep);font-weight:700;text-align:left}
.text-btn:hover {text-decoration:underline}
.actions {display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.brand {display:inline-flex;align-items:center;gap:0;color:var(--petrol);font-size:1.58rem;line-height:1;font-weight:850;letter-spacing:-.065em;white-space:nowrap}
.brand svg {width:36px;height:36px;margin-right:9px}
.brand span {color:#059669}
.avatar {display:inline-grid;place-items:center;width:34px;height:34px;flex:none;border-radius:50%;background:#e6f5ed;color:#097653;font-size:.75rem;font-weight:800}
.badge {display:inline-flex;align-items:center;gap:5px;justify-content:center;white-space:nowrap;padding:3px 8px;min-height:22px;border-radius:99px;
  background:#edf2f2;color:#475c64;font-size:.74rem;font-weight:720;line-height:1.2;vertical-align:middle}
.badge.green {background:#e4f6ec;color:#12704e}
.badge.blue {background:#e9f2f9;color:#255b7b}
.badge.amber {background:#fff4db;color:#805217}
.badge.violet {background:#f1ecfb;color:#64439a}
.badge.red {background:#fbeaec;color:#a02b39}
.eyebrow {display:inline-flex;align-items:center;gap:8px;color:var(--green-deep);font-weight:780;letter-spacing:.13em;text-transform:uppercase;font-size:.72rem}
.live-dot {display:inline-block;width:7px;height:7px;border-radius:50%;background:#0eac79;box-shadow:0 0 0 4px #c9efde}
.feature-icon,.org-icon {display:inline-grid;place-items:center;width:37px;height:37px;flex:none;background:var(--green-soft);color:var(--green-deep);border-radius:10px}
.feature-icon.blue {background:#e9f2f9;color:#2c6690}
.feature-icon.amber {background:#fff4dc;color:#956119}
.feature-icon.violet {background:#f0ecfb;color:#7055ac}
footer {text-align:center;font-size:.78rem;color:#61757a;padding:19px 16px;border-top:1px solid var(--line)}
footer b {color:#34575a}
.sr-only {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.muted {color:var(--muted)}
.form-error {padding:9px 12px;border-radius:8px;background:#fff0f1;color:#9c2630;font-size:.86rem}

/* Inicio público y acceso */
.public {min-height:100vh;display:flex;flex-direction:column;background:#fff}
.public main {flex:1}
.wrap {width:min(1200px,calc(100% - 88px));margin-inline:auto}
.public-nav {display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:74px}
.public-nav .actions {gap:24px}
.nav-feature {font-size:.9rem;font-weight:680;color:var(--muted)}
.nav-feature:hover {color:var(--green-deep)}
.hero {background:radial-gradient(ellipse at 74% 0%,#e2f6ed,transparent 57%),linear-gradient(110deg,#f7faf8,#f1f7f4);border-block:1px solid #e8f1ed}
.hero-grid {display:grid;grid-template-columns:minmax(335px,1.05fr) minmax(0,1.2fr);align-items:center;gap:clamp(24px,5vw,76px);padding-block:clamp(44px,7vw,94px)}
.hero h1,.login-intro h1 {font-size:clamp(2.6rem,3.7vw,4.3rem);line-height:1.02;letter-spacing:-.05em;font-weight:860;color:var(--petrol);margin:18px 0 21px}
.hero h1 em,.login-intro h1 span {font-style:normal;color:var(--green-deep)}
.hero-copy>p,.login-intro>p {font-size:1.22rem;line-height:1.6;color:#4b626a;max-width:410px}
.hero-copy>.actions {margin-top:24px}
.hero-company {display:flex;align-items:center;gap:10px;padding-top:15px;margin-top:22px;border-top:1px solid #dbe9e2;font-size:.84rem;color:var(--muted);max-width:355px}
.hero-company .icon {color:var(--green-deep)}
.hero-company strong {color:var(--petrol)}
.hero-company small {display:block;font-size:.76rem;margin-top:1px}
.preview-stage {isolation:isolate;position:relative;padding:34px 23px 48px;border-radius:21px;background:
  radial-gradient(circle at 28% 13%,#126c61,transparent 58%),radial-gradient(circle at 80% 85%,#11504f,transparent 49%),#0d3039;
  min-width:0;box-shadow:0 20px 45px #1a3e332b}
.preview-stage::before {content:"";position:absolute;inset:0;border-radius:inherit;z-index:-1;opacity:.25;background-image:radial-gradient(#a8e1ca 1px,transparent 1px);background-size:15px 15px}
.preview {background:#fff;border:1px solid #e6eeea;border-radius:13px;overflow:hidden;box-shadow:0 14px 32px #061d3a45}
.preview-bar {height:45px;display:flex;align-items:center;justify-content:space-between;gap:7px;padding:0 12px;border-bottom:1px solid var(--line);font-size:.76rem;font-weight:760}
.preview-dots {display:flex;gap:4px}
.preview-dots i {width:6px;height:6px;background:#bfd3cc;border-radius:50%}
.preview-body {display:grid;grid-template-columns:42px minmax(106px,.9fr) minmax(0,1.6fr);min-height:248px}
.preview-rail {display:grid;align-content:start;justify-items:center;gap:12px;padding:11px 3px;background:#f4f8f6;border-right:1px solid var(--line);color:#60797b}
.preview-rail .icon {width:14px;height:14px}
.mini-brand {display:grid;place-items:center;width:22px;height:22px;color:white;background:#059669;border-radius:6px;font-weight:800}
.preview-active {display:grid;place-items:center;background:#dcefe6;color:var(--green-deep);width:27px;height:24px;border-radius:5px}
.preview-inbox {padding:10px 6px;border-right:1px solid var(--line);min-width:0}
.preview-inbox>b {display:block;font-size:.88rem;margin:0 0 9px 5px}
.preview-row,.preview-contact {display:flex;align-items:center;gap:7px;padding:7px 4px;margin:3px 0;border-radius:6px;font-size:.72rem;font-weight:720;white-space:nowrap}
.preview-row span:not(.avatar) {min-width:0;overflow:hidden;text-overflow:ellipsis}
.preview-row.active {background:#e9f7f0}
.preview-row small,.preview-contact small {display:block;font-size:.64rem;font-weight:500;overflow:hidden;text-overflow:ellipsis}
.preview-row .avatar,.preview-contact .avatar {width:24px;height:24px;font-size:.58rem}
.preview-chat {background:#edf4ee;min-width:0}
.preview-contact {background:white;border-bottom:1px solid var(--line);border-radius:0;margin:0;padding:8px 10px}
.preview-messages {padding:13px 8px;display:grid;gap:8px}
.preview-messages .bubble {font-size:.72rem;padding:7px 9px;width:fit-content;max-width:94%}
.preview-bot {display:flex;align-items:center;justify-content:flex-end;gap:4px;color:#146948;font-size:.6rem;font-weight:720;text-align:right}
.preview-bot .icon {width:12px;height:12px}
.preview-float {position:absolute;bottom:20px;right:12px;display:flex;align-items:center;gap:8px;padding:7px 9px;background:#fff;border:1px solid #def0e9;border-radius:10px;box-shadow:0 9px 25px #092e3742;max-width:calc(100% - 24px)}
.preview-float strong,.preview-float small {display:block}
.preview-float strong {font-size:.76rem}
.preview-float small {font-size:.68rem}
.preview-float .feature-icon {width:30px;height:30px}
.preview-float .feature-icon .icon {width:15px;height:15px}
.features {padding-block:42px 52px}
.feature-header {margin-bottom:19px}
.feature-header h2 {font-size:clamp(1.65rem,3.25vw,2.65rem);letter-spacing:-.06em;margin-top:4px;line-height:1.1}
.feature-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.feature-grid article {border:1px solid var(--line);border-radius:13px;padding:17px;box-shadow:0 4px 12px #163b3207}
.feature-grid h3 {font-size:1.03rem;margin:8px 0 3px;letter-spacing:-.02em}
.feature-grid p {font-size:.89rem;color:var(--muted)}
.login-page {background:radial-gradient(ellipse at 28% 50%,#e6f6ee,transparent 55%),#f6faf8}
.login-grid {display:grid;grid-template-columns:1fr minmax(310px,.85fr);gap:7vw;align-items:center;max-width:995px;padding-block:40px 58px}
.login-intro h1 {font-size:clamp(2.4rem,3.6vw,4rem)}
.login-card {background:white;border:1px solid var(--line);border-radius:19px;box-shadow:var(--shadow);padding:29px}
.login-card h2 {font-size:1.8rem;letter-spacing:-.05em}
.login-card>p {color:var(--muted);margin:5px 0 16px;font-size:.9rem}
.form-stack {display:grid;gap:11px}
.test-accounts {background:#eff7f3;border:1px solid #dcefe6;border-radius:10px;margin-top:19px;padding:10px 12px}
.test-accounts h3 {font-size:.88rem;color:#245f50;margin-bottom:5px}
.test-account {display:flex;gap:8px;justify-content:space-between;align-items:center;padding:7px 0;font-size:.78rem}
.test-account+.test-account {border-top:1px solid #dcece3}
.test-account code {display:block;overflow-wrap:anywhere;font-size:.75rem}

/* Aplicación */
.shell {display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh;align-items:start}
.sidebar {position:sticky;top:0;height:100dvh;overflow-y:auto;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:18px 12px 10px;z-index:4}
.side-head {display:flex;align-items:center;justify-content:space-between;margin:0 0 0 9px}
.menu-overlay {display:none}
.sidebar .brand svg {width:34px;height:34px}
.org {display:flex;align-items:center;gap:9px;margin:17px 1px 12px;padding:9px 8px;background:#f4f8f6;border:1px solid #e7efeb;border-radius:10px;min-width:0}
.org-icon {width:31px;height:31px;border-radius:8px}
.org-icon .icon {width:16px;height:16px}
.org>span:nth-child(2),.side-profile>div {min-width:0;flex:1}
.org small,.org b,.side-profile small,.side-profile b {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.35}
.org b,.side-profile b {font-size:.82rem}
.org small,.side-profile small {font-size:.7rem}
.nav-group {margin:0 0 11px}
.nav-group>span {display:block;padding:2px 9px 4px;color:#61777c;font-size:.66rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.nav-group a {position:relative;display:flex;align-items:center;gap:9px;padding:7px 9px;min-height:34px;border-radius:7px;color:#34515b;font-size:.84rem;font-weight:620;line-height:1.2}
.nav-group a .icon {width:17px;height:17px;color:#54717a}
.nav-group a:hover {background:#f0f6f3}
.nav-group a.active {background:#e3f5ed;color:#067354;font-weight:750}
.nav-group a.active .icon {color:#07835e}
.nav-group a.active::after {content:"";position:absolute;right:8px;width:5px;height:5px;border-radius:50%;background:#07966a}
.side-profile {display:flex;align-items:center;gap:7px;margin-top:auto;border-top:1px solid var(--line);padding:10px 3px 0}
.side-profile .avatar {width:31px;height:31px}
.workspace {min-width:0;display:flex;flex-direction:column;min-height:100vh}
.topbar {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;padding:0 clamp(16px,3vw,35px);background:#fff;border-bottom:1px solid var(--line)}
.breadcrumb,.top-right {display:flex;align-items:center;gap:9px;font-size:.83rem}
.breadcrumb span {color:var(--muted)}
.breadcrumb .icon {width:14px;height:14px;color:#748b90}
.top-avatar .avatar {width:29px;height:29px}
.mobile-menu,.mobile-back {display:none}
.main {width:min(100%,1590px);margin:0 auto;padding:22px clamp(16px,3vw,35px) 30px;flex:1;min-width:0}
.page-head {display:flex;align-items:flex-end;justify-content:space-between;gap:13px;margin-bottom:19px}
.page-head .eyebrow {margin-bottom:4px}
.page-head h1 {font-size:clamp(1.88rem,3vw,2.8rem);letter-spacing:-.063em;line-height:1.06}
.page-head p {margin-top:6px;color:var(--muted);font-size:.94rem}
.page-head .actions {justify-content:flex-end}
.date-chip {display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#405961;font-size:.83rem;font-weight:650;white-space:nowrap}
.date-chip .icon {width:16px;height:16px;color:var(--green-deep)}
.card {min-width:0;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 2px 5px #173d3206}
.main>.card+.card,.settings-grid+.card {margin-top:13px}
.card-head {display:flex;align-items:center;justify-content:space-between;gap:9px;padding:14px 15px 10px}
.card-head h2 {font-size:1.08rem;line-height:1.24;letter-spacing:-.025em}
.card-head p {margin-top:3px;color:var(--muted);font-size:.8rem}
.card-head .btn {flex:none}
.metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:13px}
.metrics.three {grid-template-columns:repeat(3,minmax(0,1fr))}
.metric {display:grid;align-content:start;gap:5px;padding:12px 13px 13px}
.metric-label {display:flex;align-items:center;justify-content:space-between;gap:6px;color:#3f595f;font-size:.84rem;font-weight:680}
.metric .feature-icon {width:30px;height:30px;border-radius:8px}
.metric .feature-icon .icon {width:16px;height:16px}
.metric>strong {font-size:clamp(1.17rem,2.02vw,1.92rem);line-height:1.18;letter-spacing:-.055em;overflow-wrap:anywhere}
.metric>small {font-size:.75rem}
.dashboard-grid {display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:12px;margin-bottom:13px}
.dashboard-grid.settings-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
.line-chart {display:block;width:100%;height:auto;margin:2px 0 8px}
.line-chart text {font:11px system-ui,sans-serif;fill:#527075}
.goal-list {display:grid;gap:10px;padding:0 14px 14px}
.goal {display:grid;gap:3px;line-height:1.2}
.goal>div {display:flex;align-items:center;gap:6px;font-size:.81rem}
.goal .avatar {width:21px;height:21px;font-size:.61rem}
.goal strong {margin-left:auto;color:var(--green-deep);font-size:.77rem}
.goal small {font-size:.7rem}
progress {width:100%;height:6px;border:0;border-radius:10px;background:#e9f0ed;overflow:hidden;accent-color:#059669}
progress::-webkit-progress-bar {background:#e9f0ed;border-radius:10px}
progress::-webkit-progress-value {background:#059669;border-radius:10px}
progress::-moz-progress-bar {background:#059669;border-radius:10px}
.bar-list {display:grid;gap:8px;padding:5px 14px 14px}
.bar-row {display:grid;grid-template-columns:minmax(75px,.9fr) minmax(42px,1.7fr) minmax(22px,max-content);gap:9px;align-items:center;font-size:.79rem}
.bar-row b {text-align:right;font-size:.78rem}
.bar-row svg {height:8px;width:100%}
.mini-list {padding:0 14px 8px}
.mini-list>div {display:flex;gap:9px;align-items:center;padding:7px 0;border-bottom:1px solid #eef3f1}
.mini-list>div:last-child {border:0}
.mini-list .feature-icon {width:28px;height:28px;border-radius:7px}
.mini-list .feature-icon .icon {width:15px;height:15px}
.mini-list>div>span:nth-child(2) {flex:1;font-size:.78rem}
.mini-list b,.mini-list small {display:block}
.mini-list small {font-size:.71rem;margin-top:1px}
.filters {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px}
.main>.filters {padding:0 0 11px}
.search {position:relative;display:flex;align-items:center;flex:1 1 210px;max-width:390px}
.search .icon {position:absolute;left:10px;width:17px;height:17px;color:#577676;pointer-events:none}
.search input {padding-left:33px;width:100%}
.filter {display:flex;align-items:center;gap:6px;color:#46606a;font-size:.79rem;font-weight:680}
.filter select,.filter input {width:auto;max-width:100%}
input,select,textarea {width:100%;background:#fff;border:1px solid #dbe7e2;border-radius:8px;min-height:35px;padding:6px 9px;font-size:.88rem}
textarea {resize:vertical}
input::placeholder {color:#687e84}
select {padding-right:15px}
.field {display:grid;gap:4px;min-width:0;font-size:.81rem;color:#3f5860;font-weight:690}
.field input,.field select,.field textarea {color:var(--ink);font-weight:500}
.check {display:flex;align-items:center;gap:7px;padding:6px 0;font-size:.86rem;font-weight:600}
.check input {width:16px;height:16px;min-height:0;accent-color:var(--green-deep)}
.choices {margin:0;border:1px solid var(--line);border-radius:9px;display:flex;gap:7px 15px;flex-wrap:wrap}
.choices legend {font-weight:700;font-size:.85rem}
.table-scroll {overflow:auto;min-width:0}
.table-scroll table {width:100%;border-spacing:0;text-align:left;font-size:.8rem}
thead th {background:#f2f7f5;font-size:.73rem;color:#48636c;font-weight:760;white-space:nowrap}
tbody th,tbody td {border-bottom:1px solid #edf2f0}
tbody th {font-weight:650}
tr:last-child>td,tr:last-child>th {border-bottom:0}
tr:hover>td,tr:hover>th[scope="row"] {background:#fafcfb}
td,th {padding:8px 12px;vertical-align:middle}
th:first-child,td:first-child {padding-left:14px}
td small,th small {display:block;margin-top:1px}
td .actions {flex-wrap:nowrap}
td .btn {white-space:nowrap}
.card>.table-scroll:last-child,.card>#results>.table-scroll:last-child {border-radius:0 0 var(--radius) var(--radius)}
.person-cell {display:flex;align-items:center;gap:7px}
.person-cell .avatar {width:27px;height:27px}
.table-progress {display:flex;align-items:center;gap:7px;min-width:80px}
.empty {display:grid;justify-items:center;gap:7px;color:#5a7378;text-align:center;padding:22px 14px;font-size:.88rem}
.empty .icon {width:23px;height:23px;color:#3b8576}
.kanban {display:grid;grid-template-columns:repeat(6,minmax(154px,1fr));gap:9px;overflow:auto;padding-bottom:8px;align-items:start}
.lane {min-height:165px;border:1px solid #e1ebe7;border-radius:11px;padding:9px;background:#edf4f1}
.lane.over {border-color:#0b9971;background:#e0f6ea}
.lane-head {display:flex;justify-content:space-between;gap:4px;align-items:center;margin-bottom:4px}
.lane-head>span:nth-child(2) {font-size:.71rem;color:#4e6b70}
.lane>strong {font-size:.76rem;color:#3e6063}
.deal {background:#fff;border:1px solid #dce8e3;border-radius:8px;display:grid;gap:3px;text-align:left;padding:8px;margin-top:7px;width:100%;cursor:grab}
.deal:active {cursor:grabbing}
.deal:hover {border-color:#70bba3}
.deal>strong {font-size:.79rem}
.deal>span {font-size:.73rem;color:#4f696e}
.deal>b {font-size:.79rem;color:var(--green-deep)}
.deal>small {font-size:.69rem}
.settings-details {display:grid;gap:9px;padding:0 14px 14px;font-size:.84rem}
.settings-details dt {color:var(--muted);font-size:.76rem}
.settings-details dd {font-weight:660;overflow-wrap:anywhere}
.report-graph .line-chart {max-width:800px}
.report-graph .bar-list {max-width:810px}
.donut {display:flex;align-items:center;gap:26px;flex-wrap:wrap;padding:6px 18px 15px}
.donut>svg {width:135px;height:135px}
.donut>svg text {fill:var(--ink);font-size:22px;font-weight:780}
.donut>svg .donut-caption {font-size:8px;font-weight:620;fill:var(--muted)}
.donut-legend {display:grid;gap:7px;width:185px}
.donut-legend>div {display:flex;align-items:center;gap:7px;font-size:.85rem}
.donut-legend b {margin-left:auto}
.donut-legend svg {width:12px;height:12px}

/* Bandejas y mensajería */
.chat-layout {display:grid;grid-template-columns:minmax(206px,.64fr) minmax(0,1.38fr);height:clamp(460px,68dvh,730px);border-top:1px solid var(--line);overflow:hidden;border-radius:0 0 var(--radius) var(--radius)}
.chat-list {min-width:0;overflow:auto;border-right:1px solid var(--line)}
.chat-list-label {display:flex;justify-content:space-between;align-items:center;padding:10px 12px;background:#fff;position:sticky;top:0;z-index:1;font-weight:750;font-size:.82rem;border-bottom:1px solid #eef3f1}
.chat-list-label span {color:var(--green-deep);background:var(--green-soft);padding:0 7px;border-radius:8px}
.chat-item {width:100%;display:flex;align-items:flex-start;gap:7px;padding:9px 8px;border:0;border-bottom:1px solid #edf3f0;border-left:3px solid transparent;background:#fff;text-align:left}
.chat-item:hover,.chat-item.selected {background:#eaf7f0}
.chat-item.selected {border-left-color:#059669}
.chat-item .avatar {width:29px;height:29px}
.chat-item-text {flex:1;min-width:0}
.chat-item-text b,.chat-item-text small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.35}
.chat-item-text b {font-size:.85rem}
.chat-item-text small {font-size:.72rem;margin-top:2px}
.chat-item-text small:last-child {color:#397364;font-size:.68rem}
.chat-item-state {display:grid;justify-items:end;font-size:.63rem;color:var(--quiet);white-space:nowrap}
.unread {display:block;width:7px;height:7px;margin-top:5px;background:#08a171;border-radius:50%}
.chat-detail {min-width:0;min-height:0;display:flex;flex-direction:column}
.chat-header {display:flex;flex-wrap:wrap;gap:5px 10px;align-items:center;justify-content:space-between;padding:9px 11px;border-bottom:1px solid var(--line)}
.chat-contact {display:flex;align-items:center;gap:7px;min-width:0}
.chat-contact h2 {font-size:1rem;line-height:1.1;overflow-wrap:anywhere}
.chat-contact small {font-size:.72rem}
.chat-tools {padding:7px 11px;border-bottom:1px solid var(--line)}
.chat-tools .badge {font-size:.67rem}
.messages {min-height:0;flex:1;overflow:auto;padding:9px 12px;display:flex;flex-direction:column;gap:7px;background-color:#eaf3ed;
  background-image:radial-gradient(#c6dfd47a 1px,transparent 1px);background-size:14px 14px}
.chat-date {align-self:center;background:#f6fcf8;color:#55716e;border:1px solid #dceae3;padding:2px 8px;border-radius:6px;font-size:.68rem}
.bubble {box-shadow:0 1px 2px #224e4420;font-size:.86rem;max-width:83%;padding:7px 9px;border-radius:9px;background:#fff;line-height:1.48;align-self:flex-start;white-space:pre-wrap;overflow-wrap:anywhere}
.bubble.client {border-top-left-radius:2px}
.bubble.bot,.bubble.human {justify-self:end;align-self:flex-end;border-top-right-radius:2px;background:#ddf5e6}
.bubble.bot {background:#d8f0e5}
.bubble time {display:block;text-align:right;font-size:.65rem;color:#4a6c65;margin-top:3px}
.bot-label {display:flex;gap:4px;align-items:center;color:#126d50;font-size:.66rem;font-weight:780;margin-bottom:3px}
.bot-label .icon {width:13px;height:13px}
.handoff {padding:5px 10px;background:#fff4da;color:#764b13;font-size:.76rem}
.handoff .icon {width:14px;height:14px}
.compose {padding:8px 10px;border-top:1px solid var(--line)}
.compose>.actions {margin-bottom:6px;gap:5px}
.compose .field {display:block}
.compose .field>span {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
.compose select {min-height:31px;padding-block:4px;font-size:.77rem}
#chat-form {display:flex;gap:5px}
#chat-form input {flex:1;min-width:0}
.chat-blank {display:grid;place-items:center;height:100%;background:#f2f8f5}
.qr-box {display:flex;gap:14px;align-items:center}
.qr-box img {max-width:45%;height:auto;background:#fff;border:1px solid var(--line);border-radius:10px}
.qr-box p {margin:5px 0;font-size:.85rem}
.qr-box .btn {margin-top:5px}
.catalog-preview {max-height:245px;overflow:auto}

/* Diálogos, documentos y avisos */
#dialog {width:min(570px,calc(100vw - 28px));max-height:calc(100dvh - 34px);max-width:none;border:1px solid #e0ebe6;border-radius:15px;padding:0;box-shadow:0 25px 70px #0b282846;color:var(--ink)}
#dialog.wide {width:min(835px,calc(100vw - 28px))}
#dialog::backdrop {background:#102d3b69}
.dialog-head {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px 10px 17px;border-bottom:1px solid var(--line)}
.dialog-head h2 {font-size:1.15rem;letter-spacing:-.025em;overflow-wrap:anywhere}
.dialog-body {padding:14px 17px;display:grid;gap:10px;overflow-wrap:anywhere}
.dialog-body .table-scroll {border:1px solid var(--line);border-radius:8px}
.dialog-body>h3 {font-size:.94rem}
.dialog-foot {display:flex;justify-content:flex-end;gap:7px;padding:9px 17px;border-top:1px solid var(--line);background:#f7faf8}
.form-grid,.details-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px}
.details-grid {background:#f3f8f6;border:1px solid var(--line);border-radius:9px;padding:10px;font-size:.85rem}
.details-grid small,.details-grid b {display:block}
.modal-actions {margin:1px 0 3px}
.timeline {list-style:none;padding:0 0 0 14px;margin:0}
.timeline li {position:relative;border-left:1px solid #cae4da;padding:0 0 11px 12px;font-size:.84rem}
.timeline li::before {content:"";position:absolute;width:7px;height:7px;border-radius:50%;background:#059669;left:-4px;top:5px}
.timeline li:last-child {padding-bottom:0}
.timeline li span {margin-left:5px;color:var(--muted);font-size:.73rem}
.timeline p {white-space:pre-wrap;color:#3f5a61}
.doc-meta {display:flex;justify-content:space-between;align-items:center;gap:7px;padding:6px 8px;background:#f2f8f5;border-radius:7px}
.doc-meta small {display:block}
.doc-note {font-size:.84rem;white-space:pre-wrap;color:#334f57}
.doc-totals {display:grid;justify-self:end;width:min(238px,100%);margin-left:auto;font-size:.86rem}
.doc-totals>div {display:flex;justify-content:space-between;gap:4px;padding:5px 2px;border-bottom:1px solid var(--line)}
.doc-totals>div:last-child {font-weight:800;color:#10694f;border-bottom:0}
.doc-totals dd {font-weight:700}
.line-wrap {display:grid;gap:8px}
.line-editor {display:grid;grid-template-columns:minmax(0,2.5fr) minmax(64px,.6fr) minmax(79px,.9fr) auto;align-items:end;gap:6px}
.paper-head,.paper-meta {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;font-size:.86rem}
.paper-head {border-bottom:1px solid var(--line);padding-bottom:8px}
.paper-head>div:last-child {text-align:right}
.paper-head h2 {font-size:1.17rem}
.paper-meta {background:#f4f8f7;padding:8px}
#toasts {position:fixed;right:14px;bottom:14px;z-index:6;display:grid;gap:6px;max-width:min(360px,calc(100vw - 28px));pointer-events:none}
.toast {display:flex;align-items:center;gap:7px;padding:10px 12px;border-radius:9px;background:#12654f;color:#fff;box-shadow:0 7px 22px #16392d36;font-size:.87rem}
.toast.error {background:#a1313b}
#print-sheet {display:none}
@media print {
  @page {margin:16mm}
  body {background:#fff;color:#000;font:11pt/1.45 system-ui,sans-serif}
  #app,#dialog,#toasts,noscript {display:none!important}
  #dialog::backdrop {display:none}
  #print-sheet {display:block}
  #print-sheet .table-scroll {overflow:visible}
  #print-sheet table {border-collapse:collapse}
  #print-sheet thead {display:table-header-group}
  #print-sheet th,#print-sheet td {border-bottom:1px solid #ddd}
  #print-sheet tr,#print-sheet .doc-totals,#print-sheet .paper-meta {break-inside:avoid}
  #print-sheet .paper-head,#print-sheet .paper-meta,#print-sheet>p {margin-bottom:14px}
  #print-sheet .doc-totals {margin-top:9px}
  .paper-footer {margin-top:24px;padding-top:8px;border-top:1px solid #ddd;color:#444;font-size:9pt}
}
@media (max-width:1080px) {
  .shell {grid-template-columns:208px minmax(0,1fr)}
  .sidebar {padding-inline:9px}
  .hero-grid {grid-template-columns:minmax(290px,.9fr) minmax(0,1.1fr);gap:24px}
  .preview-stage {padding-inline:13px}
  .preview-body {grid-template-columns:34px minmax(103px,.9fr) minmax(0,1.4fr)}
}
@media (max-width:860px) {
  .wrap {width:calc(100% - 40px)}
  .shell {display:block}
  .sidebar {position:fixed;inset:0 auto 0 0;width:min(255px,83vw);visibility:hidden;transform:translateX(-100%);transition:transform .18s,visibility .18s;box-shadow:0 0 34px #18423936}
  .menu-open .sidebar {visibility:visible;transform:translateX(0)}
  .menu-open .menu-overlay {display:block;position:fixed;inset:0;z-index:3;border:0;background:#13363b49}
  .mobile-menu {display:inline-grid;margin-left:-5px}
  .mobile-menu .icon {width:20px;height:20px}
  .hero-grid {padding-block:38px}
  .hero h1 {font-size:clamp(2.5rem,6.6vw,4rem)}
}
@media (max-width:680px) {
  .hero-grid,.login-grid {grid-template-columns:1fr;gap:21px}
  .hero-grid {padding-block:30px}
  .hero h1 {font-size:clamp(2.7rem,10vw,4.1rem);margin:12px 0}
  .hero-copy>p,.login-intro>p {font-size:1rem;max-width:none}
  .hero-company {margin-top:16px;padding-top:10px}
  .public-nav {min-height:61px}
  .public-nav .brand {font-size:1.4rem}
  .public-nav .brand svg {width:31px;height:31px;margin-right:6px}
  .public-nav .btn {font-size:.79rem}
  .nav-feature {display:none}
  .features {padding-block:28px}
  .feature-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .login-grid {padding-block:18px 27px}
  .login-intro h1 {margin:8px 0;font-size:2.45rem}
  .login-intro br {display:none}
  .login-card {padding:16px}
  .page-head {align-items:flex-start;flex-direction:column;gap:9px;margin-bottom:13px}
  .page-head .actions {justify-content:start}
  .metrics,.metrics.three {grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .dashboard-grid,.dashboard-grid.settings-grid {grid-template-columns:1fr}
  .metric {padding:9px;min-width:0}
  .metric .feature-icon {width:26px;height:26px}
  .metric-label {font-size:.75rem}
  .main {padding-block:15px 20px}
  .filters {gap:6px}
  .search {max-width:none;flex-basis:100%}
  .top-right .top-avatar,.breadcrumb>span,.breadcrumb>.icon {display:none}
  .chat-layout {display:block;height:clamp(410px,62dvh,700px)}
  .chat-list {height:100%;border-right:0}
  .chat-detail {display:none;height:100%}
  .chat-open .chat-list {display:none}
  .chat-open .chat-detail {display:flex}
  .mobile-back {display:inline-grid;width:27px;height:29px}
  .mobile-back .icon {transform:rotate(180deg)}
  .compose .btn {font-size:.71rem;min-height:29px;padding:4px 6px}
  .compose select {max-width:130px}
  .bubble {max-width:93%}
  .chat-header,.chat-tools {padding:6px 8px}
}
@media (max-width:375px) {
  .wrap {width:calc(100% - 24px)}
  .preview-body {grid-template-columns:26px 94px minmax(0,1fr)}
  .preview-row .avatar {display:none}
  .preview-stage {padding-inline:8px}
  .feature-grid {gap:7px}
  .feature-grid article {padding:10px}
  .form-grid {gap:7px}
  .line-editor {grid-template-columns:1fr 1fr auto}
  .line-editor>.field:first-child {grid-column:1/-1}
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after {transition:none!important;scroll-behavior:auto!important}
}
