/*
 * Dashboard360 · base de diseño compartida (3.0.0).
 *
 * Única hoja común a todas las pantallas. Define colores, tipografía, espaciados, tarjetas,
 * indicadores, tablas, controles, avisos y la base de los gráficos. Las hojas de módulo
 * (d360-economic.css, d360-finance.css, d360-risk.css, importaciones.css, inicio.css) sólo
 * agregan componentes propios y nunca redefinen esta base.
 *
 * Reglas de mantenimiento:
 *  - Colores y fuentes sólo como variables de :root.
 *  - Sin !important (la única excepción es el atributo [hidden], que debe ocultar siempre).
 *  - Los nombres heredados (.panel, .finance-table, .op-badge, .d360-kpi…) se resuelven acá como
 *    alias del componente común, para no mantener dos versiones del mismo elemento.
 */

:root {
    --navy: #032e7c;
    --navy-dark: #021b4a;
    --navy-2: #0a429a;
    --red: #cd1433;
    --red-dark: #a90d28;
    --green: #14734d;
    --gold: #b47708;
    --gold-dark: #8a5a00;
    --cyan: #1186b5;
    --text: #46494f;
    --ink: #19365c;
    --heading: #153b70;
    --muted: #61738b;
    --muted-2: #75859b;
    --link: #0b4ca2;
    --line: #d7e1ef;
    --line-soft: #e3e9f2;
    --line-input: #c7d5e6;
    --soft-blue: #eaf1fb;
    --soft-blue-2: #e7f0fc;
    --soft-blue-line: #b8cde7;
    --soft-green: #e3f4ee;
    --soft-red: #fbe8ec;
    --soft-gold: #f7ebd4;
    --soft-gray: #eef1f5;
    --row-alt: #f6f9fe;
    --highlight: #fff6dc;
    --white: #ffffff;

    /* Colores de serie para gráficos (mismo orden en todas las pantallas). */
    --chart-1: #032e7c;
    --chart-2: #b47708;
    --chart-3: #14734d;
    --chart-4: #cd1433;
    --chart-5: #1186b5;
    --chart-6: #75859b;

    --font-title: "IBM Plex Sans", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 2px 8px rgba(20, 52, 90, .04);
    --shadow-raised: 0 5px 16px rgba(22, 52, 89, .075);
    --gap: 14px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    background: linear-gradient(180deg, #f5f7fb 0%, #f1efe6 100%);
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(135deg, transparent 0 74%, rgba(3,46,124,.06) 74% 74.6%, transparent 74.6% 100%),
        linear-gradient(135deg, transparent 0 81%, rgba(205,20,51,.05) 81% 81.5%, transparent 81.5% 100%);
}
a { color: var(--link); }
h1, h2, h3, h4 { font-family: var(--font-title); color: var(--heading); margin: 0; }
h2 { font-size: 17px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
h3 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
h4 { font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
p { margin: 0; }
small { font-size: 11px; }
code { padding: 2px 6px; border-radius: 6px; background: var(--soft-gray); color: var(--navy); font-size: 12px; }
[hidden] { display: none !important; }
.muted, .v10-muted { color: var(--muted); }
.num, .money, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Un importe nunca se parte: el símbolo queda junto al número. */
.amount, .money, .v10-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos, .positive, .pp-positive { color: var(--green); }
.neg, .negative, .pp-negative, .v10-text-red, .d360-text-bad, .result-negative { color: var(--red); }
.warn-text, .pp-partial, .pp-null { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Encabezado ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid rgba(3,46,124,.12);
    box-shadow: 0 8px 22px rgba(3,46,124,.08);
}
.topbar::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--navy) 0 86%, var(--red) 86% 100%); }
.topbar-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 52px; width: auto; display: block; }
.gs-primary-nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1; flex-wrap: wrap; }
.gs-primary-nav a {
    font-family: var(--font-title); font-size: 13px; font-weight: 700; line-height: 1.2;
    color: var(--navy); text-decoration: none; white-space: nowrap;
    padding: 10px 13px; border-radius: 999px;
    border: 1px solid rgba(3,46,124,.14); background: rgba(234,241,251,.68);
    transition: background .15s ease, color .15s ease;
}
.gs-primary-nav a:hover, .gs-primary-nav a.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.gs-user-menu { display: flex; align-items: center; gap: 6px; margin-left: 12px; }
.gs-user-name {
    font-size: 12px; font-weight: 700; color: var(--navy); text-decoration: none;
    padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
}
.gs-user-exit-form { margin: 0; }
.gs-user-menu .gs-user-exit { min-height: 0; padding: 8px 12px; font-size: 12px; box-shadow: none; }

