/* =====================================================================
   ERPUIX v2 — Sistema de diseño (propuesta desde cero)
   ---------------------------------------------------------------------
   Independiente del tema actual (Limitless / assets/erpuix). Un archivo
   con: tokens (claro y oscuro), base, layout de aplicación y componentes.
   Prefijo de clases: v2-   ·   Variables: --v2-*
   La marca de cada compañía se cambia con --v2-primary-* (ver README).
   ===================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF;
}

/* ─────────────────────────────────────────────────────────────────────
   1. TOKENS
   ───────────────────────────────────────────────────────────────────── */
:root {
    color-scheme: light;

    /* Marca del producto (azul índigo). Cada compañía puede redefinirla. */
    --v2-primary-50: #eef2ff;
    --v2-primary-100: #e0e7ff;
    --v2-primary-200: #c7d2fe;
    --v2-primary-500: #4f6bf5;
    --v2-primary-600: #3b55e6;
    --v2-primary-700: #2f44c4;
    --v2-primary-text: #3047cf;

    /* Neutros fríos */
    --v2-n-0: #ffffff;
    --v2-n-25: #fcfcfd;
    --v2-n-50: #f7f8fa;
    --v2-n-100: #f0f2f5;
    --v2-n-200: #e4e7ec;
    --v2-n-300: #d0d5dd;
    --v2-n-400: #98a2b3;
    --v2-n-500: #667085;
    --v2-n-600: #475467;
    --v2-n-700: #344054;
    --v2-n-800: #1d2939;
    --v2-n-900: #101828;

    /* Superficies y texto */
    --v2-bg: #f5f6f8;
    --v2-surface: #ffffff;
    --v2-surface-2: #f9fafb;
    --v2-surface-hover: #f5f6f8;
    --v2-fill: #f0f2f5;
    --v2-border: #e6e8ec;
    --v2-border-strong: #d0d5dd;
    --v2-text: #101828;
    --v2-text-2: #344054;
    --v2-muted: #667085;
    --v2-faint: #98a2b3;

    /* Estados (siempre con ícono o texto, nunca solo color) */
    --v2-success: #067647;
    --v2-success-bg: #ecfdf3;
    --v2-success-border: #abefc6;
    --v2-warning: #b54708;
    --v2-warning-bg: #fffaeb;
    --v2-warning-border: #fedf89;
    --v2-danger: #b42318;
    --v2-danger-bg: #fef3f2;
    --v2-danger-border: #fecdca;
    --v2-info: #175cd3;
    --v2-info-bg: #eff8ff;
    --v2-info-border: #b2ddff;

    /* Gráficas (paleta validada para daltonismo) */
    --v2-series-1: #2a78d6;
    --v2-series-2: #eb6834;
    --v2-series-3: #1baf7a;
    --v2-chart-grid: #eceef2;

    /* Medidas */
    --v2-sidebar-w: 264px;
    --v2-sidebar-w-min: 72px;
    --v2-topbar-h: 60px;
    --v2-control-h: 38px;
    --v2-control-h-sm: 32px;
    --v2-r-xs: 4px;
    --v2-r-sm: 6px;
    --v2-r: 8px;
    --v2-r-lg: 12px;
    --v2-r-xl: 16px;
    --v2-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --v2-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

    --v2-shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --v2-shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --v2-shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .05);
    --v2-shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
    --v2-ring: 0 0 0 4px rgba(79, 107, 245, .18);
    --v2-ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --v2-primary-50: #1a2140;
        --v2-primary-100: #212a52;
        --v2-primary-200: #2e3a6e;
        --v2-primary-500: #6d86ff;
        --v2-primary-600: #5570f7;
        --v2-primary-700: #7d93ff;
        --v2-primary-text: #9aaeff;
        --v2-bg: #0c0f15;
        --v2-surface: #131720;
        --v2-surface-2: #171c26;
        --v2-surface-hover: #1b212c;
        --v2-fill: #212734;
        --v2-border: #242a36;
        --v2-border-strong: #323948;
        --v2-text: #eceff4;
        --v2-text-2: #c3c9d4;
        --v2-muted: #8d96a7;
        --v2-faint: #626b7c;
        --v2-success: #47cd89;
        --v2-success-bg: #0f2a1f;
        --v2-success-border: #1d5b3f;
        --v2-warning: #fdb022;
        --v2-warning-bg: #2d220c;
        --v2-warning-border: #5f4513;
        --v2-danger: #f97066;
        --v2-danger-bg: #2f1513;
        --v2-danger-border: #6a2620;
        --v2-info: #53b1fd;
        --v2-info-bg: #0f2236;
        --v2-info-border: #1f4a73;
        --v2-series-1: #3987e5;
        --v2-series-2: #d95926;
        --v2-series-3: #199e70;
        --v2-chart-grid: #232935;
        --v2-shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .5);
        --v2-shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
        --v2-ring: 0 0 0 4px rgba(109, 134, 255, .25);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --v2-primary-50: #1a2140;
    --v2-primary-100: #212a52;
    --v2-primary-200: #2e3a6e;
    --v2-primary-500: #6d86ff;
    --v2-primary-600: #5570f7;
    --v2-primary-700: #7d93ff;
    --v2-primary-text: #9aaeff;
    --v2-bg: #0c0f15;
    --v2-surface: #131720;
    --v2-surface-2: #171c26;
    --v2-surface-hover: #1b212c;
    --v2-fill: #212734;
    --v2-border: #242a36;
    --v2-border-strong: #323948;
    --v2-text: #eceff4;
    --v2-text-2: #c3c9d4;
    --v2-muted: #8d96a7;
    --v2-faint: #626b7c;
    --v2-success: #47cd89;
    --v2-success-bg: #0f2a1f;
    --v2-success-border: #1d5b3f;
    --v2-warning: #fdb022;
    --v2-warning-bg: #2d220c;
    --v2-warning-border: #5f4513;
    --v2-danger: #f97066;
    --v2-danger-bg: #2f1513;
    --v2-danger-border: #6a2620;
    --v2-info: #53b1fd;
    --v2-info-bg: #0f2236;
    --v2-info-border: #1f4a73;
    --v2-series-1: #3987e5;
    --v2-series-2: #d95926;
    --v2-series-3: #199e70;
    --v2-chart-grid: #232935;
    --v2-shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .5);
    --v2-shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    --v2-ring: 0 0 0 4px rgba(109, 134, 255, .25);
}

