/* =========================================================
   MATCHD · Estilos de la app (Brand Guidelines v1.0)
   Grafito → navego · Blanco → trabajo · Morado → actúo · Lima → presto atención
   Índice: 1 base · 2 shell · 3 componentes · 4 formularios · 5 ventanas
           6 auth · 7 vistas · 8 público · 9 responsive e impresión
   ========================================================= */

/* ---------- 1. Base ---------- */
:root {
  --graphite: #0F0F14; --g800: #24242C; --g700: #3A3A44;
  --white: #FFFFFF; --n50: #F6F6F8; --n100: #ECECF0; --n200: #DCDCE2; --n300: #C2C2CC; --n400: #9A9AA8; --n500: #71717F; --n600: #52525E;
  --purple: #6C3AED; --purple-600: #5A2BD3; --purple-700: #4920AE; --purple-50: #F4F0FE; --purple-100: #E9E0FD;
  --lime: #CCFF66; --lime-50: #F3FFD1;
  --ok: #1F7A4D; --ok-50: #E6F5EC; --warn: #9A5B05; --warn-50: #FDF0DC; --bad: #B42318; --bad-50: #FDECEA;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 15, 20, .04), 0 4px 16px rgba(15, 15, 20, .04);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --brand: #6C3AED; /* color de la property (perfil) */
}
* { box-sizing: border-box }
html, body { height: 100% }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--graphite); background: var(--n50); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11" }
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--purple-700) }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2 }
h1 { font-size: 28px; font-weight: 700 }
h2 { font-size: 19px; font-weight: 600 }
h3 { font-size: 16px; font-weight: 600 }
p { margin: 0 }
p + p { margin-top: 6px }
[hidden] { display: none !important }
svg.ic { flex: none; vertical-align: -3px }
.tnum, td.n, .n { font-variant-numeric: tabular-nums }

/* Utilidades */
.muted { color: var(--n500) }
.small { font-size: 13px }
.upper { text-transform: uppercase; letter-spacing: .06em }
.pre { white-space: pre-wrap }
.lead { font-size: 16px }
.ok-text { color: var(--ok); font-weight: 600 }
.bad-text { color: var(--bad); font-weight: 600 }
.warn-text { color: var(--warn); font-weight: 600 }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--purple-700) }
.eyebrow.red { color: var(--bad) }
.help { font-size: 12px; color: var(--n500); font-weight: 400 }
.block { display: block }
.grow { flex: 1; min-width: 0 }
.nowrap { flex-wrap: nowrap !important; white-space: nowrap }
.push { margin-left: auto }
.spacer { flex: 1 }
.mb { margin-bottom: 16px } .mb-s { margin-bottom: 10px }
.mt { margin-top: 16px } .mt-s { margin-top: 10px }
.gap-top { margin-top: 12px } .gap-xs { margin-top: 6px }
.narrow { max-width: 680px }
.narrow-field { max-width: 180px }
.w-90 { width: 90px !important; min-width: 90px }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.row.center { justify-content: center }
.row.top, label.row.top { align-items: flex-start }
.spread { justify-content: space-between }
.stack { display: grid; gap: 16px; align-content: start }
.grid { display: grid; gap: 16px }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--n600); margin-bottom: 10px }
.back:hover { color: var(--purple-700) }