/* ---------- Contenedor y título de página ---------- */
.container { width: min(1460px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 44px; }
.page-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 20px;
    min-height: 112px; margin: 0 0 var(--gap); padding: 14px 18px;
    background: linear-gradient(135deg, #fff 0%, #f2f7ff 72%, #fff9ed 100%);
    border: 1px solid rgba(3,46,124,.10); border-left: 6px solid var(--navy);
    border-radius: 13px; box-shadow: 0 7px 20px rgba(3,46,124,.08);
}
.page-hero::after {
    content: ""; position: absolute; right: -36px; top: -36px; width: 140px; height: 140px;
    border: 2px solid rgba(3,46,124,.09); transform: rotate(45deg);
}
.page-hero-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px;
    font-family: var(--font-title); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--red);
}
.eyebrow::before { content: ""; width: 42px; height: 3px; background: linear-gradient(90deg, var(--red), transparent); }
.page-hero h1 { font-size: clamp(29px, 3vw, 38px); font-weight: 700; line-height: 1; letter-spacing: -.045em; color: var(--navy); }
.hero-subtitle { margin-top: 6px; max-width: 760px; font-size: 13px; line-height: 1.35; color: var(--text); }
.tenant-brand-hero { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 350px; width: 350px; margin-left: auto; position: relative; z-index: 1; }
.v9-company-logo { display: block; width: 330px; height: 96px; max-width: 330px; object-fit: contain; padding: 4px 6px; border-radius: 12px; background: var(--white); box-shadow: 0 4px 14px rgba(3,46,124,.14); }

/* ---------- Pestañas de sección ---------- */
.gs-module-nav, .finance-subnav, .imports-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--gap); }
.gs-module-nav a, .finance-subnav a, .imports-tabs a {
    font-size: 12px; font-weight: 800; color: #183d70; text-decoration: none;
    min-height: 34px; display: inline-flex; align-items: center;
    padding: 7px 13px; border-radius: 10px; border: 1px solid #d3e0ef; background: var(--white);
    box-shadow: 0 3px 10px rgba(22,52,89,.05);
}
.gs-module-nav a:hover, .finance-subnav a:hover, .imports-tabs a:hover { background: var(--soft-blue); border-color: var(--soft-blue-line); color: var(--navy); }
.gs-module-nav a.active, .finance-subnav a.active, .imports-tabs a.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.finance-context-line { display: flex; gap: 10px; align-items: center; margin: -4px 0 var(--gap); font-size: 12px; }
.d360-subtabs { display: flex; gap: 2px; flex-wrap: wrap; margin: -4px 0 var(--gap); border-bottom: 1px solid var(--line); }
.d360-subtabs a { display: inline-flex; align-items: center; padding: 9px 12px 8px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.d360-subtabs a:not(.active):hover { color: var(--navy); border-bottom-color: var(--line-input); }
.d360-subtabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
/* Chips de filtro rápido. */
.chips, .v10-quick-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 var(--gap); }
.chip, .v10-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 6px 13px; border: 1px solid #cedaea; background: var(--white); border-radius: 999px; color: #3c526f; font-size: 12px; font-weight: 700; text-decoration: none; }
.chip:hover, .v10-chip:hover { border-color: var(--navy); background: var(--soft-blue); color: var(--navy); }
.chip.active, .v10-chip.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.chip b { font-variant-numeric: tabular-nums; }

/* ---------- Avisos ---------- */
.alert, .note, .d360-note, .pp-warning, .d360-chart-off, .op-warning-note, .v9-inline-status, .comparison-ipc-notice {
    margin: 0 0 var(--gap); padding: 10px 13px;
    font-size: 12.5px; line-height: 1.5; color: var(--ink);
    background: var(--soft-blue); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 10px;
}
.alert strong, .note strong, .d360-note strong { color: var(--navy); }
.alert a, .note a, .d360-note a { color: var(--navy); font-weight: 700; }
.alert.success, .note.ok, .d360-note-ok { background: var(--soft-green); border-left-color: var(--green); }
.alert.danger, .note.danger, .d360-note-bad, .op-warning-note { background: var(--soft-red); border-left-color: var(--red); }
.alert.warning, .note.warn, .d360-note-warn, .pp-warning, .v9-inline-status { background: var(--soft-gold); border-left-color: var(--gold); }
.d360-chart-off { border-style: dashed; text-align: center; color: var(--muted); }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note-list .note { margin: 0; }