/* ─────────────────────────────────────────────────────────────────────
   2. BASE
   ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body.v2 {
    margin: 0;
    background: var(--v2-bg);
    color: var(--v2-text);
    font: 400 14px/1.5 var(--v2-font);
    font-feature-settings: "cv11", "ss01", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.v2 h1, .v2 h2, .v2 h3, .v2 h4 {
    margin: 0;
    color: var(--v2-text);
    font-weight: 600;
    letter-spacing: -.015em;
}

.v2 p {
    margin: 0;
}

/* :where() deja la especificidad en 0 para que .v2-btn, .v2-menu-item,
   etc. definan su propio color sin pelear con el de los enlaces. */
:where(.v2) a {
    color: var(--v2-primary-text);
    text-decoration: none;
}

    :where(.v2) a:hover {
        text-decoration: underline;
    }

.v2 :focus-visible {
    outline: 2px solid var(--v2-primary-500);
    outline-offset: 2px;
}

.v2 ::selection {
    background: var(--v2-primary-100);
}

.v2 * {
    scrollbar-width: thin;
    scrollbar-color: var(--v2-border-strong) transparent;
}

.v2-ico {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.v2-ico-sm {
    width: 16px;
    height: 16px;
}

.v2-ico-xs {
    width: 14px;
    height: 14px;
}

.v2-num {
    font-variant-numeric: tabular-nums;
}

.v2-mono {
    font-family: var(--v2-mono);
    font-size: .92em;
}

.v2-muted {
    color: var(--v2-muted);
}

.v2-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────
   3. LAYOUT DE APLICACIÓN
   ───────────────────────────────────────────────────────────────────── */
.v2-app {
    display: grid;
    grid-template-columns: var(--v2-sidebar-w) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    transition: grid-template-columns .22s var(--v2-ease);
}

.v2-app.is-collapsed {
    grid-template-columns: var(--v2-sidebar-w-min) minmax(0, 1fr);
}

/* ── Menú lateral ── */
.v2-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--v2-surface);
    border-right: 1px solid var(--v2-border);
    overflow: hidden;
}

.v2-ws {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--v2-topbar-h);
    margin: 0;
    padding: 0 14px;
    border-bottom: 1px solid var(--v2-border);
    flex-shrink: 0;
}

.v2-ws-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    margin: 0 -8px;
    background: none;
    border: 0;
    border-radius: var(--v2-r);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

    .v2-ws-btn:hover {
        background: var(--v2-surface-hover);
    }