/* ---------- 2. Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh }
.sidebar { background: var(--graphite); color: #fff; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow: auto }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 21px; letter-spacing: -.035em; padding: 0 8px 14px; color: #fff; text-decoration: none }
.logo svg { width: 28px; height: 23px; flex: none }
.org-switch { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--g800); border: 0; border-radius: 12px; padding: 9px 10px; color: #fff; cursor: pointer; margin-bottom: 8px }
.org-switch:hover { background: var(--g700) }
.org-switch > span:last-child { min-width: 0 }
.org-switch small { display: block; color: var(--n400); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.org-switch b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.org-switch .avatar.sq { background: #fff; border: 0 }
.nav { display: grid; gap: 1px }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--n400); padding: 12px 10px 4px }
.nav a { display: flex; align-items: center; gap: 10px; color: #D9D9E0; text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 10px; border-radius: 9px }
.nav a .ic { opacity: .8 }
.nav a .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.nav a:hover { background: var(--g800); color: #fff }
.nav a.active { background: var(--lime); color: var(--graphite); font-weight: 600 }
.nav a.active .ic { opacity: 1 }
.nav a .count { font-size: 11px; font-weight: 700; background: var(--g700); color: #fff; border-radius: 999px; padding: 1px 7px }
.nav a.active .count { background: var(--graphite) }
.nav a .soon { font-size: 10px; font-weight: 700; color: var(--graphite); background: var(--lime); border-radius: 5px; padding: 1px 6px }
.nav a.active .soon { background: var(--graphite); color: var(--lime) }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--g700) }
.side-foot .who { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--n400); padding: 6px 8px; border-radius: 9px; text-decoration: none }
.side-foot .who:hover { background: var(--g800) }
.side-foot .who span { min-width: 0; display: grid }
.side-foot .who b { color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.side-link { display: flex; align-items: center; gap: 8px; color: var(--n300); font-size: 13px; text-decoration: none; padding: 6px 10px; border-radius: 9px }
.side-link:hover { background: var(--g800); color: #fff }
.mode-badge { margin: 0 8px; font-size: 11px; color: var(--graphite); background: var(--lime); border-radius: 6px; padding: 4px 8px; font-weight: 600 }
.main { min-width: 0; display: flex; flex-direction: column }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--n100); position: sticky; top: 0; z-index: 5 }
.topbar .menu { display: none }
.content { padding: 28px; max-width: 1320px; width: 100%; margin: 0 auto }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap }
.pagehead .eyebrow { display: block; margin-bottom: 6px }
.pagehead p { color: var(--n600); margin-top: 6px; max-width: 72ch }
.searchbox { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--n200); border-radius: 10px; background: var(--n50); cursor: pointer; text-align: left; font-size: 14px; color: var(--n500) }
.searchbox:hover { border-color: var(--n300) }
.searchbox kbd { margin-left: auto; font: 600 11px var(--font); border: 1px solid var(--n200); border-radius: 6px; padding: 2px 6px; color: var(--n500); background: var(--white) }
.searchbox .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.icon-btn { width: 38px; padding: 0 !important; justify-content: center }
.bell { position: relative }
.bell i { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid #fff }

/* ---------- 3. Componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--n200); background: var(--white); color: var(--graphite); border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 40px; transition: border-color .12s, background .12s }
.btn:hover { border-color: var(--graphite) }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #fff }
.btn.primary:hover { background: var(--purple-600) }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--graphite) }
.btn.lime:hover { border-color: var(--graphite) }
.btn.ghost { border-color: transparent; background: transparent }
.btn.ghost:hover { background: var(--n100) }
.btn.danger { color: var(--bad); border-color: var(--bad-50) }
.btn.danger:hover { border-color: var(--bad) }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px }
.btn:disabled { opacity: .5; cursor: not-allowed }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px }
.plain { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer }

.panel { background: var(--white); border: 1px solid var(--n100); border-radius: var(--radius); padding: 20px; min-width: 0; box-shadow: var(--shadow) }
.panel > h2 { margin-bottom: 12px }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap }
.panel-head h2 { margin: 0 }
.section-title { font-size: 15px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--n600) }

.kpi { display: flex; flex-direction: column; gap: 2px }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px }
.kpi .label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--n500) }
.kpi-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--purple-50); color: var(--purple-700); flex: none }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums }
.kpi .sub { font-size: 13px; color: var(--n500) }
.kpi.tone-bad .val { color: var(--bad) } .kpi.tone-bad .kpi-ic { background: var(--bad-50); color: var(--bad) }
.kpi.tone-ok .val { color: var(--ok) } .kpi.tone-ok .kpi-ic { background: var(--ok-50); color: var(--ok) }
.kpi.tone-warn .kpi-ic { background: var(--warn-50); color: var(--warn) }
.kpi.tone-lime { background: var(--graphite); color: #fff; border-color: var(--graphite) }
.kpi.tone-lime .label, .kpi.tone-lime .sub { color: var(--n300) }
.kpi.tone-lime .kpi-ic { background: var(--lime); color: var(--graphite) }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px }

.bar { height: 6px; background: var(--n100); border-radius: 6px; overflow: hidden; margin-top: 10px }
.bar i { display: block; height: 100%; background: var(--purple); border-radius: 6px; transition: width .3s }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--n100); color: var(--n600); white-space: nowrap }
.pill.p { background: var(--purple-50); color: var(--purple-700) }
.pill.l { background: var(--lime); color: var(--graphite) }
.pill.ok { background: var(--ok-50); color: var(--ok) }
.pill.warn { background: var(--warn-50); color: var(--warn) }
.pill.bad { background: var(--bad-50); color: var(--bad) }
.pill.lg { font-size: 14px; padding: 6px 12px }
.lock { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; color: var(--purple-700) }
.count-in { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 8px }
.filetag { display: inline-block; font: 700 10px var(--font); letter-spacing: .04em; background: var(--bad-50); color: var(--bad); border-radius: 5px; padding: 2px 5px; vertical-align: 1px }

.empty { text-align: center; padding: 36px 20px; color: var(--n500) }
.empty h3 { color: var(--graphite); margin-bottom: 6px }
.empty .btn { margin-top: 14px }
.callout { background: var(--purple-50); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--graphite) }
.callout.lime, .callout.hot { background: var(--lime-50); border: 1px solid #DDF39A }
.callout.warn { background: var(--warn-50) }
.upsell { border-color: var(--purple-100); background: linear-gradient(135deg, var(--purple-50), #fff 60%) }
.upsell ul { margin: 10px 0 14px; padding-left: 20px; display: grid; gap: 6px; color: var(--n600) }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--n100) }
.list-row:last-child { border-bottom: 0 }
.list-row .meta, .meta { font-size: 13px; color: var(--n500) }
.list-row b a { text-decoration: none }
.list-row b a:hover { text-decoration: underline }
.list-row > b, .tnum { white-space: nowrap }
.clickrow { border-radius: 8px; padding-left: 6px; padding-right: 6px }
.clickrow:hover { background: var(--n50) }
.links a { margin-right: 10px }

.tablewrap, .table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--n100); border-radius: var(--radius) }
table { border-collapse: collapse; width: 100%; font-size: 14px }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--n100); vertical-align: middle }
th { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--n500); background: var(--n50); white-space: nowrap }
tr:last-child td { border-bottom: 0 }
tr.click { cursor: pointer }
tr.click:hover td { background: var(--n50) }
tr.total td { font-weight: 700; background: var(--n50) }
td.n, th.n { text-align: right }
td input, td select { min-height: 34px; padding: 6px 8px }
.cell-co { display: flex; align-items: center; gap: 10px; min-width: 0 }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--n100); margin-bottom: 18px; overflow-x: auto }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--n600); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap }
.tabs a:hover { color: var(--graphite) }
.tabs a.active { color: var(--purple-700); border-bottom-color: var(--purple) }
.chips { gap: 6px }
.chip { border: 1px solid var(--n200); background: var(--white); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer }
.chip:hover { border-color: var(--n400) }
.chip.on { background: var(--graphite); color: #fff; border-color: var(--graphite) }
.chip.on .muted { color: var(--n300) }
.seg { display: inline-flex; background: var(--n100); border-radius: 10px; padding: 3px; gap: 2px }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--n600); cursor: pointer }
.seg button.on { background: var(--white); color: var(--graphite); box-shadow: 0 1px 2px rgba(0, 0, 0, .08) }
.seg.sm button { padding: 4px 9px; font-size: 12px }
.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px }
.filterbar select, .filterbar input { width: auto; min-width: 150px; min-height: 38px }
.filterbar .search { flex: 1; min-width: 200px }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 700; font-size: 12px; object-fit: cover; overflow: hidden }
.avatar.sq { border-radius: 22%; background: var(--n100); color: var(--g700) }
img.avatar.sq { background: var(--white); border: 1px solid var(--n100); object-fit: contain; padding: 2px }
.score { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--purple-50); color: var(--purple-700); font-weight: 700; font-size: 13px }
.score.sm { width: 26px; height: 26px; font-size: 11px }
.ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--n100); flex: none; color: var(--g700) }
.ico.hot { background: var(--lime) }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none }
.switch input { opacity: 0; width: 0; height: 0 }
.switch span { position: absolute; inset: 0; background: var(--n200); border-radius: 999px; transition: .15s; cursor: pointer }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s }
.switch input:checked + span { background: var(--purple) }
.switch input:checked + span::before { transform: translateX(18px) }
.switch input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px }
.switch input:disabled + span { opacity: .5; cursor: not-allowed }

/* Gráficos */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px }
.chart.small-chart { height: 110px }
.chart .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0 }
.chart .c .bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center }
.chart .c i { display: block; width: 40%; background: var(--purple); border-radius: 4px 4px 0 0; min-height: 2px }
.chart .c i.t { background: var(--n200) }
.chart .c i.c2 { background: var(--lime) }
.chart .c span { font-size: 11px; color: var(--n500) }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--n500); margin-top: 8px; flex-wrap: wrap }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px }
.rhythm { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; font-size: 14px }
.rhythm .bar { grid-column: 1 / -1; margin-top: 2px }
.rhythm.target .bar i { background: var(--graphite) }
.rhythm.previous .bar i { background: var(--n300) }
.rhythm.forecast .bar i { background: var(--lime) }
.rhythm.bad b { color: var(--bad) }
.spark { display: flex; gap: 3px; align-items: flex-end; height: 28px; margin-top: 8px }
.spark i { flex: 1; background: var(--purple-100); border-radius: 2px }
.spark i:last-child { background: var(--purple) }