/* ---------- Tarjetas ---------- */
.card, .panel, .v10-card, .v10-empty, .v10-source, .form-panel, .finance-setup-panel, .finance-intro-panel,
.finance-form-panel, .finance-import-panel, .finance-range-panel, .finance-pending-panel, .finance-chart-panel {
    scroll-margin-top: 100px;
    margin: 0 0 var(--gap); padding: 18px; min-width: 0;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.panel > h2, .card > h2 { margin-bottom: 8px; }
.panel > p, .card > p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.form-panel { display: grid; gap: 12px; max-width: 620px; }
.form-panel label:has(> input[type=checkbox]) { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.form-panel label > input[type=checkbox] { order: 0; }
.form-panel > button { justify-self: start; }
.card-head, .v10-section-heading, .v10-card-heading, .section-head, .section-heading, .finance-panel-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px;
}
.card-head > div, .section-head > div, .finance-panel-head > div { min-width: 0; }
.card-head h2, .section-head h2, .v10-card-heading h3, .v10-section-heading h3, .finance-panel-head h2 { margin: 0; }
.card-head p, .section-head p, .v10-section-heading p, .finance-panel-head p, .section-heading p { margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.card-head > a:not(.btn), .card-link { font-size: 11.5px; font-weight: 800; color: var(--link); text-decoration: none; white-space: nowrap; }
.card-head .actions, .d360-actions, .v9-actions, .pp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-head .actions { justify-content: flex-end; }
.card-foot { margin-top: 12px; font-size: 11.5px; line-height: 1.45; color: #718197; }
.card.narrow { max-width: 620px; }
.v10-empty, .empty-state { padding: 32px 22px; text-align: center; }
.v10-empty h3, .empty-state h3 { margin-top: 0; font-size: 18px; }
.v10-empty p, .empty-state p { margin: 8px 0 16px; color: var(--muted); }
.finance-empty, .finance-table-empty, .tutorial-empty {
    margin: 12px 0; padding: 18px; text-align: center; color: var(--muted); font-weight: 600;
    background: var(--row-alt); border: 1px dashed var(--line-input); border-radius: 10px;
}
.grid-2, .cols-2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-2 > .card, .grid-3 > .card, .grid-2 > .panel { margin-bottom: 0; }
.stack { display: grid; gap: var(--gap); margin-bottom: var(--gap); }

/* ---------- Indicadores (un solo componente) ---------- */
.kpis, .kpi-grid, .d360-kpi-row, .op-kpis, .imports-stats, .v10-metrics, .finance-kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 var(--gap); align-items: stretch;
}
.kpi, .d360-kpi, .op-kpis > article, .op-kpis > a, .op-kpis > div, .imports-stats > article, .imports-stats > div, .finance-kpi-card, .v10-metric {
    --tone: var(--navy);
    position: relative;
    display: flex; flex-direction: column; gap: 4px; min-width: 0;
    padding: 15px 16px 14px; background: var(--white); color: inherit; text-decoration: none;
    border: 1px solid var(--line); border-top: 4px solid var(--tone); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.kpi > span, .d360-kpi > span, .op-kpis > * > span, .imports-stats > * > span, .finance-kpi-card > span, .v10-metric > h3 {
    margin: 0; font: 600 12px/1.4 var(--font-body); color: var(--muted); letter-spacing: 0; text-transform: none;
}
.kpi > strong, .d360-kpi > strong, .op-kpis > * > strong, .imports-stats > * > strong, .finance-kpi-card > strong, .v10-number {
    font-size: clamp(16px, 1.35vw, 21px); font-weight: 750; line-height: 1.25; letter-spacing: -.02em;
    color: var(--tone); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi > small, .d360-kpi > small, .op-kpis > * > small, .imports-stats > * > small, .finance-kpi-card > small, .v10-metric > small, .v10-metric > span {
    font-size: 11px; line-height: 1.45; color: var(--muted-2);
}
a.kpi:hover, a.d360-kpi:hover { background: var(--row-alt); border-color: var(--tone); }
a.kpi:focus-visible, a.d360-kpi:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
:is(.kpi, .d360-kpi):is(.is-selected, [aria-current="page"]) { background: var(--row-alt); border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone), var(--shadow-card); }
/* Tonos: una sola convención para todas las pantallas. */
.tone-green, .v10-green, .d360-tone-green, .sg-tone-success { --tone: var(--green); --metric-tone: var(--green); }
.tone-red, .v10-red, .d360-tone-red, .sg-tone-danger { --tone: var(--red); --metric-tone: var(--red); }
.tone-gold, .v10-amber, .d360-tone-amber, .sg-tone-warning { --tone: var(--gold); --metric-tone: var(--gold); }
.tone-blue, .v10-blue, .v11-blue, .d360-tone-blue { --tone: var(--navy); --metric-tone: var(--navy); }
.tone-cyan, .d360-tone-cyan { --tone: var(--cyan); --metric-tone: var(--cyan); }
.tone-gray { --tone: var(--muted-2); --metric-tone: var(--muted-2); }
.d360-compact > :is(.kpi, .d360-kpi) { padding: 11px 14px 12px; gap: 2px; }
.d360-compact > :is(.kpi, .d360-kpi) > span { font-size: 11.5px; }
.d360-compact > :is(.kpi, .d360-kpi) > strong { font-size: clamp(15px, 1.25vw, 19px); }
/* Variación junto al indicador: el color expresa el efecto, el texto lo explica. */
.delta { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.good { color: #11603e; background: #e8f5ee; }
.delta.bad { color: #a31330; background: #fff0f2; }
.delta.flat { color: #344e71; background: #edf2f9; }

/* ---------- Filtros y barras de herramientas ---------- */
.toolbar, .filters, .op-toolbar, .finance-company-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.toolbar .field, .filters > label, .op-toolbar label { flex: 0 0 auto; min-width: 170px; }
.toolbar .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
/* Botón de envío y accesos juntos, pegados a los campos y alineados abajo con ellos. */
.toolbar .actions.toolbar-buttons { margin-left: 0; align-items: flex-end; }
.container > .filters, .container > form.filters {
    margin: 0 0 var(--gap); padding: 16px 18px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.op-toolbar { margin: 12px 0 16px; }
.op-toolbar h2 { margin: 0; }
.toolbar-note { margin-top: 10px; font-size: 11.5px; color: #718197; }
/* El selector de empresa no aporta cuando el usuario sólo tiene una: se omite desde el primer pintado. */
label:has(> select[name="empresa_id"] > option:only-child) { display: none; }

/* ---------- Campos ---------- */
label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--navy); }
label > input, label > select, label > textarea, label > .d360-month-picker, .field > input, .field > select, .field > textarea, .field > .d360-month-picker { order: 2; }
label > small, .field > small, .field > span:empty, .field-help { order: 3; font-size: 11px; font-weight: 400; line-height: 1.4; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]):not([type=hidden]):not([type=file]):not([type=range]), select, textarea {
    width: 100%; min-height: 40px; margin: 0; padding: 8px 11px;
    font: 600 13px/1.3 var(--font-body); color: #102e56;
    background: var(--white); border: 1px solid var(--line-input); border-radius: var(--radius-sm);
}
textarea { min-height: 80px; resize: vertical; }
input[type=file] { font: 500 12px var(--font-body); color: var(--ink); }
input[type=range] { width: 100%; accent-color: var(--navy); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(3,46,124,.25); outline-offset: 1px; border-color: var(--navy); }
input::placeholder, textarea::placeholder { color: #9aa8ba; font-weight: 400; }
input[readonly] { background: var(--row-alt); }
.d360-month-picker { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 6px; width: 100%; min-width: 0; }
.d360-month-picker select { width: 100%; min-width: 0; }
.d360-month-picker select[data-mp=y] { width: 104px; }
.form-grid, .finance-form-grid, .op-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; align-items: end; }
.finance-form-grid.cols-2, .op-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.finance-form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .wide, .op-wide, .finance-form-grid .wide { grid-column: 1 / -1; }
.op-form .table-wrap { max-width: 100%; }
.op-form .finance-table input { min-width: 90px; }
.form-stack, .finance-entry-form { display: grid; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check, .finance-check-label, .d360-check, .check-line { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.check input, .finance-check-label input, .d360-check input, .check-line input { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--navy); }
.finance-check-label { min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--row-alt); }
.group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.group legend { padding: 0; margin-bottom: 10px; font-family: var(--font-title); font-size: 13px; font-weight: 700; color: var(--heading); }
fieldset.box { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
fieldset.box > legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--navy); }

/* Opciones en botones (radio) */
.cf-toggles { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.choice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.choice legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--navy); }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.choice label { flex-direction: row; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: inline-flex; align-items: center; min-height: 36px; padding: 7px 14px; cursor: pointer;
    font-size: 12.5px; font-weight: 700; color: var(--navy);
    background: var(--white); border: 1px solid var(--line-input); border-radius: 999px;
}
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.choice input:focus-visible + span { outline: 2px solid rgba(3,46,124,.35); outline-offset: 2px; }

/* ---------- Botones (azul Sigma, letra blanca) ---------- */
button, .btn, .btn-soft, .v10-btn, a.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 8px 16px; cursor: pointer;
    font: 700 12.5px/1.2 var(--font-body); color: var(--white); text-decoration: none; white-space: nowrap;
    background: var(--navy); border: 1px solid var(--navy); border-radius: 999px;
    box-shadow: 0 4px 12px rgba(3,46,124,.14);
    transition: background .15s ease;
}
button:hover, .btn:hover, .btn-soft:hover, .v10-btn:hover, a.button:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: var(--white); }
button:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.btn-soft, .btn-sm, .v10-small, td button, td .btn { min-height: 30px; padding: 5px 12px; font-size: 11.5px; box-shadow: none; }
/* Acción secundaria: borde azul sobre blanco. */
.btn-outline, .v10-outline, .risk-secondary {
    background: var(--white); color: var(--navy); border-color: var(--soft-blue-line); box-shadow: none;
}
.btn-outline:hover, .v10-outline:hover, .risk-secondary:hover { background: var(--soft-blue); color: var(--navy); border-color: var(--navy); }
.btn-danger, .sg-delete, button.danger, a.button.danger, .link-button, .fin-doc-danger { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-danger:hover, .sg-delete:hover, button.danger:hover, a.button.danger:hover, .link-button:hover, .fin-doc-danger:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }
.link-button { min-height: 30px; padding: 5px 12px; font-size: 11.5px; box-shadow: none; }
.btn-link { background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; color: var(--link); font-weight: 800; font-size: 11.5px; }
.btn-link:hover { background: none; color: var(--navy); text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ---------- Tablas ---------- */
/* Una sola tabla para todo el sistema: .table, .finance-table, .op-table, .v10-table, .pp-table… */
.table-wrap, .v10-table-wrap, .pp-table-wrap, .fin-doc-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
:where(main) table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--white); }
:where(main) th {
    padding: 9px 10px; text-align: left; white-space: nowrap;
    font: 800 10px/1.25 var(--font-title); letter-spacing: .04em; text-transform: uppercase;
    color: var(--white); background: var(--navy);
}
:where(main) td { padding: 9px 10px; vertical-align: top; color: var(--ink); border-top: 1px solid var(--line-soft); }
:where(main) tbody tr:nth-child(even) > td { background: var(--row-alt); }
:where(main) td small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; line-height: 1.35; color: var(--muted); }
:where(main) td small.neg { color: var(--red); font-weight: 600; }
:where(main) th.num, :where(main) td.num { text-align: right; }
.table thead th { position: sticky; top: 0; z-index: 1; }
:where(main) tfoot td, :where(main) tfoot th, :where(main) tr.total td, :where(main) tr.billing-total-row td {
    font-weight: 800; color: var(--navy); background: var(--soft-blue); border-top: 2px solid var(--navy);
}
:where(main) tbody tr.is-highlight > td, :where(main) tbody tr.is-current > td { background: var(--highlight); }
:where(main) tr.is-flagged td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
:where(main) tr.is-danger td:first-child { box-shadow: inset 4px 0 0 var(--red); }
:where(main) tr.is-today td { border-top: 2px solid var(--navy); }
:where(main) tr.is-clickable { cursor: pointer; }
:where(main) tbody tr.is-clickable:hover > td { background: var(--soft-blue); }
td.actions { white-space: nowrap; }
td.actions > * { vertical-align: middle; margin: 0 4px 4px 0; }
.table .empty td, td.empty, .risk-empty { text-align: center; color: var(--muted); padding: 18px; }
.table-scroll { max-height: 560px; overflow: auto; }