.v2-ws-logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r);
}

    .v2-ws-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.v2-ws-text {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

    .v2-ws-text b {
        display: block;
        overflow: hidden;
        font-size: 13.5px;
        font-weight: 600;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .v2-ws-text small {
        display: block;
        overflow: hidden;
        color: var(--v2-muted);
        font-size: 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.v2-ws-btn > .v2-ico {
    color: var(--v2-faint);
}

.v2-side-search {
    padding: 12px 12px 4px;
}

.v2-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    background: var(--v2-surface-2);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r);
    color: var(--v2-muted);
    font: 400 13px var(--v2-font);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

    .v2-search-btn:hover {
        border-color: var(--v2-border-strong);
        background: var(--v2-surface);
    }

    .v2-search-btn > span:not(.v2-kbd) {
        flex: 1;
        overflow: hidden;
        text-align: left;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.v2-kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-bottom-width: 2px;
    border-radius: 5px;
    color: var(--v2-muted);
    font: 500 11px var(--v2-font);
}

.v2-nav {
    flex: 1;
    min-height: 0;
    padding: 6px 12px 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.v2-nav-group {
    margin-top: 14px;
}

.v2-nav-label {
    padding: 0 10px 6px;
    color: var(--v2-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.v2-nav-item,
.v2-nav-sub a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    background: none;
    border: 0;
    border-radius: var(--v2-r);
    color: var(--v2-text-2) !important;
    font: 500 13.5px var(--v2-font);
    text-align: left;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, color .12s;
}

    .v2-nav-item:hover,
    .v2-nav-sub a:hover {
        background: var(--v2-surface-hover);
        color: var(--v2-text) !important;
    }

    .v2-nav-item > .v2-ico {
        color: var(--v2-muted);
    }

    .v2-nav-item .v2-nav-text {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .v2-nav-item .v2-chev {
        width: 16px;
        height: 16px;
        color: var(--v2-faint);
        transition: transform .2s var(--v2-ease);
    }

.v2-nav-mod.is-open > .v2-nav-item .v2-chev {
    transform: rotate(90deg);
}

.v2-nav-item.is-active {
    background: var(--v2-primary-50);
    color: var(--v2-primary-text) !important;
    font-weight: 600;
}

    .v2-nav-item.is-active > .v2-ico {
        color: var(--v2-primary-text);
    }

.v2-nav-count {
    min-width: 20px;
    padding: 0 6px;
    background: var(--v2-fill);
    border-radius: 999px;
    color: var(--v2-text-2);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.v2-nav-sub {
    display: none;
    position: relative;
    margin: 2px 0 6px;
    padding: 0 0 0 20px;
    list-style: none;
}

    .v2-nav-sub::before {
        content: "";
        position: absolute;
        top: 4px;
        bottom: 4px;
        left: 19px;
        width: 1px;
        background: var(--v2-border);
    }

.v2-nav-mod.is-open > .v2-nav-sub {
    display: block;
}

.v2-nav-sub a {
    min-height: 32px;
    padding-left: 18px;
    color: var(--v2-muted) !important;
    font-size: 13px;
    font-weight: 500;
}

    .v2-nav-sub a.is-active {
        color: var(--v2-primary-text) !important;
        font-weight: 600;
    }

        .v2-nav-sub a.is-active::before {
            content: "";
            position: absolute;
            left: 17px;
            width: 3px;
            height: 18px;
            background: var(--v2-primary-600);
            border-radius: 3px;
        }

.v2-side-foot {
    flex-shrink: 0;
    padding: 12px;
    border-top: 1px solid var(--v2-border);
}

.v2-plan {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--v2-surface-2);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r-lg);
    font-size: 12.5px;
}

    .v2-plan b {
        display: block;
        font-weight: 600;
    }

    .v2-plan small {
        color: var(--v2-muted);
    }

.v2-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--v2-success);
    box-shadow: 0 0 0 3px var(--v2-success-bg);
    flex-shrink: 0;
}

/* Menú colapsado: solo íconos */
.v2-app.is-collapsed .v2-ws-text,
.v2-app.is-collapsed .v2-ws-btn > .v2-ico,
.v2-app.is-collapsed .v2-search-btn span,
.v2-app.is-collapsed .v2-search-btn .v2-kbd,
.v2-app.is-collapsed .v2-nav-label,
.v2-app.is-collapsed .v2-nav-text,
.v2-app.is-collapsed .v2-nav-count,
.v2-app.is-collapsed .v2-chev,
.v2-app.is-collapsed .v2-nav-sub,
.v2-app.is-collapsed .v2-plan div {
    display: none !important;
}

.v2-app.is-collapsed .v2-nav-item,
.v2-app.is-collapsed .v2-search-btn {
    justify-content: center;
    padding: 0;
}

.v2-app.is-collapsed .v2-nav-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--v2-border);
}

    .v2-app.is-collapsed .v2-nav-group:first-child {
        border-top: 0;
    }

.v2-app.is-collapsed .v2-plan {
    justify-content: center;
    padding: 10px 0;
}

/* ── Zona principal ── */
.v2-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.v2-topbar {
    /* sobre el contenido, para que sus menús desplegables no queden detrás */
    position: relative;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    height: var(--v2-topbar-h);
    padding: 0 20px 0 12px;
    background: color-mix(in srgb, var(--v2-surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--v2-border);
}

.v2-crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: var(--v2-muted);
    font-size: 13px;
    list-style: none;
}

    .v2-crumbs li {
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

        .v2-crumbs li + li::before {
            content: "/";
            color: var(--v2-border-strong);
        }

        .v2-crumbs li:last-child {
            overflow: hidden;
            color: var(--v2-text);
            font-weight: 500;
            text-overflow: ellipsis;
        }

.v2-topbar-spacer {
    flex: 1;
}

.v2-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.v2-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.v2-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 28px 48px;
}

.v2-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

    .v2-page-head h1 {
        font-size: 24px;
        font-weight: 600;
        letter-spacing: -.02em;
        line-height: 1.25;
    }

    .v2-page-head p {
        margin-top: 4px;
        color: var(--v2-muted);
        font-size: 14px;
    }

.v2-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-grid {
    display: grid;
    gap: 16px;
}

.v2-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.v2-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.v2-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-grid-main {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.v2-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.v2-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─────────────────────────────────────────────────────────────────────
   4. COMPONENTES
   ───────────────────────────────────────────────────────────────────── */

/* ── Botones ── */
.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: var(--v2-control-h);
    padding: 0 14px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border-strong);
    border-radius: var(--v2-r);
    box-shadow: var(--v2-shadow-xs);
    color: var(--v2-text-2);
    font: 600 13.5px var(--v2-font);
    white-space: nowrap;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}

    .v2-btn:hover {
        background: var(--v2-surface-hover);
        color: var(--v2-text);
    }

    .v2-btn:active {
        transform: translateY(1px);
    }

    .v2-btn:focus-visible {
        outline: 0;
        box-shadow: var(--v2-ring);
    }

    .v2-btn[disabled] {
        opacity: .5;
        pointer-events: none;
    }

.v2-btn-primary {
    background: var(--v2-primary-600);
    border-color: var(--v2-primary-600);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
    color: var(--v2-on-primary, #fff);
}

    .v2-btn-primary:hover {
        background: var(--v2-primary-700);
        border-color: var(--v2-primary-700);
        color: var(--v2-on-primary, #fff);
    }

:root[data-theme="dark"] .v2-btn-primary:hover {
    background: var(--v2-primary-500);
}

.v2-btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--v2-text-2);
}

    .v2-btn-ghost:hover {
        background: var(--v2-surface-hover);
    }