/* ---------- 4. Formularios ---------- */
label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--n600); align-content: start }
input, select, textarea { width: 100%; border: 1px solid var(--n200); border-radius: 9px; padding: 9px 11px; background: var(--white); min-height: 40px }
input:hover, select:hover, textarea:hover { border-color: var(--n300) }
input:focus, select:focus, textarea:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 3px var(--purple-50) }
input:disabled, select:disabled, textarea:disabled { background: var(--n50); color: var(--n500) }
textarea { min-height: 80px; resize: vertical }
input[type=checkbox], input[type=radio] { width: auto; min-height: auto; accent-color: var(--purple); box-shadow: none }
input[type=color] { padding: 2px; height: 40px }
input[type=range] { padding: 0; min-height: 28px; accent-color: var(--purple); box-shadow: none; border: 0 }
input[type=file] { padding: 7px; background: var(--n50) }
select.compact, input.compact { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px }
.search { max-width: 320px }
.search.wide { max-width: none }
.form { display: grid; gap: 14px }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px }
.form-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--purple-700); margin-top: 6px }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer }
.fieldset { border: 1px solid var(--n100); border-radius: 12px; padding: 12px 14px; margin: 0; display: grid; gap: 8px }
.fieldset legend { font-size: 13px; font-weight: 600; color: var(--n600); padding: 0 6px }
.color-sm { width: 56px !important; flex: none }
.dropzone { border: 2px dashed var(--purple-100); background: var(--purple-50); border-radius: 12px; padding: 28px; text-align: center; display: grid; gap: 8px; justify-items: center }
.dropzone.over { border-color: var(--purple) }

/* Filas editables (subtareas, métricas, pruebas, líneas de activos) */
.subtask-edit, .metric-edit { display: grid; grid-template-columns: 1fr 150px 36px; gap: 8px; align-items: center }
.metric-edit { grid-template-columns: 1.4fr 1fr 1fr 36px; margin-bottom: 8px }
.metric-edit.two-cols { grid-template-columns: 1fr 1.2fr 36px }
.subtask-edit input, .metric-edit input { min-height: 36px; padding: 6px 9px }
.ag-line { gap: 8px; margin-bottom: 8px; align-items: center }
.ag-line select { flex: 1; min-width: 0 }
.ag-sub { min-width: 100px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums }
.pkg-line.off td, .pline.off td { color: var(--n400) }
.pkg-line.off input[type=number], .pline.off input[type=number] { opacity: .5 }
.price-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; background: var(--n50); border: 1px solid var(--n100); border-radius: 12px; padding: 14px 16px }
.price-box > div { display: grid; gap: 2px }
.price-box > div > span { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--n500) }
.price-box b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.price-box b.big { color: var(--purple-700) }
.price-box small { color: var(--n500); font-size: 12px }
.price-box input { background: var(--white) }

