/* ==========================================================================
   malva · demo inmobiliaria · estilos
   Escala tipográfica: 13 / 14 / 16 / 18 / 22 · pesos 400 / 500 / 600
   Espaciado base 4 px · radios 4 / 6 / 8 / 10 · sombras solo en capas flotantes
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --sidebar: #F8F9FA;
  --subtle: #F4F5F7;
  --hover: #F1F3F5;
  --thead: #FAFBFC;
  --line: #E6E8EC;
  --line-strong: #D4D8DE;
  --text: #161B26;
  --text-2: #545D6B;
  --text-3: #687080;
  --accent: #1E3A5F;
  --accent-hover: #16304F;
  --accent-soft: #EDF1F6;
  --accent-line: #C7D2E0;
  --on-accent: #FFFFFF;
  --link: #1E3A5F;
  --focus: #3A6699;
  --r-bloqueada: #C9D3E0;
  --r-reservada: #8CA3C0;
  --r-arras: #4B6890;
  --r-vendida: #1E3A5F;
  --track: #ECEFF3;
  --danger: #B42318;
  --danger-soft: #FDF1F0;
  --warn: #92560A;
  --scrim: rgba(15, 20, 30, 0.32);
  --shadow-sm: none;
  --shadow-float: 0 8px 24px rgba(16, 24, 40, 0.12), 0 1px 3px rgba(16, 24, 40, 0.08);
  --paper: #FFFFFF;
  --paper-ink: #161B26;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

:root[data-app-theme="dark"] {
  color-scheme: dark;
  --bg: #111317;
  --sidebar: #0C0E11;
  --subtle: #181B20;
  --hover: #1C2026;
  --thead: #15181C;
  --line: #2A2F37;
  --line-strong: #3A404B;
  --text: #E7E9ED;
  --text-2: #A3A9B3;
  --text-3: #8E96A3;
  --accent: #3A6497;
  --accent-hover: #4570A5;
  --accent-soft: #1A2331;
  --accent-line: #2F4564;
  --on-accent: #FFFFFF;
  --link: #9DB9DD;
  --focus: #7FA6D6;
  --r-bloqueada: #363E4B;
  --r-reservada: #516888;
  --r-arras: #7F9DC3;
  --r-vendida: #C4D5EA;
  --track: #1F2329;
  --danger: #F0877D;
  --danger-soft: #2B1715;
  --warn: #D9A35C;
  --scrim: rgba(0, 0, 0, 0.56);
  --shadow-sm: none;
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --paper: #FFFFFF;
  --paper-ink: #161B26;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
:root[data-app-theme="dark"] body { -webkit-font-smoothing: auto; }
::selection { background: color-mix(in srgb, var(--focus) 28%, transparent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.code { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 13px; line-height: 18px; }
.strong { font-weight: 500; }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding-inline: 20px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; }
.brand-mark i { width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid #fff; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.org { margin: 0 12px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); box-shadow: var(--shadow-sm); }
.org-name { font-weight: 500; font-size: 13px; }
.org-sub { font-size: 13px; line-height: 18px; color: var(--text-2); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 8px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding-inline: 10px; border-radius: 6px; color: var(--text-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); font-weight: 500; }
.nav a svg { flex: none; color: var(--text-3); }
.nav a[aria-current="page"] svg { color: var(--link); }
.nav .count { margin-left: auto; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav .count.alert { color: var(--text); font-weight: 500; }
.nav-label { padding: 14px 10px 4px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.side-foot { margin-top: auto; padding: 16px 20px; font-size: 13px; line-height: 18px; color: var(--text-3); }
.side-foot b { font-weight: 500; color: var(--text-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; height: 56px; display: flex; align-items: center; gap: 12px; padding-inline: 40px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.icon-btn.menu-btn { display: none; }
.search { position: relative; width: min(440px, 100%); }
.search svg { position: absolute; left: 11px; top: 9px; color: var(--text-3); pointer-events: none; }
.search input { width: 100%; height: 32px; padding: 0 56px 0 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--subtle); }
.search input::placeholder { color: var(--text-3); }
.search input:focus { background: var(--bg); border-color: var(--focus); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.kbd { position: absolute; right: 8px; top: 7px; font-size: 12px; line-height: 18px; padding-inline: 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--text-2); background: var(--bg); }
.results { position: absolute; top: 40px; left: 0; right: 0; z-index: 20; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-float); padding: 6px; margin: 0; list-style: none; max-height: 70vh; overflow-y: auto; }
.results button { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; }
.results button:hover, .results button[aria-selected="true"] { background: var(--hover); }
.results .empty-r { padding: 10px; color: var(--text-2); }
.results .kind { font-size: 13px; color: var(--text-3); }
.who { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.today { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.today b { font-weight: 500; color: var(--text); }
.role-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 13px; font-weight: 500; }

.page { width: 100%; max-width: 1440px; padding-inline: 40px; padding-block: 28px 96px; }
.crumb { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.page-sub { margin: 4px 0 0; color: var(--text-2); max-width: 80ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 12px; flex-wrap: wrap; }
.sec-h.first { margin-top: 0; }
.sec-h h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.sec-h .note { font-size: 13px; color: var(--text-2); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding-inline: 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font-weight: 500; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--hover); border-color: color-mix(in srgb, var(--text) 22%, var(--line-strong)); }
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-sm { height: 28px; padding-inline: 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; border-radius: 6px; display: inline-grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.link { color: var(--link); background: none; border: 0; padding: 0; font-weight: 500; text-decoration: none; text-align: left; }
.link:hover { text-decoration: underline; }

/* ---------- Estados (escala monocroma) ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-disponible { background: transparent; box-shadow: inset 0 0 0 1.5px var(--link); }
.d-bloqueada { background: var(--r-bloqueada); }
.d-reservada { background: var(--r-reservada); }
.d-arras { background: var(--r-arras); }
.d-vendida { background: var(--r-vendida); }
.d-neutral { background: var(--text-3); }
.d-danger { background: var(--danger); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding-inline: 8px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.pill.neutral { color: var(--text-2); }
.pill.alert { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.due { font-size: 13px; white-space: nowrap; color: var(--text-2); }
.due-late { color: var(--danger); font-weight: 500; }
.due-soon { color: var(--warn); font-weight: 500; }

.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--track); }
.bar span { height: 100%; }
.b-vendida { background: var(--r-vendida); }
.b-arras { background: var(--r-arras); }
.b-reservada { background: var(--r-reservada); }
.b-bloqueada { background: var(--r-bloqueada); }
.b-fill { background: var(--accent); }
.legend-line { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.legend-line span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.kpi { padding: 14px 20px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-label { font-size: 13px; color: var(--text-2); }
.kpi-value { margin-top: 4px; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value.sm { font-size: 20px; line-height: 28px; }
.kpi-sub { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub.alert { color: var(--danger); }

/* ---------- Superficies ---------- */
.box { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); box-shadow: var(--shadow-sm); min-width: 0; }
.box-pad { padding: 20px 24px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.promo-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.6fr) 160px; gap: 32px; align-items: center; padding: 18px 24px; }
.promo-row .meta { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 4px; }
.promo-fig { text-align: right; }
.promo-fig strong { display: block; font-size: 18px; line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.promo-fig span { font-size: 13px; color: var(--text-2); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.two > div { min-width: 0; }
.attn button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; border: 0; background: none; text-align: left; }
.attn button:hover { background: var(--hover); }
.attn-title { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.attn-sub { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tablas ---------- */
.tbl { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--bg); }
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th, td { text-align: left; padding: 0 12px; height: 44px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { height: 36px; font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--thead); border-bottom-color: var(--line-strong); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { background: var(--thead); font-weight: 500; border-bottom: 0; border-top: 1px solid var(--line); }
td.r, th.r { text-align: right; }
td.wrap { white-space: normal; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
tr.late td { background: none; }
th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; }
th[aria-sort] button { color: var(--text); }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); background: var(--thead); flex-wrap: wrap; }
.cell2 { display: flex; flex-direction: column; line-height: 18px; }
.cell2 small { font-size: 13px; line-height: 18px; color: var(--text-2); }
.mini { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.mini .bar { flex: 1; }

/* ---------- Herramientas ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.toolbar .select, .toolbar select { max-width: 100%; min-width: 0; }
.select, .input { height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; background-color: var(--bg); }
.input { padding: 0 12px; min-width: 240px; }
.input-sm { min-width: 0; width: 150px; }
.select { padding: 0 32px 0 12px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238A919C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select-strong { font-weight: 500; }
.input:focus, .select:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--text-2); }
.chip b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.chip .x { color: var(--text-3); }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--subtle); border: 1px solid var(--line); }
.seg button { height: 28px; padding-inline: 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px var(--line); }
.push { margin-left: auto; }

/* ---------- Edificio ---------- */
.portals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 24px; }
.portal-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.portal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.building { overflow-x: auto; padding: 16px 20px 20px; }
.floors { display: grid; grid-template-columns: 64px repeat(var(--doors), minmax(108px, 1fr)); gap: 8px; min-width: calc(64px + var(--doors) * 116px); }
.floor-label { display: flex; align-items: center; font-size: 13px; color: var(--text-3); }
.door-label { font-size: 13px; color: var(--text-3); padding-left: 2px; }
.cell { display: flex; flex-direction: column; gap: 3px; min-height: 80px; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease), opacity 120ms var(--ease); }
.cell:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--line-strong)); }
.cell-top { display: flex; justify-content: space-between; align-items: center; }
.cell-code { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.cell-price { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cell-meta { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: auto; }
.cell.st-vendida { background: var(--subtle); }
.cell.st-vendida .cell-price, .cell.st-vendida .cell-code { color: var(--text-3); }
.cell.st-arras .cell-price { color: var(--text-2); }
.cell.dim { opacity: .28; }
.cell.sel { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); }
.cell .flag { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: thin; }
.tabs button { height: 40px; border: 0; background: none; padding: 0; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
:root[data-app-theme="dark"] .tabs button[aria-selected="true"] { border-bottom-color: var(--link); }

/* ---------- Gráficos ---------- */
.chart { padding: 20px 20px 12px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--text-3); }
.chart .val { fill: var(--text-2); }
.chart .grid { stroke: var(--line); }
.chart .bar-a { fill: var(--r-reservada); }
.chart .bar-b { fill: var(--r-vendida); }
.chart .bar-c { fill: var(--r-bloqueada); }
.hbars { padding: 8px 24px 16px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 240px) minmax(0, 1fr) 100px; gap: 16px; align-items: center; padding: 10px 0; }
.hbar + .hbar { border-top: 1px solid var(--line); }
.hbar .track { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--r-arras); border-radius: 4px; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Ajustes ---------- */
.settings { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 48px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 88px; }
.subnav button { text-align: left; height: 34px; padding-inline: 12px; border: 0; border-radius: 6px; background: none; color: var(--text-2); }
.subnav button:hover { background: var(--hover); color: var(--text); }
.subnav button[aria-current="true"] { background: var(--subtle); color: var(--text); font-weight: 500; }
.form-sec { max-width: 760px; }
.form-sec.wide { max-width: none; }
.form-sec h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.form-sec > p { margin: 4px 0 24px; color: var(--text-2); max-width: 64ch; }
.form-sec h3 { margin: 32px 0 12px; font-size: 14px; font-weight: 600; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.vocab-row { display: grid; grid-template-columns: 160px repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); }
.vocab-row:first-of-type { border-top: 0; }
.vocab-key { font-weight: 500; padding-bottom: 8px; }
.form-actions { display: flex; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme-opt { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); text-align: left; }
.theme-opt[aria-checked="true"] { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); }
.theme-prev { height: 88px; border-radius: 8px; border: 1px solid var(--line); display: grid; grid-template-columns: 28% 1fr; overflow: hidden; }
.theme-prev .s { height: 100%; }
.theme-prev .c { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.theme-prev .c i { display: block; height: 6px; border-radius: 3px; }
.tp-light .s { background: #F8F9FA; border-right: 1px solid #E6E8EC; } .tp-light .c { background: #fff; } .tp-light i { background: #E6E8EC; } .tp-light i:first-child { background: #1E3A5F; width: 40%; }
.tp-dark .s { background: #0C0E11; border-right: 1px solid #252930; } .tp-dark .c { background: #111317; } .tp-dark i { background: #252930; } .tp-dark i:first-child { background: #9DB9DD; width: 40%; }
.tp-sys { grid-template-columns: 1fr 1fr; }
.tp-sys .s { background: #fff; } .tp-sys .c { background: #111317; padding: 0; }
.clock { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Paneles laterales y diálogos ---------- */
dialog { color: var(--text); padding: 0; border: 0; }
dialog::backdrop { background: var(--scrim); }
.sheet { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(620px, 100%); height: 100%; max-height: 100%; max-width: 100%; background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-float); flex-direction: column; }
.sheet[open] { display: flex; animation: slide 180ms var(--ease); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 28px 18px; border-bottom: 1px solid var(--line); }
.sheet-kicker { font-size: 13px; color: var(--text-2); }
.sheet-title { margin: 2px 0 0; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; outline: none; font-variant-numeric: tabular-nums; }
.sheet-body { flex: 1; overflow-y: auto; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 32px; }
.sheet h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sheet h3 .note { font-weight: 400; font-size: 13px; color: var(--text-2); }
.price { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-note { font-size: 13px; line-height: 18px; color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.facts > div { padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.facts > div:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.facts dt { font-size: 13px; line-height: 18px; color: var(--text-2); }
.facts dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts.three > div:nth-child(-n+3) { border-top: 0; padding-top: 0; }
.card-link { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-align: left; }
.card-link:hover { background: var(--hover); }
.card-link + .card-link { margin-top: 8px; }
.sum { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--thead); }
.sum div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.sum .tot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-weight: 600; }
.plan { width: 100%; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.plan table { font-size: 13px; }
.plan th, .plan td { height: 40px; padding: 0 10px; }
.plan th:first-child, .plan td:first-child { padding-left: 14px; }
.plan th:last-child, .plan td:last-child { padding-right: 10px; }
.progress-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; left: 97px; top: 8px; bottom: -2px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-date { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 20px; }
.tl-body { padding-left: 14px; position: relative; min-width: 0; }
.tl-body::before { content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--text-3); }
.tl-what { font-weight: 500; }
.tl-detail { font-size: 13px; color: var(--text-2); }
.note-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.note-box + .note-box { margin-top: 8px; }
.note-meta { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }

.modal { width: min(580px, calc(100% - 32px)); max-height: calc(100% - 48px); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-float); }
.modal.wide { width: min(860px, calc(100% - 32px)); }
.modal[open] { animation: pop 150ms var(--ease); }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal-head { padding: 24px 28px 0; }
.modal-head h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.modal-body { padding: 22px 28px 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--thead); border-radius: 0 0 10px 10px; }
.form-error { grid-column: 1 / -1; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.preview { grid-column: 1 / -1; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f.full { grid-column: 1 / -1; }
.f label, .f .lbl { font-size: 13px; font-weight: 500; }
.f .opt { font-weight: 400; color: var(--text-3); }
.f input:not([type="checkbox"]):not([type="radio"]), .f select, .f textarea { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); }
.f select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238A919C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.f textarea { height: auto; min-height: 76px; padding: 8px 12px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.f input[disabled], .f select[disabled] { background: var(--subtle); color: var(--text-2); }
.affix { position: relative; }
.affix input { padding-right: 32px !important; text-align: right; font-variant-numeric: tabular-nums; }
.affix span { position: absolute; right: 12px; top: 8px; color: var(--text-3); }
.f .help { font-size: 13px; line-height: 18px; color: var(--text-3); }
.f .err { font-size: 13px; line-height: 18px; color: var(--danger); }
.f.invalid input, .f.invalid select, .f.invalid textarea { border-color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.radios { display: grid; gap: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.radio:has(input:checked) { border-color: var(--focus); background: var(--accent-soft); }
.radio input { margin: 3px 0 0; accent-color: var(--accent); }
.radio small { display: block; color: var(--text-2); font-size: 13px; line-height: 18px; }
.checklist { display: grid; gap: 6px; max-height: 180px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; }

/* ---------- Documento ---------- */
.doc-wrap { padding: 24px; background: var(--subtle); overflow-y: auto; max-height: calc(100vh - 170px); }
.doc { max-width: 720px; margin: 0 auto; background: var(--paper); color: var(--paper-ink); padding: 56px 64px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-size: 13px; line-height: 20px; }
.doc h1 { font-size: 20px; line-height: 28px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
.doc h2 { font-size: 14px; margin: 24px 0 8px; font-weight: 600; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #D4D8DE; }
.doc .doc-org { text-align: right; font-size: 13px; line-height: 18px; color: #545D6B; }
.doc table { font-size: 13px; }
.doc th, .doc td { height: 32px; padding: 0 8px; border-bottom: 1px solid #E6E8EC; color: #161B26; background: none; }
.doc th { color: #545D6B; }
.doc p { margin: 0 0 10px; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
.doc .sign div { border-top: 1px solid #8A919C; padding-top: 8px; font-size: 13px; color: #545D6B; }
.doc .muted-doc { color: #545D6B; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 8px; background: #161B26; color: #fff; font-size: 14px; box-shadow: var(--shadow-float); max-width: calc(100% - 32px); }
:root[data-app-theme="dark"] .toast { background: #E7E9ED; color: #111317; }
.toast .code { opacity: .7; }
.toast.error { background: var(--danger); color: #fff; }

.empty { padding: 56px 24px; text-align: center; }
.empty h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.empty p { margin: 0 auto; color: var(--text-2); max-width: 46ch; }
.notice { padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); color: var(--text-2); font-size: 14px; }
.notice.alert { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.scrim { display: none; }

@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(3n+2), .kpi:nth-child(3n+3) { border-left: 1px solid var(--line); }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .today { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 272px; height: 100%; transform: translateX(-100%); transition: transform 180ms var(--ease); padding-top: env(safe-area-inset-top, 0px); }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-float); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: var(--scrim); }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding-inline: 16px; top: env(safe-area-inset-top, 0px); }
  .page { padding-inline: 16px; padding-block: 24px 64px; }
  .kbd, .role-pick span, .avatar { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .promo-row { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 16px; padding: 16px; }
  .promo-row .bar-cell { grid-column: 1 / -1; grid-row: 2; }
  .settings { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; }
  .subnav button { white-space: nowrap; }
  .grid-form, .modal-body { grid-template-columns: minmax(0, 1fr); }
  .vocab-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vocab-key { grid-column: 1 / -1; padding-bottom: 0; }
  .hbar { grid-template-columns: minmax(0, 1fr) 80px; }
  .hbar .track { grid-column: 1 / -1; grid-row: 2; }
  .input { min-width: 0; width: 100%; }
  .push { margin-left: 0; }
  .themes { grid-template-columns: minmax(0, 1fr); }
  .facts.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   Componentes de módulos
   ========================================================================== */
/* Embudo */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 4px; }
.kcol { background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; }
.kcol h3 { margin: 2px 4px 4px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.kcard { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.kcard:hover { border-color: var(--line-strong); }
.kcard { cursor: grab; }
.kcard.dragging { opacity: .45; cursor: grabbing; }
.kcol.over { border-color: var(--accent-line); background: var(--accent-soft); }
.kcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.temp { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.temp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.temp.t-caliente::before { background: var(--accent); }
.temp.t-templado::before { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
:root[data-app-theme="dark"] .temp::before { border-color: var(--link); }
:root[data-app-theme="dark"] .temp.t-caliente::before { background: var(--link); }
:root[data-app-theme="dark"] .temp.t-templado::before { background: linear-gradient(90deg, var(--link) 50%, transparent 50%); }
.kmeta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 4px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; }
.step { font-size: 13px; padding: 3px 8px; border-radius: 4px; background: var(--subtle); color: var(--text-3); }
.step.on { background: var(--accent-soft); color: var(--link); font-weight: 500; }
/* Agenda */
.agenda-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 32px; align-items: start; }
.aday { margin-bottom: 24px; }
.aday h3 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.aday .rows { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.aitem { width: 100%; display: grid; grid-template-columns: 48px 10px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 16px; border: 0; background: none; text-align: left; }
.aitem:hover { background: var(--hover); }
.atime { font-size: 13px; color: var(--text-2); }
.task { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; padding: 12px 16px; }
.task .check input { margin-top: 3px; }
.link-plain { border: 0; background: none; padding: 0; text-align: left; }
.link-plain:hover span:first-child { text-decoration: underline; }
/* Mensajes y ficheros */
pre.msg { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 14px; line-height: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--thead); color: var(--text); }
pre.xml { margin: 0; white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: 13px; line-height: 18px; color: #161B26; }
/* Portal del comprador */
.portal { max-width: 920px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-float); background: var(--bg); }
.portal-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--sidebar); }
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.portal-body { padding: 28px 24px 32px; }
.portal-hello { margin: 0 0 4px; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }
.pasos { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pasos li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-3); }
.pasos li .dot { margin-top: 6px; }
.pasos li.on { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.portal-grid h3, .box-pad h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.plist li:first-child { border-top: 0; }
.plist li small { display: block; font-size: 13px; }
.hitos { list-style: none; margin: 0; padding: 0; }
.hitos li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; color: var(--text-3); }
.hitos li.on { color: var(--text); }
@media (max-width: 1100px) { .agenda-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(4, 260px); }
  .pasos, .portal-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Suite de productos
   ========================================================================== */
.brand-org { display: none; }
.pmark { display: inline-grid; place-items: center; flex: none; border-radius: 6px; background: var(--subtle); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.psel .pmark, .pitem.on .pmark { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.psel-wrap { position: relative; margin: 0 12px 12px; }
.psel { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-align: left; }
.psel:hover { border-color: var(--line-strong); }
.psel .cell2 { flex: 1; min-width: 0; }
.psel .cell2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psel > svg { color: var(--text-3); flex: none; }
.psel-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 320px; max-height: 72vh; overflow-y: auto; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-float); }
.psel-head { padding: 10px 10px 6px; font-size: 13px; color: var(--text-3); }
.plist2 { list-style: none; margin: 0; padding: 0; }
.pitem { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; }
.pitem:hover, .pitem.on { background: var(--hover); }
.pitem .cell2 { flex: 1; }
.pitem .lock { color: var(--text-3); flex: none; }
.psel-all { width: 100%; margin-top: 6px; padding: 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--link); font-weight: 500; text-align: left; }
/* Sugerencia de otro producto */
.hint { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.sheet .hint { margin: 0; }
.page > .hint:last-child { margin: 24px 0 0; }
.hint-body { display: flex; gap: 12px; align-items: center; max-width: 90ch; }
.hint-title { font-weight: 600; font-size: 13px; }
.hint p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 18px; }
.hint-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Ayuda y glosario */
.help-box { margin: -14px 0 20px; }
.help-box summary { cursor: pointer; width: max-content; padding: 2px 0; font-size: 13px; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 6px; border-radius: 4px; }
.help-box summary:hover { color: var(--link); }
.help-box[open] { padding-bottom: 4px; }
.help-box[open] ol { margin-top: 8px; padding: 12px 16px 12px 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--thead); }
.help-box summary::-webkit-details-marker { display: none; }
.help-box summary::before { content: "?"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.25px solid currentColor; font-size: 12px; line-height: 1; font-weight: 600; }
.help-box ol { margin: 0; color: var(--text-2); display: grid; gap: 6px; max-width: 90ch; }
.term { position: relative; border-bottom: 1px dotted var(--text-3); cursor: help; }
.term:hover::after, .term:focus::after { content: attr(data-def); position: absolute; z-index: 60; left: 0; top: calc(100% + 6px); width: max-content; max-width: 320px; padding: 10px 12px; border-radius: 8px; background: #161B26; color: #fff; font-size: 13px; line-height: 18px; font-weight: 400; white-space: normal; box-shadow: var(--shadow-float); }
:root[data-app-theme="dark"] .term:hover::after, :root[data-app-theme="dark"] .term:focus::after { background: #E7E9ED; color: #111317; }
/* Banda de prueba */
.trial { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -8px 0 24px; padding: 8px 14px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-soft); }
.trial span { flex: 1; }
/* Resumen */
.onboard .steps-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 24px; }
.onboard li { display: flex; align-items: center; gap: 10px; }
.onboard li.done { color: var(--text-3); }
.onboard .ok { width: 14px; height: 14px; flex: none; color: var(--link); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pcard header { display: flex; gap: 12px; align-items: center; }
.pcard h3 { margin: 0; font-size: 16px; font-weight: 600; }
.pcard p { margin: 0; }
.pcard dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; min-height: 50px; }
.pcard dt { font-size: 13px; color: var(--text-2); }
.pcard dd { margin: 2px 0 0; font-size: 18px; line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard .btn { align-self: flex-start; margin-top: auto; }
.ulist { display: grid; gap: 8px; }
.ucard { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-align: left; }
.ucard:hover { border-color: var(--line-strong); background: var(--hover); }
/* Página de producto */
.phero { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0 28px; }
.phero > div:nth-child(2) { flex: 1; min-width: 260px; }
.phero .page-title { font-size: 24px; line-height: 32px; }
.lead { margin: 6px 0 0; font-size: 16px; line-height: 24px; color: var(--text-2); max-width: 60ch; }
.benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.benefits div { display: flex; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; font-weight: 500; }
.benefits svg { color: var(--link); flex: none; margin-top: 1px; }
.feat { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text); }
.conn { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.conn li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.conn li.mine { border-color: var(--accent-line); background: var(--accent-soft); }
@media (max-width: 900px) { .benefits { grid-template-columns: minmax(0, 1fr); } .psel-pop { width: 100%; } }

/* ---------- Menú «Más acciones» ---------- */
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; z-index: 45; top: calc(100% + 4px); left: 0; min-width: 240px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-float); display: grid; }
.more-pop .btn { justify-content: flex-start; height: 34px; border: 0; background: none; font-weight: 400; width: 100%; }
.more-pop .btn:hover { background: var(--hover); }
.more-pop .btn-primary { color: var(--text); }
.more-pop .btn-danger { color: var(--danger); }
.more-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Móvil: indicadores como lista y filtros en una fila ---------- */
@media (max-width: 600px) {
  .kpis { grid-template-columns: minmax(0, 1fr) !important; }
  .kpis > .kpi:nth-child(n) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 16px; border-left: 0 !important; border-top: 1px solid var(--line) !important; }
  .kpis > .kpi:first-child { border-top: 0 !important; }
  .kpi-label { grid-column: 1; }
  .kpi-value { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 18px; line-height: 24px; text-align: right; }
  .kpi-sub { grid-column: 1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .chip { flex: none; }
  .page-title { font-size: 20px; line-height: 26px; }
}

/* ---------- Tablas anchas: sombra en el borde que indica que hay más columnas ---------- */
.tbl-scroll {
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(16, 24, 40, .14), transparent) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(16, 24, 40, .14), transparent) right center / 10px 100% no-repeat scroll;
}
:root[data-app-theme="dark"] .tbl-scroll {
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .5), transparent) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .5), transparent) right center / 10px 100% no-repeat scroll;
}
/* ---------- Pestañas numerosas (Informes): se reparten en filas como filtros ---------- */
.tabs.tabs-wrap { flex-wrap: wrap; gap: 6px; border-bottom: 0; overflow: visible; }
.tabs.tabs-wrap button { height: 30px; padding-inline: 12px; border: 1px solid var(--line); border-radius: 6px; margin: 0; font-weight: 400; }
.tabs.tabs-wrap button:hover { background: var(--hover); color: var(--text); }
.tabs.tabs-wrap button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); font-weight: 500; }
:root[data-app-theme="dark"] .tabs.tabs-wrap button[aria-selected="true"] { border-color: var(--accent-line); }