.v2-btn-danger {
    color: var(--v2-danger);
    border-color: var(--v2-danger-border);
}

    .v2-btn-danger:hover {
        background: var(--v2-danger-bg);
        color: var(--v2-danger);
    }

.v2-btn-sm {
    height: var(--v2-control-h-sm);
    padding: 0 10px;
    font-size: 13px;
}

.v2-btn-icon {
    width: var(--v2-control-h);
    padding: 0;
}

    .v2-btn-icon.v2-btn-sm {
        width: var(--v2-control-h-sm);
    }

.v2-icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--v2-r);
    color: var(--v2-muted);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

    .v2-icon-btn:hover {
        background: var(--v2-surface-hover);
        color: var(--v2-text);
    }

.v2-dot-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--v2-danger);
    box-shadow: 0 0 0 2px var(--v2-surface);
}

.v2-btn-group {
    display: inline-flex;
}

    .v2-btn-group .v2-btn {
        border-radius: 0;
        margin-left: -1px;
    }

        .v2-btn-group .v2-btn:first-child {
            border-radius: var(--v2-r) 0 0 var(--v2-r);
            margin-left: 0;
        }

        .v2-btn-group .v2-btn:last-child {
            border-radius: 0 var(--v2-r) var(--v2-r) 0;
        }

/* ── Tarjetas ── */
.v2-card {
    min-width: 0;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r-lg);
    box-shadow: var(--v2-shadow-xs);
}

.v2-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--v2-border);
}

    .v2-card-head h2, .v2-card-head h3 {
        font-size: 15px;
        font-weight: 600;
    }

    .v2-card-head p {
        margin-top: 2px;
        color: var(--v2-muted);
        font-size: 13px;
    }

.v2-card-body {
    padding: 20px;
}

.v2-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--v2-surface-2);
    border-top: 1px solid var(--v2-border);
    border-radius: 0 0 var(--v2-r-lg) var(--v2-r-lg);
}

.v2-card-flush {
    padding: 0;
}

/* ── Indicadores (stat tile) ── */
.v2-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
}

.v2-stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--v2-muted);
    font-size: 13px;
    font-weight: 500;
}

.v2-stat-value {
    color: var(--v2-text);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.v2-stat-value small {
    margin-right: 3px;
    color: var(--v2-muted);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
}

.v2-stat-value {
    white-space: nowrap;
}

.v2-stat-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.v2-stat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--v2-muted);
    font-size: 12.5px;
}

.v2-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px 1px 5px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

    .v2-delta.is-good {
        background: var(--v2-success-bg);
        color: var(--v2-success);
    }

    .v2-delta.is-bad {
        background: var(--v2-danger-bg);
        color: var(--v2-danger);
    }

.v2-spark {
    width: 96px;
    height: 28px;
    overflow: visible;
}

    .v2-spark path {
        fill: none;
        stroke: var(--v2-faint);
        stroke-width: 2;
        stroke-linejoin: round;
        stroke-linecap: round;
    }

    .v2-spark .is-now {
        stroke: var(--v2-series-1);
    }

    .v2-spark circle {
        fill: var(--v2-series-1);
        stroke: var(--v2-surface);
        stroke-width: 2;
    }

/* ── Insignias de estado ── */
.v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    background: var(--v2-fill);
    border: 1px solid var(--v2-border);
    border-radius: 999px;
    color: var(--v2-text-2);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

    .v2-badge::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .v2-badge.no-dot::before {
        display: none;
    }

.v2-badge-success {
    background: var(--v2-success-bg);
    border-color: var(--v2-success-border);
    color: var(--v2-success);
}

.v2-badge-warning {
    background: var(--v2-warning-bg);
    border-color: var(--v2-warning-border);
    color: var(--v2-warning);
}

.v2-badge-danger {
    background: var(--v2-danger-bg);
    border-color: var(--v2-danger-border);
    color: var(--v2-danger);
}

.v2-badge-info {
    background: var(--v2-info-bg);
    border-color: var(--v2-info-border);
    color: var(--v2-info);
}

.v2-badge-primary {
    background: var(--v2-primary-50);
    border-color: var(--v2-primary-200);
    color: var(--v2-primary-text);
}

/* ── Formularios ── */
.v2-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.v2-label {
    color: var(--v2-text-2);
    font-size: 13px;
    font-weight: 500;
}

    .v2-label .v2-req {
        color: var(--v2-danger);
    }

.v2-hint {
    color: var(--v2-muted);
    font-size: 12.5px;
}

.v2-error {
    color: var(--v2-danger);
    font-size: 12.5px;
}

.v2-input,
.v2-select,
.v2-textarea {
    width: 100%;
    height: var(--v2-control-h);
    padding: 0 12px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border-strong);
    border-radius: var(--v2-r);
    box-shadow: var(--v2-shadow-xs);
    color: var(--v2-text);
    font: 400 14px var(--v2-font);
    transition: border-color .15s, box-shadow .15s;
}

.v2-textarea {
    height: auto;
    min-height: 88px;
    padding: 10px 12px;
    line-height: 1.5;
    resize: vertical;
}

.v2-select {
    padding-right: 34px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
}

    .v2-input::placeholder,
    .v2-textarea::placeholder {
        color: var(--v2-faint);
    }

    .v2-input:hover,
    .v2-select:hover,
    .v2-textarea:hover {
        border-color: var(--v2-n-400);
    }

    .v2-input:focus,
    .v2-select:focus,
    .v2-textarea:focus {
        border-color: var(--v2-primary-500);
        box-shadow: var(--v2-ring);
        outline: 0;
    }

    .v2-input[readonly],
    .v2-input:disabled {
        background: var(--v2-surface-2);
        color: var(--v2-muted);
    }