/* ---------- 5. Ventanas, panel lateral, avisos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 15, 20, .55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 70; overflow: auto }
.modal { background: var(--white); border-radius: 16px; width: min(640px, 100%); padding: 24px; box-shadow: 0 30px 80px rgba(15, 15, 20, .3) }
.modal.wide { width: min(980px, 100%) }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px }
.modal-head button { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--n500); min-width: 36px; min-height: 36px; border-radius: 8px }
.modal-head button:hover { background: var(--n100) }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--graphite); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 80; max-width: 420px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2) }
.toast.err { background: var(--bad) }
.drawer-wrap { position: fixed; inset: 0; background: rgba(15, 15, 20, .35); z-index: 60; display: flex; justify-content: flex-end }
.drawer { width: min(560px, 100%); height: 100%; background: var(--white); overflow: auto; box-shadow: -10px 0 40px rgba(0, 0, 0, .15); display: flex; flex-direction: column }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 22px 22px 12px; border-bottom: 1px solid var(--n100); position: sticky; top: 0; background: var(--white); z-index: 1 }
.drawer-body { padding: 16px 22px 30px }
.crop-canvas { width: 100%; height: auto; border-radius: 12px; display: block; margin-top: 10px; background: var(--graphite) }
.search-results { display: grid; gap: 2px; margin-top: 12px; max-height: 60vh; overflow: auto }
.search-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--n500); margin: 12px 0 4px }
.sres { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: 8px; padding: 8px }
.sres:hover, .sres:focus { background: var(--purple-50) }

/* ---------- 6. Acceso y alta ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr }
.auth-brand { background: var(--graphite); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden }
.auth-brand h1 { font-size: 44px; line-height: 1.05; letter-spacing: -.035em; margin-top: 24px; max-width: 13ch }
.auth-brand p { color: var(--n300); margin-top: 14px; max-width: 44ch; font-size: 16px }
.auth-brand .lines { position: absolute; right: -30px; bottom: 60px; width: 70%; opacity: .9 }
.auth-brand .tag { color: var(--lime); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--white) }
.auth-card { width: min(440px, 100%) }
.auth-card h2 { font-size: 26px; margin-bottom: 6px }
.steps { display: flex; gap: 6px; margin-bottom: 18px }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--n100) }
.steps i.on { background: var(--purple) }
.typegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.typegrid button { border: 1px solid var(--n200); background: var(--white); border-radius: 10px; padding: 12px 8px; cursor: pointer; font-weight: 600; font-size: 14px }
.typegrid button:hover { border-color: var(--n400) }
.typegrid button[aria-pressed=true] { border-color: var(--purple); background: var(--purple-50); color: var(--purple-700) }
.org-pick { justify-content: flex-start; gap: 12px; width: 100%; min-height: 56px; text-align: left }

/* ---------- 7. Vistas ---------- */
/* Inicio */
.hero { position: relative; background: var(--graphite); color: #fff; border-radius: 18px; overflow: hidden; margin-bottom: 16px }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .4 }
.hero-in { position: relative; display: flex; justify-content: space-between; gap: 20px; padding: 30px 28px; flex-wrap: wrap; align-items: flex-end }
.hero .eyebrow { color: var(--lime) }
.hero h1 { font-size: 34px; margin: 6px 0 }
.hero p { color: #D4D4DC; max-width: 640px }
.hero-side { display: grid; gap: 10px; justify-items: end }
.hero-week { border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 8px 12px; font-size: 12px; color: #C9C3F7; display: grid; justify-items: end }
.hero-week b { color: #fff; font-size: 14px }
.hero .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff }
.hero .btn.lime { background: var(--lime); color: var(--graphite); border-color: var(--lime) }
.guide .gstep { border: 1px solid var(--n200); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start }
.guide .gstep.done { background: var(--n50); opacity: .75 }
.guide .gstep .pill { justify-self: start }
.home-grid, .agenda-grid { align-items: start }
.prio { align-items: center; gap: 10px }
.next-meet { background: var(--graphite); color: #fff; border-color: var(--graphite) }
.next-meet .muted, .next-meet .meta { color: var(--n300) }
.next-meet .eyebrow { color: var(--lime) }
.next-meet h2 { margin: 6px 0 2px }
.next-meet .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff }
.next-meet .btn.lime { background: var(--lime); color: var(--graphite) }

/* Tareas y subtareas */
.task { border-bottom: 1px solid var(--n100) }
.task:last-child { border-bottom: 0 }
.task .list-row { border-bottom: 0 }
.task-title { color: var(--graphite); text-decoration: none; font-weight: 600 }
.task-title:hover { color: var(--purple-700) }
.task.done .task-title { text-decoration: line-through; color: var(--n400) }
.subtasks { padding: 0 0 12px 30px; display: grid; gap: 4px }
.subtasks .bar { margin: 0 0 6px; height: 4px }
.subtask { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer }
.subtask span { flex: 1 }
.subtask time { font-size: 12px; color: var(--n500) }
.subtask time.late { color: var(--bad); font-weight: 600 }
.subtask.done span { text-decoration: line-through; color: var(--n400) }

/* Línea de tiempo */
.timeline { display: grid }
.tl { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--n100); font-size: 14px; align-items: flex-start }
.tl:last-child { border-bottom: 0 }
.tl time { color: var(--n500); font-size: 13px }
.tl-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--purple-50); color: var(--purple-700); flex: none }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }

