/* =====================================================================
   ARALIA · Portal del cliente (<cliente>.aralia.cl)
   Complementa aralia.css (no lo modifica). Solo componentes del portal.
   ===================================================================== */

body.portal { background: var(--bg-soft); overflow-x: hidden; }
.portal .content { max-width: 1440px; width: 100%; }
.portal .content > *, .portal .content .grid > *, .run-grid > *, .data-cols > *, .tables-grid > *, .home-grid > * { min-width: 0; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.small { font-size: .85rem; }
.xsmall { font-size: .78rem; }
.strong { font-weight: 600; color: var(--navy-900); }
.mt-0 { margin-top: 0; }
.hide { display: none !important; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

/* ---------- Shell: sidebar ---------- */
.sidebar__brand a { display: block; }
.sidebar__back { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin: 0 0 6px; border-radius: 10px; font-size: .82rem; color: #8ea4bc; }
.sidebar__back:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar__back .icon { transform: rotate(180deg); width: 15px; height: 15px; }
.model-switch { position: relative; margin: 0 4px 6px; }
.model-switch__btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #fff; cursor: pointer; font: inherit; }
.model-switch__btn:hover { background: rgba(255,255,255,.1); }
.model-switch__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(168,195,222,.18); color: var(--steel-200); flex: none; }
.model-switch__txt { min-width: 0; flex: 1; line-height: 1.25; }
.model-switch__txt strong { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-switch__txt small { color: #8ea4bc; font-size: .74rem; }
.model-switch__btn > .icon:last-child { color: #8ea4bc; width: 16px; height: 16px; }
.model-switch__menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 5; display: none; }
.model-switch.is-open .model-switch__menu { display: block; }
.model-switch__menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: .86rem; line-height: 1.25; }
.model-switch__menu a:hover { background: var(--mist-50); }
.model-switch__menu a.is-current { background: var(--info-100); }
.model-switch__menu a.is-disabled { opacity: .55; }
.model-switch__menu small { display: block; color: var(--text-subtle); font-size: .74rem; }
.model-switch__menu .icon { color: var(--steel-500); }
.side-link .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 700 .7rem/1 var(--font-body); background: rgba(217,138,28,.22); color: #f2c46d; }
.side-link .count--info { background: rgba(168,195,222,.18); color: var(--steel-200); }
.sidebar__foot .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.sidebar__foot small { color: #8ea4bc; }
.sidebar__foot .icon-btn { margin-left: auto; color: #8ea4bc; }
.sidebar__foot .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar__help { margin: 14px 4px 14px; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, rgba(53,91,135,.35), rgba(53,91,135,.08)); border: 1px solid rgba(168,195,222,.15); font-size: .8rem; line-height: 1.45; color: #b9c9db; }
.sidebar__help strong { color: #fff; display: block; font-size: .85rem; margin-bottom: 4px; }
.sidebar__help a { color: var(--steel-200); font-weight: 600; }
.nav-scrim { display: none; }
@media (max-width: 1024px) {
  .app.is-nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(8,19,31,.45); z-index: 44; }
}

/* ---------- Shell: topbar ---------- */
.topbar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: 6px; flex: none; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--navy-800); }
.crumbs .sep { color: var(--text-subtle); }
.icon-btn { position: relative; }
.icon-btn .ping { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn-500); box-shadow: 0 0 0 2px #fff; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; font: 600 .85rem var(--font-body); color: var(--navy-900); }
.avatar-btn:hover { border-color: var(--border-strong); }
.avatar-btn .icon { width: 14px; height: 14px; color: var(--text-subtle); }
.pop-wrap { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 30; display: none; overflow: hidden; }
.pop-wrap.is-open .popover { display: block; }
.popover__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.popover__head strong { font: 700 .95rem var(--font-display); color: var(--navy-900); }
.popover__list a, .popover__list button { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 16px; border: 0; background: none; font: inherit; font-size: .86rem; color: var(--text); line-height: 1.4; cursor: pointer; border-bottom: 1px solid var(--border); }
.popover__list > :last-child { border-bottom: 0; }
.popover__list a:hover, .popover__list button:hover { background: var(--mist-25); }
.popover__list small { display: block; color: var(--text-subtle); font-size: .76rem; margin-top: 2px; }
.popover__list .is-new { background: #fbfdff; }
.popover__list .is-new::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--steel-500); margin: 6px 0 0 auto; flex: none; }
.popover--menu { width: 240px; }
.popover--menu .popover__list a, .popover--menu .popover__list button { align-items: center; padding: 10px 16px; }
.popover__user { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .85rem; line-height: 1.35; }
.popover__user strong { display: block; color: var(--navy-900); }
.tone { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.tone .icon { width: 16px; height: 16px; }
.tone--ok { background: var(--leaf-100); color: var(--leaf-600); }
.tone--warn { background: var(--warn-100); color: #9a5f0c; }
.tone--danger { background: var(--danger-100); color: #a83232; }
.tone--info { background: var(--info-100); color: var(--navy-700); }
.tone--plain { background: var(--bg-sunken); color: var(--text-muted); }
@media (max-width: 640px) {
  .topbar .env-pill, .avatar-btn .name, .avatar-btn > .icon, .topbar .hide-sm { display: none; }
  .avatar-btn { padding: 2px; }
  .crumbs .crumb-mid { display: none; }
}

/* ---------- Encabezados y avisos ---------- */
.page-head__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.eyebrow--app { margin-bottom: 8px; font-size: .7rem; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--info-100); color: var(--navy-800); font-size: .9rem; line-height: 1.5; border: 1px solid #d3e2f1; }
.notice > .icon { margin-top: 2px; flex: none; }
.notice--warn { background: var(--warn-100); color: #7a4b08; border-color: #f4dcb1; }
.notice--ok { background: var(--leaf-100); color: #156548; border-color: #bfe6d3; }
.notice--danger { background: var(--danger-100); color: #8f2a2a; border-color: #f2c8c8; }
.notice .btn { margin-left: auto; }
.notice b { color: inherit; }

/* ---------- Inicio: mis modelos ---------- */
.welcome { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 28px 30px; background: var(--grad-brand); color: #fff; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; }
.welcome h1 { color: #fff; font-size: 1.7rem; margin: 0 0 6px; }
.welcome p { color: #c9d9ea; margin: 0; }
.welcome__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; }
.welcome__stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 14px; }
.welcome__stat b { display: block; font: 800 1.5rem/1.1 var(--font-display); }
.welcome__stat span { display: block; font-size: .78rem; line-height: 1.3; color: #c9d9ea; margin-top: 4px; }
.welcome__mark { position: absolute; right: -60px; bottom: -80px; width: 320px; opacity: .08; pointer-events: none; }
@media (max-width: 960px) { .welcome { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .welcome { padding: 22px 18px; } .welcome__stats { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; } .welcome__stat { padding: 10px; } .welcome__stat b { font-size: 1.2rem; } }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1200px) { .home-grid { grid-template-columns: 1fr; } }
.models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .models { grid-template-columns: 1fr; } }
.model-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.model-card:not(.is-soon):hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--steel-200); }
.model-card__top { display: flex; gap: 14px; align-items: flex-start; }
.model-card__ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--info-100); color: var(--navy-700); flex: none; }
.model-card__ico .icon { width: 22px; height: 22px; }
.model-card h3 { font-size: 1.08rem; margin: 0 0 2px; }
.model-card__type { font-size: .8rem; color: var(--text-subtle); }
.model-card p { font-size: .88rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.model-card__status { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.model-card__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 0 0; border-top: 1px dashed var(--border); font-size: .82rem; }
.model-card__meta dt { color: var(--text-subtle); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.model-card__meta dd { margin: 2px 0 0; color: var(--navy-900); font-weight: 500; }
.model-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.model-card.is-soon { background: linear-gradient(180deg, #fff, var(--mist-25)); border-style: dashed; }
.model-card.is-soon .model-card__ico { background: var(--bg-sunken); color: var(--text-muted); }
.milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.milestones li { display: flex; gap: 8px; align-items: center; color: var(--text-muted); }
.milestones li.is-done { color: var(--navy-900); }
.milestones .icon { width: 16px; height: 16px; color: var(--text-subtle); }
.milestones li.is-done .icon { color: var(--leaf-500); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: .87rem; line-height: 1.45; }
.feed li:last-child { border-bottom: 0; }
.feed li a { color: var(--text); }
.feed li a:hover b { color: var(--steel-500); }
.feed b { color: var(--navy-900); font-weight: 600; }
.feed small { display: block; color: var(--text-subtle); font-size: .76rem; margin-top: 2px; }
.support-card { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.team-list { display: grid; gap: 12px; padding: 18px 20px; }
.team-list div { display: flex; gap: 10px; align-items: center; font-size: .86rem; line-height: 1.3; }
.team-list small { display: block; color: var(--text-subtle); font-size: .76rem; }
.team-list .badge { margin-left: auto; }

/* ---------- Datos de entrada ---------- */
.sources { display: grid; }
.source { display: grid; grid-template-columns: 28px minmax(0, 2.6fr) minmax(0, 1.2fr) 80px minmax(0, 1.4fr) minmax(0, 1.1fr); gap: 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); font-size: .88rem; }
.source:last-child { border-bottom: 0; }
.source--head { padding-top: 10px; padding-bottom: 10px; background: var(--mist-50); font: 600 .72rem/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.source.is-selected { background: #f7fafd; }
.source__name { display: flex; gap: 12px; align-items: center; min-width: 0; }
.source__name strong { display: block; color: var(--navy-900); font-weight: 600; font-family: var(--font-mono); font-size: .86rem; overflow-wrap: anywhere; }
.source__name > div { min-width: 0; }
.source__name small, .source small { display: block; color: var(--text-subtle); font-size: .77rem; line-height: 1.35; }
.chan { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.chan--sharepoint { background: #e3f1f2; color: #0f7173; }
.chan--drive { background: #fdf3d9; color: #9a6a00; }
.chan--web { background: var(--info-100); color: var(--navy-700); }
.new-file { white-space: nowrap; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: var(--warn-100); color: #8a5408; font-size: .76rem; font-weight: 600; }
.new-file .icon { width: 13px; height: 13px; }
.source .c-new { grid-column: 2 / -1; margin-top: -8px; padding-left: 48px; }
.source .c-new .new-file { margin-top: 0; }
.source .pipeline { grid-column: 2 / -1; display: none; }
.source.is-running .pipeline { display: block; }
.pipeline__steps { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.pstep { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--bg-sunken); color: var(--text-subtle); font-size: .76rem; font-weight: 600; }
.pstep .icon { width: 13px; height: 13px; }
.pstep.is-active { background: var(--info-100); color: var(--navy-700); }
.pstep.is-active .icon { animation: spin 1s linear infinite; }
.pstep.is-done { background: var(--leaf-100); color: var(--leaf-600); }
@keyframes spin { to { transform: rotate(360deg); } }
.pipeline .progress { height: 6px; margin-top: 8px; }
@media (max-width: 640px) { .new-file { white-space: normal; } }
@media (max-width: 900px) {
  .source { grid-template-columns: 28px minmax(0, 1fr) auto; row-gap: 8px; }
  .source--head { display: none; }
  .source > .c-canal, .source > .c-filas, .source > .c-carga { grid-column: 2 / -1; }
  .source > .c-valid { grid-column: 3; grid-row: 1; }
  .source .lbl-sm { display: inline; }
}
.lbl-sm { display: none; color: var(--text-subtle); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-right: 6px; }
.selbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--mist-25); border-radius: 0 0 var(--radius-lg) var(--radius-lg); font-size: .88rem; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 16px; padding: 26px; text-align: center; background: var(--mist-25); transition: border-color .15s, background .15s; cursor: pointer; display: grid; justify-items: center; gap: 8px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--steel-400); background: var(--info-100); }
.dropzone__ico { width: 48px; height: 48px; border-radius: 14px; background: #fff; display: grid; place-items: center; color: var(--steel-500); box-shadow: var(--shadow-sm); }
.dropzone strong { color: var(--navy-900); }
.dropzone p { margin: 0; font-size: .85rem; color: var(--text-muted); }
.upload-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-top: 12px; font-size: .86rem; }
.upload-item .progress { height: 6px; margin-top: 6px; }
.upload-item > div { flex: 1; min-width: 0; }
.data-cols--below { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
@media (max-width: 900px) { .data-cols--below { grid-template-columns: 1fr !important; } }
.data-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1200px) { .data-cols { grid-template-columns: 1fr; } }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; display: grid; gap: 6px; }
.kpi-card .kpi__value { font-size: 1.55rem; }
.kpi-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-card__top .tone { width: 32px; height: 32px; }
.kpi-card small { color: var(--text-subtle); font-size: .78rem; }
.kpi-card .kpi__delta { display: inline-flex; align-items: center; gap: 4px; }
.kpi__delta--neutral { color: var(--text-muted); }
@media (max-width: 480px) { .kpi-card { padding: 14px; } .kpi-card .kpi__value { font-size: 1.2rem; } }
.chart-box { position: relative; height: 300px; }
.chart-box--sm { height: 240px; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.findings li { display: flex; gap: 12px; align-items: flex-start; font-size: .87rem; line-height: 1.45; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); }
.findings li small { display: block; color: var(--text-subtle); font-size: .78rem; }
.reason { margin-top: 6px; padding: 10px 12px; border-left: 3px solid var(--danger-500); background: var(--danger-100); border-radius: 0 10px 10px 0; font-size: .82rem; color: #7d2626; line-height: 1.45; white-space: normal; max-width: 60ch; }
.table tr.reason-row td { padding-top: 0; }
.table tr:has(+ tr.reason-row) td { border-bottom: 0; }
.reason-row .reason { margin-top: 0; max-width: none; }
.reason--warn { border-color: var(--warn-500); background: var(--warn-100); color: #7a4b08; }

/* ---------- Tablas del modelo ---------- */
.tbl-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .tbl-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tbl-opt { text-align: left; display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s; }
.tbl-opt:hover { border-color: var(--steel-200); }
.tbl-opt.is-active { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(23,52,90,.1); }
.tbl-opt strong { color: var(--navy-900); font-size: .92rem; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.tbl-opt > span { font-family: var(--font-mono); font-size: .74rem; color: var(--text-subtle); }
.tbl-opt .badge { height: 20px; font-size: .68rem; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); width: 16px; height: 16px; }
.search .input { padding-left: 36px; }
.table td.is-adjusted { background: #eef4fb; position: relative; }
.table td.is-adjusted::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--steel-500); }
.table td.is-invalid { background: var(--danger-100) !important; color: #8f2a2a; }
.table td.is-invalid::after { background: var(--danger-500) !important; }
.table td.edit { cursor: text; }
.table td.edit:hover { box-shadow: inset 0 0 0 1px var(--steel-200); }
.table th.edit-col::after { content: "✎"; margin-left: 6px; color: var(--steel-400); font-size: .8rem; text-transform: none; }
.table .mono { font-size: .82rem; color: var(--navy-700); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.legend .l-adj { background: #eef4fb; box-shadow: inset 0 0 0 1px #c7d8ea; }
.legend .l-edit { background: var(--warn-100); box-shadow: inset 0 0 0 1px #f0d5a6; }
.editbar { position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 18px; border-radius: 16px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-size: .9rem; transform: translateY(12px); opacity: 0; pointer-events: none; transition: all .2s var(--ease); }
.editbar.is-show { transform: none; opacity: 1; pointer-events: auto; }
.editbar .dot { background: var(--warn-500); }
.editbar .btn--ghost { --btn-fg: #fff; --btn-bd: rgba(255,255,255,.3); }
.editbar .btn--ghost:hover { --btn-bg: rgba(255,255,255,.08); }
.adj-list { list-style: none; margin: 0; padding: 0; }
.adj { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: .85rem; display: grid; gap: 6px; }
.adj:last-child { border-bottom: 0; }
.adj__top { display: flex; gap: 10px; align-items: center; }
.adj__top .adj__who { flex: 1; min-width: 0; line-height: 1.3; }
.adj__top small { display: block; color: var(--text-subtle); font-size: .76rem; }
.adj__what { color: var(--navy-900); font-weight: 600; }
.adj__vals { font-family: var(--font-mono); font-size: .8rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adj__vals .old { color: var(--text-subtle); text-decoration: line-through; }
.adj__vals .new { color: var(--navy-800); background: var(--info-100); padding: 1px 6px; border-radius: 6px; }
.adj__why { color: var(--text-muted); font-style: italic; }
.adj.is-undone { opacity: .55; }
.adj.is-undone .adj__vals .new { background: var(--bg-sunken); text-decoration: line-through; }
.adj.is-fresh { animation: flash 1.6s var(--ease); }
@keyframes flash { 0% { background: var(--leaf-100); } 100% { background: transparent; } }
.tables-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
@media (max-width: 1520px) { .tables-grid { grid-template-columns: 1fr; } .tables-grid .adj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } .tables-grid .adj { border-right: 1px solid var(--border); } }
@media (max-width: 640px) { .source .c-new { padding-left: 0; } }
.change-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: .84rem; max-height: 180px; overflow: auto; }
.change-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--mist-50); }
.change-list .mono { color: var(--navy-800); }

/* ---------- Ejecutar ---------- */
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1200px) { .run-grid { grid-template-columns: 1fr; } }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.summary > div { padding: 18px 22px; border-right: 1px solid var(--border); display: grid; gap: 4px; align-content: start; }
.summary > div:last-child { border-right: 0; }
.summary dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.summary dt .icon { width: 14px; height: 14px; }
.summary dd { margin: 0; font: 700 1.1rem/1.2 var(--font-display); color: var(--navy-900); }
.summary small { color: var(--text-muted); font-size: .8rem; line-height: 1.4; }
@media (max-width: 900px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .summary > div:nth-child(2) { border-right: 0; } .summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); } }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .radio-cards { grid-template-columns: 1fr; } }
.radio-card { position: relative; display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 14px; cursor: pointer; font-size: .85rem; line-height: 1.4; color: var(--text-muted); transition: border-color .15s, box-shadow .15s, background .15s; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card strong { display: block; color: var(--navy-900); font-size: .92rem; }
.radio-card .tone { width: 34px; height: 34px; }
.radio-card:has(input:checked) { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(23,52,90,.1); background: #fbfdff; }
.radio-card:has(input:focus-visible) { box-shadow: var(--ring); }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stepper div { display: grid; gap: 6px; font-size: .78rem; color: var(--text-subtle); font-weight: 600; }
.stepper div::before { content: ""; height: 4px; border-radius: 4px; background: var(--bg-sunken); transition: background .3s; }
.stepper div.is-active { color: var(--navy-800); }
.stepper div.is-active::before { background: linear-gradient(90deg, var(--steel-500), var(--steel-200)); }
.stepper div.is-done { color: var(--leaf-600); }
.stepper div.is-done::before { background: var(--leaf-500); }
@media (max-width: 640px) { .stepper span { display: none; } .stepper div.is-active span { display: inline; } }
.run-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.run-status h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.run-pct { font: 700 1.6rem/1 var(--font-display); color: var(--navy-900); font-variant-numeric: tabular-nums; }
.console { height: 360px; white-space: pre-wrap; word-break: break-word; }
.console .line { display: block; }
.console .lvl { display: inline-block; width: 6ch; }
.console .caret { display: inline-block; width: 8px; height: 14px; background: #8fb7e0; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.console-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: #0f2036; border-radius: var(--radius) var(--radius) 0 0; color: #8ea4bc; font: 500 .78rem var(--font-mono); border: 1px solid #1a2b42; border-bottom: 0; }
.console-head + .console { border-radius: 0 0 var(--radius) var(--radius); }
.console-dots { display: flex; gap: 6px; }
.console-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3d57; }
.done-card { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--leaf-100), #fff 70%); border: 1px solid #bfe6d3; flex-wrap: wrap; }
.done-card .tone { width: 48px; height: 48px; border-radius: 14px; }
.done-card .tone .icon { width: 24px; height: 24px; }
.done-card h3 { margin: 0 0 2px; }
.done-card p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.done-card .toolbar { margin-left: auto; }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li { padding: 14px 20px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; font-size: .85rem; }
.queue li:last-child { border-bottom: 0; }
.queue .row { gap: 10px; }
.queue small { color: var(--text-subtle); font-size: .76rem; }
.queue .progress { height: 6px; }

/* ---------- Resultados ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.filters .select, .filters .input { width: auto; }
.filters .search { flex: 1; min-width: 200px; }
.filters .search .input { width: 100%; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-sunken); gap: 2px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 999px; font: 600 .8rem var(--font-body); color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.seg button.is-active { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-sm); }
.runs-table tbody tr { cursor: pointer; }
.runs-table .run-n { font: 700 .9rem var(--font-display); color: var(--navy-900); }
.runs-table .run-name { font-weight: 600; color: var(--navy-900); }
.runs-table td, .runs-table th { padding-left: 12px; padding-right: 12px; }
.runs-table td:nth-child(2) { min-width: 200px; }
.runs-table td small.mono { font-size: .74rem; }
.table--model td { white-space: nowrap; }
.table--model td.wrap { white-space: normal; min-width: 260px; }
.runs-table small { display: block; color: var(--text-subtle); font-size: .76rem; }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.vis-toggle { display: inline-flex; align-items: center; gap: 8px; }
.vis-toggle .switch { font-size: .8rem; color: var(--text-muted); }
.vis-ro { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.vis-ro .icon { width: 14px; height: 14px; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(8,19,31,.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; z-index: 41; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .28s var(--ease); display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer.is-open + .drawer-scrim, .drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer__head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer__head h2 { font-size: 1.25rem; margin: 4px 0 6px; }
.drawer__body { padding: 20px 24px; overflow: auto; display: grid; gap: 20px; align-content: start; flex: 1; }
.drawer__foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }
.drawer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 10px; }
.mini-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-kpis > div { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.mini-kpis span { display: block; font-size: .76rem; color: var(--text-muted); }
.mini-kpis b { font: 700 1.15rem/1.3 var(--font-display); color: var(--navy-900); font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .86rem; margin: 0; }
.facts dt { color: var(--text-subtle); }
.facts dd { margin: 0; color: var(--navy-900); font-weight: 500; }
.files { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: .86rem; }
.file-row:hover { border-color: var(--steel-200); background: var(--mist-25); }
.file-row > div { flex: 1; min-width: 0; line-height: 1.3; }
.file-row strong { display: block; color: var(--navy-900); font-family: var(--font-mono); font-size: .84rem; font-weight: 500; }
.file-row small { color: var(--text-subtle); font-size: .76rem; }
.recips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; min-height: 46px; }
.recips:focus-within { border-color: var(--steel-400); box-shadow: var(--ring); }
.recips input { border: 0; outline: 0; flex: 1; min-width: 160px; height: 32px; font: inherit; font-size: .9rem; padding: 0 6px; }
.rchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 3px; border-radius: 999px; background: var(--info-100); color: var(--navy-800); font-size: .82rem; font-weight: 500; }
.rchip .avatar { width: 24px; height: 24px; font-size: .6rem; }
.rchip button { border: 0; background: none; cursor: pointer; color: var(--text-muted); display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.rchip button:hover { background: rgba(0,0,0,.06); }
.rchip button .icon { width: 13px; height: 13px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggest .chip { height: 28px; font-size: .8rem; }
.suggest .chip .icon { width: 13px; height: 13px; }
.mail-preview { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; font-size: .86rem; }
.mail-preview__head { padding: 12px 16px; background: var(--mist-50); border-bottom: 1px solid var(--border); display: grid; gap: 2px; font-size: .8rem; color: var(--text-muted); }
.mail-preview__head b { color: var(--navy-900); }
.mail-preview__body { padding: 16px; line-height: 1.55; }
.mail-preview__body p { margin: 0 0 10px; white-space: pre-wrap; }
.mail-link { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 6px; color: var(--steel-500); font-weight: 500; }
.mail-link small { color: var(--text-subtle); margin-left: auto; font-weight: 400; }
.modal--lg { width: min(720px, 100%); }
.modal__head h3 { margin: 0; }
.modal__head p { margin: 4px 0 0; color: var(--text-muted); font-size: .88rem; }
.modal__body { display: grid; gap: 16px; }
.check-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .check-cards { grid-template-columns: 1fr; } }
.check-card { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: .84rem; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--steel-400); background: #f7fafd; }
.check-card input { accent-color: var(--navy-700); width: 16px; height: 16px; }
.check-card div { line-height: 1.3; min-width: 0; }
.check-card strong { display: block; font-family: var(--font-mono); font-weight: 500; font-size: .8rem; color: var(--navy-900); overflow-wrap: anywhere; }
.check-card small { color: var(--text-subtle); font-size: .74rem; }
.sent-list { list-style: none; margin: 0; padding: 0; }
.sent-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); font-size: .86rem; }
.sent-list li:last-child { border-bottom: 0; }
.sent-list small { display: block; color: var(--text-subtle); font-size: .78rem; }
@media (max-width: 640px) { .sent-list li { grid-template-columns: auto minmax(0, 1fr); } .sent-list li > :last-child { grid-column: 2; } }

/* ---------- Dashboards ---------- */
.dash-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; padding: 16px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.dash-bar .field { min-width: 240px; flex: 1; max-width: 360px; }
.dash-bar .toolbar { margin-left: auto; }
.vs { display: grid; place-items: center; width: 34px; height: 44px; font: 700 .78rem var(--font-display); color: var(--text-subtle); }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) { .span-8, .span-7, .span-5, .span-4, .span-6 { grid-column: span 12; } }
.cmp-tag { display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--text-muted); }
.cmp-tag i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-cell span { height: 6px; border-radius: 4px; background: var(--steel-300); }
.bar-cell span.ok { background: var(--leaf-500); } .bar-cell span.warn { background: var(--warn-500); }

/* ---------- Login ---------- */
.auth__side { background: var(--navy-900); }
.auth__side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(8,19,31,.35) 0%, rgba(12,28,50,.82) 70%); }
.auth__side > * { z-index: 1; }
.auth__side img.bg { opacity: .55; }
.tenant-mark { display: flex; align-items: center; gap: 14px; }
.tenant-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--navy-800); font: 800 1.05rem var(--font-display); letter-spacing: -.04em; box-shadow: var(--shadow); }
.tenant-logo--sm { width: 40px; height: 40px; border-radius: 12px; font-size: .9rem; background: var(--navy-800); color: #fff; }
.tenant-mark strong { display: block; font: 700 1.1rem var(--font-display); }
.tenant-mark small { color: #c9d9ea; font-size: .82rem; display: flex; align-items: center; gap: 8px; }
.tenant-mark small img { height: 14px; width: auto; display: inline-block; }
.auth__pitch h2 { color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.4rem); max-width: 16ch; }
.auth__pitch ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; color: #d6e3f0; font-size: .95rem; }
.auth__pitch li { display: flex; gap: 10px; align-items: center; }
.auth__pitch li .icon { color: #6fd3a5; }
.auth__legal { font-size: .78rem; color: #9fb3c9; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.demo-flag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(217,138,28,.2); color: #f2c46d; font-weight: 600; }
.auth__box h1 { font-size: 1.75rem; margin: 18px 0 6px; }
.auth__box > p { color: var(--text-muted); margin: 0 0 24px; }
.auth__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth__url { font: 500 .78rem var(--font-mono); color: var(--text-muted); background: var(--mist-50); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; }
.auth__url .icon { width: 12px; height: 12px; color: var(--leaf-600); }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-subtle); font-size: .8rem; margin: 18px 0; }
.or::before, .or::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i { display: block; }
.pw { position: relative; }
.pw .icon-btn { position: absolute; right: 4px; top: 4px; }
.auth__foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .78rem; color: var(--text-subtle); flex-wrap: wrap; }
.auth__foot img { height: 16px; width: auto; display: inline-block; vertical-align: -3px; margin-left: 4px; }
.mobile-tenant { display: none; }
@media (max-width: 900px) { .mobile-tenant { display: flex; } }
.btn.is-loading .icon { animation: spin 1s linear infinite; }

/* Impresión mínima / movimiento reducido */
@media (prefers-reduced-motion: reduce) { .pstep.is-active .icon, .btn.is-loading .icon { animation: none; } }
body[data-page="tablas"] .toast { bottom: 96px; }
#run-box { scroll-margin-top: 84px; }

.done-card > div:nth-child(2) { flex: 1 1 320px; min-width: 0; }
.drawer .sent-list li { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px; }
.drawer .sent-list li > :last-child { grid-column: 2; text-align: left !important; }
.bar-cell { white-space: nowrap; }
.notice { flex-wrap: wrap; }
.notice > div { flex: 1 1 220px; min-width: 0; }
@media (max-width: 640px) { .filters .select { flex: 1 1 calc(50% - 10px); } .filters .seg { width: 100%; justify-content: space-between; } }
