/* =========================================================================
   Kavanah Capital v3.1 · sistema visual
   Fuente: KAVANAH_BRAND.md, tokens literales de marca Kavanah Ventures.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,300;0,400;0,500;0,600;0,700&family=IBM+Plex+Mono:wght@500&display=swap');

/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio.
   Va después del @import (que debe ir primero); el CSS de producto fuera de la capa siempre gana. */
@layer od-layout {
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }
  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
/* /OD-LAYOUT-PRIMITIVES v1 */

:root {
  /* paleta Kavanah */
  --fg: #0E1217;
  --accent: #0066CA;
  --accent-2: #C2381F;
  --tinte: #EDF3FA;
  --bg: #FBFCFD;
  --surface: #FFFFFF;
  --muted: #6A6F76;
  --border: #E2E5E8;
  --accent-hover: #0052A3;
  --accent-press: #003F80;
  --accent-2-hover: #A02D18;
  --focus: #8FB7E8;

  --on-dark: #FFFFFF;
  --on-dark-muted: rgba(255, 255, 255, 0.62);
  --on-dark-border: rgba(255, 255, 255, 0.14);
  --on-dark-surface: rgba(255, 255, 255, 0.06);
  --on-dark-surface-hover: rgba(255, 255, 255, 0.1);

  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-sm: 12px;

  --font-sans: 'Archivo', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --shadow-card: 0 12px 28px -16px rgba(14, 18, 23, 0.18);
  --sidebar-w: 268px;
  --topbar-h: 64px;
}

* , *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
ul { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── eyebrow / mono labels ─────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 10px;
}
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.muted { color: var(--muted); }

/* ─── shell layout ──────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--fg);
  color: var(--on-dark);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
  border-bottom: 1px solid var(--on-dark-border);
  margin-bottom: 18px;
}
.brand-mono {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mono span {
  font: 500 12px/1 var(--font-mono);
  color: #fff;
  letter-spacing: 0.02em;
}
.brand-words { display: flex; flex-direction: column; line-height: 1.1; }
.brand-words .k { font: 600 17px/1 var(--font-sans); letter-spacing: -0.01em; color: #fff; }
.brand-words .v { font: 700 10px/1 var(--font-sans); letter-spacing: 0.16em; color: var(--focus); margin-top: 4px; }

.mandate-switch {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--on-dark-surface);
  border: 1px solid var(--on-dark-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 22px;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mandate-switch:hover { background: var(--on-dark-surface-hover); border-color: rgba(255,255,255,0.24); }
.mandate-switch .ms-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mandate-switch .ms-label { font: 500 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--on-dark-muted); }
.mandate-switch .ms-name { font: 500 13.5px/1.25 var(--font-sans); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mandate-switch svg { width: 16px; height: 16px; color: var(--on-dark-muted); flex-shrink: 0; }

.nav-group { margin-bottom: 22px; }
.nav-group-label {
  font: 500 10.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-dark-muted);
  padding: 0 10px 10px;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  font: 500 13.5px/1 var(--font-sans);
  color: var(--on-dark-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--on-dark-surface); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.disabled { color: rgba(255,255,255,0.28); cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: rgba(255,255,255,0.28); }
.nav-item .phase-tag {
  margin-left: auto;
  font: 500 9.5px/1 var(--font-mono);
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--on-dark-border);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tinte);
  color: var(--accent);
  display: grid; place-items: center;
  font: 600 11.5px/1 var(--font-sans);
  flex-shrink: 0;
}
.sidebar-foot .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-foot .name { font: 500 13px/1.2 var(--font-sans); color: #fff; }
.sidebar-foot .role { font: 500 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--on-dark-muted); }

/* ─── main / topbar ─────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(380px, 40vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
}
.search-field svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.search-field input {
  border: none; background: transparent; outline: none;
  font: 400 13.5px var(--font-sans); color: var(--fg); width: 100%;
}
.search-field input::placeholder { color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.today-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.today-chip svg { width: 15px; height: 15px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }

.content { padding: 32px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* ─── page header ────────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-header h1 { font: 300 34px/1.1 var(--font-sans); letter-spacing: -0.01em; }
.page-header h1 strong { font-weight: 600; }
.page-header .lead { color: var(--muted); font-size: 14.5px; max-width: 56ch; margin-top: 10px; }
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ─── buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 20px;
  border-radius: var(--radius-pill);
  font: 500 14px/1 var(--font-sans);
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { border: 1.5px solid var(--fg); color: var(--fg); }
.btn-secondary:hover { background: var(--fg); color: #fff; }
.btn-tertiary { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; height: auto; padding: 0; }
.btn-tertiary:hover { color: var(--accent-hover); }
.btn-ghost { color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--fg); border-color: var(--fg); }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border); color: var(--muted); }
.btn-icon:hover { border-color: var(--fg); color: var(--fg); }

/* hidden siempre gana: menús, modales y filas filtradas usan el atributo */
[hidden] { display: none !important; }

/* ─── cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card-link:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }
.card-pad-sm { padding: 20px; }

/* ─── tags / pills / badges ──────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font: 500 11.5px/1 var(--font-sans);
  color: var(--muted);
}
.tag svg { width: 13px; height: 13px; }
.tag-fill { background: var(--tinte); color: var(--accent); border-color: transparent; }
.tag-dark { background: var(--fg); color: #fff; border-color: transparent; }
.tag-alert { color: var(--accent-2); border-color: rgba(194,56,31,0.3); }

.fit-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--radius-pill); font: 600 12.5px/1 var(--font-mono); }
.fit-badge .num { font-variant-numeric: tabular-nums; }
.fit-alto { background: var(--accent); color: #fff; }
.fit-medio { background: var(--tinte); color: var(--accent); }
.fit-bajo { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.certainty { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-mono); color: var(--muted); }
.certainty.low { color: var(--accent-2); }
.certainty svg { width: 13px; height: 13px; }

.date-flag { color: var(--accent-2); font: 500 12.5px var(--font-mono); display: inline-flex; align-items: center; gap: 6px; }
.date-flag svg { width: 13px; height: 13px; }

/* ─── progress bar ───────────────────────────────────────────────────── */
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--tinte); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); }

/* ─── grids ──────────────────────────────────────────────────────────── */
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.split-detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }

/* ─── filter bar ─────────────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.chip-group { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px; }
.chip {
  padding: 7px 14px; border-radius: var(--radius-pill);
  font: 500 12.5px/1 var(--font-sans); color: var(--muted);
}
.chip.active { background: var(--fg); color: #fff; }

/* ─── table ──────────────────────────────────────────────────────────── */
.ds-table { width: 100%; font-size: 13.5px; }
.ds-table thead th {
  text-align: left; padding: 0 16px 12px;
  font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.ds-table tbody td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ds-table tbody tr { transition: background 0.1s ease; cursor: pointer; }
.ds-table tbody tr:hover { background: var(--tinte); }
.ds-table tbody tr.selected { background: var(--tinte); }
.ds-table .num-col { text-align: right; font-family: var(--font-mono); }
.investor-name { display: flex; align-items: center; gap: 12px; }
.organism { width: 34px; height: 34px; border-radius: 10px; background: var(--tinte); color: var(--accent); display: grid; place-items: center; font: 600 11px var(--font-mono); flex-shrink: 0; }
.investor-name .texts { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.investor-name .n { font: 600 13.5px var(--font-sans); }
.investor-name .sub { font-size: 12px; color: var(--muted); }
.ds-table tbody tr.row-approved td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ─── detail panel ───────────────────────────────────────────────────── */
.detail-panel { position: sticky; top: calc(var(--topbar-h) + 24px); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dim-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.dim-row:first-of-type { border-top: none; }
.dim-name { font: 500 13px var(--font-sans); }
.dim-meta { font-size: 11.5px; color: var(--muted); }
.dim-score { font: 600 13px var(--font-mono); }
.dim-excluded { color: var(--muted); font-style: normal; }
.dim-bar { height: 4px; border-radius: 999px; background: var(--tinte); margin-top: 6px; overflow: hidden; }
.dim-bar > span { display: block; height: 100%; background: var(--accent); }
.dim-bar.excluded > span { background: var(--border); }
.source-line { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 7px 0; border-top: 1px solid var(--border); }
.source-line:first-of-type { border-top: none; }
.source-line svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }
.source-line strong { color: var(--fg); font-weight: 500; }

/* ─── investor profile (ficha, Directorio) ───────────────────────────── */
.organism-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 14px; }
.profile-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
.profile-top .texts { flex: 1; min-width: 0; }
.profile-top h3 { font: 600 19px var(--font-sans); }
.profile-actions-row { display: flex; gap: 6px; flex-shrink: 0; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.mini-stat { background: var(--tinte); border-radius: var(--radius-sm); padding: 12px 14px; }
.mini-stat .v { font: 600 16.5px var(--font-sans); display: block; }
.mini-stat .v.empty { font-weight: 500; color: var(--muted); font-size: 13px; }
.mini-stat .l { font: 500 10px var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 4px; display: block; }

.thesis-text { font-size: 13px; color: var(--fg); line-height: 1.6; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 4px; top: 16px; bottom: -2px; width: 1px; background: var(--border); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 4px; flex-shrink: 0; position: relative; z-index: 1; }
.timeline-item.terminal .timeline-dot { background: var(--border); }
.timeline-item.urgent .timeline-dot { background: var(--accent-2); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-body .t-title { font: 500 12.5px var(--font-sans); }
.timeline-body .t-date { font: 500 11px var(--font-mono); color: var(--muted); margin-top: 2px; }

.no-contact-note {
  display: flex; gap: 10px;
  background: rgba(194, 56, 31, 0.06);
  border: 1px solid rgba(194, 56, 31, 0.22);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--accent-2);
  font-size: 12.5px;
  line-height: 1.55;
}
.no-contact-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.profile-footer-actions { display: flex; gap: 8px; margin-top: 4px; }

.organism-xl { width: 68px; height: 68px; border-radius: 18px; font-size: 17px; }
.profile-back { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--font-sans); color: var(--muted); margin-bottom: 18px; }
.profile-back:hover { color: var(--fg); }
.profile-back svg { width: 15px; height: 15px; }
.profile-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.profile-decision-maker { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.profile-decision-maker svg { width: 13px; height: 13px; }

.criteria-list { display: flex; flex-direction: column; gap: 11px; }
.criteria-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.criteria-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.criteria-item.met svg { color: var(--accent); }
.criteria-item.unmet svg { color: var(--accent-2); }
.criteria-item.unknown svg { color: var(--muted); }
.criteria-item.unmet .criteria-label { color: var(--accent-2); }

.profile-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ─── kanban (Embudo) ────────────────────────────────────────────────── */
.board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; }
.stage-col { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.stage-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.stage-head .stage-name { font: 600 12.5px var(--font-sans); }
.stage-head .stage-count { font: 500 11.5px var(--font-mono); color: var(--muted); background: var(--tinte); padding: 2px 8px; border-radius: var(--radius-pill); }
.stage-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.stage-card:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }
.stage-card .sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.stage-card .sc-name { font: 600 13px var(--font-sans); }
.stage-card .sc-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stage-card .sc-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.stage-card .sc-days { font: 500 11px var(--font-mono); color: var(--muted); }
.stage-col.terminal .stage-card { opacity: 0.82; }

/* ─── lists (Hoy) ─────────────────────────────────────────────────────── */
.task-row, .meeting-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.task-row:first-of-type, .meeting-row:first-of-type { border-top: none; padding-top: 0; }
.row-mark { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--border); }
.row-mark.urgent { background: var(--accent-2); }
.row-body { flex: 1; min-width: 0; }
.row-body .rb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-body .rb-title { font: 500 13.5px var(--font-sans); }
.row-body .rb-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.meeting-time { width: 58px; flex-shrink: 0; font: 600 13px var(--font-mono); color: var(--fg); padding-top: 1px; }

/* ─── section titles ─────────────────────────────────────────────────── */
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { font: 600 16px var(--font-sans); }
.section-title .count { color: var(--muted); font: 500 12px var(--font-mono); }

hr.rule { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* ─── dropdown menu ──────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card); padding: 6px; min-width: 230px; z-index: 30;
  display: flex; flex-direction: column; gap: 2px;
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px; font: 500 13px var(--font-sans); color: var(--fg);
}
.dropdown-item:hover { background: var(--tinte); }
.dropdown-item.active { color: var(--accent); font-weight: 600; }
.dropdown-menu-dark { background: var(--fg); border-color: var(--on-dark-border); left: 0; right: 0; }
.dropdown-menu-dark .dropdown-item { color: #fff; }
.dropdown-menu-dark .dropdown-item:hover { background: var(--on-dark-surface-hover); }
.dropdown-menu-dark .dropdown-item.active { color: var(--focus); }

/* ─── modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(14, 18, 23, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: var(--radius-card);
  padding: 28px; width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-card);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { font: 600 20px var(--font-sans); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; flex: 1; min-width: 0; }
.field-row { display: flex; gap: 16px; }
.field label { font: 500 12.5px var(--font-sans); color: var(--fg); }
.field .req { color: var(--accent-2); }
.field input, .field select {
  height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: 400 13.5px var(--font-sans); color: var(--fg); background: var(--bg);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input.invalid, .field select.invalid { border-color: var(--accent-2); }
.field-error { color: var(--accent-2); font-size: 12px; }

/* ─── informe al cliente (aplicación completa del sistema de marca) ──── */
.report-doc { padding: 0; overflow: hidden; }

.report-cover { position: relative; background: var(--fg); color: #fff; padding: 36px 40px 28px; overflow: hidden; }
.report-cover::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(23.3deg, rgba(10,109,205,0.16) 0px, rgba(10,109,205,0.16) 1px, transparent 1px, transparent 32px);
  opacity: 0.6; pointer-events: none;
}
.report-cover-inner { position: relative; z-index: 1; }
.report-filete { width: 64px; height: 8px; background: var(--accent-2); border-radius: 2px; margin-bottom: 18px; }
.report-eyebrow { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--focus); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.report-eyebrow svg { width: 13px; height: 13px; }
.report-title { font: 300 36px/1.15 var(--font-sans); letter-spacing: -0.01em; margin-bottom: 6px; }
.report-title strong { font-weight: 600; }
.report-meta { font-size: 13px; color: var(--on-dark-muted); }
.report-cover-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--on-dark-border); }
.report-cover-foot .cf-brand { display: flex; align-items: center; gap: 10px; }
.report-cover-foot .cf-mono { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font: 500 10px/1 var(--font-mono); color: #fff; flex-shrink: 0; }
.report-cover-foot .cf-name { font: 600 12.5px var(--font-sans); color: #fff; }
.report-cover-foot .cf-tag { font: 500 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--on-dark-muted); }
.brand-lockup { color: var(--on-dark); text-decoration: none; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo { display: block; width: 168px; height: auto; aspect-ratio: 1040 / 238; }
.brand-product { font: 500 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--focus); }
.report-cover-foot .cf-logo { display: block; width: 120px; height: auto; aspect-ratio: 1040 / 238; }
.report-cover-foot .cf-brand { flex-direction: column; align-items: flex-start; gap: 6px; }

.report-body { padding: 32px 40px 36px; }

.report-dato { background: var(--fg); color: #fff; border-radius: var(--radius-card); padding: 22px 26px 22px 30px; position: relative; overflow: hidden; }
.report-dato::before { content: ''; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; background: var(--accent-2); border-radius: 0 4px 4px 0; }
.report-dato .eyebrow { color: var(--focus); margin-bottom: 12px; }
.report-dato .rd-figure { font: 300 38px/1 var(--font-sans); }
.report-dato .rd-figure .of { font: 400 14.5px/1 var(--font-sans); color: var(--on-dark-muted); margin-left: 6px; }
.report-dato .progress { background: rgba(255,255,255,0.16); margin-top: 14px; }
.report-dato .progress > span { background: var(--focus); }
.report-dato .rd-caption { font-size: 11.5px; color: var(--on-dark-muted); margin-top: 8px; }

.report-funnel { display: flex; gap: 2px; margin-bottom: 4px; }
.rf-step { flex: 1; text-align: center; padding: 16px 8px; background: var(--tinte); position: relative; }
.rf-step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.rf-step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.rf-step:not(:last-child)::after {
  content: ''; position: absolute; right: -1px; top: 50%; transform: translate(0, -50%);
  width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 7px solid var(--surface); z-index: 2;
}
.rf-step .rf-n { font: 600 22px/1 var(--font-sans); color: var(--fg); display: block; }
.rf-step .rf-l { font: 500 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 5px; display: block; }
.rf-step.rf-accent { background: var(--accent); }
.rf-step.rf-accent .rf-n, .rf-step.rf-accent .rf-l { color: #fff; }

.report-move-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.report-move-row:first-of-type { border-top: none; padding-top: 0; }
.report-move-row .rm-name { font: 600 13.5px var(--font-sans); flex-shrink: 0; min-width: 160px; }
.report-move-row .rm-sub { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; }

.report-close { background: var(--fg); color: var(--on-dark-muted); padding: 20px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 11.5px; }
.report-close svg { width: 13px; height: 13px; }

/* ─── toast ──────────────────────────────────────────────────────────── */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--fg); color: var(--on-dark); border-radius: var(--radius-pill); padding: 10px 12px 10px 18px; font: 500 13px var(--font-sans); box-shadow: var(--shadow-card); animation: toast-in 0.2s ease-out; max-width: 440px; }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--focus); }
.toast .toast-action { color: var(--focus); font: 600 12.5px var(--font-sans); text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; }
.toast.leaving { animation: toast-out 0.14s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ─── hoy: tareas y reuniones ────────────────────────────────────────── */
.task-row.is-done .rb-title { text-decoration: line-through; color: var(--muted); }
.task-row .postpone-menu { right: 0; left: auto; min-width: 180px; }
.done-list { margin-top: 8px; }
.done-list summary { cursor: pointer; font: 600 12.5px var(--font-sans); color: var(--muted); padding: 12px 0 4px; list-style: none; display: flex; align-items: center; gap: 6px; }
.done-list summary::-webkit-details-marker { display: none; }
.done-list summary svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.done-list[open] summary svg { transform: rotate(90deg); }
.meeting-row.is-logged .rb-title { color: var(--muted); }
.outcome-tag { color: var(--accent); border-color: var(--accent); }
.list-empty { text-align: center; padding: 32px 16px; }
.list-empty svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 8px; }
.list-empty p { font-size: 13px; }
.coord-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.coord-row svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.coord-row a { color: var(--fg); font-weight: 600; text-decoration: none; }
.coord-row a:hover { color: var(--accent); }