/* Compañías: cabecera tipo red social */
.social-header { background: var(--white); border: 1px solid var(--n100); border-radius: 16px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow) }
.social-cover { position: relative; height: 200px; background: linear-gradient(120deg, var(--graphite), var(--purple-700) 70%, var(--purple)); background-size: cover; background-position: center }
.cover-edit { position: absolute; right: 14px; bottom: 14px; background: rgba(15, 15, 20, .6); border-color: transparent; color: #fff; backdrop-filter: blur(4px) }
.cover-edit:hover { background: rgba(15, 15, 20, .8); border-color: transparent }
.social-profile { display: flex; align-items: flex-end; gap: 18px; padding: 0 24px 20px; flex-wrap: wrap }
.social-logo { margin-top: -44px; flex: none }
.social-logo .avatar { border: 4px solid #fff; box-shadow: 0 4px 14px rgba(15, 15, 20, .12); background: #fff }
.social-logo span.avatar.sq { background: var(--purple-50); color: var(--purple-700) }
.social-heading { flex: 1; min-width: 220px; padding-top: 12px }
.social-heading h1 { font-size: 26px; margin-top: 2px }
.social-heading p { color: var(--n600); margin-top: 4px }
.social-actions { padding-top: 12px }
.media-row { display: grid; grid-template-columns: 1fr 2fr; gap: 14px }
.media-card { border: 1px solid var(--n100); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--n50) }
.media-card.inline { display: flex; align-items: center; gap: 14px }
.media-card.inline label { flex: 1 }
.media-logo { display: flex; align-items: center; min-height: 64px }
.media-cover { height: 64px; border-radius: 9px; background: linear-gradient(120deg, var(--graphite), var(--purple)); background-size: cover; background-position: center }
.cover-prev { height: 120px; border-radius: 12px; background: var(--n50) center / cover; overflow: hidden; display: grid; place-items: center; border: 1px dashed var(--n200) }
.idbox { display: flex; gap: 16px; align-items: center; margin: 10px 0 14px }
.brand-preview { border-radius: 12px; padding: 14px 16px; background: var(--preview); color: #fff; display: grid; gap: 2px }
.brand-preview span { font-size: 13px; opacity: .85 }

/* Pipeline */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px }
.col { background: var(--n100); border-radius: 14px; padding: 10px; min-height: 320px; border-top: 3px solid var(--n300) }
.col.over { outline: 2px dashed var(--purple); background: var(--purple-50) }
.col.stage-prospeccion { border-top-color: var(--n400) }
.col.stage-contactada { border-top-color: #8B6CF0 }
.col.stage-cualificada { border-top-color: var(--purple) }
.col.stage-propuesta { border-top-color: var(--purple-700) }
.col.stage-negociacion { border-top-color: var(--graphite) }
.col.stage-ganada { border-top-color: var(--ok); background: #EEF6F0 }
.col.stage-perdida { border-top-color: var(--bad); background: #F8F1F0 }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 4px 4px 10px; font-size: 13px }
.col-head span { color: var(--n500); font-variant-numeric: tabular-nums }
.col-empty { text-align: center; padding: 18px 0 }
.deal { position: relative; background: var(--white); border: 1px solid var(--n200); border-radius: 11px; padding: 11px; margin-bottom: 8px; cursor: grab; transition: border-color .12s, box-shadow .12s }
.deal:hover { border-color: var(--purple); box-shadow: 0 4px 14px rgba(108, 58, 237, .12) }
.deal-top { display: flex; align-items: center; gap: 8px }
.deal-top .co { flex: 1; min-width: 0; font-size: 12px; color: var(--n500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.deal .t { font-weight: 600; font-size: 14px; margin: 6px 0 6px }
.deal .v { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums }
.deal .nx { font-size: 12px; color: var(--n500); margin-top: 6px; padding-right: 24px }
.deal .nx.late { color: var(--bad); font-weight: 600 }
.deal .owner { position: absolute; right: 10px; bottom: 9px }
.opp-hero { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--n50); border-radius: 12px }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px }
.detail-card { border: 1px solid var(--n100); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; align-content: start; font-size: 14px }
.detail-card h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--purple-700); margin-bottom: 4px }

/* Calendario */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px }
.cal-layers { margin-bottom: 12px; gap: 12px }
.cal-panel { padding: 0; overflow: auto }
.wk { min-width: 680px }
.wk-head, .wk-all { display: grid; grid-template-columns: 60px repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--n100) }
.wk-head > div { padding: 10px 8px; text-align: center; font-size: 14px }
.wk-head small { text-transform: uppercase; color: var(--n500); font-weight: 700; font-size: 11px }
.wk-head .today b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff }
.wk-all > div { padding: 4px; min-height: 30px; border-left: 1px solid var(--n100); display: grid; gap: 3px; align-content: start }
.wk-all > div:first-child { border-left: 0; font-size: 11px; display: flex; align-items: center; color: var(--n500) }
.wk-body { display: grid; grid-template-columns: 60px repeat(var(--n), minmax(0, 1fr)) }
.wk-hours div { font-size: 11px; color: var(--n500); padding: 2px 8px; text-align: right; border-top: 1px solid var(--n100) }
.wk-day { position: relative; border-left: 1px solid var(--n100) }
.wk-day .slot { border-top: 1px solid var(--n100); cursor: pointer }
.wk-day .slot:nth-child(even) { border-top-color: var(--n50) }
.wk-day .slot:hover { background: var(--purple-50) }
.wk-day .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2 }
.ev { position: absolute; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, white); border-radius: 6px; padding: 4px 6px; text-align: left; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; gap: 1px; z-index: 1; font-size: 12px; color: var(--graphite) }
.ev b { font-size: 12px; line-height: 1.25 }
.ev span { color: var(--n600); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ev.done, .cal-chip.done { opacity: .55 }
.cal-chip { display: block; width: 100%; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, white); border-radius: 5px; padding: 2px 6px; font-size: 11.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--graphite) }
.mo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) }
.mo-h { padding: 8px; font-size: 11px; font-weight: 700; color: var(--n500); text-align: center; border-bottom: 1px solid var(--n100) }
.mo-d { min-height: 108px; border-right: 1px solid var(--n100); border-bottom: 1px solid var(--n100); padding: 4px; display: grid; gap: 3px; align-content: start; cursor: pointer }
.mo-d .n { font-size: 12px; font-weight: 600; padding: 2px 4px }
.mo-d.out { background: var(--n50) } .mo-d.out .n { color: var(--n400) }
.mo-d.today .n { background: var(--purple); color: #fff; border-radius: 999px; justify-self: start; padding: 2px 8px }
.mo-d .more { border: 0; background: none; font-size: 11px; color: var(--purple-700); text-align: left; cursor: pointer; padding: 0 4px }
.mo.compact .mo-d { min-height: 0; border: 0; background: none; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px }
.mo.compact .mo-h { border: 0; padding: 4px }
.mo.compact .mo-d.out { color: var(--n300); background: none }
.mo.compact .mo-d.today span { background: var(--purple); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center }
.mo.compact i { display: flex; gap: 2px; height: 4px }
.mo.compact em { width: 4px; height: 4px; border-radius: 50% }
.mini-cal { background: var(--n50); border-radius: 12px; padding: 10px; margin-bottom: 10px }
.up { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 8%, white); border-radius: 8px; padding: 8px 10px; margin-top: 8px; cursor: pointer; font-size: 13px }
.up > b { min-width: 52px; color: var(--purple-700) }
.up span { display: flex; flex-direction: column; min-width: 0 }
.up small { color: var(--n500) }
.brief { padding: 12px 0; border-bottom: 1px solid var(--n100) }
.brief h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--purple-700); margin-bottom: 6px }
.brief ol { margin: 0; padding-left: 18px; display: grid; gap: 4px }