.v2-field.has-error .v2-input {
    border-color: var(--v2-danger);
}

.v2-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

    .v2-input-group > .v2-ico {
        position: absolute;
        left: 12px;
        color: var(--v2-faint);
        pointer-events: none;
    }

    .v2-input-group > .v2-input {
        padding-left: 38px;
    }

    .v2-input-group > .v2-addon {
        position: absolute;
        right: 10px;
        color: var(--v2-muted);
        font-size: 13px;
    }

.v2-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px 16px;
}

    .v2-form-grid > .c3 { grid-column: span 3; }
    .v2-form-grid > .c4 { grid-column: span 4; }
    .v2-form-grid > .c6 { grid-column: span 6; }
    .v2-form-grid > .c8 { grid-column: span 8; }
    .v2-form-grid > .c12 { grid-column: 1 / -1; }

/* Sección de formulario: título a la izquierda, campos a la derecha */
.v2-section {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
    padding: 24px 0;
    border-top: 1px solid var(--v2-border);
}

    .v2-section:first-child {
        border-top: 0;
        padding-top: 4px;
    }

    .v2-section h3 {
        font-size: 14.5px;
    }

    .v2-section > div:first-child p {
        margin-top: 4px;
        color: var(--v2-muted);
        font-size: 13px;
    }

.v2-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--v2-text-2);
    font-size: 13.5px;
    cursor: pointer;
}

    .v2-check input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--v2-primary-600);
    }

.v2-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--v2-text-2);
    cursor: pointer;
}

    .v2-switch input {
        position: absolute;
        opacity: 0;
    }

    .v2-switch i {
        position: relative;
        width: 36px;
        height: 20px;
        border-radius: 999px;
        background: var(--v2-border-strong);
        transition: background-color .2s;
    }

        .v2-switch i::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #fff;
            box-shadow: var(--v2-shadow-sm);
            transition: transform .2s var(--v2-ease);
        }

    .v2-switch input:checked + i {
        background: var(--v2-primary-600);
    }

        .v2-switch input:checked + i::after {
            transform: translateX(16px);
        }

    .v2-switch input:focus-visible + i {
        box-shadow: var(--v2-ring);
    }

/* Barra de acciones fija al pie del formulario */
.v2-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 20px;
    background: color-mix(in srgb, var(--v2-surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r-lg);
    box-shadow: var(--v2-shadow-md);
}

/* ── Pestañas y control segmentado ── */
.v2-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--v2-border);
    overflow-x: auto;
}

.v2-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    background: none;
    border: 0;
    color: var(--v2-muted);
    font: 500 13.5px var(--v2-font);
    white-space: nowrap;
    cursor: pointer;
}

    .v2-tab:hover {
        color: var(--v2-text);
    }

    .v2-tab.is-active {
        color: var(--v2-text);
        font-weight: 600;
    }

        .v2-tab.is-active::after {
            content: "";
            position: absolute;
            right: 8px;
            bottom: -1px;
            left: 8px;
            height: 2px;
            border-radius: 2px;
            background: var(--v2-primary-600);
        }

    .v2-tab .v2-nav-count {
        font-size: 11px;
        line-height: 18px;
    }

.v2-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--v2-fill);
    border-radius: var(--v2-r);
}

:root[data-theme="dark"] .v2-seg {
    background: var(--v2-surface-2);
}

.v2-seg button {
    height: 28px;
    padding: 0 12px;
    background: none;
    border: 0;
    border-radius: var(--v2-r-sm);
    color: var(--v2-muted);
    font: 500 13px var(--v2-font);
    cursor: pointer;
}

    .v2-seg button.is-active {
        background: var(--v2-surface);
        box-shadow: var(--v2-shadow-sm);
        color: var(--v2-text);
        font-weight: 600;
    }

/* ── Barra de filtros ── */
.v2-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--v2-border);
}

    .v2-toolbar .v2-input-group {
        flex: 1 1 260px;
        max-width: 360px;
    }

.v2-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    background: var(--v2-surface);
    border: 1px dashed var(--v2-border-strong);
    border-radius: var(--v2-r);
    color: var(--v2-text-2);
    font: 500 13px var(--v2-font);
    cursor: pointer;
}

    .v2-chip:hover {
        background: var(--v2-surface-hover);
    }

    .v2-chip.is-set {
        border-style: solid;
        border-color: var(--v2-primary-200);
        background: var(--v2-primary-50);
        color: var(--v2-primary-text);
    }

        .v2-chip.is-set b {
            font-weight: 600;
        }

/* Barra de acciones masivas (al seleccionar filas) */
.v2-bulk {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--v2-primary-50);
    border-bottom: 1px solid var(--v2-primary-200);
    color: var(--v2-primary-text);
    font-size: 13px;
    font-weight: 600;
}

    .v2-bulk.is-visible {
        display: flex;
    }

/* ── Tabla de datos ── */
.v2-table-wrap {
    overflow-x: auto;
}