/* ---------- Etiquetas de estado ---------- */
.tag, .op-badge, .finance-status, .finance-type, .rk-pill, .v9-label {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap;
    color: var(--ink); background: var(--soft-gray); border: 1px solid transparent;
}
.tag-in, .tag-on, .tag.ok, .op-badge.success, .finance-status.success, .finance-status.cobrado, .finance-status.cobrada, .finance-type.ingreso, .rk-success { background: var(--soft-green); color: var(--green); }
.tag-out, .tag-off, .tag.bad, .op-badge.danger, .finance-status.danger, .finance-type.egreso, .rk-danger { background: var(--soft-red); color: var(--red); }
.tag-int, .tag.info, .finance-status.proyectado, .finance-status.projected, .finance-status.vigente, .v9-label { background: var(--soft-blue); color: var(--navy); }
.tag-wait, .tag.warn, .op-badge.warning, .rk-warning { background: var(--soft-gold); color: var(--gold-dark); }
.tag.muted, .finance-status.cancelado, .finance-status.cancelada, .rk-neutral { background: var(--soft-gray); color: #526176; }

/* ---------- Paginación ---------- */
.pagination, .op-pagination, .v10-pagination, .risk-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 14px; font-size: 12px; color: var(--muted); }
.pagination > span:first-child, .v10-pagination > span:first-child { margin-right: auto; }
.pagination a, .op-pagination a { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 12px; border: 1px solid var(--line-input); border-radius: 9px; background: var(--white); color: var(--navy); font-weight: 700; text-decoration: none; }
.pagination a:hover, .op-pagination a:hover { background: var(--soft-blue); }