/* Inventario y acuerdos */
.pkg + .pkg { margin-top: 10px }
.pkg { border: 1px solid var(--n100); border-radius: 12px; padding: 14px; display: grid; gap: 6px }
.act-card { display: grid; gap: 8px; align-content: start }
.act-card .btn { justify-self: start }
.metric-grid + .help { margin-top: 8px }
.metric-grid { margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px }
.metric-card { border: 1px solid var(--n100); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; background: var(--white) }
.metric-card > span { font-size: 12px; font-weight: 600; color: var(--n500) }
.metric-card > b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.metric-card small { color: var(--n500) }
.metric-card .bar { margin: 6px 0 }
.metric-card .pill { justify-self: start }

/* Informes */
.goal-bars { display: grid; gap: 4px }
.goal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.goal-grid label.f { font-size: 12px }

/* Desarrollo de negocio */
.seq { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px }
.seq div { background: var(--n50); border-radius: 10px; padding: 10px; display: grid; gap: 3px; font-size: 13px }
.seq span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 11px; font-weight: 700 }
.seq small { color: var(--n500) }
.fit { display: inline-block; background: var(--lime); color: var(--graphite); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 3px 9px; white-space: nowrap; cursor: help }
.prospect { align-items: center; gap: 12px }
.signal.descartada { opacity: .5 }
.evdate { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--purple-50); color: var(--purple-700); flex: none; line-height: 1.1 }
.evdate b { font-size: 18px }
.evdate small { text-transform: uppercase; font-size: 11px; font-weight: 700 }
details.msg { border: 1px solid var(--n200); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px }
details.msg summary { cursor: pointer; display: flex; gap: 8px; align-items: center }
details.msg textarea { width: 100%; margin-top: 8px }

/* Perfil, equipo, planes, automatizaciones */
.network-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px }
.network-card { border: 1px solid var(--n100); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--n50) }
.joincode { font-size: 24px; font-weight: 700; letter-spacing: .12em; background: var(--n50); padding: 8px 14px; border-radius: 10px }
.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px }
.plan { border: 1px solid var(--n200); border-radius: 14px; padding: 18px; background: var(--white); display: flex; flex-direction: column; gap: 10px }
.plan.current { border: 2px solid var(--purple) }
.plan .price { font-size: 28px; font-weight: 700; letter-spacing: -.03em }
.plan ul { margin: 0; padding-left: 18px; color: var(--n600); font-size: 14px; display: grid; gap: 4px }
.plan .btn, .plan > .pill { margin-top: auto; align-self: flex-start }
.flow { display: grid; gap: 6px; align-content: start }
.flow.on { border-color: var(--purple-100); background: linear-gradient(180deg, var(--purple-50), #fff 50%) }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px }
.conn { display: flex; align-items: center; gap: 12px; border: 1px solid var(--n100); border-radius: 12px; padding: 12px }
.conn-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--graphite); color: var(--lime); font-weight: 700; font-size: 13px; flex: none }

/* ---------- 8. Páginas públicas ---------- */
.pub-head { background: var(--graphite) center / cover; color: #fff; padding: 44px 24px 38px; border-bottom: 6px solid var(--brand) }
.pub-head .in { max-width: 920px; margin: 0 auto; display: flex; gap: 22px; align-items: center; flex-wrap: wrap }
.pub-head .eyebrow { color: var(--lime) }
.pub-head h1 { font-size: 34px; margin-top: 6px }
.pub-head p { opacity: .8; margin-top: 8px; max-width: 640px; font-size: 16px }
.pub-head .btn { margin-top: 6px }
.pub-logos { display: flex; align-items: center; gap: 10px; flex: none }
.pub-logos img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 16px; padding: 8px }
.pub-logos span { font-size: 22px; opacity: .6 }
.pub-body { max-width: 920px; margin: 0 auto; padding: 28px 16px 60px; display: grid; gap: 16px }
.pub-frame { width: 100%; height: 80vh; border: 1px solid var(--n100); border-radius: 12px; background: #fff }
.pub-image { max-width: 100%; border-radius: 12px }
.pub-metric { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--n100) }
.pub-metric:last-child { border-bottom: 0 }
.pub-metric > b { white-space: nowrap }
.pub-metric-val { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap }
.pub-bar { display: flex; gap: 8px; align-items: center; min-width: 50% }
.pub-bar .bar { flex: 1; margin: 0 }
.pub-activation { padding: 16px 0; border-bottom: 1px solid var(--n100); display: grid; gap: 6px }
.pub-activation:last-child { border-bottom: 0 }
.pub-links { display: flex; gap: 14px; flex-wrap: wrap }
.pub-cat { margin: 16px 0 6px; color: var(--n600) }
.pub-foot { text-align: center; color: var(--n500); font-size: 12px; padding: 20px }
.pub-foot svg { width: 18px; height: 15px; vertical-align: -3px }