.v2-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

    .v2-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        height: 40px;
        padding: 0 16px;
        background: var(--v2-surface-2);
        border-bottom: 1px solid var(--v2-border);
        color: var(--v2-muted);
        font-size: 12px;
        font-weight: 500;
        text-align: left;
        white-space: nowrap;
    }

        .v2-table th.is-sortable {
            cursor: pointer;
        }

            .v2-table th.is-sortable:hover {
                color: var(--v2-text);
            }

        .v2-table th .v2-ico {
            width: 14px;
            height: 14px;
            vertical-align: -2px;
            margin-left: 2px;
        }

    .v2-table td {
        white-space: nowrap;
        height: 52px;
        padding: 8px 16px;
        border-bottom: 1px solid var(--v2-border);
        color: var(--v2-text-2);
        vertical-align: middle;
    }

    .v2-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .v2-table tbody tr {
        transition: background-color .1s;
    }

        .v2-table tbody tr:hover td {
            background: var(--v2-surface-hover);
        }

        .v2-table tbody tr.is-selected td {
            background: var(--v2-primary-50);
        }

    .v2-table .is-num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .v2-table .is-check {
        width: 44px;
        padding-right: 0;
    }

    .v2-table .is-actions {
        width: 56px;
        text-align: right;
    }

.v2-table-compact td {
    height: 42px;
}

.v2-cell-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

    .v2-cell-main b {
        display: block;
        max-width: 260px;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--v2-text);
        font-weight: 600;
    }

    .v2-cell-main small {
        display: block;
        color: var(--v2-muted);
        font-size: 12.5px;
    }

.v2-avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--v2-primary-100);
    color: var(--v2-primary-text);
    font-size: 12px;
    font-weight: 600;
}

    .v2-avatar.is-org {
        border-radius: var(--v2-r);
        background: var(--v2-fill);
        color: var(--v2-text-2);
    }

.v2-avatar-lg {
    width: 44px;
    height: 44px;
    font-size: 15px;
}

.v2-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--v2-border);
    color: var(--v2-muted);
    font-size: 13px;
}

/* ── Menú desplegable ── */
.v2-dd {
    position: relative;
    display: inline-flex;
}

.v2-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    display: none;
    min-width: 220px;
    padding: 6px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r-lg);
    box-shadow: var(--v2-shadow-lg);
}

.v2-dd.is-open > .v2-menu {
    display: block;
    animation: v2-pop .14s var(--v2-ease);
}

.v2-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    background: none;
    border: 0;
    border-radius: var(--v2-r-sm);
    color: var(--v2-text-2) !important;
    font: 500 13.5px var(--v2-font);
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}

    .v2-menu-item:hover {
        background: var(--v2-surface-hover);
        color: var(--v2-text) !important;
    }

    .v2-menu-item .v2-ico {
        color: var(--v2-muted);
    }

    .v2-menu-item.is-danger,
    .v2-menu-item.is-danger .v2-ico {
        color: var(--v2-danger) !important;
    }

.v2-menu-sep {
    height: 1px;
    margin: 6px -6px;
    background: var(--v2-border);
}

.v2-menu-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--v2-border);
    margin: -6px -6px 6px;
}

    .v2-menu-head b {
        display: block;
        font-size: 13.5px;
    }

    .v2-menu-head small {
        color: var(--v2-muted);
        font-size: 12.5px;
    }

@keyframes v2-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.98);
    }
}

/* ── Paleta de comandos (Ctrl+K) ── */
.v2-cmdk {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
    background: rgba(16, 24, 40, .4);
    backdrop-filter: blur(2px);
}

    .v2-cmdk.is-open {
        display: flex;
    }

.v2-cmdk-box {
    width: 100%;
    max-width: 620px;
    overflow: hidden;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r-xl);
    box-shadow: var(--v2-shadow-lg);
    animation: v2-pop .16s var(--v2-ease);
}

.v2-cmdk-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--v2-border);
    color: var(--v2-muted);
}

    .v2-cmdk-input input:focus-visible {
        outline: 0;
    }

    .v2-cmdk-input input {
        flex: 1;
        height: 56px;
        background: none;
        border: 0;
        outline: 0;
        color: var(--v2-text);
        font: 400 16px var(--v2-font);
    }

.v2-cmdk-list {
    max-height: 360px;
    padding: 8px;
    overflow-y: auto;
}

.v2-cmdk-group {
    padding: 8px 10px 4px;
    color: var(--v2-faint);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.v2-cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: var(--v2-r);
    color: var(--v2-text-2);
    font-size: 14px;
    cursor: pointer;
}

    .v2-cmdk-item small {
        margin-left: auto;
        color: var(--v2-faint);
        font-size: 12px;
    }

    .v2-cmdk-item.is-active {
        background: var(--v2-primary-50);
        color: var(--v2-primary-text);
    }

.v2-cmdk-foot {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--v2-border);
    color: var(--v2-muted);
    font-size: 12px;
}

/* ── Panel lateral (drawer) y notificaciones ── */
.v2-toast-host {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v2-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 340px;
    padding: 12px 14px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-r-lg);
    box-shadow: var(--v2-shadow-lg);
    font-size: 13.5px;
    animation: v2-pop .18s var(--v2-ease);
}

    .v2-toast b {
        display: block;
        font-weight: 600;
    }

    .v2-toast small {
        color: var(--v2-muted);
    }

    .v2-toast .v2-ico {
        color: var(--v2-success);
        margin-top: 1px;
    }

/* ── Alerta en línea ── */
.v2-alert {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: var(--v2-info-bg);
    border: 1px solid var(--v2-info-border);
    border-radius: var(--v2-r-lg);
    color: var(--v2-text-2);
    font-size: 13.5px;
}

    .v2-alert > .v2-ico {
        color: var(--v2-info);
        margin-top: 1px;
    }

    .v2-alert b {
        color: var(--v2-text);
    }