/* ─── embudo: arrastre, detalle, terminales ──────────────────────────── */
.stage-card { cursor: grab; width: 100%; text-align: left; }
.stage-card:active { cursor: grabbing; }
.stage-card.dragging { opacity: 0.4; }
.stage-card.just-moved { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tinte); }
.stage-body.drop-target { background: var(--tinte); border-radius: var(--radius-sm); outline: 1.5px dashed var(--accent); outline-offset: 2px; }
.stage-card .sc-mandate { font: 500 10.5px var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.sc-days.stale { color: var(--accent-2); }
.field textarea { min-height: 84px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 13.5px/1.5 var(--font-sans); color: var(--fg); background: var(--bg); resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--accent); }
.detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; background: var(--tinte); border-radius: var(--radius-sm); margin-bottom: 20px; }
.detail-meta .l { display: block; font: 500 10.5px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-meta .v { display: block; font: 600 13px var(--font-sans); margin-top: 4px; }
.terminal-list { margin-top: 16px; }
.terminal-list .ds-table tbody tr { cursor: default; }
.rule-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.rule-note svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .toast, .toast.leaving { animation: none; } }

/* ─── compromisos ────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-danger { background: var(--accent-2); color: #fff; }
.btn-danger:hover { background: var(--accent-2-hover); }
.cm-legend { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--font-sans); color: var(--muted); }
.cm-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.cm-dot.firm { background: var(--accent); }
.cm-dot.soft { background: var(--focus); }
.progress-stack { display: flex; height: 8px; border-radius: var(--radius-pill); background: var(--tinte); overflow: hidden; }
.progress-stack > span { display: block; height: 100%; }
.progress-stack .firm { background: var(--accent); }
.progress-stack .soft { background: var(--focus); }
.cm-mandate { display: block; width: 100%; text-align: left; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.cm-mandate:hover { border-color: var(--accent); }
.cm-mandate.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tinte); }
.cm-mandate .cm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.cm-mandate .cm-title { font: 600 16px var(--font-sans); color: var(--fg); }
.cm-mandate .cm-figs { font: 400 13px var(--font-mono); margin-bottom: 10px; }
.cm-mandate .cm-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cm-table-wrap { overflow-x: auto; }
.cm-table tbody tr { cursor: default; }
.cm-table .cm-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.cm-table .cm-actions .btn-icon { width: 36px; height: 36px; }
.cm-table .investor-name a { color: var(--fg); text-decoration: none; }
.cm-table .investor-name a:hover { color: var(--accent); }
.cm-table .cm-source { display: block; font: 500 10.5px var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.cm-table tr.just-added td { background: var(--tinte); }

/* ─── menú lateral: perfil como enlace ───────────────────────────────── */
a.sidebar-foot { color: inherit; text-decoration: none; border-radius: var(--radius-sm); transition: background 0.15s ease; }
a.sidebar-foot:hover, a.sidebar-foot.active { background: var(--on-dark-surface); }
.sidebar-foot .foot-gear { width: 16px; height: 16px; color: var(--on-dark-muted); margin-left: auto; flex-shrink: 0; }
.dropdown-item.current { color: var(--focus); font-weight: 600; }

/* ─── piezas compartidas de las pantallas nuevas ─────────────────────── */
.kv-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 12px 16px; font-size: 13.5px; }
.kv-list dt { color: var(--muted); }
.kv-list dd { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font: 600 16px var(--font-sans); }
.card-head a { font: 500 12.5px var(--font-sans); color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state svg { width: 28px; height: 28px; color: var(--muted); margin-bottom: 10px; }
.empty-state h2 { font: 600 18px var(--font-sans); margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13.5px; max-width: 44ch; margin: 0 auto 16px; }
.mini-table td, .mini-table th { padding: 12px 14px; }
.stat-num { font: 300 32px var(--font-sans); white-space: nowrap; }
.stat-num .unit { color: var(--muted); font-size: 14px; }
.field select[multiple] { height: auto; padding: 8px; }
.field-hint { color: var(--muted); font-size: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 8px 0; border-top: 1px solid var(--border); cursor: pointer; }
.check-row:first-child { border-top: none; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.check-row .cr-meta { margin-left: auto; color: var(--muted); font: 500 11.5px var(--font-mono); text-align: right; }
.check-row .cr-warn { color: var(--accent-2); }

/* ─── interacciones ──────────────────────────────────────────────────── */
.sync-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.sync-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.sync-item svg { width: 16px; height: 16px; color: var(--accent); }
.sync-item.off svg { color: var(--accent-2); }
.sync-item a { color: var(--accent); font-weight: 600; }
.ix-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--border); }
.ix-row:first-child { border-top: none; padding-top: 0; }
.ix-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--tinte); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.ix-icon svg { width: 16px; height: 16px; }
.ix-body { flex: 1; min-width: 0; }
.ix-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ix-top a.tag { text-decoration: none; }
.ix-top .ix-investor { font: 600 13.5px var(--font-sans); color: var(--fg); text-decoration: none; }
.ix-top a.ix-investor:hover { color: var(--accent); }
.ix-subject { font-size: 13.5px; margin-top: 4px; }
.ix-summary { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ix-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.ix-when { font: 500 11.5px var(--font-mono); color: var(--muted); white-space: nowrap; }
.ix-day { font: 500 11px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 18px 0 6px; }
.ix-day:first-child { padding-top: 0; }

/* ─── plantillas y secuencias ────────────────────────────────────────── */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 0.15s ease; }
.tpl-item:hover { border-color: var(--accent); }
.tpl-item.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tinte); }
.tpl-item .tpl-name { display: block; font: 600 13.5px var(--font-sans); }
.tpl-item .tpl-meta { display: block; font: 500 11px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.var-chip { font: 500 12px var(--font-mono); padding: 6px 10px; border-radius: var(--radius-pill); background: var(--tinte); color: var(--accent); min-height: 32px; }
.var-chip:hover { background: var(--accent); color: #fff; }
.ai-draft { border: 1.5px dashed var(--accent); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px; }
.ai-draft .ai-head { display: flex; align-items: center; gap: 8px; font: 600 13px var(--font-sans); color: var(--accent); margin-bottom: 10px; }
.ai-draft .ai-head svg { width: 15px; height: 15px; }
.ai-draft pre { white-space: pre-wrap; font: 400 13.5px/1.6 var(--font-sans); color: var(--fg); }
.ai-sources { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.ai-sources span { display: flex; gap: 6px; align-items: flex-start; }
.ai-sources svg { width: 13px; height: 13px; margin-top: 2px; flex-shrink: 0; }
.skeleton { display: flex; flex-direction: column; gap: 8px; }
.skeleton span { display: block; height: 12px; border-radius: var(--radius-pill); background: var(--tinte); animation: skel 1s ease-in-out infinite alternate; }
.skeleton span:nth-child(2) { width: 86%; } .skeleton span:nth-child(3) { width: 64%; }
@keyframes skel { from { opacity: 1; } to { opacity: 0.45; } }
.seq-step { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.seq-step:first-child { border-top: none; }
.seq-step input { height: 40px; width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 500 13px var(--font-mono); background: var(--bg); }
.seq-step select { height: 40px; width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 13px var(--font-sans); background: var(--bg); }
.seq-step .btn-icon { width: 40px; height: 40px; }

/* ─── usuario ────────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.role-card { position: relative; display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card .rc-title { display: block; font: 600 14px var(--font-sans); margin-bottom: 4px; }
.role-card .rc-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.role-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tinte); }
.role-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.perm-table td, .perm-table th { padding: 10px 12px; text-align: center; font-size: 13px; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-table tbody tr { cursor: default; }
.perm-table svg { width: 15px; height: 15px; }
.perm-yes { color: var(--accent); } .perm-no { color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.switch-row:first-of-type { border-top: none; }
.switch-row .sr-text { display: block; min-width: 0; }
.switch-row .sr-title { display: block; font: 500 13.5px var(--font-sans); }
.switch-row .sr-help { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: var(--radius-pill); background: var(--border); transition: background 0.15s ease; pointer-events: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(14,18,23,0.2); transition: transform 0.15s ease; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.danger-zone { border-color: rgba(194,56,31,0.3); }
.danger-zone h2 { color: var(--accent-2); }
.team-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.team-row:first-child { border-top: none; }
.team-row .avatar { background: var(--tinte); }
.team-row .tr-role { margin-left: auto; }
body.role-lectura .profile-actions-row, body.role-lectura [data-edit-only] { display: none !important; }
.readonly-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--tinte); color: var(--accent); font-size: 13px; margin-bottom: 20px; }
.readonly-banner svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ─── visión 4.0 ─────────────────────────────────────────────────────── */
.vision-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cap-card { display: flex; flex-direction: column; gap: 10px; }
.cap-card h3 { font: 600 15px var(--font-sans); }
.cap-card .cap-unlock { font-size: 13px; color: var(--muted); line-height: 1.5; }
.cap-card .cap-why { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
.cap-card .cap-progress { font: 500 11.5px var(--font-mono); color: var(--muted); }
.move-list { counter-reset: move; display: flex; flex-direction: column; }
.move-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-top: 1px solid var(--border); }
.move-item:first-child { border-top: none; padding-top: 0; }
.move-item .mi-n { font: 300 32px/1 var(--font-sans); color: var(--accent); }
.move-item h3 { font: 600 15px var(--font-sans); margin-bottom: 6px; }
.move-item p, .move-item li { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.move-item ul { margin-top: 6px; padding-left: 18px; list-style: disc; }
.risk-list li { font-size: 13.5px; line-height: 1.6; padding: 10px 0; border-top: 1px solid var(--border); }
.risk-list li:first-child { border-top: none; padding-top: 0; }

@media (max-width: 1180px) {
  .vision-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  a.sidebar-foot { display: flex; margin: 0 0 0 auto; padding: 6px; border-top: none; }
  a.sidebar-foot .who, a.sidebar-foot .foot-gear { display: none; }
  .vision-grid, .role-cards { grid-template-columns: 1fr; }
  .seq-step { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .ix-row { flex-wrap: wrap; }
  .ix-meta { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .kv-list { grid-template-columns: 1fr; gap: 2px 0; }
  .kv-list dd { margin-bottom: 10px; }
}

/* ─── Kavanah 4.0 ────────────────────────────────────────────────────── */
.v4-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--fg); color: var(--on-dark); font-size: 13px; line-height: 1.5; margin-bottom: 24px; }
.v4-banner svg { width: 16px; height: 16px; color: var(--focus); flex-shrink: 0; margin-top: 2px; }
.v4-banner a { color: var(--focus); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.legal-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid rgba(194,56,31,0.3); border-radius: var(--radius-sm); background: var(--surface); font-size: 13.5px; line-height: 1.5; margin-bottom: 24px; }
.legal-card svg { width: 18px; height: 18px; color: var(--accent-2); flex-shrink: 0; margin-top: 1px; }
.prop-card { margin-bottom: 16px; }
.prop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.prop-head h3 { font: 600 15px/1.4 var(--font-sans); }
.prop-agent { display: inline-flex; align-items: center; gap: 6px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 6px; }
.prop-agent svg { width: 13px; height: 13px; }
.prop-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.prop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.prop-result { margin-top: 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pb-item { padding: 14px 0; border-top: 1px solid var(--border); }
.pb-item:first-child { border-top: none; padding-top: 0; }
.pb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.pb-top strong { font: 600 13.5px var(--font-sans); }
.pb-item textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 12.5px/1.5 var(--font-sans); background: var(--bg); resize: vertical; }
.pb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.pb-row input[type="number"] { width: 72px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 500 13px var(--font-mono); background: var(--bg); }
.pred-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font: 500 11.5px var(--font-mono); color: var(--accent); }
.pred-line button { font: 600 11.5px var(--font-sans); color: var(--accent); text-decoration: underline; text-underline-offset: 3px; min-height: 28px; padding: 0 4px; }
.pred-factors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.factor { font: 500 11.5px var(--font-sans); padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); white-space: nowrap; }
.factor.pos { color: var(--accent); border-color: rgba(0,102,202,0.3); }
.factor.neg { color: var(--accent-2); border-color: rgba(194,56,31,0.3); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 56px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.bar-track { height: 10px; border-radius: var(--radius-pill); background: var(--tinte); overflow: hidden; }
.bar-track > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.bar-track.alt > span { background: var(--focus); }
.bar-val { font: 500 12.5px var(--font-mono); text-align: right; white-space: nowrap; }
.hidden-cell { color: var(--muted); font: 500 11.5px var(--font-mono); white-space: nowrap; }
.teaser-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: var(--surface); }
.teaser-card .tz-text { font-size: 14px; line-height: 1.6; margin: 8px 0 12px; }
.teaser-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.brief-doc { max-width: 880px; }
.brief-section { padding: 20px 0; border-top: 1px solid var(--border); }
.brief-section:first-child { border-top: none; padding-top: 0; }
.brief-section h2 { font: 600 15px var(--font-sans); margin-bottom: 10px; }
.brief-section p, .brief-section li { font-size: 14px; line-height: 1.65; }
.brief-section ol { padding-left: 20px; list-style: decimal; display: flex; flex-direction: column; gap: 6px; }
.mcp-query { display: flex; gap: 8px; flex-wrap: wrap; }
.mcp-query input { flex: 1 1 260px; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 13.5px var(--font-sans); background: var(--bg); }
.mcp-answer { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--fg); color: var(--on-dark); font: 400 13px/1.6 var(--font-mono); white-space: pre-wrap; }
@media print { .sidebar, .topbar, .v4-banner, .page-header-actions, .brief-actions { display: none !important; } .content { padding: 0; } }
@media (max-width: 860px) {
  .teaser-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ─── Kavanah Capital simplificado: 4 secciones ──────────────────────── */
.nav-item .nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--accent-2); color: #fff; font: 600 11px/22px var(--font-mono); text-align: center; }
.nav-item.active .nav-count { background: #fff; color: var(--accent); }
.inline-link { color: var(--fg); font-weight: 600; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.inline-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.hoy-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.check-btn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; color: var(--muted); flex-shrink: 0; transition: border-color 0.15s ease, color 0.15s ease; }
.check-btn svg { width: 15px; height: 15px; }
@media (hover: hover) { .check-btn:hover { border-color: var(--accent); color: var(--accent); } }
.task-row { align-items: center; }
.task-row .row-body { min-width: 0; }
.prop-card { padding: 16px 0; border-top: 1px solid var(--border); }
.prop-card:first-of-type { border-top: none; padding-top: 0; }
.prop-title { font: 600 14px/1.45 var(--font-sans); margin-bottom: 6px; }
.prop-details summary { cursor: pointer; font: 500 12.5px var(--font-sans); color: var(--accent); padding: 4px 0; min-height: 32px; display: flex; align-items: center; }
.prop-details[open] summary { margin-bottom: 8px; }
.coord-row { padding: 8px 0; align-items: flex-start; line-height: 1.5; }
.coord-row.urgent svg { color: var(--accent-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 12px 16px; font: 500 14px var(--font-sans); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
@media (hover: hover) { .tab:hover { color: var(--fg); } }
.mandate-card { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.mandate-card .mc-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mandate-card .mc-name { display: block; font: 600 18px var(--font-sans); }
.mandate-card .mc-sub { display: block; color: var(--muted); font-size: 13px; }
.mandate-card .mc-figs { display: block; font: 400 13px var(--font-mono); margin-top: 4px; }
.mandate-card .mc-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.stage-empty { font-size: 12px; color: var(--muted); padding: 8px 4px; }
.sc-prob { font: 500 11px var(--font-mono); color: var(--accent); }
.stage-card .sc-sub { margin-top: 4px; }
.pred-box { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; }
.pred-head { font-size: 13.5px; margin-bottom: 8px; }
.card-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.modal-intro { font-size: 14px; color: var(--muted); margin: -8px 0 16px; }
.modal-intro:empty { display: none; }
.share-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inv-table tbody tr { cursor: pointer; }
.inv-table .tag { margin: 2px 0; }
.brief-qs { padding-left: 20px; list-style: decimal; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.55; }
.anchor-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.anchor-nav a { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); font: 500 13px var(--font-sans); color: var(--fg); text-decoration: none; background: var(--surface); }
@media (hover: hover) { .anchor-nav a:hover { border-color: var(--accent); color: var(--accent); } }
.settings-sec { margin-bottom: 20px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.role-cards-stack { grid-template-columns: 1fr; }
.agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.agent-card { border: 1px solid var(--border) !important; border-radius: var(--radius-sm); padding: 16px !important; }
.cap-list { display: flex; flex-direction: column; }
.cap-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.cap-row:first-child { border-top: none; padding-top: 0; }
.cap-body { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.cap-where { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; }
#brief { scroll-margin-top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1180px) { .hoy-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .agent-grid { grid-template-columns: 1fr; }
  .cap-row { grid-template-columns: 36px minmax(0, 1fr); }
  .cap-where { grid-column: 2; justify-content: flex-start; }
  .nav-item .nav-count { margin-left: 6px; }
}

/* ─── pipeline en lista ──────────────────────────────────────────────── */
.view-toggle { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 36px; border-radius: var(--radius-pill); font: 500 13px var(--font-sans); color: var(--muted); }
.view-toggle button svg { width: 15px; height: 15px; }
.view-toggle button.active { background: var(--fg); color: #fff; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; min-height: 32px; }
.sort-btn svg { width: 13px; height: 13px; opacity: 0.7; }
.pl-list tbody tr { cursor: pointer; }
.pl-list td { vertical-align: middle; }
.pl-list .stale-cell { color: var(--accent-2); }

/* ─── recorrido guiado ───────────────────────────────────────────────── */
.tour { position: fixed; right: 24px; bottom: 24px; z-index: 250; width: min(380px, calc(100vw - 32px)); background: var(--fg); color: var(--on-dark); border-radius: var(--radius-card); padding: 20px 20px 16px; box-shadow: 0 24px 48px -20px rgba(14, 18, 23, 0.45); animation: toast-in 0.25s ease-out; }
.tour h2 { font: 600 17px/1.3 var(--font-sans); margin-bottom: 8px; }
.tour .tour-step { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--focus); margin-bottom: 8px; }
.tour .tour-text { font-size: 14px; line-height: 1.6; color: var(--on-dark-muted); }
.tour .tour-dots { display: flex; gap: 6px; margin: 16px 0 12px; }
.tour .tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark-border); }
.tour .tour-dots span.on { background: var(--focus); }
.tour .tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour .btn-ghost { color: var(--on-dark); border-color: var(--on-dark-border); }
.tour-target { position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px var(--tinte) !important; border-radius: var(--radius-card); }
.nav-item.tour-target { box-shadow: 0 0 0 2px var(--focus) !important; border-radius: var(--radius-pill); }
@media (prefers-reduced-motion: reduce) { .tour { animation: none; } }
@media (max-width: 860px) { .tour { right: 16px; left: 16px; bottom: 16px; width: auto; } }

/* ─── informe al cliente como PDF ────────────────────────────────────── */
@media print {
  body.print-report { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-report .sidebar, body.print-report .topbar, body.print-report .profile-back, body.print-report .page-header,
  body.print-report .tabs, body.print-report [data-panel="informe"] > :not(.report-doc), body.print-report .toast-stack,
  body.print-report .tour { display: none !important; }
  body.print-report .shell, body.print-report .main, body.print-report .content { display: block; padding: 0; margin: 0; max-width: none; }
  body.print-report .report-doc { border: none; box-shadow: none; border-radius: 0; }
  body.print-report .report-doc .grid-cards { grid-template-columns: repeat(3, 1fr); }
  body.print-report .report-move-row, body.print-report .report-dato, body.print-report .rf-step { break-inside: avoid; }
  @page { margin: 12mm; }
}

/* ─── guía de inicio ─────────────────────────────────────────────────── */
.guide-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.guide-toc { position: sticky; top: calc(var(--topbar-h) + 24px); }
.guide-toc ol { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; counter-reset: toc; }
.guide-toc a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); font: 500 13.5px var(--font-sans); color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
@media (hover: hover) { .guide-toc a:hover { color: var(--fg); background: var(--tinte); } }
.guide-toc a.active { color: var(--accent); font-weight: 600; background: var(--tinte); }
.guide-body { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.guide-sec { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.guide-sec > h2 { font: 600 24px/1.25 var(--font-sans); margin: 6px 0 12px; }
.guide-sec h3 { font: 600 16px var(--font-sans); margin: 24px 0 12px; }
.guide-lead { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 68ch; margin-bottom: 16px; }
.guide-big { font: 400 19px/1.55 var(--font-sans); max-width: 62ch; }
.guide-big strong { font-weight: 600; color: var(--accent); }
.guide-hero { padding: 4px 0 20px; }
.guide-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gf-step { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--tinte); border-radius: var(--radius-sm); }
.gf-step:last-child { background: var(--fg); color: var(--on-dark); }
.gf-n { font: 600 12px var(--font-mono); color: var(--accent); }
.gf-step:last-child .gf-n { color: var(--focus); }
.gf-t { display: block; font: 600 15px var(--font-sans); }
.gf-d { display: block; font-size: 13px; line-height: 1.45; opacity: 0.8; }
.guide-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; transition: border-color 0.15s ease; }
.guide-card svg { width: 18px; height: 18px; color: var(--accent); margin-bottom: 4px; }
.guide-card strong { display: block; font-size: 15px; }
.guide-card span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
@media (hover: hover) { .guide-card:hover { border-color: var(--accent); } }
.onb-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.onb-progress .progress { flex: 1; height: 8px; }
.onb-progress p { font-size: 12.5px; white-space: nowrap; }
.onb-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.onb-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.onb-item:first-child { border-top: none; }
.onb-check { position: relative; width: 28px; height: 28px; cursor: pointer; }
.onb-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.onb-box { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; color: transparent; pointer-events: none; }
.onb-box svg { width: 15px; height: 15px; }
.onb-check input:checked + .onb-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.onb-check input:focus-visible + .onb-box { outline: 2px solid var(--focus); outline-offset: 2px; }
.onb-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.onb-body strong { display: block; font-size: 15px; }
.onb-body .muted { display: block; font-size: 13.5px; line-height: 1.5; }
.onb-n { display: block; font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.onb-item.is-done strong { color: var(--muted); }
.guide-area { padding: 18px 0; border-top: 1px solid var(--border); }
.guide-area:first-of-type { border-top: none; padding-top: 4px; }
.ga-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; margin-bottom: 10px; }
.ga-head h3 { margin: 0 0 2px; }
.ga-head .muted { font-size: 14px; }
.guide-bullets { list-style: disc; padding-left: 70px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.6; }
.guide-table td { font-size: 14px; line-height: 1.5; vertical-align: top; }
.guide-tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--tinte); margin-top: 16px; font-size: 14px; line-height: 1.6; }
.guide-tip svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.recipe, .faq { border-top: 1px solid var(--border); }
.recipe:first-of-type, .faq:first-of-type { border-top: none; }
.recipe summary, .faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; min-height: 44px; font-size: 15px; }
.recipe summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.recipe summary > span { display: flex; flex-direction: column; gap: 2px; }
.recipe summary .muted { font-size: 13px; }
.recipe summary svg, .faq summary svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; transition: transform 0.15s ease; }
.recipe[open] summary svg, .faq[open] summary svg { transform: rotate(180deg); }
.recipe ol { list-style: decimal; padding: 0 0 16px 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.6; }
.faq summary { font-weight: 600; }
.faq p { padding: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--muted); max-width: 68ch; }
.rule-list { display: flex; flex-direction: column; gap: 12px; }
.rule-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; }
.rule-list svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.roadmap { display: flex; flex-direction: column; }
.roadmap li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--border); }
.roadmap li:first-child { border-top: none; }
.roadmap .rm-phase { font-size: 12px; color: var(--accent); padding-top: 2px; }
.roadmap strong { display: block; font-size: 15px; }
.roadmap .muted { font-size: 13.5px; line-height: 1.5; }
@media (max-width: 1180px) { .guide-grid { grid-template-columns: 1fr; } .guide-toc { position: static; } .guide-toc ol { flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 860px) {
  .guide-flow, .guide-cards { grid-template-columns: 1fr; }
  .guide-bullets { padding-left: 20px; }
  .onb-item { grid-template-columns: 32px minmax(0, 1fr); }
  .onb-item > .btn { grid-column: 2; justify-self: start; }
  .roadmap li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media print {
  body.print-guide { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-guide .sidebar, body.print-guide .topbar, body.print-guide .page-header-actions, body.print-guide .guide-toc, body.print-guide .toast-stack, body.print-guide .onb-item > .btn { display: none !important; }
  body.print-guide .shell, body.print-guide .main, body.print-guide .content { display: block; padding: 0; margin: 0; max-width: none; }
  body.print-guide .guide-grid { display: block; }
  body.print-guide .guide-sec { break-inside: avoid-page; box-shadow: none; }
  body.print-guide .recipe summary svg, body.print-guide .faq summary svg { display: none; }
}


/* ─── guía: búsqueda, recetas del Socio y aviso en Hoy ─────────────── */
.guide-search { position: relative; margin-bottom: 24px; }
.guide-search-field { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 12px 20px; box-shadow: var(--shadow-card); transition: border-color 0.15s ease; }
.guide-search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.guide-search-field svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.guide-search-field input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font: 400 16px var(--font-sans); color: var(--fg); }
.guide-search-field input::placeholder { color: var(--muted); }
.guide-search-field kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.guide-results-n { font-size: 12.5px; margin: 8px 20px 0; }
.guide-results { list-style: none; margin: 8px 0 0; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); display: grid; gap: 4px; }
.guide-results a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; }
.guide-results a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--tinte); }
@media (hover: hover) { .guide-results a:hover { background: var(--tinte); } }
.guide-results a > svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 18px; }
.gr-body { display: grid; gap: 2px; min-width: 0; }
.gr-body > * { display: block; }
.gr-kind { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gr-body strong { font-size: 15px; }
.gr-body .muted { font-size: 13.5px; line-height: 1.5; }
.guide-results mark { background: var(--tinte); color: var(--accent); font-weight: 600; border-radius: 4px; padding: 0 2px; }
.gr-empty { display: grid; gap: 4px; padding: 16px; font-size: 14px; }
.recipe-socio summary strong::after { content: 'Socio'; margin-left: 8px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-pill); padding: 2px 8px; vertical-align: 2px; }
.guide-role { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.guide-role-l { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.guide-role .chip[aria-pressed="true"] { font-weight: 600; }
.recipe-analista summary strong::after { content: 'Analista'; margin-left: 8px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg); border: 1px solid var(--fg); border-radius: var(--radius-pill); padding: 2px 8px; vertical-align: 2px; }
.stage-lock { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); vertical-align: 1px; }
.stage-lock svg { width: 12px; height: 12px; }
#rp-send-lock { display: block; margin-top: 4px; }
.guide-flash { animation: guide-flash 1.2s ease-out; }
@keyframes guide-flash { 0% { box-shadow: 0 0 0 3px var(--focus); background: var(--tinte); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .guide-flash { animation: none; outline: 2px solid var(--focus); } }
.onb-banner { display: flex; align-items: center; gap: 20px; padding: 20px 24px; margin-bottom: 24px; background: var(--tinte); border: 1px solid var(--border); border-radius: var(--radius-card); }
.onb-banner-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-dark); display: grid; place-items: center; flex-shrink: 0; }
.onb-banner-icon svg { width: 22px; height: 22px; }
.onb-banner-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.onb-banner-body .eyebrow { margin: 0; }
.onb-banner-title { font: 600 17px/1.35 var(--font-sans); margin: 0; }
.onb-banner-body .muted { font-size: 14px; margin: 0 0 8px; }
.onb-banner-body .progress { max-width: 420px; background: var(--surface); }
.onb-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
@media (max-width: 860px) { .onb-banner { flex-direction: column; align-items: flex-start; } .onb-banner-icon { display: none; } .guide-search-field kbd { display: none; } }
@media print { body.print-guide .guide-search { display: none !important; } }