/* ---------- 9. Responsive, accesibilidad e impresión ---------- */
@media (max-width: 1200px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)) } }
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .seq, .goal-grid { grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 40; transform: translateX(-100%); transition: transform .2s }
  .sidebar.open { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .3) }
  .topbar .menu { display: inline-flex }
  .content { padding: 18px 16px }
  .topbar { padding: 10px 16px }
  .searchbox span.muted, .searchbox kbd { display: none }
  .searchbox { flex: 0 0 auto; width: 40px; justify-content: center; padding: 8px }
  .hide-sm { display: none }
  .auth { grid-template-columns: 1fr }
  .auth-brand { padding: 28px 20px }
  .auth-brand h1 { font-size: 32px }
  .auth-brand .lines { display: none }
  .hero h1 { font-size: 26px }
  .hero-side { justify-items: start }
  .social-cover { height: 140px }
  .social-profile { padding: 0 16px 16px }
  .media-row, .detail-grid, .price-box { grid-template-columns: 1fr }
}
@media (max-width: 620px) {
  .g2, .g3, .g4, .plans, .two, .three, .kpis { grid-template-columns: 1fr }
  .typegrid { grid-template-columns: repeat(2, 1fr) }
  .metric-edit { grid-template-columns: 1fr 1fr 36px }
  .metric-edit input:first-child { grid-column: 1 / -1 }
  .metric-edit.two-cols { grid-template-columns: 1fr 36px }
  .filterbar select, .filterbar input { flex: 1 }
  .filterbar .search { max-width: none; flex-basis: 100% }
  .pub-head h1 { font-size: 26px }
}
@media (max-height: 820px) { .nav a { padding: 5px 10px; font-size: 13.5px } .nav-group { padding: 8px 10px 2px } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }
@media print {
  .no-print, .sidebar, .topbar, .tabs, .btn, .seg, .chip { display: none !important }
  body { background: #fff }
  .shell { display: block }
  .content { padding: 0 }
  .panel { box-shadow: none }
  .drawer-wrap { position: static; background: none }
  .drawer { box-shadow: none; width: 100% }
}

/* ---------- Ampliación: contactos en la ficha de compañía ---------- */
.contact-edit { display: grid; grid-template-columns: 64px 1fr 36px; gap: 12px; align-items: start; border: 1px solid var(--n100); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--n50) }
.contact-edit-photo { display: grid; justify-items: center; gap: 4px }
.contact-edit-photo .btn { padding: 2px 6px; min-height: 26px; font-size: 12px }
.contact-edit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center }
.contact-edit-fields input { min-height: 36px; padding: 6px 9px; background: var(--white) }
output.fit { min-width: 42px; text-align: center }
input[type=range][name=fit] { flex: 1 }
@media (max-width: 620px) { .contact-edit-fields { grid-template-columns: 1fr } }