.v2-alert-warning {
    background: var(--v2-warning-bg);
    border-color: var(--v2-warning-border);
}

    .v2-alert-warning > .v2-ico {
        color: var(--v2-warning);
    }

/* ── Lista de actividad ── */
.v2-feed {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .v2-feed li {
        display: flex;
        gap: 12px;
        padding: 12px 20px;
        border-top: 1px solid var(--v2-border);
    }

        .v2-feed li:first-child {
            border-top: 0;
        }

    .v2-feed .v2-feed-ico {
        display: grid;
        place-items: center;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        border-radius: var(--v2-r);
        background: var(--v2-fill);
        color: var(--v2-text-2);
    }

:root[data-theme="dark"] .v2-feed .v2-feed-ico {
    background: var(--v2-surface-2);
}

.v2-feed p {
    color: var(--v2-text-2);
    font-size: 13.5px;
}

    .v2-feed p b {
        color: var(--v2-text);
        font-weight: 600;
    }

.v2-feed small {
    color: var(--v2-muted);
    font-size: 12.5px;
}

/* ── Línea de tiempo / progreso de envío ── */
.v2-steps {
    display: grid;
    grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
}

.v2-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 36px;
}

    .v2-step::before {
        content: "";
        position: absolute;
        top: 12px;
        right: 0;
        left: 0;
        height: 4px;
        background: var(--v2-n-200);
    }

:root[data-theme="dark"] .v2-step::before {
    background: var(--v2-border-strong);
}

.v2-step:first-child::before {
    border-radius: 4px 0 0 4px;
}

.v2-step:last-child::before {
    border-radius: 0 4px 4px 0;
}

.v2-step.is-done::before {
    background: var(--v2-primary-600);
}

.v2-step.is-current::before {
    background: linear-gradient(90deg, var(--v2-primary-600) 50%, var(--v2-n-200) 50%);
}

:root[data-theme="dark"] .v2-step.is-current::before {
    background: linear-gradient(90deg, var(--v2-primary-600) 50%, var(--v2-border-strong) 50%);
}

.v2-step-dot {
    position: absolute;
    top: 2px;
    left: 0;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--v2-surface);
    box-shadow: inset 0 0 0 2px var(--v2-border-strong);
    color: var(--v2-faint);
}

.v2-step.is-done .v2-step-dot,
.v2-step.is-current .v2-step-dot {
    background: var(--v2-primary-600);
    box-shadow: 0 0 0 4px var(--v2-surface);
    color: #fff;
}

.v2-step.is-current .v2-step-dot {
    box-shadow: 0 0 0 4px var(--v2-surface), 0 0 0 7px var(--v2-primary-200);
}

.v2-step-dot .v2-ico {
    width: 13px;
    height: 13px;
    stroke-width: 2.4;
}

.v2-step b {
    font-size: 13.5px;
    font-weight: 600;
}

.v2-step.is-pending b {
    color: var(--v2-muted);
}

.v2-step small {
    color: var(--v2-muted);
    font-size: 12.5px;
}

.v2-timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.v2-tl-day {
    padding: 14px 0 8px;
    color: var(--v2-muted);
    font-size: 12px;
    font-weight: 600;
}

    .v2-tl-day:first-child {
        padding-top: 0;
    }

.v2-tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 0 14px;
    padding-bottom: 20px;
}

    .v2-tl-item::before {
        content: "";
        position: absolute;
        top: 22px;
        bottom: 2px;
        left: 9px;
        width: 2px;
        border-radius: 2px;
        background: var(--v2-border);
    }

    .v2-tl-item.is-last::before {
        display: none;
    }

.v2-tl-dot {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 2px solid var(--v2-border-strong);
    border-radius: 50%;
    background: var(--v2-surface);
}

.v2-tl-item.is-latest .v2-tl-dot {
    border-color: var(--v2-primary-600);
    background: var(--v2-primary-600);
    box-shadow: inset 0 0 0 3px var(--v2-surface), 0 0 0 4px var(--v2-primary-100);
}

.v2-tl-item.is-warning .v2-tl-dot {
    border-color: var(--v2-warning);
}

.v2-tl-item b {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.v2-tl-item.is-latest b {
    color: var(--v2-primary-text);
}

.v2-tl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin-top: 3px;
    color: var(--v2-muted);
    font-size: 12.5px;
}

.v2-tl-note {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--v2-warning-bg);
    border: 1px solid var(--v2-warning-border);
    border-radius: var(--v2-r);
    color: var(--v2-text-2);
    font-size: 13px;
}

.v2-tl-time {
    color: var(--v2-muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Lista de definición (datos clave) ── */
.v2-dl {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
    gap: 0;
    margin: 0;
}

    .v2-dl > div {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        padding: 12px 0;
        border-top: 1px solid var(--v2-border);
    }

        .v2-dl > div:nth-child(-n + 2) {
            border-top: 0;
            padding-top: 0;
        }

    .v2-dl dt {
        color: var(--v2-muted);
        font-size: 12.5px;
    }

    .v2-dl dd {
        margin: 0;
        overflow-wrap: anywhere;
        color: var(--v2-text);
        font-size: 14px;
        font-weight: 500;
    }

/* ── Gráficas ── */
.v2-chart {
    position: relative;
    width: 100%;
}

    .v2-chart svg {
        display: block;
        width: 100%;
        overflow: visible;
    }

    .v2-chart .grid line {
        stroke: var(--v2-chart-grid);
        stroke-width: 1;
    }

    .v2-chart .axis text {
        fill: var(--v2-muted);
        font: 400 11.5px var(--v2-font);
        font-variant-numeric: tabular-nums;
    }

    .v2-chart .bar {
        fill: var(--v2-series-1);
        transition: opacity .15s;
    }

    .v2-chart .bar-hit {
        fill: transparent;
        cursor: pointer;
    }

    .v2-chart.is-hovering .bar:not(.is-hover) {
        opacity: .45;
    }

    .v2-chart .val {
        fill: var(--v2-text-2);
        font: 600 11.5px var(--v2-font);
        font-variant-numeric: tabular-nums;
    }

.v2-tip {
    position: absolute;
    z-index: 10;
    display: none;
    padding: 8px 10px;
    background: var(--v2-n-900);
    border-radius: var(--v2-r);
    box-shadow: var(--v2-shadow-md);
    color: #fff;
    font-size: 12.5px;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 10px));
    white-space: nowrap;
}