/* ─── pipeline por proyecto ─────────────────────────────────────────── */
.pp-projects { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; scroll-snap-type: x proximity; }
.pp-chip { flex: none; scroll-snap-align: start; display: grid; gap: 4px; min-width: 176px; padding: 12px 16px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--fg); font: inherit; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.pp-chip > * { display: block; }
@media (hover: hover) { .pp-chip:hover { border-color: var(--accent); } }
.pp-chip.active { border-color: var(--accent); background: var(--tinte); box-shadow: inset 0 0 0 1px var(--accent); }
.pp-chip-name { font-weight: 600; font-size: 14px; }
.pp-chip-meta { font-size: 11.5px; color: var(--muted); }
.pp-chip .progress { height: 4px; margin-top: 4px; }
.pp-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.pp-summary .card { display: grid; gap: 4px; }
.pp-summary .card > * { display: block; margin: 0; }
.pp-summary .eyebrow { margin-bottom: 8px; }
.pp-summary .stat-num { font-size: clamp(24px, 2.4vw, 32px); }
.pp-summary .muted { font-size: 12.5px; line-height: 1.5; }
.pp-filters { flex-wrap: wrap; gap: 12px; }
.pp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.pp-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.pp-hint { margin-bottom: 12px; }
.pp-proj { display: inline-block; max-width: 100%; margin-bottom: 6px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--tinte); color: var(--accent); font: 500 11px var(--font-mono); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stage-col.pp-focus { box-shadow: 0 0 0 2px var(--accent); border-radius: var(--radius-sm); }
.pp-matrix th[scope="row"] { min-width: 180px; text-align: left; }
.pp-matrix th[scope="row"] > * { display: block; }
.pp-mlink { background: none; border: 0; padding: 0; font: 600 14px var(--font-sans); color: var(--fg); cursor: pointer; text-align: left; }
@media (hover: hover) { .pp-mlink:hover { color: var(--accent); text-decoration: underline; } }
.pp-msub { font-size: 12px; font-weight: 400; margin-top: 2px; }
.pp-cell { min-width: 36px; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font: 600 13px var(--font-mono); color: var(--fg); cursor: pointer; }
@media (hover: hover) { .pp-cell:hover { border-color: var(--accent); background: var(--tinte); color: var(--accent); } }
.pp-zero { color: var(--muted); }
.pp-commit { min-width: 200px; }
.pp-commit > * { display: block; }
.pp-commit .progress { margin: 6px 0 4px; }
.pp-commit .muted { font-size: 12px; }
.pp-out { margin-top: 24px; }
.pp-out-head { flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.pp-out-head h2 { margin: 0 0 4px; }
.pp-out-head .muted { font-size: 13.5px; line-height: 1.5; max-width: 60ch; margin: 0; }
.pp-out-head .chip .mono { font-size: 11px; opacity: 0.8; }
.pp-reason { min-width: 180px; line-height: 1.5; }
.pp-out-act { text-align: right; white-space: nowrap; }
.pp-out-empty { font-size: 13.5px; margin: 0; }
@media (max-width: 1024px) { .pp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pp-summary { grid-template-columns: 1fr; } .pp-chip { min-width: 160px; } }

/* ─── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .split-detail { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
  .profile-panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand-lockup, .mandate-switch, .nav-group-label, .sidebar-foot { display: none; }
  .nav-list { flex-direction: row; }
  .grid-cards, .grid-2 { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .report-cover, .report-body, .report-close { padding-left: 20px; padding-right: 20px; }
  .report-funnel { flex-wrap: wrap; }
  .rf-step { flex: 1 1 calc(50% - 2px); border-radius: var(--radius-sm) !important; }
  .rf-step:not(:last-child)::after { display: none; }
  .report-move-row { flex-wrap: wrap; }
  .report-move-row .rm-name { min-width: 0; }
}

/* =========================================================================
   Kavanah Capital 6 · capa visual
   Misma marca (Tinta Noche, Azul Kavanah, Rojo Señal solo alertas, Archivo +
   IBM Plex Mono). Más precisión: neutros fríos, elevación en 3 niveles,
   números tabulares, estados completos y movimiento corto.
   ========================================================================= */
:root {
  --n-0: #FFFFFF;
  --n-25: #FAFBFC;
  --n-50: #F5F7F9;
  --n-100: #EEF1F4;
  --n-200: #E3E7EC;
  --n-300: #CDD3DB;
  --n-500: #6A6F76;
  --n-700: #3A4049;
  --bg: var(--n-50);
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --text-2: var(--n-700);
  --accent-soft: #E6F0FB;
  --radius-ctl: 10px;
  --shadow-xs: 0 1px 2px rgba(14, 18, 23, 0.06);
  --shadow-sm: 0 1px 2px rgba(14, 18, 23, 0.05), 0 4px 12px -4px rgba(14, 18, 23, 0.08);
  --shadow-md: 0 12px 32px -12px rgba(14, 18, 23, 0.22), 0 2px 6px rgba(14, 18, 23, 0.06);
  --shadow-lg: 0 32px 80px -24px rgba(14, 18, 23, 0.45);
  --shadow-card: var(--shadow-sm);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-med: 220ms;
  --sidebar-w: 248px;
  --topbar-h: 60px;
}
body { font-size: 14.5px; font-feature-settings: "ss01", "cv11"; }
.mono, .stat-num, .num-col, .sc-days, .stage-count, .ds-table td.mono { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.eyebrow { font-size: 11px; letter-spacing: 0.1em; color: var(--n-500); }

/* ─── menú lateral ─────────────────────────────────────────────────── */
.sidebar { padding: 20px 14px; background: #0B0F14; border-right: 1px solid rgba(255,255,255,0.04); }
.brand-lockup { padding: 4px 10px 20px; margin-bottom: 14px; }
.brand-logo { width: 150px; }
.nav-group { margin-bottom: 18px; }
.nav-group-label { font-size: 10px; letter-spacing: 0.12em; padding: 0 10px 8px; color: rgba(255,255,255,0.4); }
.nav-item { position: relative; border-radius: var(--radius-ctl); padding: 9px 10px; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,0.64); transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.nav-item svg { width: 17px; height: 17px; opacity: 0.9; }
@media (hover: hover) { .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; } }
.nav-item.active { background: rgba(255,255,255,0.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item.active svg { color: #6FA8E8; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active .nav-count { background: var(--accent); }
.sidebar-foot { border-radius: var(--radius-ctl); padding: 10px; border-top: none; background: rgba(255,255,255,0.04); transition: background var(--t-fast); }
@media (hover: hover) { .sidebar-foot:hover { background: rgba(255,255,255,0.08); } }
.sidebar-foot .avatar { background: var(--accent); color: #fff; }

/* ─── barra superior ───────────────────────────────────────────────── */
.topbar { height: var(--topbar-h); padding: 0 28px; gap: 16px; background: rgba(255,255,255,0.86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); z-index: 20; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; font-size: 13.5px; color: var(--n-500); }
.crumbs a { color: var(--n-500); white-space: nowrap; border-radius: 6px; padding: 4px 6px; transition: color var(--t-fast), background var(--t-fast); }
@media (hover: hover) { .crumbs a:hover { color: var(--fg); background: var(--n-100); } }
.crumb-sep { width: 14px; height: 14px; color: var(--n-300); flex: none; }
.crumb-current { color: var(--fg); font-weight: 600; padding: 4px 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-field { width: min(360px, 34vw); flex: 0 1 360px; background: var(--n-50); border-color: var(--border); border-radius: var(--radius-ctl); padding: 0 6px 0 12px; height: 38px; transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.search-field:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-field input { font-size: 13.5px; height: 100%; }
.kbd-hint { display: inline-flex; gap: 3px; padding: 4px; border-radius: 6px; flex: none; }
@media (hover: hover) { .kbd-hint:hover kbd { border-color: var(--n-300); color: var(--fg); } }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: #fff; font: 500 11px/1 var(--font-mono); color: var(--n-500); }
.topbar-right { gap: 10px; flex: none; }
.today-chip { font-size: 11px; padding: 6px 10px; border-radius: 999px; background: var(--n-100); color: var(--text-2); }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-ctl); border-color: var(--border); background: #fff; }
.topbar-avatar .avatar { width: 34px; height: 34px; background: var(--fg); color: #fff; font-size: 11.5px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border); transition: box-shadow var(--t-fast); }
@media (hover: hover) { .topbar-avatar:hover .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent); } }
.content { padding: 32px 32px 64px; max-width: 1360px; }

/* ─── encabezado de página ─────────────────────────────────────────── */
.page-header { margin-bottom: 28px; align-items: flex-end; }
.page-header h1 { font: 600 30px/1.15 var(--font-sans); letter-spacing: -0.025em; }
.page-header h1 strong { font-weight: 700; }
.page-header .lead { font-size: 15px; line-height: 1.55; color: var(--n-500); margin-top: 8px; }
.page-header .eyebrow { margin-bottom: 8px; }

/* ─── botones ──────────────────────────────────────────────────────── */
.btn { height: 40px; padding: 0 16px; gap: 8px; font: 600 13.5px/1 var(--font-sans); letter-spacing: -0.005em; transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform 80ms; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-primary { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(0,60,120,0.3); }
@media (hover: hover) { .btn-primary:hover { background: var(--accent-hover); } }
.btn-secondary { border: 1px solid var(--border-strong); background: #fff; color: var(--fg); box-shadow: var(--shadow-xs); }
@media (hover: hover) { .btn-secondary:hover { background: var(--fg); border-color: var(--fg); color: #fff; } }
.btn-ghost { border: 1px solid transparent; color: var(--text-2); background: transparent; }
@media (hover: hover) { .btn-ghost:hover { background: var(--n-100); color: var(--fg); border-color: transparent; } }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-icon { width: 40px; height: 40px; border-radius: var(--radius-ctl); border-width: 1px; }

/* ─── tarjetas, etiquetas y barras ─────────────────────────────────── */
.card { border-color: var(--border); box-shadow: var(--shadow-xs); padding: 24px; }
.card-pad-sm { padding: 18px 20px; }
.card-link { transition: border-color var(--t-fast), box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); }
@media (hover: hover) { .card-link:hover { border-color: var(--n-300); box-shadow: var(--shadow-md); transform: translateY(-2px); } }
.card-head h2 { font: 600 15px var(--font-sans); letter-spacing: -0.01em; }
.card-head a { text-decoration: none; font-weight: 600; }
@media (hover: hover) { .card-head a:hover { text-decoration: underline; } }
.tag { padding: 4px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border-color: var(--border); background: #fff; color: var(--text-2); }
.tag-fill { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag-dark { background: var(--fg); color: #fff; }
.tag-alert { background: #FBEDEA; border-color: transparent; color: var(--accent-2); }
.progress { height: 6px; background: var(--n-100); }
.progress > span { background: linear-gradient(90deg, var(--accent), #2B84E0); transition: width 400ms var(--ease-out); }

/* indicadores */
.grid-stats { gap: 12px; }
.grid-stats .card { padding: 18px 20px; display: grid; gap: 2px; }
.grid-stats .eyebrow { margin-bottom: 10px !important; }
.stat-num { font: 600 30px/1.1 var(--font-sans); letter-spacing: -0.03em; }
.stat-num .unit { font-weight: 500; letter-spacing: 0; }
.stat-sub { font-size: 12.5px; color: var(--n-500); margin-top: 6px; line-height: 1.4; }
.sub-alert { color: var(--accent-2); font-weight: 600; }

/* anillo de avance */
.ring { flex: none; }
.ring-bg { fill: none; stroke: var(--n-100); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease-out); }
.ring-fg.done { stroke: var(--fg); }
.ring-txt { font: 600 12px var(--font-mono); fill: var(--fg); }

/* tarjeta de cliente */
.mandate-card { display: flex; flex-direction: column; gap: 10px; }
.mc-progress { display: flex; align-items: center; gap: 14px; margin: 6px 0 2px; }
.mc-figs-wrap { display: grid; gap: 4px; min-width: 0; }
.mc-figs-wrap > * { display: block; }
.mc-figs { font-size: 13px; color: var(--n-500); }
.mc-figs strong { font: 600 20px var(--font-sans); letter-spacing: -0.02em; color: var(--fg); margin-right: 4px; }
.mc-split { font-size: 11.5px; color: var(--n-500); }
.mc-name { font: 600 18px/1.25 var(--font-sans); letter-spacing: -0.015em; }
.mc-foot { border-top: 1px solid var(--n-100); padding-top: 12px; margin-top: 4px; font-size: 12px; color: var(--n-500); }

/* ─── panorama de Hoy ──────────────────────────────────────────────── */
.panorama { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; margin: 12px 0 24px; }
.pano-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.pano-big { font: 600 32px/1.1 var(--font-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pano-of { font: 500 15px var(--font-sans); color: var(--n-500); letter-spacing: 0; }
.stack-bar { display: flex; height: 10px; border-radius: 999px; background: var(--n-100); overflow: hidden; }
.stack-bar span { display: block; height: 100%; }
.sb-firm { background: var(--fg); }
.sb-soft { background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 18px; font-size: 12.5px; color: var(--n-500); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend strong { color: var(--fg); font-weight: 600; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: block; }
.lg-firm { background: var(--fg); } .lg-soft { background: var(--accent); } .lg-rest { background: var(--n-200); }
.pano-clients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; border-top: 1px solid var(--n-100); padding-top: 14px; }
.pano-clients a { display: grid; grid-template-columns: minmax(0, 1fr) 72px 40px; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: var(--fg); font-size: 13px; }
@media (hover: hover) { .pano-clients a:hover { background: var(--n-50); } }
.pc-bar { height: 4px; border-radius: 4px; background: var(--n-100); overflow: hidden; }
.pc-bar span { display: block; height: 100%; background: var(--accent); }
.pc-pct { font-size: 12px; text-align: right; color: var(--text-2); }
.pano-note { font-size: 12.5px; margin: -8px 0 12px; }
.bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 168px; }
.bar { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; height: 100%; color: var(--fg); text-align: center; min-width: 0; }
.bar-n { font-size: 12px; color: var(--text-2); }
.bar-col { display: flex; align-items: flex-end; background: var(--n-50); border-radius: 6px; overflow: hidden; }
.bar-col span { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; transition: height 500ms var(--ease-out); }
.bar:nth-last-child(-n+2) .bar-col span { background: var(--fg); }
.bar-l { font-size: 10.5px; color: var(--n-500); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .bar:hover .bar-col span { filter: brightness(1.15); } }

/* ─── chips, pestañas y filtros ────────────────────────────────────── */
.chip-group { border-radius: var(--radius-ctl); padding: 3px; background: var(--n-100); border-color: transparent; }
.chip { border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.chip.active { background: #fff; color: var(--fg); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.tabs { gap: 2px; margin-bottom: 24px; }
.tab { font-size: 13.5px; font-weight: 600; padding: 12px 14px; border-bottom-width: 2px; }
.tab.active { color: var(--fg); border-bottom-color: var(--fg); }
.view-toggle { background: var(--n-100); border-radius: var(--radius-ctl); padding: 3px; border: none; }
.view-toggle button { border-radius: 7px; }
.view-toggle button.active, .view-toggle button[aria-pressed="true"] { background: #fff; color: var(--fg); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }

/* ─── formularios ──────────────────────────────────────────────────── */
.field label { font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.field input, .field select, .field textarea { border-radius: var(--radius-ctl); border-color: var(--border-strong); background: #fff; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
@media (hover: hover) { .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--n-500); } }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.invalid, .field select.invalid { border-color: var(--accent-2); box-shadow: 0 0 0 3px #FBEDEA; }

/* ─── tablas ───────────────────────────────────────────────────────── */
.ds-table thead th { background: var(--n-25); font: 600 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--n-500); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ds-table tbody td { padding: 14px 16px; border-bottom-color: var(--n-100); }
.ds-table tbody tr:last-child td { border-bottom: none; }
@media (hover: hover) { .ds-table tbody tr:hover { background: var(--n-25); } }
.ds-table tbody tr.selected { background: var(--accent-soft); }

/* ─── tablero del pipeline ─────────────────────────────────────────── */
.board { gap: 12px; padding-bottom: 16px; }
.stage-col { width: 264px; background: var(--n-100); border-radius: 14px; padding: 10px; gap: 8px; }
.stage-head { padding: 4px 4px 6px; }
.stage-head .stage-name { font-size: 12.5px; font-weight: 700; letter-spacing: -0.005em; }
.stage-head .stage-count { background: #fff; box-shadow: 0 0 0 1px var(--border); font-weight: 600; color: var(--text-2); }
.stage-body { display: flex; flex-direction: column; gap: 8px; min-height: 64px; border-radius: 10px; transition: background var(--t-fast), box-shadow var(--t-fast); }
.stage-body.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.stage-card { border-radius: 10px; padding: 12px; border-color: var(--border); box-shadow: var(--shadow-xs); transition: border-color var(--t-fast), box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); }
@media (hover: hover) { .stage-card:hover { border-color: var(--n-300); box-shadow: var(--shadow-md); transform: translateY(-1px); } }
.stage-card .sc-name { font-size: 13.5px; letter-spacing: -0.01em; }
.stage-card.dragging { opacity: 0.5; transform: rotate(1.5deg); box-shadow: var(--shadow-lg); }
.stage-empty { font-size: 12px; color: var(--n-500); text-align: center; padding: 14px 0; border: 1px dashed var(--border-strong); border-radius: 10px; }

/* ─── modales, menús y avisos ──────────────────────────────────────── */
.modal-overlay { background: rgba(11, 15, 20, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: ov-in var(--t-med) var(--ease-out); }
.modal { border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 24px; animation: modal-in var(--t-med) var(--ease-out); }
.modal-head h2 { font-size: 18px; letter-spacing: -0.015em; }
@keyframes ov-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.toast { border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 16px; }
.empty-state svg { width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--n-100); color: var(--text-2); margin: 0 auto 14px; }

/* ─── paleta de comandos ───────────────────────────────────────────── */
.cmdk-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(11, 15, 20, 0.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: ov-in var(--t-fast) var(--ease-out); }
.cmdk { width: min(640px, 100%); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; animation: modal-in var(--t-med) var(--ease-out); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--n-100); }
.cmdk-input svg { width: 18px; height: 18px; color: var(--n-500); flex: none; }
.cmdk-input input { flex: 1; min-width: 0; border: none; outline: none; font: 500 16px var(--font-sans); color: var(--fg); background: transparent; }
.cmdk-input input::placeholder { color: var(--n-500); }
.cmdk-list { overflow-y: auto; padding: 8px; flex: 1 1 auto; }
.cmdk-group { font: 600 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--n-500); padding: 12px 10px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cmdk-item.active { background: var(--n-100); }
.cmdk-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 1px var(--border); flex: none; }
.cmdk-ic svg { width: 15px; height: 15px; color: var(--text-2); }
.cmdk-item.active .cmdk-ic { background: var(--fg); box-shadow: none; }
.cmdk-item.active .cmdk-ic svg { color: #fff; }
.cmdk-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.cmdk-txt > * { display: block; }
.cmdk-t { font: 600 14px var(--font-sans); color: var(--fg); }
.cmdk-d { font-size: 12px; color: var(--n-500); }
.cmdk-enter { width: 15px; height: 15px; color: var(--n-500); opacity: 0; flex: none; }
.cmdk-item.active .cmdk-enter { opacity: 1; }
.cmdk-empty { display: grid; gap: 4px; padding: 28px 16px; text-align: center; font-size: 13.5px; }
.cmdk-empty > * { display: block; }
.cmdk-empty span { color: var(--n-500); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--n-100); background: var(--n-25); font-size: 12px; color: var(--n-500); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ─── barra inferior (móvil) ───────────────────────────────────────── */
.bottom-nav { display: none; }

/* ─── responsive ───────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .panorama { grid-template-columns: 1fr; }
  .crumbs { display: none; }
  .search-field { flex: 1 1 auto; width: auto; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { padding: 0 16px; }
  .today-chip, .kbd-hint { display: none; }
  .content { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-header h1 { font-size: 24px; }
  .page-header-actions { width: 100%; flex-wrap: wrap; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 3px; min-height: 48px; padding: 6px 2px; border-radius: 10px; color: var(--n-500); font: 600 10.5px/1.1 var(--font-sans); }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav .active { color: var(--accent); }
  .toast-stack { bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; left: 16px; align-items: stretch; }
  .tour { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .pano-clients { grid-template-columns: 1fr; }
  .bars { height: 140px; }
  .cmdk-overlay { padding-top: 8vh; }
}
@media (max-width: 560px) {
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 24px; }
  .pano-big { font-size: 26px; }
  .bar-l { font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .modal-overlay, .cmdk, .cmdk-overlay { animation: none; }
  .card-link, .stage-card { transition: none; }
  .card-link:hover, .stage-card:hover { transform: none; }
  .ring-fg, .bar-col span, .progress > span { transition: none; }
}
@media print { .bottom-nav, .cmdk-overlay, .crumbs, .kbd-hint, .topbar-avatar { display: none !important; } }

/* =========================================================================
   Ficha del inversor v6: encabezado de perfil, métricas y línea de tiempo
   ========================================================================= */
.iv-hero { padding: 0; overflow: hidden; }
.iv-hero-main { display: flex; align-items: flex-start; gap: 20px; padding: 24px; }
.iv-avatar { flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--fg); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; box-shadow: var(--shadow-xs); }
.iv-id { flex: 1 1 0; min-width: 0; display: grid; gap: 6px; }
.iv-kicker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.iv-hero h1 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.iv-sub { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; max-width: 68ch; }
.iv-sectors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.iv-sectors span { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--n-100); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.iv-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.iv-contact { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--n-25); font-size: 13px; color: var(--text-2); }
.ivc { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); text-decoration: none; }
.ivc svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.ivc span { min-width: 0; overflow-wrap: anywhere; }
a.ivc { border-radius: 6px; transition: color var(--t-fast) var(--ease-out); }
@media (hover: hover) { a.ivc:hover { color: var(--accent); } a.ivc:hover svg { color: var(--accent); } }

.iv-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 16px 0 24px; }
.iv-metric { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-xs); min-width: 0; }
.iv-metric > * { display: block; min-width: 0; }
.ivm-l { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ivm-v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivm-of { color: var(--muted); font-weight: 500; }
.ivm-n { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.iv-metric.is-alert { border-color: rgba(194, 56, 31, 0.35); }
.iv-metric.is-alert .ivm-v { color: var(--accent-2); }

.iv-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.iv-col-main, .iv-col-side { display: grid; gap: 16px; min-width: 0; }

/* línea de tiempo */
.ivt { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.ivt::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: var(--border); }
.ivt-group { position: relative; padding: 16px 0 8px 48px; }
.ivt-group:first-child { padding-top: 4px; }
.ivt-group span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ivt-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding: 8px 0; }
.ivt-ic { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--n-100); color: var(--text-2); box-shadow: 0 0 0 4px var(--surface); }
.ivt-ic svg { width: 15px; height: 15px; }
.ivt-email .ivt-ic { background: var(--accent-soft); color: var(--accent); }
.ivt-reunion .ivt-ic { background: var(--fg); color: #fff; }
.ivt-llamada .ivt-ic, .ivt-nota .ivt-ic { background: var(--n-100); color: var(--text-2); }
.ivt-body { min-width: 0; display: grid; gap: 4px; padding: 4px 0 8px; border-bottom: 1px solid var(--n-100); }
.ivt-item:last-child .ivt-body { border-bottom: none; }
.ivt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ivt-title { font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.ivt-when { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ivt-sum { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.ivt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.ivt-client { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--n-100); color: var(--text-2); font-weight: 500; text-decoration: none; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
@media (hover: hover) { .ivt-client:hover { background: var(--accent-soft); color: var(--accent); } }
.ivt-dir { color: var(--accent); font-weight: 500; }

/* columna lateral */
.iv-brief-lead { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--fg); }
.iv-clients { list-style: none; margin: 0; padding: 0; }
.iv-clients li { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.iv-clients li:first-child { border-top: none; padding-top: 4px; }
.ivcl-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ivcl-name { font-weight: 600; font-size: 14px; color: var(--fg); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
@media (hover: hover) { .ivcl-name:hover { color: var(--accent); } }
.iv-steps { display: flex; gap: 4px; }
.iv-steps i { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--n-200); }
.iv-steps i.done { background: var(--accent); }
.iv-steps i.now { background: var(--fg); }
.ivcl-sub { font-size: 12px; color: var(--muted); }
.iv-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 10px 16px; margin: 0 0 16px; font-size: 13.5px; }
.iv-kv dt { color: var(--muted); }
.iv-kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.iv-docs { list-style: none; margin: 0; padding: 0; }
.iv-docs li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.iv-docs li:first-child { border-top: none; padding-top: 4px; }
.iv-docs li > svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.iv-docs li > div { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.ivd-l { display: block; font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.ivd-d { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

@media (max-width: 1180px) {
  .iv-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .iv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .iv-hero-main { flex-wrap: wrap; padding: 20px; gap: 16px; }
  .iv-id { flex-basis: calc(100% - 80px); }
  .iv-actions { width: 100%; flex-wrap: wrap; }
  .iv-actions .btn-primary { flex: 1 1 auto; justify-content: center; }
  .iv-contact { padding: 12px 20px; flex-direction: column; }
}
@media (max-width: 560px) {
  .iv-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .iv-metric { padding: 12px; }
  .ivm-v { font-size: 19px; }
  .ivt-top { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  a.ivc, .ivt-client { transition: none; }
}
@media print {
  .iv-actions, .iv-contact { display: none; }
}

/* =========================================================================
   v7 · listo para construir: encabezado de cliente, Ajustes, Inversores,
   tarjeta única del pipeline, confirmaciones y tablas legibles en móvil
   ========================================================================= */

/* tarjeta del pipeline (un solo componente) */
.stage-card .sc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stage-card .sc-av { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--n-100); color: var(--text-2); font: 600 10.5px var(--font-sans); letter-spacing: 0.02em; }
.stage-card .sc-top .sc-name { min-width: 0; overflow-wrap: anywhere; }
.stage-card .sc-sub { margin-top: 6px; }
.stage-card .sc-amount { font-size: 12px; font-weight: 600; color: var(--fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stage-card .pp-proj { margin-bottom: 8px; }

/* encabezado de cliente */
.cl-hero { padding: 0; overflow: hidden; margin-bottom: 20px; }
.cl-hero-main { display: flex; align-items: center; gap: 20px; padding: 24px; }
.cl-ring { flex: none; display: grid; place-items: center; width: 64px; height: 64px; }
.cl-ring > * { grid-area: 1 / 1; }
.cl-ring-pct { font-size: 13px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.cl-id { flex: 1 1 0; min-width: 0; display: grid; gap: 4px; }
.cl-id .eyebrow { margin: 0; }
.cl-hero h1 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.cl-sub { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.cl-actions { flex: none; display: flex; gap: 8px; }
.cl-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--border); background: var(--n-25); }
.cl-metric { display: grid; gap: 4px; align-content: start; padding: 16px 20px; min-width: 0; border-left: 1px solid var(--border); }
.cl-metric:first-child { border-left: none; }
.cl-metric > * { display: block; min-width: 0; }
.cl-metric .ivm-v { font-size: 20px; }
.cl-metric.is-alert .ivm-v { color: var(--accent-2); }

/* Ajustes: navegación lateral fija */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: 2px; }
.settings-nav a, .guide-toc a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 8px; font: 500 13.5px var(--font-sans); color: var(--text-2); text-decoration: none; border-left: none; transition: background var(--t-fast), color var(--t-fast); }
.settings-nav svg { width: 16px; height: 16px; flex: none; color: var(--n-500); }
@media (hover: hover) { .settings-nav a:hover, .guide-toc a:hover { background: var(--n-100); color: var(--fg); } }
.settings-nav a.active, .guide-toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-nav a.active svg { color: var(--accent); }
.settings-body { display: grid; gap: 16px; min-width: 0; }
.settings-body .settings-sec { margin: 0; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.settings-sec .card-head h2 { font-size: 17px; letter-spacing: -0.015em; }
.danger-zone { border-color: rgba(194, 56, 31, 0.3); }

/* Guía: mismo lenguaje que Ajustes */
.guide-sec { scroll-margin-top: calc(var(--topbar-h) + 24px); }
.guide-sec h2 { font-size: 20px; letter-spacing: -0.02em; }
.guide-lead { color: var(--text-2); line-height: 1.6; max-width: 72ch; }
.recipe { border-radius: 10px; }
.recipe summary { cursor: pointer; min-height: 44px; }

/* Inversores */
.chip-count { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--n-100); color: var(--n-500); font: 600 11px/18px var(--font-mono); font-variant-numeric: tabular-nums; }
.chip.active .chip-count { background: var(--accent-soft); color: var(--accent); }
.inv-table tbody tr { cursor: pointer; transition: background var(--t-fast); }
@media (hover: hover) { .inv-table tbody tr:hover { background: var(--n-25); } .inv-table tbody tr:hover .inv-go svg { color: var(--accent); transform: translateX(2px); } }
.inv-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.inv-thesis { max-width: 32ch; font-size: 13px; color: var(--text-2); }
.inv-clients, .inv-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.inv-flags .tag svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.inv-stale { color: var(--accent-2); font-weight: 600; }
.inv-go { width: 32px; text-align: right; }
.inv-go svg { width: 16px; height: 16px; color: var(--n-300); transition: transform var(--t-fast), color var(--t-fast); }

/* confirmación destructiva */
.modal.modal-sm { width: min(440px, calc(100vw - 32px)); }

/* responsive v7 */
@media (max-width: 1180px) {
  .cl-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cl-metric:nth-child(3n + 1) { border-left: none; }
  .cl-metric:nth-child(n + 4) { border-top: 1px solid var(--border); }
  .crumbs { display: flex; flex: 0 1 auto; max-width: 40%; }
  .crumbs > a { display: none; }
  .crumbs > a:last-of-type { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .crumbs > .crumb-sep { display: none; }
  .crumbs > .crumb-sep:last-of-type { display: block; }
}
@media (max-width: 860px) {
  .cl-hero-main { flex-wrap: wrap; padding: 20px; gap: 16px; }
  .cl-id { flex-basis: calc(100% - 80px); }
  .cl-actions { width: 100%; flex-wrap: wrap; }
  .cl-actions .btn { flex: 1 1 auto; justify-content: center; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 0; margin: 0 -16px; padding-inline: 16px; background: var(--bg); }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { flex: none; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
}
@media (max-width: 560px) {
  .crumbs { display: none; }
  .cl-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-metric { padding: 12px 16px; border-left: none; border-top: 1px solid var(--border); }
  .cl-metric:nth-child(-n + 2) { border-top: none; }
  .cl-metric:nth-child(2n) { border-left: 1px solid var(--border); }
  .cl-metric .ivm-v { font-size: 18px; }
  /* tablas como tarjetas: cada fila es un bloque con etiquetas */
  .ds-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ds-table, .ds-table tbody, .ds-table tr, .ds-table td { display: block; width: 100%; }
  .ds-table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .ds-table td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; padding: 4px 0; border: none; text-align: left; }
  .ds-table td[data-label]::before { content: attr(data-label); font: 500 11px/1.6 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--n-500); }
  .ds-table td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  .ds-table td.num-col { text-align: left; }
  .inv-go { display: none !important; }
  .inv-thesis { max-width: none; }
  .cm-table-wrap { overflow-x: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .inv-table tbody tr, .inv-go svg, .settings-nav a, .guide-toc a { transition: none; }
}
@media print {
  .settings-nav, .cl-actions { display: none !important; }
}

/* =========================================================================
   v8 · cliente activo: selector en el menú, franja superior y alcance
   ========================================================================= */
/* contador del menú: número blanco sobre azul en la sección activa */
.nav-item.active .nav-count { background: var(--accent); color: #fff; }

/* selector bajo el logo */
.ws { position: relative; margin: -4px 0 16px; }
.ws-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: #fff; text-align: left; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
@media (hover: hover) { .ws-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.14); } }
.ws-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,102,202,0.35); }
.ws-ring { flex: none; display: grid; place-items: center; width: 32px; height: 32px; }
.ws-ring .ring-txt { display: none; }
.ws-ring .ring-bg { stroke: rgba(255,255,255,0.14); stroke-width: 4; }
.ws-ring .ring-fg { stroke: #6FA8E8; stroke-width: 4; }
.ws-ring .ring-fg.done { stroke: #fff; }
.ws-ring.ws-all { border-radius: 9px; background: rgba(255,255,255,0.08); color: #6FA8E8; }
.ws-ring.ws-all svg { width: 16px; height: 16px; }
.ws-txt { display: grid; gap: 2px; flex: 1 1 0; min-width: 0; }
.ws-txt > * { display: block; min-width: 0; }
.ws-k { font: 500 10.5px/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.ws-name { font: 600 14px/1.3 var(--font-sans); color: #fff; letter-spacing: -0.01em; }
.ws-chev { flex: none; width: 16px; height: 16px; color: rgba(255,255,255,0.5); }
.ws-menu { position: fixed; z-index: 300; max-height: min(420px, 70vh); overflow-y: auto; padding: 6px; border-radius: 14px; background: #141A21; border: 1px solid rgba(255,255,255,0.1); box-shadow: var(--shadow-lg); animation: ws-in var(--t-fast) var(--ease-out); }
@keyframes ws-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ws-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px; border-radius: 10px; background: none; border: 0; color: #fff; text-align: left; cursor: pointer; }
.ws-opt .ws-ring { width: 28px; height: 28px; }
.ws-opt .ws-name { font-size: 13.5px; }
.ws-opt .ws-k { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
@media (hover: hover) { .ws-opt:hover { background: rgba(255,255,255,0.07); } }
.ws-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ws-opt.active { background: rgba(0,102,202,0.22); }
.ws-check { flex: none; width: 16px; height: 16px; color: #6FA8E8; }
.ws-sep { margin: 8px 8px 4px; font: 500 10.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.45); }

/* franja en la barra superior */
.ws-chip { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 320px; height: 36px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); flex: 0 1 auto; }
.ws-chip.is-all { display: none; background: var(--n-100); }
.ws-chip.is-all .ws-chip-name { color: var(--text-2); font-weight: 500; }
.ws-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ws-chip-name { font: 600 13px var(--font-sans); color: var(--fg); min-width: 0; }
.ws-chip-btn { flex: none; height: 28px; padding: 0 10px; border-radius: 999px; border: 0; background: #fff; color: var(--accent); font: 600 12px var(--font-sans); cursor: pointer; box-shadow: var(--shadow-xs); }
.ws-chip-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: none; color: var(--accent); cursor: pointer; }
.ws-chip-x svg { width: 14px; height: 14px; }
@media (hover: hover) { .ws-chip-btn:hover { background: var(--accent); color: #fff; } .ws-chip-x:hover { background: rgba(0,102,202,0.14); } }

/* alcance en Inversores y tarjeta activa en Clientes */
.ws-scope { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: 500 13px var(--font-sans); color: var(--text-2); cursor: pointer; }
.ws-scope input { accent-color: var(--accent); width: 16px; height: 16px; }
.mandate-card.is-ws { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm); }

@media (max-width: 1180px) { .ws-chip { max-width: 220px; } }
@media (max-width: 860px) {
  .ws-chip, .ws-chip.is-all { display: flex; max-width: 52%; flex: 0 1 auto; }
  .ws-chip-x { display: none; }
}
@media (max-width: 560px) { .ws-chip .ws-dot { display: none; } }
@media (prefers-reduced-motion: reduce) { .ws-menu { animation: none; } .ws-btn { transition: none; } }
@media print { .ws, .ws-chip { display: none !important; } }
@media (max-width: 560px) { .ws-chip.is-all .ws-chip-name { display: none; } .ws-chip.is-all { padding-left: 4px; } }

/* =========================================================================
   v9 · menú en dos zonas: trabajo con el cliente arriba, plataforma abajo
   ========================================================================= */
.nav-zone { display: block; }
.nav-zone .nav-group-label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 10px 8px; }
.nav-zone-work { margin-bottom: 16px; padding: 12px 8px 8px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
.nav-zone-work .nav-group-label { padding: 0 6px 10px; }
.nav-zone-work .ws { margin: 0 0 8px; }
.nav-zone-work .ws-btn { background: rgba(255,255,255,0.06); }
.nav-zone-work .nav-item.active::before { left: -8px; }
.nav-zone-platform { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.nav-zone-platform + .sidebar-foot { margin-top: 12px; }

/* v10 · pie del selector de cliente: acceso a la cartera */
.ws-foot { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 6px; padding: 8px; border-top: 1px solid rgba(255,255,255,0.08); border-radius: 0 0 10px 10px; color: #9CC3EE; font: 600 13px var(--font-sans); text-decoration: none; }
.ws-foot svg { width: 16px; height: 16px; flex: none; }
@media (hover: hover) { .ws-foot:hover { background: rgba(255,255,255,0.07); color: #fff; } }
.ws-foot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-ws-li][hidden] { display: none; }

/* v11 · pendientes de hoy por cliente en el selector y llamado a elegir cliente */
.ws-head { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.ws-pend { flex: none; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--accent-2); color: #fff; font: 600 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.ws-pend.is-zero { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.ws-empty { display: grid; gap: 8px; margin: 0 0 8px; padding: 12px; border-radius: 12px; border: 1px dashed rgba(255,255,255,0.16); }
.ws-empty[hidden] { display: none; }
.ws-empty p { margin: 0; font-size: 12.5px; line-height: 1.5; color: rgba(255,255,255,0.64); }
.ws-empty-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--radius-ctl); background: var(--accent); color: #fff; font: 600 13px var(--font-sans); cursor: pointer; transition: background var(--t-fast); }
.ws-empty-btn svg { width: 16px; height: 16px; }
@media (hover: hover) { .ws-empty-btn:hover { background: var(--accent-hover); } }
.ws-empty-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ws-empty-btn { transition: none; } }

/* v12 · archivos y contexto del cliente */
.modal.modal-lg { width: min(640px, 100%); }
.field-label { display: block; margin-bottom: 6px; font: 600 13px var(--font-sans); color: var(--fg); }
.dropzone { display: grid; justify-items: center; gap: 4px; padding: 20px 16px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--n-25); text-align: center; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.dropzone > svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 4px; }
.dz-title { margin: 0; font: 600 13.5px var(--font-sans); color: var(--fg); }
.dz-hint { margin: 0; max-width: 52ch; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.dz-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); } }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.is-over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list:empty { display: none; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.fr-ic { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fr-ic svg { width: 16px; height: 16px; }
.fr-body { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.fr-body > * { display: block; min-width: 0; }
.fr-name { font: 600 13px var(--font-sans); color: var(--fg); }
.fr-meta { font: 500 11.5px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.fr-cat { flex: none; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--n-25); font: 500 12.5px var(--font-sans); color: var(--text-2); max-width: 150px; }
.fr-x { flex: none; }
.cf-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cf-files { display: grid; gap: 12px; min-width: 0; }
.cf-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-empty { margin: 0; font-size: 13.5px; line-height: 1.6; }
.cf-files .file-list { margin: 0; }
.cf-label { display: block; margin-bottom: 4px; font: 600 13.5px var(--font-sans); color: var(--fg); }
.cf-context textarea { width: 100%; min-height: 160px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-ctl); font: 400 14px/1.6 var(--font-sans); color: var(--fg); background: var(--surface); }
.cf-context textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 1180px) { .cf-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .fr-cat { max-width: 110px; } .file-row { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .dropzone { transition: none; } }
@media print { .dropzone, .fr-x { display: none !important; } }

/* ═══ v13 · Matching de inversionistas ═══════════════════════════════════ */
.mt-noclient { margin-top: 8px; }
.mt-basis { margin-bottom: 16px; }
.mt-basis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.mt-basis-item { min-width: 0; display: grid; gap: 2px; }
.mt-basis-item dt { font: 600 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mt-basis-item dd { margin: 0; font-size: 14px; line-height: 1.5; color: var(--fg); overflow-wrap: anywhere; }
.mt-how { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.mt-how summary { cursor: pointer; font: 600 13.5px var(--font-sans); color: var(--accent); width: fit-content; border-radius: 6px; }
.mt-how summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-how p { margin: 10px 0 0; max-width: 72ch; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.mt-how-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 24px; max-width: 640px; }
.mt-how-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--border); }

.mt-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.mt-stat { display: grid; gap: 2px; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.mt-stat-n { font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; line-height: 1.1; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-stat-k { font: 600 13px var(--font-sans); color: var(--fg); }
.mt-stat-d { font-size: 12px; color: var(--muted); }
.mt-stat > * { display: block; min-width: 0; }

.mt-filters { flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.mt-filters select { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); font: 500 13.5px var(--font-sans); color: var(--fg); }
.mt-filters select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.mt-bulk { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; margin-bottom: 12px; border-radius: var(--radius-pill); background: var(--fg); color: #fff; box-shadow: var(--shadow-card); }
.mt-bulk > span { flex: 1 1 auto; font: 600 13.5px var(--font-sans); }
.mt-bulk .btn-ghost { color: #fff; }

.mt-list { display: grid; gap: 8px; }
.mt-row { display: grid; grid-template-columns: 24px 96px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color 150ms ease-out, box-shadow 150ms ease-out; }
.mt-row.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (hover: hover) { .mt-row:hover { border-color: var(--border-strong); } }
.mt-sel { padding-top: 6px; }
.mt-sel input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.mt-score { display: grid; gap: 2px; justify-items: start; }
.mt-score > * { display: block; }
.mt-num { font-size: clamp(26px, 2.6vw, 32px); font-weight: 500; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-num-k { font: 600 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mt-cert { display: grid; gap: 4px; margin-top: 6px; width: 100%; }
.mt-cert > .mono { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mt-cert-bar { display: block; height: 4px; border-radius: 4px; background: var(--n-100); overflow: hidden; }
.mt-cert-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.mt-main { min-width: 0; display: grid; gap: 6px; }
.mt-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mt-name { font: 600 15.5px var(--font-sans); color: var(--fg); text-decoration: none; }
.mt-name:hover { color: var(--accent); }
.mt-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mt-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-meta { margin: 0; font-size: 13px; color: var(--muted); }
.mt-crit { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mt-c { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: var(--radius-pill); font: 500 12px var(--font-sans); border: 1px solid transparent; }
.mt-c svg { width: 14px; height: 14px; flex: none; }
.mt-c.is-ok { background: var(--accent-soft); color: var(--accent-press); }
.mt-c.is-part { background: var(--n-50); color: var(--text-2); border-color: var(--border); }
.mt-c.is-no { background: var(--surface); color: var(--accent-2); border-color: rgba(194, 56, 31, 0.28); }
.mt-c.is-na { background: var(--surface); color: var(--muted); border-color: var(--border); border-style: dashed; }
.mt-coord { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.mt-coord svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.mt-why { margin-top: 6px; padding: 12px 14px; background: var(--n-25); border: 1px solid var(--border); border-radius: 10px; }
.mt-why dl { margin: 0; display: grid; gap: 10px; }
.mt-why-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }
.mt-why-row dt { display: flex; align-items: center; gap: 6px; font: 600 13px var(--font-sans); color: var(--fg); }
.mt-why-row dt svg { width: 15px; height: 15px; flex: none; }
.mt-why-row dt .mono { font-size: 11px; font-weight: 500; }
.mt-why-row dd { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.mt-why-row.is-ok dt svg { color: var(--accent); }
.mt-why-row.is-part dt svg, .mt-why-row.is-na dt svg { color: var(--muted); }
.mt-why-row.is-no dt svg { color: var(--accent-2); }
.mt-acts { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 172px; }
.mt-acts .btn { justify-content: center; }
.mt-acts .btn-icon { align-self: flex-end; }

.mt-low { margin-top: 16px; padding: 0; }
.mt-low summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; font: 600 14px var(--font-sans); color: var(--fg); list-style: none; border-radius: var(--radius-card); }
.mt-low summary::-webkit-details-marker { display: none; }
.mt-low summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mt-low[open] summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.mt-low-intro { margin: 12px 20px 0; font-size: 13px; }
.mt-low-list, .mt-ex-list { list-style: none; margin: 0; padding: 8px 20px 16px; display: grid; }
.mt-low-list li, .mt-ex-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--n-100); }
.mt-low-list li:last-child, .mt-ex-list li:last-child { border-bottom: 0; }
.mt-mini-score { flex: none; width: 40px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--n-50); font-size: 14px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.mt-mini-txt { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.mt-mini-txt > * { display: block; min-width: 0; }
.mt-mini-txt .muted { font-size: 12.5px; line-height: 1.5; }
.mt-excluded { margin-top: 16px; }
.mt-ex-list { padding: 0; }
.mt-ex-list li > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.mt-type-out { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.mt-type-out summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.mt-type-out p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; }
.mt-mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--n-100); }
.mt-mini-row:last-of-type { border-bottom: 0; }

@media (max-width: 1180px) {
  .mt-basis-grid, .mt-how-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-row { grid-template-columns: 24px 88px minmax(0, 1fr); }
  .mt-acts { grid-column: 3; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .mt-acts .btn-icon { align-self: center; }
}
@media (max-width: 560px) {
  .mt-basis-grid, .mt-how-list { grid-template-columns: minmax(0, 1fr); }
  .mt-row { grid-template-columns: 24px minmax(0, 1fr); gap: 12px; }
  .mt-score { grid-column: 2; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; }
  .mt-cert { margin-top: 0; }
  .mt-main, .mt-acts { grid-column: 1 / -1; }
  .mt-acts .btn { flex: 1 1 auto; }
  .mt-why-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mt-bulk { border-radius: var(--radius-sm); flex-wrap: wrap; }
  .mt-filters [data-mt-sort] { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .mt-row { transition: none; } }
@media print { .mt-filters, .mt-bulk, .mt-acts, .mt-sel { display: none !important; } }

/* ═══ v14 · Nuevo cliente: startup o fondo ══════════════════════════════ */
.nm-type { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.nm-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nm-type-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out; }
.nm-type-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nm-type-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.nm-type-card.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
@media (hover: hover) { .nm-type-card:not(.is-on):hover { border-color: var(--border-strong); } }
.nm-type-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--n-50); color: var(--fg); }
.nm-type-card.is-on .nm-type-ic { background: var(--accent); color: #fff; }
.nm-type-ic svg { width: 20px; height: 20px; }
.nm-type-txt { min-width: 0; display: grid; gap: 2px; }
.nm-type-txt > * { display: block; }
.nm-type-txt strong { font: 600 15px var(--font-sans); color: var(--fg); }
.nm-type-txt span { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.nm-sec { border: 0; border-top: 1px solid var(--border); margin: 16px 0 0; padding: 16px 0 0; min-width: 0; }
.nm-sec-t { padding: 0; margin-bottom: 12px; font: 600 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nm-checks { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.nm-check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.nm-check-grid label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); font: 500 13px var(--font-sans); color: var(--fg); cursor: pointer; }
.nm-check-grid input { width: 16px; height: 16px; accent-color: var(--accent); }
.nm-check-grid label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nm-check-grid label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.nm-profile { margin-top: 16px; }
@media (max-width: 560px) { .nm-type-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .nm-type-card { transition: none; } }

/* ═══ v15 · Ficha del inversor según la BBDD ════════════════════════════ */
.db-card .card-head { gap: 12px; }
.db-kv { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); row-gap: 10px; }
.db-kv dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
.db-miss { color: var(--muted); font-weight: 400; font-style: italic; }
.db-na { color: var(--muted); font-weight: 400; }
.db-src { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--n-100); font: 500 10.5px var(--font-mono); letter-spacing: 0.02em; color: var(--text-2); white-space: nowrap; }
.db-ver { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); font: 600 11px var(--font-sans); color: var(--accent-press); white-space: nowrap; }
.db-ver svg { width: 12px; height: 12px; }
.db-sub { font-size: 12px; color: var(--muted); }
.db-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 12.5px; color: var(--fg); background: var(--surface); }
.db-chip.is-ver { border-color: transparent; background: var(--accent-soft); color: var(--accent-press); }
.db-chip svg { width: 12px; height: 12px; }
.db-quote { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--n-25); border: 1px solid var(--border); }
.db-quote p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.6; color: var(--fg); }
.db-quote footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--muted); }
.db-empty { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.db-note { display: flex; gap: 8px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--n-100); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.db-note svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.db-alert { display: flex; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #FBEDEA; color: var(--accent-2); font-size: 13px; line-height: 1.5; }
.db-alert svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.db-good { color: var(--accent-press); font-weight: 600; }
.db-bad { color: var(--accent-2); font-weight: 600; }
.db-ok { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }
.db-eyebrow { margin: 14px 0 6px; }
.db-tried, .db-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.db-tried li { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.db-tried li svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.db-tried li.is-ok svg { color: var(--accent); }
.db-tried strong { color: var(--fg); font-weight: 600; margin-right: 2px; }
.db-list li { position: relative; padding-left: 14px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.db-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.db-list.is-alert li::before { background: var(--accent-2); }
.db-complete { display: grid; gap: 6px; margin-top: 12px; max-width: 360px; }
.db-complete > * { display: block; }
.db-complete-l { font-size: 12.5px; color: var(--text-2); }
.db-bar { height: 6px; border-radius: 6px; background: var(--n-100); overflow: hidden; }
.db-bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.iv-sub svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.iv-kicker .tag svg { width: 12px; height: 12px; }
.db-people { list-style: none; margin: 0; padding: 0; display: grid; }
.db-person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--n-100); }
.db-person:last-child { border-bottom: 0; }
.db-p-av { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--n-100); font: 600 12px var(--font-sans); color: var(--fg); }
.db-p-body { display: grid; gap: 2px; min-width: 0; }
.db-p-body > * { display: block; min-width: 0; }
.db-p-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.db-p-name { font: 600 14px var(--font-sans); color: var(--fg); }
.db-p-role { font-size: 13px; color: var(--text-2); }
.db-p-loc, .db-p-src { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.db-p-links { display: flex; gap: 4px; align-items: center; }
.db-more { margin-top: 4px; }
.db-more summary { cursor: pointer; padding: 8px 0; font: 600 13px var(--font-sans); color: var(--accent); width: fit-content; border-radius: 6px; }
.db-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.db-vline { font-weight: 500; }
.db-vline.is-ver { color: var(--accent-press); }
.db-vline.is-low { color: var(--accent-2); }
@media (max-width: 560px) {
  .db-kv { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .db-kv dd { margin-bottom: 8px; }
  .db-person { grid-template-columns: 36px minmax(0, 1fr); }
  .db-p-links { grid-column: 2; }
}

/* ═══ v16 · Alta con 7 datos, carga desde el deck y matching en 3 grupos ═ */
.nm-deck { margin: 16px 0 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--n-25); }
.nm-deck-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.nm-deck-txt { min-width: 0; display: grid; gap: 4px; }
.nm-deck-txt > * { display: block; margin: 0; }
.nm-sec-h { font: 600 14px var(--font-sans); color: var(--fg); }
.nm-step { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--fg); color: #fff; font-size: 12px; font-weight: 600; }
.nm-sec-t { display: flex; align-items: center; gap: 8px; }
.nm-sec-t .nm-step { width: 20px; height: 20px; font-size: 11px; letter-spacing: 0; }
.nm-deck-zone { min-height: 0; padding: 20px 16px; }
.nm-deck-status { display: flex; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-press); font-size: 13px; line-height: 1.5; }
.nm-deck-status svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.nm-src { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 4px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-press); font: 600 10.5px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle; }
.nm-src.is-edited { background: var(--n-100); color: var(--text-2); }
.nm-check-grid label.is-off { opacity: 0.45; cursor: not-allowed; }
.nm-assumed { margin-left: 2px; color: var(--muted); font-weight: 600; }
.nm-later { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 16px; }
.nm-later summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; list-style: none; font: 600 13.5px var(--font-sans); color: var(--fg); }
.nm-later summary::-webkit-details-marker { display: none; }
.nm-later summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform 150ms ease-out; }
.nm-later[open] summary svg { transform: rotate(180deg); }
.nm-later summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.nm-later[open] { padding-bottom: 16px; }
.nm-impact { margin-top: 4px; }
.mt-pos { margin-top: 24px; }
.mt-group-head { display: grid; gap: 4px; margin-bottom: 4px; }
.mt-group-head > * { display: block; margin: 0; }
.mt-group-head h2 { font: 600 16px var(--font-sans); color: var(--fg); }
.mt-group-head p { font-size: 13px; }
.mt-verify { background: var(--n-50); color: var(--text-2); }
.mt-verify svg { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .nm-later summary svg { transition: none; } }

/* ═══ v17 · Matching: conteo en la BBDD y pedidos de enriquecimiento ════ */
.mt-bbdd { margin-bottom: 16px; }
.mt-bbdd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mt-bbdd-step { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.mt-bbdd-step > * { display: block; min-width: 0; }
.mt-bbdd-step.is-pending { border-style: dashed; background: var(--n-25); }
.mt-bbdd-k { font: 600 11px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mt-bbdd-n { font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; color: var(--fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-bbdd-step.is-pending .mt-bbdd-n { font: 600 14px var(--font-sans); color: var(--text-2); white-space: normal; }
.mt-bbdd-d { font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.mt-enrich-done { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent-press); }
.mt-enrich-done svg { width: 14px; height: 14px; flex: none; }
@media (max-width: 860px) { .mt-bbdd-grid { grid-template-columns: minmax(0, 1fr); } }

/* v18 · contador de pedidos de enriquecimiento en el menú de Ajustes */
.settings-nav .set-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; background: var(--accent); color: #fff; }
.settings-nav .set-count[hidden] { display: none; }
@media (max-width: 860px) { .settings-nav .set-count { margin-left: 4px; } }

/* v19 · enriquecimiento de datos con IA (agente simulado, aprobación humana) */
.iv-enrich { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.iv-enrich-pend { color: var(--accent); }
.iv-enrich-done { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.iv-enrich-done svg, .db-src-ai svg { width: 12px; height: 12px; }
.db-src-ai { gap: 4px; background: var(--accent-soft); color: var(--accent-press); text-decoration: none; }
@media (hover: hover) { .db-src-ai:hover { text-decoration: underline; } }
.en-modal { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.en-modal .modal-head h2 { display: flex; align-items: center; gap: 8px; }
.en-modal .modal-head h2 svg { width: 18px; height: 18px; color: var(--accent); }
.en-modal .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.en-body { overflow-y: auto; min-height: 0; padding-right: 4px; }
.en-pick { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin: 0 0 16px; }
.en-pick legend { padding: 0 4px; font: 600 12px var(--font-sans); color: var(--text-2); }
.en-pick-row { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--n-100); cursor: pointer; }
.en-pick-row:last-child { border-bottom: 0; }
.en-pick-l { flex: 1 1 0; min-width: 0; font-size: 14px; }
.en-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.en-sources .tag svg { width: 12px; height: 12px; }
.en-off { opacity: 0.6; text-decoration: line-through; }
.en-note { display: flex; gap: 8px; margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--n-100); font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.en-note svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }
.en-run { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.en-run li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.en-run li .en-run-st { margin-left: auto; font-size: 12.5px; }
.en-run-ic svg { width: 16px; height: 16px; color: var(--muted); }
.en-run li.is-busy { border-color: var(--accent); }
.en-run li.is-busy .en-run-ic svg { color: var(--accent); animation: en-spin 900ms linear infinite; }
.en-run li.is-ok .en-run-ic svg { color: var(--accent-press); }
.en-run li.is-off { opacity: 0.55; }
@keyframes en-spin { to { transform: rotate(360deg); } }
.en-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.en-item { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.en-item.is-pending { border-color: #B9D3F0; }
.en-item.is-approved { background: var(--accent-soft); border-color: transparent; }
.en-item.is-rejected, .en-item.is-nf { background: var(--n-100); border-color: transparent; }
.en-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.en-head strong { font-size: 14px; margin-right: 4px; }
.en-sim { border-style: dashed; color: var(--text-2); }
.en-val { font: 600 15px var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.en-quote { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); font-style: italic; }
.en-src { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; overflow-wrap: anywhere; }
.en-src svg { flex: none; width: 13px; height: 13px; }
.en-status { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; }
.en-status svg { width: 14px; height: 14px; }
.en-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.en-edit { display: grid; gap: 4px; }
.en-edit input { width: 100%; }
.en-edit .muted { font-size: 12px; }
.en-head-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.en-h3 { display: flex; align-items: center; gap: 8px; margin: 24px 0 8px; font: 600 14px var(--font-sans); }
.en-empty { font-size: 13px; }
.en-tray-acts { display: flex; gap: 6px; justify-content: flex-end; }
.en-tray + .btn { margin-top: 12px; }
.en-cfg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px); gap: 16px; align-items: start; }
.en-cfg-src { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.en-cfg-src legend { padding: 0 4px; font: 600 12px var(--font-sans); color: var(--text-2); }
.en-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; cursor: pointer; }
.en-cfg-lim .muted { font-size: 12.5px; margin: 4px 0 0; }
.en-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.en-log li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
@media (max-width: 860px) { .en-cfg { grid-template-columns: minmax(0, 1fr); } .en-log li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
@media (prefers-reduced-motion: reduce) { .en-run li.is-busy .en-run-ic svg { animation: none; } }
.en-modal .modal-foot { flex-wrap: wrap; }

/* v20 · equipo con Apollo, historial de datos enriquecidos y datos por revisar en Hoy */
.db-card .card-head { flex-wrap: wrap; gap: 8px; }
.db-card .card-head h2 { display: flex; align-items: baseline; gap: 8px; }
.en-pick-l { display: grid; gap: 2px; }
.en-pick-sub { display: block; font-size: 12.5px; }
.en-pick-row:has(input:disabled) { cursor: default; opacity: 0.6; }
.en-hist-live { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.en-hist-live li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.en-hl-main { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.en-hl-label { font: 600 13px var(--font-sans); }
.en-hl-val { font-size: 13px; overflow-wrap: anywhere; }
.en-hl-meta { font-size: 12px; }
.en-hist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.en-hist li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
.en-hist li.is-rev strong { color: var(--text-2); }
.en-hoy-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-press); }
.en-hoy-ic svg { width: 16px; height: 16px; }
.en-hoy-row { align-items: center; }
@media (max-width: 560px) { .en-hist li { grid-template-columns: minmax(0, 1fr); gap: 0; } .en-hist-live li { flex-direction: column; } }

/* v21 · equipos con Apollo desde Matching y créditos de Apollo en Ajustes */
.mt-ai-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ap-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 16px; }
.ap-rates input { width: 100%; }
.ap-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.ap-sum .od-stat { padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.ap-sum .muted { font-size: 12px; }
.ap-n { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-log td.mono { font-variant-numeric: tabular-nums; }
.ap-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 12.5px; }
@media (max-width: 860px) { .ap-rates { grid-template-columns: minmax(0, 1fr); } .ap-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* v22 · paginación de Matching (1, 2, 3…) */
.mt-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 4px; }
.mt-pager-info { font-size: 13px; }
.mt-pager-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mt-pager-n { min-width: 40px; height: 40px; padding: 0 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--fg); font: 600 13px var(--font-mono); font-variant-numeric: tabular-nums; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
@media (hover: hover) { .mt-pager-n:hover { background: var(--n-100); } }
.mt-pager-n.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mt-pager-n:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-pager-gap { min-width: 24px; text-align: center; color: var(--muted); }
.mt-pager .btn-icon[disabled] { opacity: 0.4; cursor: default; }
.mt-pager-per { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
[data-mt-list]:focus, [data-mt-pos]:focus { outline: none; }
@media (max-width: 560px) { .mt-pager { justify-content: center; } .mt-pager-info { width: 100%; text-align: center; } }

/* v23 · paginación de Inversores */
.inv-pager:empty { display: none; }
.inv-pager { padding: 4px 16px 12px; border-top: 1px solid var(--border); }
.inv-table:focus { outline: none; }

/* v24 · filtro del directorio de Inversores */
.dx-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--n-25); font-size: 13px; line-height: 1.5; color: var(--text-2); }
.dx-notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.dx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dx-stat { display: grid; gap: 4px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); }
.dx-stat-l { font-size: 12px; color: var(--muted); }
.dx-stat-n { font: 600 clamp(18px, 2vw, 22px) var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--fg); }
.dx-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.dx-facets { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-xs); }
.dx-sheet-head, .dx-sheet-foot, .dx-open-sheet { display: none; }
.dx-views { display: grid; gap: 8px; padding: 16px; border-bottom: 1px solid var(--border); }
.dx-views-l { font: 600 12px var(--font-sans); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dx-views-row { display: flex; gap: 6px; }
.dx-views-row select { flex: 1 1 0; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 500 13px var(--font-sans); color: var(--fg); }
.dx-save-form { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-save-form input { flex: 1 1 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: 14px var(--font-sans); }
.dx-group { border-bottom: 1px solid var(--border); }
.dx-group:last-child { border-bottom: 0; }
.dx-group summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer; list-style: none; font: 600 13.5px var(--font-sans); color: var(--fg); }
.dx-group summary::-webkit-details-marker { display: none; }
.dx-group summary:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: -2px; }
.dx-g-l { flex: 1 1 0; }
.dx-g-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 11px/20px var(--font-mono); text-align: center; }
.dx-g-n[hidden] { display: none; }
.dx-g-chev { width: 16px; height: 16px; color: var(--muted); transition: transform var(--t-fast); }
.dx-group[open] .dx-g-chev { transform: rotate(180deg); }
.dx-g-body { display: grid; gap: 8px; padding: 0 16px 16px; }
.dx-g-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.dx-ast { margin-left: 2px; color: var(--accent); font-weight: 700; }
.dx-opts { display: grid; gap: 2px; }
.dx-opt { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 6px; margin: 0 -6px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; color: var(--fg); }
@media (hover: hover) { .dx-opt:hover { background: var(--n-50); } }
.dx-opt input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.dx-opt-l { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-opt-n { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dx-opt.is-zero { color: var(--muted); }
.dx-more { justify-self: start; padding: 4px 0; border: 0; background: none; font: 600 13px var(--font-sans); color: var(--accent); cursor: pointer; }
.dx-regions { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-region { height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: 500 12px var(--font-sans); color: var(--text-2); cursor: pointer; }
.dx-region.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-press); }
.dx-g-search { position: relative; }
.dx-g-search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--muted); }
.dx-g-search input { width: 100%; height: 34px; padding: 0 10px 0 30px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 13.5px var(--font-sans); background: var(--surface); }
.dx-tk { display: grid; gap: 10px; }
.dx-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: var(--radius-sm); background: var(--n-100); }
.dx-seg button { min-height: 30px; border: 0; border-radius: 6px; background: none; font: 500 12.5px var(--font-sans); color: var(--text-2); cursor: pointer; }
.dx-seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-xs); font-weight: 600; }
.dx-tk-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dx-tk-range label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.dx-tk-range select { height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 500 13px var(--font-mono); color: var(--fg); }
.dx-tk-range select:disabled, .dx-check input:disabled + span { opacity: .5; }
.dx-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--fg); cursor: pointer; }
.dx-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.dx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.dx-search { flex: 1 1 260px; max-width: none; }
.dx-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.dx-sort select { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 500 13px var(--font-sans); }
.dx-toolbar [data-dx-scope] .ws-scope { margin-left: 0; }
.dx-badge { min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 11px/18px var(--font-mono); }
.dx-badge[hidden] { display: none; }
.dx-active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dx-active:empty { display: none; }
.dx-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 8px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: 500 12.5px var(--font-sans); color: var(--fg); cursor: pointer; max-width: 100%; }
.dx-chip svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
@media (hover: hover) { .dx-chip:hover { border-color: var(--border-strong); } .dx-chip:hover svg { color: var(--fg); } }
.dx-clear-all { border: 0; background: none; padding: 0 8px; font: 600 12.5px var(--font-sans); color: var(--accent); cursor: pointer; }
.dx-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: var(--radius-ctl); background: var(--accent-soft); }
.dx-bulk-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.dx-bulk-n { font-size: 13.5px; color: var(--accent-press); }
.dx-bulk-hint { font-size: 12.5px; color: var(--text-2); }
.dx-table-card { padding: 0; overflow: hidden; }
.dx-table td { vertical-align: middle; }
.dx-table tr[data-dx-id] { cursor: pointer; }
.dx-table tr.is-sel td { background: var(--accent-soft); }
.dx-table:focus { outline: none; }
.dx-table .investor-name .texts { max-width: 260px; }
.dx-ck { width: 40px; }
.dx-ck input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.dx-sub { display: block; font-size: 12px; color: var(--muted); }
.dx-secs { display: flex; flex-wrap: wrap; gap: 4px; }
.dx-icons { display: inline-flex; align-items: center; gap: 6px; }
.dx-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--n-100); color: var(--text-2); }
.dx-ic svg { width: 13px; height: 13px; }
.dx-dm { margin-left: 2px; }
.dx-own { color: var(--accent); font-weight: 600; }
.dx-drawer-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(14, 18, 23, .32); }
.dx-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; display: flex; flex-direction: column; gap: 16px; width: min(440px, 100vw); padding: 20px 24px; overflow-y: auto; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(24px); opacity: 0; transition: transform var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out); }
.dx-drawer.open { transform: none; opacity: 1; }
.dx-dr-head { display: flex; align-items: flex-start; gap: 12px; }
.dx-dr-head .organism { flex: none; }
.dx-dr-t { flex: 1 1 0; min-width: 0; }
.dx-dr-t h2 { margin: 0 0 4px; font: 600 20px/1.25 var(--font-sans); overflow-wrap: anywhere; }
.dx-dr-t h2:focus { outline: none; }
.dx-dr-t p { margin: 0; font-size: 13px; }
.dx-dr-note { display: flex; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--n-50); font-size: 13px; line-height: 1.5; color: var(--text-2); }
.dx-dr-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
.dx-dr-compl { display: grid; gap: 6px; font-size: 13px; }
.dx-bar { display: block; height: 6px; border-radius: 999px; background: var(--n-100); overflow: hidden; }
.dx-bar span { display: block; height: 100%; background: var(--accent); }
.dx-dr-kv { margin: 0; }
.dx-yes { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); }
.dx-yes svg { width: 14px; height: 14px; color: var(--accent); }
.dx-dr-acts { display: grid; gap: 8px; margin-top: auto; }
.dx-dr-acts .btn { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .dx-drawer { transition: none; } .dx-g-chev { transition: none; } }
@media (max-width: 1180px) {
  .dx-layout { grid-template-columns: minmax(0, 1fr); }
  .dx-open-sheet { display: inline-flex; }
  .dx-facets { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 82; max-height: 85vh; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); transform: translateY(100%); visibility: hidden; transition: transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med); }
  .dx-facets.open { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease-out); }
  .dx-sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .dx-sheet-head h2 { margin: 0; font: 600 16px var(--font-sans); }
  .dx-sheet-foot { display: flex; gap: 8px; position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
  .dx-sheet-foot .btn-primary { flex: 1 1 0; justify-content: center; }
  body.dx-sheet-on::after { content: ''; position: fixed; inset: 0; z-index: 81; background: rgba(14, 18, 23, .32); }
  .dx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dx-sort { flex: 1 1 0; }
  .dx-sort select { flex: 1 1 0; min-width: 0; }
  .dx-bulk-acts { margin-left: 0; }
  .dx-drawer { padding: 16px; }
  .dx-table .dx-ck { width: auto; }
}

/* v25 · alertas por correo y próximos pasos */
.al-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.al-person { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.al-p-head { display: flex; align-items: center; gap: 12px; }
.al-p-head .avatar { flex: none; }
.al-p-t { display: grid; gap: 2px; flex: 1 1 0; min-width: 0; }
.al-p-t strong { font: 600 16px var(--font-sans); color: var(--fg); }
.al-p-t .muted { font-size: 13px; }
.al-fs { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.al-fs legend { padding: 0; margin-bottom: 8px; font: 600 12px var(--font-sans); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.al-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.al-line select { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 500 13px var(--font-mono); }
.al-type { justify-content: space-between; }
.al-type span:first-of-type { flex: 1 1 0; min-width: 0; }
.al-scope { max-width: 320px; grid-template-columns: repeat(2, 1fr); }
.al-clients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.al-warn { color: var(--accent-2, #C2381F); }
.al-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px solid var(--border); padding-top: 16px; }
.al-sub { margin: -4px 0 12px; font-size: 13.5px; }
.al-route select { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 500 13px var(--font-sans); }
.al-prev-tabs { display: inline-grid; grid-auto-flow: column; gap: 0; padding: 3px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--n-100); }
.al-prev-tabs button { min-height: 32px; padding: 0 16px; border: 0; border-radius: 6px; background: none; font: 500 13px var(--font-sans); color: var(--text-2); cursor: pointer; }
.al-prev-tabs button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: var(--shadow-xs); }
.al-mail { display: grid; gap: 12px; margin-bottom: 24px; padding: 16px; border-radius: var(--radius-card); background: var(--n-50); }
.al-mail-meta { display: grid; gap: 4px; max-width: 600px; width: 100%; margin: 0 auto; font-size: 13px; overflow-wrap: anywhere; }
.al-miss { color: var(--accent-2, #C2381F); font-weight: 600; }
.al-outbox td { vertical-align: top; }
.modal-wide { width: min(720px, calc(100vw - 32px)); }
.modal-body { max-height: 70vh; overflow-y: auto; }
.hoy-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.hoy-mail[hidden] { display: none; }
.hoy-mail svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.hoy-mail-off { color: var(--accent-2, #C2381F); font-weight: 600; }
.next-step { display: grid; gap: 8px; margin: 0 0 16px; padding: 12px 16px 4px; border: 1px solid var(--border); border-radius: var(--radius-ctl); min-width: 0; }
.next-step legend { padding: 0 4px; font: 600 13px var(--font-sans); color: var(--fg); }
.sc-next { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }
.sc-next svg { width: 13px; height: 13px; flex: none; color: var(--accent); }
.sc-next-t { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-next-w { flex: none; font-size: 11px; white-space: nowrap; }
.sc-next.due .sc-next-w, .sc-next.due svg { color: var(--accent-2, #C2381F); }
@media (max-width: 1024px) { .al-people { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .al-clients { grid-template-columns: minmax(0, 1fr); } .al-mail { padding: 8px; } }

/* v26 · acceso, legales y errores */
.auth-body { margin: 0; min-height: 100vh; background: var(--bg); }
.auth { display: grid; grid-template-columns: minmax(320px, 44%) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; background: var(--ink, #0E1217); color: #fff; }
.auth-logo { display: inline-flex; flex-direction: column; gap: 6px; text-decoration: none; color: #fff; }
.auth-logo img { width: 168px; height: auto; display: block; }
.auth-brand-body { display: grid; gap: 16px; max-width: 440px; }
.auth-brand-eyebrow { margin: 0; font: 600 12px/1 var(--font-mono); letter-spacing: .14em; color: #9DB8D9; }
.auth-brand-title { margin: 0; font: 500 clamp(24px, 2.6vw, 34px)/1.25 var(--font-sans); letter-spacing: -.01em; color: #fff; }
.auth-brand-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: #B7C2D0; }
.auth-brand-foot a { color: #fff; text-decoration: none; }
@media (hover: hover) { .auth-brand-foot a:hover { text-decoration: underline; } }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { display: grid; gap: 16px; width: 100%; max-width: 420px; }
.auth-card h1 { margin: 0; font: 600 28px/1.2 var(--font-sans); letter-spacing: -.015em; color: var(--fg); }
.auth-card h1:focus { outline: none; }
.auth-lead { margin: -4px 0 4px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.auth-card form { display: grid; gap: 4px; }
.auth-card .field input { font-size: 16px; }
.auth-submit { width: 100%; justify-content: center; min-height: 44px; margin-top: 8px; }
.auth-google { width: 100%; justify-content: center; min-height: 44px; }
.auth-google-pick { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.auth-mini { margin: 0; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auth-or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ''; flex: 1 1 0; height: 1px; background: var(--border); }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth-label-row .inline-link { font-size: 13px; }
.auth-pass { position: relative; display: flex; }
.auth-pass input { flex: 1 1 0; min-width: 0; padding-right: 48px; }
.auth-pass .btn-icon { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.auth-remember { margin: 4px 0; }
.auth-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--radius-ctl); border: 1px solid var(--border); background: var(--n-50); font-size: 14px; line-height: 1.5; color: var(--fg); }
.auth-alert[hidden] { display: none; }
.auth-alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent); }
.auth-alert.is-bad { border-color: var(--accent-2); background: #FBEFEC; }
.auth-alert.is-bad svg { color: var(--accent-2); }
.auth-alert.is-ok svg { color: var(--accent); }
.auth-demo { border: 1px solid var(--border); border-radius: var(--radius-ctl); padding: 0 12px; }
.auth-demo summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font: 600 13.5px var(--font-sans); color: var(--text-2); }
.auth-demo ul { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 4px; }
.auth-demo-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; text-align: left; cursor: pointer; font: inherit; color: var(--fg); }
@media (hover: hover) { .auth-demo-btn:hover { background: var(--n-50); border-color: var(--border); } }
.auth-demo-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-demo-t { display: grid; gap: 2px; min-width: 0; }
.auth-demo-t span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-foot { margin: 0; font-size: 13.5px; color: var(--muted); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font: 600 13.5px var(--font-sans); color: var(--accent); text-decoration: none; min-height: 32px; }
.auth-back svg { width: 16px; height: 16px; }
.auth-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.auth-ic.is-bad { background: #FBEFEC; color: var(--accent-2); }
.auth-ic svg { width: 24px; height: 24px; }
.auth-rules { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-rules li { display: flex; align-items: center; gap: 8px; }
.auth-rules li::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; }
.auth-rules li.ok { color: var(--fg); }
.auth-rules li.ok::before { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/10px no-repeat; }
.auth-role-desc { margin: -8px 0 0; font-size: 14px; color: var(--text-2); }
.auth-terms { align-items: flex-start; line-height: 1.5; margin-top: 8px; }
.auth-spin { width: 14px; height: 14px; margin-right: 8px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; display: inline-block; animation: auth-spin .8s linear infinite; vertical-align: -2px; }
.btn-secondary .auth-spin, .btn-ghost .auth-spin { border-color: var(--border-strong); border-top-color: var(--accent); }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-spin { animation-duration: 2s; } }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 20px 24px; gap: 12px; }
  .auth-brand-body, .auth-brand-foot { display: none; }
  .auth-main { place-items: start center; padding: 32px 20px 48px; }
}
/* páginas auxiliares: legales y errores */
.aux-body { margin: 0; min-height: 100vh; background: var(--bg); }
.aux-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.aux-logo { display: inline-flex; flex-direction: column; gap: 4px; text-decoration: none; }
.aux-logo img { width: 132px; height: auto; display: block; }
.aux-logo .brand-product { color: var(--accent); }
.aux-links { display: flex; gap: 16px; font-size: 14px; }
.aux-links a { color: var(--text-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
@media (hover: hover) { .aux-links a:hover { color: var(--fg); text-decoration: underline; } }
.err-wrap { display: grid; place-items: center; padding: 64px 20px; }
.err-card { display: grid; gap: 16px; justify-items: center; width: 100%; max-width: 560px; text-align: center; }
.err-code { margin: 0; font: 600 clamp(64px, 12vw, 112px)/1 var(--font-mono); letter-spacing: -.04em; color: var(--accent); }
.err-card h1 { margin: 0; font: 600 clamp(24px, 3vw, 30px)/1.2 var(--font-sans); color: var(--fg); }
.err-card h1:focus { outline: none; }
.err-lead { margin: 0; max-width: 460px; font-size: 16px; line-height: 1.6; color: var(--text-2); }
.err-ref { margin: 0; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.err-ref code { padding: 2px 8px; border-radius: 6px; background: var(--n-100); font-size: 12.5px; }
.err-search { display: flex; gap: 8px; width: 100%; max-width: 440px; }
.err-search[hidden], .err-links[hidden] { display: none; }
.err-search .search-field { flex: 1 1 0; max-width: none; }
.err-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.err-link { display: grid; justify-items: center; gap: 6px; padding: 16px 8px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); color: var(--fg); text-decoration: none; font: 600 13px var(--font-sans); }
.err-link svg { width: 20px; height: 20px; color: var(--accent); }
@media (hover: hover) { .err-link:hover { border-color: var(--accent); background: var(--accent-soft); } }
.err-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--n-100); color: var(--fg); }
.err-ic svg { width: 30px; height: 30px; }
.err-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.err-variants { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; width: 100%; }
.err-variants a { color: var(--accent); text-decoration: none; }
.err-variants a[aria-current="page"] { color: var(--fg); font-weight: 600; }
@media (max-width: 560px) { .err-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } .aux-top { padding: 12px 16px; } }
.legal { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.legal-head { display: grid; gap: 12px; max-width: 720px; margin: 8px 0 32px; }
.legal-head h1 { margin: 0; font: 600 clamp(28px, 3.4vw, 36px)/1.15 var(--font-sans); letter-spacing: -.02em; }
.legal-meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.legal-intro { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text-2); }
.legal-draft { display: flex; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--accent-2); border-radius: var(--radius-ctl); background: #FBEFEC; font-size: 14px; line-height: 1.5; }
.legal-draft svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--accent-2); }
.ph { padding: 0 4px; border-radius: 4px; background: #FFF4CC; color: #5B4500; font-weight: 600; }
.legal-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.legal-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.legal-nav-t { margin: 0 0 8px; font: 600 12px var(--font-sans); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.legal-nav a { padding: 6px 10px; border-left: 2px solid var(--border); font-size: 14px; color: var(--text-2); text-decoration: none; }
.legal-nav a.active { border-color: var(--accent); color: var(--fg); font-weight: 600; }
@media (hover: hover) { .legal-nav a:hover { color: var(--fg); } }
.legal-body { max-width: 68ch; }
.legal-body section { padding: 8px 0 24px; scroll-margin-top: 24px; }
.legal-body h2 { margin: 0 0 12px; font: 600 20px/1.3 var(--font-sans); color: var(--fg); }
.legal-body p, .legal-body li { font-size: 16px; line-height: 1.7; color: var(--text-2); }
.legal-body p { margin: 0 0 12px; }
.legal-body ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.legal-body strong { color: var(--fg); }
@media (max-width: 860px) { .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } .legal-nav { position: static; grid-auto-flow: row; padding-bottom: 16px; border-bottom: 1px solid var(--border); } }
/* sesión dentro de la plataforma */
.sidebar-logout { display: flex; align-items: center; gap: 8px; width: calc(100% - 16px); min-height: 36px; margin: 4px 8px 0; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--on-dark-muted); font: 500 13px var(--font-sans); cursor: pointer; }
.sidebar-logout svg { width: 15px; height: 15px; }
@media (hover: hover) { .sidebar-logout:hover { background: var(--on-dark-surface-hover); color: var(--on-dark); } }
.sidebar-logout:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: -2px; }
.sidebar-legal { display: flex; gap: 6px; justify-content: center; margin: 4px 0 8px; font-size: 11.5px; color: var(--on-dark-muted); }
.sidebar-legal a { color: var(--on-dark-muted); text-decoration: none; }
@media (hover: hover) { .sidebar-legal a:hover { color: var(--on-dark); text-decoration: underline; } }
.eq-session { display: flex; gap: 10px; margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.eq-session svg { width: 17px; height: 17px; flex: none; color: var(--accent); margin-top: 2px; }
.eq-invite { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.eq-invite .field { margin: 0; }
.eq-invite .btn { min-height: 40px; margin-bottom: 2px; }
.eq-acts { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 640px) { .eq-invite { grid-template-columns: minmax(0, 1fr); } }

/* v27 · portal del cliente */
.pt-body { margin: 0; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.pt-top { background: #0E1217; color: #fff; }
.pt-top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 14px 24px; }
.pt-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pt-brand img { width: 128px; height: auto; display: block; }
.pt-brand-t { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.22); font: 600 12px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #9DB8D9; white-space: nowrap; }
.pt-user { display: flex; align-items: center; gap: 12px; }
.pt-user-n { font-size: 14px; color: #fff; }
.pt-prev-tag { padding: 4px 10px; border-radius: 999px; background: #FFF4CC; color: #5B4500; font: 600 12px var(--font-sans); }
.pt-out { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: none; color: #fff; font: 500 13px var(--font-sans); cursor: pointer; }
@media (hover: hover) { .pt-out:hover { background: rgba(255,255,255,.08); } }
.pt-out svg { width: 15px; height: 15px; }
.pt-preview { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 0; padding: 10px 16px; background: #FFF4CC; color: #5B4500; font-size: 14px; }
.pt-preview svg { width: 16px; height: 16px; }
.pt-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.pt-head-in { max-width: 1120px; margin: 0 auto; padding: 24px 24px 0; }
.pt-head h1 { margin: 4px 0 16px; font: 600 clamp(24px, 3vw, 32px)/1.2 var(--font-sans); letter-spacing: -.015em; }
.pt-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; font: 500 14px var(--font-sans); color: var(--text-2); cursor: pointer; }
.pt-tab svg { width: 16px; height: 16px; }
.pt-tab.on { border-color: var(--accent); color: var(--fg); font-weight: 600; }
@media (hover: hover) { .pt-tab:hover { color: var(--fg); } }
.pt-tab:focus-visible, .pt-th:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-2); color: #fff; font: 600 11px/20px var(--font-mono); text-align: center; }
.pt-main { flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; box-sizing: border-box; }
.pt-main:focus { outline: none; }
.pt-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; padding: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pt-foot a { color: var(--text-2); }
.pt-auth { flex: 1 0 auto; display: grid; place-items: start center; padding: 48px 20px; }
.pt-linkbtn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.pt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.pt-card { display: grid; gap: 12px; align-content: start; }
.pt-card h2 { margin: 0; font: 600 17px var(--font-sans); }
.pt-wide { grid-column: 1 / -1; }
.pt-big { margin: 0; font: 600 clamp(26px, 3.4vw, 36px)/1.1 var(--font-mono); white-space: nowrap; }
.pt-big .muted { font-size: 16px; font-weight: 500; }
.pt-bar { display: flex; height: 12px; border-radius: 999px; background: var(--n-100); overflow: hidden; }
.pt-bar-f { background: var(--accent); }
.pt-bar-s { background: #8FB5E3; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.pt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pt-dot { width: 10px; height: 10px; border-radius: 50%; }
.pt-dot.f { background: var(--accent); } .pt-dot.s { background: #8FB5E3; }
.pt-note { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.pt-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.pt-steps li { display: grid; gap: 4px; padding: 12px 8px; border-radius: var(--radius-sm); background: var(--n-50); text-align: center; }
.pt-step-n { font: 600 22px var(--font-mono); color: var(--fg); }
.pt-step-l { font-size: 12.5px; color: var(--text-2); }
.pt-list { margin: 0; padding: 0; list-style: none; display: grid; }
.pt-list li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14.5px; }
.pt-list li:first-child { border-top: 0; }
.pt-list li > span { font-size: 13.5px; color: var(--text-2); }
.pt-hl strong { color: var(--accent-press); }
.pt-print-row { margin: 0; text-align: center; }
.pt-bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pt-bar-row p { margin: 0; }
.pt-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pt-col { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: var(--radius-ctl); background: var(--n-50); min-height: 160px; }
.pt-col h3 { margin: 0 0 4px; font: 600 13px var(--font-sans); color: var(--text-2); }
.pt-pc { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13.5px; }
.pt-pc strong { font-size: 14px; overflow-wrap: anywhere; }
.pt-pc .tag { justify-self: start; }
.pt-pc-d { font-size: 12px; color: var(--muted); }
.pt-pc .pt-linkbtn { justify-self: start; font-size: 13px; color: var(--accent); }
.pt-empty-col { margin: 0; font-size: 13px; color: var(--muted); }
.pt-tag-wait { background: #FFF4CC; border-color: #F0D78A; color: #5B4500; }
.pt-intro { margin-bottom: 16px; }
.pt-intro h2 { margin: 0 0 6px; font: 600 20px var(--font-sans); }
.pt-intro p { margin: 0; max-width: 68ch; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.pt-h3 { margin: 24px 0 8px; font: 600 15px var(--font-sans); }
.pt-bulk { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.pt-approve { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.pt-ap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.pt-ap-ck { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--accent); }
.pt-ap-b h3 { margin: 0 0 2px; font: 600 16px var(--font-sans); }
.pt-ap-b p { margin: 0 0 6px; font-size: 14px; }
.pt-why { color: var(--text-2); line-height: 1.55; }
.pt-ap-acts { display: grid; gap: 6px; }
.pt-ap-acts .btn { justify-content: center; }
.pt-reject { display: grid; gap: 6px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--n-50); }
.pt-reject[hidden] { display: none; }
.pt-reject label { font: 600 13px var(--font-sans); }
.pt-reject select { height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 14px var(--font-sans); background: var(--surface); }
.pt-reject select.invalid { border-color: var(--accent-2); }
.pt-reject-acts { display: flex; gap: 8px; }
.pt-chat, .pk-chat-in { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.pt-threads { display: grid; gap: 4px; }
.pt-th { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 500 14px var(--font-sans); color: var(--fg); text-align: left; cursor: pointer; min-width: 0; }
.pt-th.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.pt-conv h2 { margin: 0 0 12px; font: 600 17px var(--font-sans); }
.pt-msgs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.pt-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; background: var(--n-50); }
.pt-msg.me { justify-self: end; background: var(--accent-soft); }
.pt-msg-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 13px; }
.pt-msg-t { margin: 0; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-msg-empty { padding: 12px 0; }
.pt-reply { display: grid; gap: 8px; }
.pt-reply textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 15px/1.5 var(--font-sans); resize: vertical; }
.pt-reply textarea.invalid { border-color: var(--accent-2); }
.pt-reply .btn { justify-self: end; }
.pt-drop { display: grid; justify-items: center; gap: 6px; padding: 24px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-ctl); text-align: center; cursor: pointer; font-size: 14px; }
.pt-drop svg { width: 22px; height: 22px; color: var(--accent); }
.pt-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-pref { align-items: flex-start; padding: 8px 0; }
.pt-pref > span { display: grid; gap: 2px; }
.pt-pref .muted { font-size: 13px; }
.pt-mail { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; line-height: 1.55; }
.pt-mail p { margin: 0; }
.pt-mail-btn { display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; }
.pt-mail-f { font-size: 12px; }
@media (max-width: 860px) {
  .pt-grid { grid-template-columns: minmax(0, 1fr); }
  .pt-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pt-chat, .pk-chat-in { grid-template-columns: minmax(0, 1fr); }
  .pt-threads { grid-auto-flow: column; grid-auto-columns: minmax(160px, max-content); overflow-x: auto; }
  .pt-ap { grid-template-columns: auto minmax(0, 1fr); }
  .pt-ap-acts { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .pt-brand-t { display: none; } .pt-user-n { display: none; } .pt-main { padding: 16px 16px 48px; } .pt-head-in { padding: 16px 16px 0; } }
@media print {
  .pt-top, .pt-tabs, .pt-foot, .pt-print-row, .pt-preview, .toast-stack { display: none !important; }
  .pt-grid { grid-template-columns: 1fr 1fr; }
  .pt-bar, .pt-bar-f, .pt-bar-s { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* portal del cliente, lado Kavanah */
.pk-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; margin-bottom: 16px; }
.pk-head-t h2 { margin: 0 0 4px; font: 600 18px var(--font-sans); }
.pk-head-t p { margin: 0; }
.pk-gate { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--n-50); cursor: pointer; }
.pk-gate input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.pk-gate > span { display: grid; gap: 2px; font-size: 14px; }
.pk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.pk-people { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.pk-people li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pk-p-t { display: grid; gap: 2px; flex: 1 1 160px; min-width: 0; font-size: 14px; }
.pk-p-t .muted { font-size: 12.5px; overflow-wrap: anywhere; }
.pk-invite { display: grid; gap: 4px; }
.pk-invite .btn { justify-self: start; }
.pk-prop { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.pk-prop .dx-check > span { display: grid; gap: 1px; }
.pk-prop .muted { font-size: 12.5px; }
.pk-new td { background: var(--accent-soft); }
.pk-chat { margin-bottom: 16px; }
.sc-appr { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--n-100); font: 600 11px var(--font-sans); color: var(--text-2); }
.sc-appr.wait { background: #FFF4CC; color: #5B4500; }
.sc-appr.ok { background: var(--accent-soft); color: var(--accent-press); }
.card-portal { display: grid; gap: 8px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--n-25); }
.card-portal[hidden] { display: none; }
.cp-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.cp-h svg { width: 16px; height: 16px; color: var(--accent); }
.card-portal .btn { justify-self: start; }
.cp-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.cp-msgs p { margin: 2px 0 0; line-height: 1.5; color: var(--text-2); }
@media (max-width: 860px) { .pk-grid { grid-template-columns: minmax(0, 1fr); } .pk-head { grid-template-columns: minmax(0, 1fr); } }

/* v28 · textura de marca: patrón A·V (manual Kavanah §5)
   Módulo A y V = mismo trapecio de ápice plano girado 180°, diagonales a 23.3°.
   Filas alternas giradas 180°, tono sobre tono sobre Tinta. Nunca detrás de texto chico:
   en el panel de acceso va como franja propia entre el logo y el texto. */
:root {
  --kv-pattern-av: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='104' viewBox='0 0 92 104'%3E%3Cg fill='%23263243'%3E%3Cpolygon points='0,48 17,8 25,8 42,48 33,48 21,20 9,48'/%3E%3Cpolygon points='46,8 55,8 67,36 79,8 88,8 71,48 63,48'/%3E%3Cpolygon points='0,60 9,60 21,88 33,60 42,60 25,100 17,100'/%3E%3Cpolygon points='46,100 63,60 71,60 88,100 79,100 67,72 55,100'/%3E%3C/g%3E%3C/svg%3E");
  --kv-pattern-size: 92px 104px;
}
.auth-logo { order: 0; }
.auth-brand::before {
  content: ''; order: 1; flex: 1 1 auto; min-height: 112px;
  margin: 0 -48px;
  background-color: var(--ink, #0E1217);
  background-image: var(--kv-pattern-av);
  background-size: var(--kv-pattern-size);
  background-position: center;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}
.auth-brand-body { order: 2; }
.auth-brand-foot { order: 3; }
@media (max-width: 900px) {
  .auth-brand::before { flex: none; min-height: 0; height: 56px; margin: 0 -24px -20px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 100%); mask-image: linear-gradient(180deg, transparent 0, #000 100%); }
}
@media print { .auth-brand::before { display: none; } }

/* v29 · patrón A·V en el portal del cliente: franja propia bajo la cabecera Tinta (sin texto encima) */
:root { --kv-pattern-strip-size: 46px 52px; }
.pt-top::after {
  content: ''; display: block; height: 52px;
  background-color: var(--ink, #0E1217);
  background-image: var(--kv-pattern-av);
  background-size: var(--kv-pattern-strip-size);
  background-position: center top;
  border-top: 1px solid rgba(255,255,255,0.06);
}
@media (max-width: 560px) { .pt-top::after { height: 26px; background-size: 23px 26px; } }
@media print { .pt-top::after { display: none; } }

/* v30 · Hoy: próximos pasos que vencen */
.row-body .nh-due { color: var(--accent-2, #C2381F); font-weight: 600; }