/* ---------- Desplegables ---------- */
details > summary { cursor: pointer; font-size: 12.5px; font-weight: 800; color: var(--navy); list-style-position: inside; }
details[open] > summary { margin-bottom: 10px; }
.v10-details > p { font-size: 12px; margin-top: 12px; }
details.popover, .v10-menu { display: inline-block; position: relative; }
details.popover > summary, .v10-menu > summary { list-style: none; display: inline-flex; align-items: center; min-height: 30px; padding: 5px 12px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 11.5px; }
details.popover > summary::-webkit-details-marker, .v10-menu > summary::-webkit-details-marker { display: none; }
details.popover[open] > summary, .v10-menu[open] > summary { margin: 0; }
details.popover > form, details.popover > .popover-body, .v10-menu > div {
    position: absolute; right: 0; z-index: 5; width: 260px; margin-top: 6px; padding: 10px;
    display: grid; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-raised);
}
.v10-menu a { display: block; padding: 8px 10px; color: #334e74; text-decoration: none; font-size: 13px; border-radius: 6px; }
.v10-menu a:hover { background: var(--soft-blue); }
details.confirm { display: inline-block; vertical-align: middle; }
details.confirm > summary { list-style: none; display: inline-flex; align-items: center; min-height: 30px; padding: 5px 12px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 11.5px; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { margin: 0 0 6px; }
details.confirm > form { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; width: 330px; max-width: 80vw; padding: 10px; margin-bottom: 4px; background: var(--soft-blue); border: 1px solid var(--line); border-radius: 10px; }
details.confirm label { font-size: 11px; }
details.confirm > form button { grid-column: 1 / -1; justify-self: start; }

/* ---------- Gráficos ---------- */
/* El contenedor reserva la altura antes de dibujar: el gráfico no empuja la página al aparecer. */
.chart-box { position: relative; height: 420px; min-width: 0; }
.chart-box.sm { height: 280px; }
.chart-box canvas { display: block; max-width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid currentColor; }
.chart-legend i.box { width: 10px; height: 10px; border: 0; border-radius: 2px; background: currentColor; }
.chart-legend i.dash { border-top-style: dashed; }
.chart-tip {
    position: absolute; z-index: 6; pointer-events: none; min-width: 250px; max-width: 340px;
    padding: 10px 12px; font-size: 12px; line-height: 1.4; color: var(--white);
    background: var(--navy); border-radius: 10px; box-shadow: 0 10px 24px rgba(3,46,124,.25);
    opacity: 0; transition: opacity .1s ease;
}
.chart-tip strong { display: block; margin-bottom: 4px; font-size: 12.5px; }
.chart-tip .row { display: flex; justify-content: space-between; gap: 12px; }
.chart-tip ul { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid rgba(255,255,255,.2); display: grid; gap: 3px; }
.chart-tip li { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.chart-tip li span:first-child { opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tip li span:last-child { white-space: nowrap; font-weight: 700; }
.chart-tip .hint { margin-top: 6px; font-size: 10.5px; opacity: .8; }
/* Barras horizontales simples (HTML), legibles en celular sin librería. */
.hbars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(60px, 3fr) max-content; gap: 10px; align-items: center; font-size: 12px; }
.hbars .hbar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbars .hbar-track { position: relative; display: grid; gap: 3px; }
.hbars .hbar { display: block; height: 9px; min-width: 2px; border-radius: 4px; background: var(--chart-1); }
.hbars .hbar.alt { background: var(--chart-2); }
.hbars .hbar.good { background: var(--green); }
.hbars .hbar.bad { background: var(--red); }
.hbars .hbar-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

/* Barra y punto de estado (usados por varios módulos). */
.v10-track { position: relative; height: 12px; background: var(--soft-blue); border-radius: 4px; overflow: hidden; }
.v10-track.is-empty { background: none; border: 1px dashed var(--line); }
.v10-track > i, .v10-track > b { display: block; height: 100%; border-radius: inherit; background: var(--navy); }
.v10-dot { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--navy); }
.v10-dot.green { background: var(--green); } .v10-dot.amber { background: var(--gold); } .v10-dot.blue { background: #376bc0; } .v10-dot.red { background: var(--red); }
/* ---------- Flujo de fondos: columnas por día ---------- */
.cf-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cf-inner { position: relative; }
.chart-box.cf-chart { height: 430px; }
.cf-swipe { display: none; margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.cf-days { display: grid; gap: 0; margin-top: 2px; }
.cf-day {
    display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; min-height: 0;
    padding: 8px 1px 8px; margin: 0; border: 0; border-left: 1px solid #dfe7f2; border-radius: 0;
    background: transparent; box-shadow: none; color: var(--ink); font: inherit; cursor: pointer; white-space: nowrap;
}
.cf-day:first-child { border-left: 0; }
.cf-day.cf-day-head { align-items: flex-end; padding-right: 8px; background: transparent; cursor: default; }
.cf-day.cf-day-head:hover { background: transparent; }
.cf-day.cf-day-head b { font-size: 10px; color: var(--navy); }
.cf-day.cf-day-head .cf-day-proy { font-size: 9.5px; }
.cf-day-head + .cf-day { border-left: 0; }
.cf-day:hover { background: var(--soft-blue); color: var(--ink); border-color: #dfe7f2; }
.cf-day b { font-size: 10.5px; font-weight: 800; letter-spacing: -.01em; color: var(--navy); }
.cf-day.is-neg b { color: var(--red); }
.cf-day-proy { min-height: 14px; font-size: 10px; font-weight: 700; color: var(--gold); letter-spacing: -.02em; }
.cf-day-proy.is-neg { color: var(--red); }
.cf-day-wd { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cf-day-dt { font-size: 10px; font-weight: 600; color: var(--ink); }
.cf-day.is-past { background: rgba(70,73,79,.05); }
.cf-day.is-past b { color: #4f5f78; }
.cf-day.is-today { background: var(--navy); border-radius: 6px; }
.cf-day.is-today b, .cf-day.is-today .cf-day-wd, .cf-day.is-today .cf-day-dt { color: var(--white); }
.cf-day.is-today .cf-day-proy { color: #f2c879; }
.cf-day.is-selected { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 6px; }

/* ---------- Puntaje crediticio: lo usan Cobranzas y Riesgo ---------- */
.score-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 7px; font-size: 13px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--soft-gray); color: #526176; }
.score-pill.success { background: var(--soft-green); color: var(--green); }
.score-pill.warning { background: var(--soft-gold); color: var(--gold-dark); }
.score-pill.danger { background: var(--soft-red); color: var(--red); }
.score-pill.provisional { border: 1px dashed currentColor; }
.score-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--gap); align-items: start; }
.score-hero { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--row-alt); border: 1px solid var(--line); border-radius: 10px; }
.score-hero strong.score-number { font: 700 40px/1.05 var(--font-title); color: var(--navy); font-variant-numeric: tabular-nums; }
.score-hero .score-number.success { color: var(--green); } .score-hero .score-number.warning { color: var(--gold-dark); } .score-hero .score-number.danger { color: var(--red); }
.score-breakdown { display: grid; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.score-breakdown > div { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 12px; align-items: baseline; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.score-breakdown > div:first-child { border-top: 0; }
.score-breakdown dt { color: var(--ink); }
.score-breakdown dt small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.score-breakdown dd { margin: 0; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--navy); }
.score-breakdown .is-penalty dd { color: var(--red); }
.score-breakdown .is-total { background: var(--soft-blue); }
.score-breakdown .is-total dd { font-size: 17px; }
.score-source { display: inline-flex; align-items: center; gap: 6px; width: max-content; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.score-source.ok { background: var(--soft-green); color: var(--green); }
.score-source.empty { background: var(--soft-blue); color: var(--navy); }
.score-source.failed, .score-source.pending, .score-source.none { background: var(--soft-gold); color: var(--gold-dark); }

/* ---------- Configuración, ingreso y error ---------- */
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.data-list dt { font-weight: 700; color: var(--navy); }
.data-list dd { margin: 0; color: var(--ink); }
.secret { font: 700 15px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--navy); background: var(--soft-blue); padding: 2px 8px; border-radius: 6px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.video-grid video { width: 100%; border-radius: 10px; background: #000; }
.logo-preview { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 12px; border: 1px dashed var(--line-input); border-radius: 10px; background: var(--row-alt); }
.logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
.login-card {
    display: grid; gap: 14px; max-width: 460px; margin: 40px auto; padding: 24px;
    background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow-raised);
}
.login-card form { display: grid; gap: 14px; }
.login-card button { justify-self: start; }
.d360-error-panel { max-width: 640px; margin: 48px auto; padding: 28px; }
.d360-error-panel h1 { margin: 0 0 8px; color: var(--navy); font-size: 24px; }
.d360-error-panel p { margin: 0 0 18px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.sg-delete-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 10px 0; }
.sg-delete-plan div { padding: 12px; background: var(--soft-blue); border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; color: var(--ink); }
.sg-delete-note { padding: 10px 13px; font-size: 12.5px; line-height: 1.5; background: var(--soft-gold); border-left: 4px solid var(--gold); border-radius: 10px; }
.sg-import-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; font-size: 13px; line-height: 1.6; }
.sg-import-help strong { color: var(--navy); }

/* Introducción: primeros pasos y tutoriales. */
.start-steps { margin-bottom: var(--gap); }
.start-steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.start-steps-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.start-steps-list li.is-done { background: var(--soft-blue); }
.start-steps-list li > div { flex: 1; min-width: 0; }
.start-steps-list strong { display: block; color: var(--ink); font-size: 13px; }
.start-steps-list p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.start-steps-list li.is-done strong { color: var(--muted); }
.start-step-number { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--white); background: var(--navy); }
.start-steps-list li.is-done .start-step-number { background: var(--green); }
.start-steps-list .btn-soft { white-space: nowrap; }
@media (max-width: 640px) { .start-steps-list li { flex-wrap: wrap; } }
.tutorial-intro { margin-bottom: var(--gap); }
.tutorial-intro .card-head { align-items: flex-end; }
.tutorial-intro .card-head p { max-width: 760px; }
.tutorial-search { flex: 0 1 290px; min-width: 220px; }
.tutorial-quick-links, .tutorial-guide-links { display: flex; flex-wrap: wrap; gap: 8px; }
/* Guías escritas con captura (3.1.0): índice por módulo y, en cada guía, pasos a la izquierda y captura a la derecha. */
.tutorial-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 22px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tutorial-index > div { display: grid; gap: 5px; align-content: start; }
.tutorial-index strong { color: var(--navy); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.tutorial-index a { color: var(--link); font-size: 13px; font-weight: 600; text-decoration: none; }
.tutorial-index a:hover { text-decoration: underline; }
.tutorial-guides > .tutorial-guide-card + .tutorial-guide-card { margin-top: var(--gap); }
.tutorial-guide-card { scroll-margin-top: 90px; }
.tutorial-guide-card.has-figure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 24px; align-items: start; }
.tutorial-guide-body { min-width: 0; }
.tutorial-guide-body h3 { margin-top: 0; }
.tutorial-guide-card ol { font-size: 13px; }
.tutorial-figure { margin: 0; min-width: 0; }
.tutorial-figure a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-card); }
.tutorial-figure img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; object-position: top; }
.tutorial-figure figcaption { margin-top: 6px; color: var(--muted); font-size: 11px; }
@media (max-width: 1000px) { .tutorial-guide-card.has-figure { grid-template-columns: 1fr; } }
.tutorial-steps ol, .tutorial-guide-card ol { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 20px; color: var(--ink); font-size: 12px; line-height: 1.5; }
.tutorial-steps li::marker, .tutorial-guide-card li::marker { color: var(--navy); font-weight: 700; }
.tutorial-guides { margin-top: 22px; }
.section-heading { align-items: flex-end; margin-bottom: 12px; }
.tutorial-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.tutorial-guide-card { margin-bottom: 0; }
.tutorial-guide-card h3 { margin: 10px 0 5px; font-size: 17px; }
.tutorial-guide-card > p { min-height: 38px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tutorial-guide-links { margin-top: 16px; }

/* ---------- Pantallas chicas ---------- */
@media (max-width: 1100px) {
    .topbar-inner { flex-wrap: wrap; }
    .gs-primary-nav { justify-content: flex-start; order: 3; flex-basis: 100%; }
    .tenant-brand-hero { flex-basis: 260px; width: 260px; }
    .v9-company-logo { width: 250px; height: 76px; }
    .finance-form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .container { width: calc(100% - 24px); padding-top: 16px; }
    .topbar { position: relative; }
    .topbar-inner { padding: 10px 14px; min-height: 0; }
    .brand-logo { height: 40px; }
    .gs-primary-nav { gap: 6px; }
    .gs-primary-nav a { padding: 8px 10px; font-size: 12px; }
    .gs-module-nav, .finance-subnav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .gs-module-nav a, .finance-subnav a { flex: 0 0 auto; }
    .page-hero { min-height: 0; flex-wrap: wrap; padding: 14px 15px; }
    .tenant-brand-hero { flex-basis: 100%; width: 100%; justify-content: flex-start; margin-left: 0; }
    .v9-company-logo { width: 240px; height: 72px; max-width: 100%; }
    .grid-2, .grid-3, .cols-2-grid, .tutorial-guide-grid { grid-template-columns: 1fr; }
    .card, .panel, .v10-card { padding: 14px; }
    .card-head, .section-head, .v10-section-heading, .v10-card-heading, .finance-panel-head, .section-heading { flex-direction: column; align-items: stretch; gap: 10px; }
    .toolbar .field, .filters > label, .op-toolbar label { flex: 1 1 140px; min-width: 0; }
    .toolbar .actions { margin-left: 0; width: 100%; }
    .form-grid, .finance-form-grid, .finance-form-grid.cols-2, .finance-form-grid.cols-3, .finance-form-grid.cols-4, .op-form { grid-template-columns: 1fr; }
    .chart-box { height: 300px; }
    .chart-box.sm { height: 240px; }
    .chart-box.cf-chart { height: 380px; }
    .cf-swipe { display: block; }
    .kpis, .kpi-grid, .d360-kpi-row, .op-kpis, .imports-stats, .finance-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .kpi, .d360-kpi, .op-kpis > *, .imports-stats > *, .finance-kpi-card { padding: 12px; }
    .kpi > strong, .d360-kpi > strong, .op-kpis > * > strong, .imports-stats > * > strong, .finance-kpi-card > strong { font-size: clamp(13px, 3.7vw, 16px); }
    .hbars li { grid-template-columns: minmax(0, 1fr) max-content; }
    .hbars .hbar-track { grid-column: 1 / -1; grid-row: 2; }
    .tutorial-search { flex-basis: 100%; min-width: 0; }
    .tutorial-guide-card > p { min-height: 0; }
}
@media (max-width: 359px) {
    .kpis, .kpi-grid, .d360-kpi-row, .op-kpis, .imports-stats, .finance-kpi-grid { grid-template-columns: 1fr; }
}
@media print {
    .topbar, .gs-module-nav, .finance-subnav, .toolbar .actions, .container > .filters, button { display: none; }
    body { background: #fff; }
    body::before { display: none; }
    .card, .panel, .v10-card, .kpi { box-shadow: none; break-inside: avoid; }
    .table-wrap, .v10-table-wrap, .pp-table-wrap { overflow: visible; }
}