:root[data-theme="dark"] .v2-tip {
    background: #eceff4;
    color: #101828;
}

.v2-tip b {
    display: block;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* Barras horizontales (distribución por estatus) */
.v2-hbars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.v2-hbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    font-size: 13.5px;
}

    .v2-hbar span {
        color: var(--v2-text-2);
    }

    .v2-hbar b {
        color: var(--v2-text);
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .v2-hbar i {
        grid-column: 1 / -1;
        position: relative;
        height: 8px;
        border-radius: 4px;
        background: var(--v2-fill);
    }

:root[data-theme="dark"] .v2-hbar i {
    background: var(--v2-surface-2);
}

.v2-hbar i::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w, 0%);
    border-radius: 4px;
    background: var(--v2-series-1);
}

/* ── Estado vacío ── */
.v2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 16px;
    color: var(--v2-muted);
    text-align: center;
}

    .v2-empty .v2-ico {
        width: 40px;
        height: 40px;
        padding: 10px;
        border-radius: var(--v2-r-lg);
        background: var(--v2-fill);
        color: var(--v2-text-2);
    }

    .v2-empty b {
        color: var(--v2-text);
        font-size: 15px;
    }

/* ── Skeleton de carga ── */
.v2-skel {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--v2-fill) 25%, var(--v2-n-200) 37%, var(--v2-fill) 63%);
    background-size: 400% 100%;
    animation: v2-shimmer 1.4s ease infinite;
}

@keyframes v2-shimmer {
    to {
        background-position: -100% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .v2 *, .v2 *::before, .v2 *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   5. PANTALLA DE INICIO DE SESIÓN
   ───────────────────────────────────────────────────────────────────── */
.v2-auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.v2-auth-form {
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
    background: var(--v2-surface);
}

.v2-auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.v2-auth-card {
    width: 100%;
    max-width: 380px;
    margin: auto;
}

    .v2-auth-card h1 {
        font-size: 28px;
        letter-spacing: -.025em;
    }

    .v2-auth-card > p {
        margin: 8px 0 28px;
        color: var(--v2-muted);
    }

.v2-auth-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    overflow: hidden;
    background: #0e1330;
    color: #fff;
}

    .v2-auth-side::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            radial-gradient(60% 50% at 80% 10%, rgba(79, 107, 245, .55), transparent 70%),
            radial-gradient(50% 45% at 10% 90%, rgba(27, 175, 122, .28), transparent 70%);
    }

    .v2-auth-side > * {
        position: relative;
    }

.v2-auth-quote {
    max-width: 460px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.3;
}

.v2-auth-points {
    display: grid;
    gap: 14px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    color: rgba(255, 255, 255, .8);
    font-size: 14.5px;
}

    .v2-auth-points li {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .v2-auth-points .v2-ico {
        padding: 5px;
        width: 26px;
        height: 26px;
        border-radius: 8px;
        background: rgba(255, 255, 255, .1);
        color: #fff;
    }

.v2-auth-preview {
    padding: 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--v2-r-xl);
    backdrop-filter: blur(6px);
}

/* ─────────────────────────────────────────────────────────────────────
   6. RESPONSIVO
   ───────────────────────────────────────────────────────────────────── */
.v2-only-mobile {
    display: none !important;
}

@media (max-width: 1200px) {
    .v2-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-grid-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .v2-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .v2-app,
    .v2-app.is-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    .v2-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 80;
        width: min(300px, 86vw);
        box-shadow: var(--v2-shadow-lg);
        transform: translateX(-102%);
        transition: transform .22s var(--v2-ease);
    }

    .v2-app.is-mobile-open .v2-sidebar {
        transform: translateX(0);
    }

    .v2-app.is-mobile-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(16, 24, 40, .4);
    }

    .v2-only-mobile {
        display: inline-grid !important;
    }

    .v2-hide-mobile {
        display: none !important;
    }

    .v2-page {
        padding: 16px 16px 40px;
    }

    .v2-grid-3,
    .v2-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .v2-form-grid > [class^="c"] {
        grid-column: 1 / -1;
    }

    .v2-auth {
        grid-template-columns: 1fr;
    }

    .v2-auth-side {
        display: none;
    }

    .v2-auth-form {
        padding: 24px 20px;
    }
}

@media (max-width: 640px) {
    .v2-grid-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .v2-page-head h1 {
        font-size: 20px;
    }

    .v2-steps {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .v2-step {
        padding: 0 0 0 36px;
    }

        .v2-step::before {
            display: none;
        }

    .v2-dl {
        --cols: 1 !important;
    }

        .v2-dl > div:nth-child(2) {
            border-top: 1px solid var(--v2-border);
            padding-top: 12px;
        }

    .v2-tl-item {
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .v2-tl-time {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
}