/* ---------- Ampliación: secciones plegables del menú ---------- */
.nav-section { display: grid; gap: 1px }
button.nav-group { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 8px; font-family: inherit }
button.nav-group span:first-child { flex: 1 }
button.nav-group:hover { color: #fff; background: var(--g800) }
button.nav-group .ic { transition: transform .15s; opacity: .7 }
button.nav-group.closed .ic { transform: rotate(-90deg) }
button.nav-group .count { font-size: 10px; font-weight: 700; background: var(--g700); color: #fff; border-radius: 999px; padding: 0 6px; letter-spacing: 0 }

/* ---------- Ampliación: panel de administración ---------- */
.admin-chart { height: 150px }
.admin-chart .c i { width: 62%; border-radius: 4px 4px 0 0 }
.admin-chart .c:hover i { background: var(--purple-700) }
.admin-spark { height: 56px; gap: 2px }
.admin-spark i { background: var(--purple-100) }
.admin-spark i:hover { background: var(--purple) }
td.n, th.n { white-space: nowrap }
.reading { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px }
.reco { border-color: var(--purple-100); background: linear-gradient(135deg, var(--purple-50), #fff 55%) } .reco h2 { font-size: 16px; margin: 6px 0 4px }
.pagehead .row select { width: auto; min-width: 140px }

/* ---------- Ampliación: ayudas debajo del campo (los campos de una fila quedan alineados) ---------- */
label.f > input, label.f > select, label.f > textarea, label.f > span.row, label.f > div, label.f > output { order: 2 }
label.f > .help { order: 3; margin-top: -1px; line-height: 1.35 }
.three > .span2, .two > .span2 { grid-column: span 2 }
@media (max-width: 620px) { .three > .span2, .two > .span2 { grid-column: auto } }
input[type=file] { font-size: 13px; color: var(--n600); cursor: pointer }
input[type=file]::file-selector-button { font: 600 13px var(--font); border: 1px solid var(--n200); background: var(--white); color: var(--graphite); border-radius: 8px; padding: 6px 12px; margin-right: 10px; cursor: pointer }
input[type=file]::file-selector-button:hover { border-color: var(--graphite) }
input[type=range][name=fit] { min-height: 40px }

/* ---------- Ampliación: conversaciones y documentación del acuerdo ---------- */
.file-drop { border: 2px dashed var(--purple-100); background: var(--purple-50); border-radius: 14px; padding: 22px; display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--purple-700); transition: border-color .12s, background .12s }
.file-drop.over { border-color: var(--purple); background: #EDE5FD }
.file-drop b { color: var(--graphite) }
.wide-drop { margin-bottom: 12px }
.inline-f { display: flex; align-items: center; gap: 8px }
.tl-ic.in { background: var(--lime); color: var(--graphite) }
.tl-ic.out { background: var(--purple); color: #fff }
.tl-mail .tl-head b { font-size: 14.5px }
details.mail-body { margin-top: 6px; font-size: 14px }
details.mail-body summary { cursor: pointer; color: var(--n600); list-style: none }
details.mail-body summary::-webkit-details-marker { display: none }
details.mail-body summary::after { content: ' · ver mensaje'; color: var(--purple-700); font-weight: 600 }
details.mail-body[open] summary::after { content: ' · ocultar'; }
details.mail-body .pre { margin-top: 8px; padding: 12px 14px; background: var(--n50); border-radius: 10px; max-height: 420px; overflow: auto; font-size: 13.5px; line-height: 1.55 }

/* ---------- Ampliación: objetivos del panel de Matchd ---------- */
.goal-line { margin-top: 12px; font-size: 13.5px }
.goal-line .bar { margin-top: 6px }
.goal-line.base .bar i { background: var(--graphite) }
.goal-line.amb .bar i { background: var(--purple) }
.goal-chart .c .bars i { width: 26% }
.goal-chart .c .bars i.c2 { background: var(--lime) }
tr.current td { background: var(--purple-50) }
.goal-table { display: grid; gap: 6px; max-height: 46vh; overflow: auto; padding-right: 4px }
.goal-head, .goal-row { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 10px; align-items: center }
.goal-head b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--n500) }
.goal-row span { font-weight: 600; font-size: 14px }
.goal-row input { min-height: 36px; padding: 6px 10px }
.filterbar input[type=checkbox] { min-width: 0; min-height: 0 }
label.inline-f { display: inline-flex; align-items: center; gap: 8px }

/* ---------- Ampliación: recortador de imágenes ---------- */
.crop-stage { position: relative; margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--n100) }
.crop-stage .crop-canvas { margin: 0; border-radius: 0; cursor: grab; touch-action: none }
.crop-stage .crop-canvas:active { cursor: grabbing }
.crop-stage.round { width: min(360px, 100%); margin: 10px auto 0; aspect-ratio: 1 }
.crop-stage.round::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(15, 15, 20, .45); pointer-events: none }
.crop-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px }
.crop-tools input[type=range] { flex: 1 }

/* ---------- Ampliación: elementos clicables y lectura de emails ---------- */
.clickable { cursor: pointer; border-radius: 10px; transition: background .12s }
.clickable:hover { background: var(--n50) }
.tl.clickable { padding-left: 8px; padding-right: 8px; margin: 0 -8px }
.mail-preview { color: var(--n600); margin-top: 4px; font-size: 14px }
.mail-view { display: grid; gap: 10px }
.mail-head { display: grid; grid-template-columns: 60px 1fr; gap: 4px 10px; margin: 0; font-size: 14px }
.mail-head dt { color: var(--n500); font-weight: 600 }
.mail-head dd { margin: 0; word-break: break-word }
.mail-text { background: var(--n50); border-radius: 12px; padding: 16px; font-size: 14.5px; line-height: 1.6; max-height: 60vh; overflow: auto }
.chip-link { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--n200); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--graphite); text-decoration: none }
.chip-link:hover { border-color: var(--purple); color: var(--purple-700) }
.act-card.clickable:hover, .panel.clickable:hover { border-color: var(--purple-100); background: var(--white); box-shadow: 0 6px 20px rgba(108, 58, 237, .1) }
tr.clickrow-tr { cursor: pointer }
tr.clickrow-tr:hover td { background: var(--n50) }
.act-hero h1 { font-size: 26px; margin: 4px 0 }
.link-more { font-size: 13px; font-weight: 600; color: var(--purple-700); margin-top: auto }
.act-card { cursor: pointer }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px }
.evidence-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin-bottom: 8px; background: var(--n50) }

/* ---------- Ampliación: ficha del contacto ---------- */
.contact-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap }
.contact-hero h1 { margin: 4px 0 2px }
.contact-photo { display: grid; justify-items: center; gap: 6px }
.contact-photo .avatar { box-shadow: 0 4px 14px rgba(15, 15, 20, .12) }
.photo-slot { flex: none }
a.plain-link { color: inherit; text-decoration: none }

/* ---- Resumen de reuniones con IA ---- */
.ai-box { border: 1px solid #DCD0FB; background: linear-gradient(180deg, #F7F3FF, #FFFFFF); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px }
.ai-box.locked { background: #FAFAFB; border-color: var(--line, #E6E6EA) }
.ai-head { display: flex; gap: 10px; align-items: flex-start }
.ai-head > svg { flex: none; color: #6C3AED; margin-top: 2px }
.ai-head b { display: block; margin-bottom: 2px }
.ai-box textarea { width: 100%; font: inherit; resize: vertical; min-height: 96px }
.ai-box .row { align-items: center; gap: 8px; flex-wrap: wrap }
.subtask-edit.ai-filled input { background: #F7F3FF; border-color: #CDBDF8 }
.ai-box #aiStatus:not(:empty) { order: 9; flex-basis: 100%; text-align: right }
