/*
 * TVILLAR UI 2026
 * Capa visual final y aislada. Se carga después del tema legado para que todos
 * los módulos compartan el mismo lenguaje sin reescribir sus pantallas.
 */

:root {
    --tv-navy-950: #07182d;
    --tv-navy-900: #0b223d;
    --tv-navy-800: #123657;
    --tv-navy-700: #1c4d70;
    --tv-teal-600: #078b8d;
    --tv-teal-500: #0ba6a6;
    --tv-teal-100: #dff8f5;
    --tv-accent-rgb: 11, 166, 166;
    --tv-accent-on-dark: #82e6dd;
    --tv-coral-600: #de3652;
    --tv-coral-500: #f04b67;
    --tv-coral-100: #fff0f3;
    --tv-gold-500: #f2b84b;
    --tv-ink: #14263d;
    --tv-muted: #66768a;
    --tv-subtle: #8b9aab;
    --tv-line: #dce5ee;
    --tv-line-soft: #edf2f6;
    --tv-canvas: #f3f7fa;
    --tv-surface: #ffffff;
    --tv-radius-sm: 10px;
    --tv-radius-md: 15px;
    --tv-radius-lg: 21px;
    --tv-radius-xl: 28px;
    --tv-shadow-sm: 0 5px 16px rgba(7, 24, 45, .07);
    --tv-shadow-md: 0 14px 36px rgba(7, 24, 45, .10);
    --tv-shadow-lg: 0 24px 60px rgba(7, 24, 45, .16);
    --tv-header-height: 78px;
    --tv-sidebar-width: 268px;
    --tv-ease: cubic-bezier(.22, 1, .36, 1);
}

:root[data-tv-accent="indigo"] {
    --tv-navy-950: #11122d;
    --tv-navy-900: #1b1d49;
    --tv-navy-800: #2d3070;
    --tv-navy-700: #4549a0;
    --tv-teal-600: #4f46d7;
    --tv-teal-500: #6366f1;
    --tv-teal-100: #eeeeff;
    --tv-accent-rgb: 99, 102, 241;
    --tv-accent-on-dark: #b7b9ff;
}
:root[data-tv-accent="amber"] {
    --tv-navy-950: #281907;
    --tv-navy-900: #432a08;
    --tv-navy-800: #6b4309;
    --tv-navy-700: #98620f;
    --tv-teal-600: #dd8500;
    --tv-teal-500: #ffab1a;
    --tv-teal-100: #fff4d9;
    --tv-accent-rgb: 255, 171, 26;
    --tv-accent-on-dark: #ffd27a;
}
:root[data-tv-accent="coral"] {
    --tv-navy-950: #2b0d1b;
    --tv-navy-900: #471329;
    --tv-navy-800: #70203d;
    --tv-navy-700: #a12d54;
    --tv-teal-600: #d92f56;
    --tv-teal-500: #ef3c68;
    --tv-teal-100: #fff0f4;
    --tv-accent-rgb: 239, 60, 104;
    --tv-accent-on-dark: #ff9bb3;
}
:root[data-tv-accent="blue"] {
    --tv-navy-950: #07172b;
    --tv-navy-900: #09294c;
    --tv-navy-800: #0c4778;
    --tv-navy-700: #176ca5;
    --tv-teal-600: #147bc4;
    --tv-teal-500: #2493e6;
    --tv-teal-100: #eaf5ff;
    --tv-accent-rgb: 36, 147, 230;
    --tv-accent-on-dark: #9bd4ff;
}
:root[data-tv-mode="dark"] {
    --tv-ink: #e9f1f7;
    --tv-muted: #a5b5c5;
    --tv-subtle: #8295a8;
    --tv-line: #2b4053;
    --tv-line-soft: #1d3042;
    --tv-canvas: #08131f;
    --tv-surface: #101f2d;
}

* {
    scrollbar-color: #a9bac8 transparent;
    scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #b8c6d2; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #8295a8; border: 1px solid transparent; background-clip: padding-box; }

html.tvillar-shell,
body.tvillar-app {
    min-height: 100%;
    background: var(--tv-canvas) !important;
    color: var(--tv-ink) !important;
    font-family: Inter, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px;
    letter-spacing: -.005em;
}

body.tvillar-app::before {
    content: "";
    position: fixed;
    inset: var(--tv-header-height) 0 0 var(--tv-sidebar-width);
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 92% 5%, rgba(11, 166, 166, .10), transparent 24rem),
        radial-gradient(circle at 7% 94%, rgba(240, 75, 103, .07), transparent 28rem),
        linear-gradient(135deg, rgba(255,255,255,.46), transparent 48%);
    transition: left .32s var(--tv-ease);
}

body.tvillar-app a { color: var(--tv-teal-600); }
body.tvillar-app a:hover,
body.tvillar-app a:focus { color: var(--tv-coral-600); text-decoration: none; }
body.tvillar-app button,
body.tvillar-app a,
body.tvillar-app input,
body.tvillar-app select,
body.tvillar-app textarea { transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s var(--tv-ease); }

/* Compatibility aliases for icons introduced after the bundled Font Awesome 4.0.3. */
.fa-bar-chart::before { content: "\f080"; }
.fa-cab::before { content: "\f0d1"; }
.fa-map-signs::before { content: "\f018"; }
.fa-balance-scale::before { content: "\f0ec"; }
.fa-cubes::before { content: "\f187"; }
.fa-file-archive-o::before { content: "\f016"; }
.fa-file-code-o::before { content: "\f121"; }
.fa-sliders::before { content: "\f0ae"; }
.fa-user-plus::before { content: "\f007"; }
.fa-unchecked::before { content: "\f096"; }
.fa-child::before { content: "\f007"; }
.fa-object-group::before { content: "\f009"; }

/* Unified line icon system (inline SVG, independent from legacy icon fonts). */
.tv-icon {
    width: 1.15em;
    height: 1.15em;
    display: block;
    flex: 0 0 auto;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
i.tv-iconized {
    width: 1.15em;
    height: 1.15em;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1em !important;
    line-height: 1 !important;
    vertical-align: -.15em;
}
i.tv-iconized::before { display: none !important; content: none !important; }
i.tv-iconized > .tv-icon { width: 100%; height: 100%; }

/* Application shell */
body.tvillar-app > .header {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    height: var(--tv-header-height);
    z-index: 1045 !important;
}

body.tvillar-app .navbar.app-header {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    height: var(--tv-header-height) !important;
    min-height: var(--tv-header-height) !important;
    margin: 0 !important;
    padding: 0 24px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background:
        radial-gradient(circle at 76% -140%, rgba(var(--tv-accent-rgb),.30), transparent 28rem),
        linear-gradient(105deg, var(--tv-navy-950) 0%, var(--tv-navy-900) 58%, var(--tv-navy-700) 140%) !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(84,224,211,.22) !important;
    border-radius: 0 !important;
    box-shadow: 0 12px 34px rgba(3, 16, 30, .22) !important;
    backdrop-filter: saturate(145%) blur(18px);
    -webkit-backdrop-filter: saturate(145%) blur(18px);
    transition: padding-left .32s var(--tv-ease);
}
body.tvillar-app .navbar.app-header::before {
    content: "";
    position: absolute;
    top: 13px;
    bottom: 13px;
    left: var(--tv-sidebar-width);
    width: 1px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(139,230,221,.24) 22%, rgba(255,255,255,.12) 78%, transparent);
}
body.tvillar-app .navbar.app-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--tv-teal-500), rgba(var(--tv-accent-rgb),.18) 38%, transparent 72%);
}

body.tvillar-app .wrapper,
body.tvillar-app body .wrapper {
    min-height: 100vh !important;
    margin: 0 !important;
    padding-top: var(--tv-header-height);
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

body.tvillar-app .leftmenu,
body.tvillar-app .leftmenu.app-sidebar {
    display: block !important;
    position: fixed !important;
    top: var(--tv-header-height) !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--tv-sidebar-width) !important;
    min-height: 0 !important;
    z-index: 1035;
    padding: 0 !important;
    background:
        radial-gradient(circle at 15% 4%, rgba(var(--tv-accent-rgb),.24), transparent 16rem),
        radial-gradient(circle at 100% 90%, rgba(240,75,103,.12), transparent 18rem),
        linear-gradient(165deg, var(--tv-navy-950) 0%, var(--tv-navy-900) 58%, var(--tv-navy-800) 100%) !important;
    border-right: 1px solid rgba(255,255,255,.07);
    box-shadow: 14px 0 38px rgba(7,24,45,.12);
    transform: translateX(0);
    transition: transform .32s var(--tv-ease), box-shadow .32s ease;
}

/* Angular inserta el menú dentro de un aside con la misma clase. El contenedor
   interior debe ocupar al padre, no volver a sumar la altura del encabezado. */
body.tvillar-app .wrapper > aside.leftmenu > .leftmenu.app-sidebar {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

body.tvillar-app .leftmenu.app-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .28;
    background-image: radial-gradient(rgba(255,255,255,.16) .65px, transparent .65px);
    background-size: 17px 17px;
}

body.tvillar-app .right-side {
    position: relative;
    z-index: auto;
    min-width: 0;
    min-height: calc(100vh - var(--tv-header-height)) !important;
    margin: 0 0 0 var(--tv-sidebar-width) !important;
    padding: 0 !important;
    background: transparent !important;
    transition: margin-left .32s var(--tv-ease);
}

body.tvillar-app section.content {
    min-height: calc(100vh - var(--tv-header-height) - 52px);
    padding: 26px clamp(18px, 2.4vw, 38px) 44px !important;
    background: transparent !important;
}

body.tvillar-app.tv-sidebar-collapsed .leftmenu { transform: translateX(calc(var(--tv-sidebar-width) * -1)); }
body.tvillar-app.tv-sidebar-collapsed .right-side { margin-left: 0 !important; }
body.tvillar-app.tv-sidebar-collapsed::before { left: 0; }

.tv-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--tv-header-height) 0 0 0;
    z-index: 1030;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: rgba(3, 16, 30, .48);
    backdrop-filter: blur(3px);
}

/* Header */
body.tvillar-app .app-header-left,
body.tvillar-app .app-header-right,
body.tvillar-app .app-brand,
body.tvillar-app .app-user-dropdown { display: flex; align-items: center; }
body.tvillar-app .app-header-left { gap: 14px; min-width: 0; }
body.tvillar-app .app-header-right { gap: 11px; margin-left: 20px; }

@media (min-width: 992px) {
    body.tvillar-app .navbar.app-header {
        padding-left: calc(var(--tv-sidebar-width) + 22px) !important;
    }
    body.tvillar-app .app-brand {
        position: absolute;
        top: 50%;
        left: 18px;
        width: calc(var(--tv-sidebar-width) - 36px);
        transform: translateY(-50%);
    }
    body.tvillar-app .app-brand-title,
    body.tvillar-app .app-brand-subtitle {
        max-width: 164px;
    }
    body.tvillar-app.tv-sidebar-collapsed .navbar.app-header {
        padding-left: 24px !important;
    }
    body.tvillar-app.tv-sidebar-collapsed .navbar.app-header::before,
    body.tvillar-app.tv-sidebar-collapsed .app-brand {
        display: none;
    }
}

body.tvillar-app .app-icon-button {
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: #93eee6;
    background: rgba(255,255,255,.07) !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    border-radius: 13px !important;
    box-shadow: none !important;
}
body.tvillar-app .app-icon-button i { color: #93eee6 !important; font-size: 17px; }
body.tvillar-app .app-icon-button:hover { color: #fff; transform: none; background: rgba(255,255,255,.13) !important; border-color: rgba(147,238,230,.32) !important; box-shadow: none !important; }

body.tvillar-app .app-brand { gap: 11px; min-width: 0; }
body.tvillar-app .app-brand-logo {
    width: 47px !important;
    height: 45px !important;
    padding: 6px;
    object-fit: contain;
    border-radius: 15px !important;
    background: #fff;
    border: 1px solid rgba(255,255,255,.26);
    box-shadow: 0 7px 18px rgba(3,16,30,.20);
}
body.tvillar-app .app-brand-text { min-width: 0; }
body.tvillar-app .app-brand-title {
    max-width: 290px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    letter-spacing: .075em !important;
}
body.tvillar-app .app-brand-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: rgba(218,238,244,.64) !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}
.app-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4fe0b0;
    box-shadow: 0 0 0 4px rgba(79,224,176,.13);
}

.app-page-context {
    min-width: 215px;
    min-height: 44px;
    margin-left: 8px;
    padding: 0 0 0 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 11px;
    border: 0;
    border-left: 1px solid rgba(255,255,255,.16);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.app-page-context-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #82e6dd;
    border: 1px solid rgba(130,230,221,.20);
    border-radius: 10px;
    background: rgba(130,230,221,.08);
}
.app-page-context-icon .tv-icon { width: 17px; height: 17px; }
.app-page-context-copy { min-width: 0; display: flex; flex-direction: column; }
.app-page-eyebrow { color: rgba(200,225,233,.48); font-size: 8.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.app-page-title { max-width: 300px; overflow: hidden; color: #fff; font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }

.app-date-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    color: rgba(235,249,251,.84);
    font-size: 12px;
    font-weight: 700;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.14);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.app-date-chip i { color: #73dfd5; }

body.tvillar-app .app-user-dropdown { gap: 9px; position: relative; padding: 3px 4px 3px 3px; border: 0; border-radius: 13px; background: transparent; box-shadow: none; }
body.tvillar-app .app-user-dropdown:hover { border-color: transparent; background: rgba(255,255,255,.07); box-shadow: none; }
body.tvillar-app .app-user-avatar {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #15a8a7, #17617b) !important;
    border: 2px solid rgba(255,255,255,.72) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(3,16,30,.28) !important;
}
body.tvillar-app .app-user-meta { position: relative; min-width: 110px; padding: 0 21px 0 0 !important; text-align: left; }
body.tvillar-app .app-user-name { max-width: 180px; overflow: hidden; color: #fff !important; font-size: 13px !important; font-weight: 750 !important; text-overflow: ellipsis; white-space: nowrap; }
body.tvillar-app .app-user-role { max-width: 180px; overflow: hidden; color: rgba(211,232,239,.58) !important; font-size: 10px !important; text-overflow: ellipsis; white-space: nowrap; }
.app-user-chevron { position: absolute; top: 9px; right: 2px; color: rgba(220,239,244,.48); }

body.tvillar-app .user-menu-card {
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    width: 276px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(199,211,222,.9) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--tv-shadow-lg) !important;
}
body.tvillar-app .user-card-header { padding: 18px !important; gap: 13px; background: linear-gradient(135deg, #f0fbfa, #f8fbff) !important; border-bottom: 1px solid var(--tv-line-soft) !important; }
body.tvillar-app .user-card-logo { width: 50px; height: 50px; border-radius: 14px; }
body.tvillar-app .user-card-body { padding: 10px !important; gap: 7px; }
body.tvillar-app .user-btn { min-height: 42px; justify-content: flex-start !important; padding: 9px 12px !important; border-radius: 12px !important; font-weight: 700; }
body.tvillar-app .user-btn-secondary { background: #f2f6f8 !important; color: var(--tv-navy-800) !important; }
body.tvillar-app .user-btn-danger { background: var(--tv-coral-100) !important; color: var(--tv-coral-600) !important; }

/* Sidebar */
body.tvillar-app .leftmenu .sidebar {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100% !important;
    padding: 18px 13px 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
body.tvillar-app .app-sidebar-header { flex: 0 0 auto; min-height: 52px; margin: 0 3px 12px; padding: 3px 7px 13px !important; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.10); }
body.tvillar-app .app-sidebar-section-icon { width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; color: #82e6dd; border: 1px solid rgba(130,230,221,.18); border-radius: 12px; background: rgba(130,230,221,.08); }
body.tvillar-app .app-sidebar-section-icon .tv-icon { width: 17px; height: 17px; }
body.tvillar-app .app-sidebar-title { color: #fff !important; font-size: 13.5px !important; font-weight: 800 !important; letter-spacing: .025em; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
body.tvillar-app .app-sidebar-subtitle { margin-top: 3px; color: rgba(235,247,251,.78) !important; font-size: 10.5px !important; font-weight: 600 !important; letter-spacing: .055em; text-transform: uppercase; }

.app-menu-search {
    position: relative;
    flex: 0 0 auto;
    margin: 0 3px 14px;
}
.app-menu-search > i { position: absolute; top: 12px; left: 13px; z-index: 1; color: rgba(232,248,251,.82); font-size: 13px; }
.app-menu-search input {
    width: 100%;
    height: 39px;
    padding: 0 34px 0 35px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    outline: 0;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    background: rgba(255,255,255,.07);
}
.app-menu-search input::placeholder { color: rgba(235,247,251,.72); opacity: 1; }
.app-menu-search input:focus { border-color: rgba(76,213,205,.46); background: rgba(255,255,255,.105); box-shadow: 0 0 0 3px rgba(11,166,166,.10); }
.app-menu-search-clear { position: absolute; top: 5px; right: 5px; width: 29px; height: 29px; padding: 0; color: rgba(223,242,248,.48); border: 0; border-radius: 9px; background: transparent; opacity: 0; pointer-events: none; }
.app-menu-search.has-value .app-menu-search-clear { opacity: 1; pointer-events: auto; }
.app-menu-search-clear:hover { color: #fff; background: rgba(255,255,255,.08); }

body.tvillar-app .sidebar-menu {
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 0 2px 20px !important;
    list-style: none;
}
body.tvillar-app .sidebar-menu > li { margin: 3px 0; }
body.tvillar-app .sidebar-menu > li > a {
    position: relative;
    min-height: 45px;
    display: flex !important;
    align-items: center;
    gap: 11px;
    padding: 10px 12px !important;
    color: rgba(244,250,252,.94) !important;
    font-size: 14.5px !important;
    font-weight: 720 !important;
    line-height: 1.35;
    letter-spacing: .005em;
    text-shadow: 0 1px 1px rgba(0,0,0,.16);
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    background: transparent !important;
}
body.tvillar-app .sidebar-menu > li > a > i:first-child { width: 22px; color: rgba(100,218,210,.86) !important; font-size: 15px; text-align: center; }
body.tvillar-app .sidebar-menu > li > a > .pull-right { position: absolute; top: 16px; right: 13px; width: auto; color: rgba(235,247,251,.72) !important; font-size: 13px; transition: transform .2s ease; }
body.tvillar-app .sidebar-menu > li.active > a > .pull-right { transform: rotate(-90deg); }
body.tvillar-app .sidebar-menu > li > a:hover { color: #fff !important; border-color: rgba(255,255,255,.07) !important; background: rgba(255,255,255,.07) !important; transform: translateX(2px); }
body.tvillar-app .sidebar-menu > li.active > a,
body.tvillar-app .sidebar-menu > li.tv-route-active > a {
    color: #fff !important;
    border-color: rgba(100,218,210,.16) !important;
    background: linear-gradient(100deg, rgba(11,166,166,.25), rgba(255,255,255,.055)) !important;
    box-shadow: inset 3px 0 0 #51d5cd;
}
body.tvillar-app .sidebar-menu > li.active > a::after,
body.tvillar-app .sidebar-menu > li.tv-route-active > a::after { display: none !important; content: none !important; }

body.tvillar-app .sidebar-menu .treeview-menu {
    margin: 4px 0 7px 18px !important;
    padding: 4px 0 4px 14px !important;
    border-left: 1px solid rgba(125,205,205,.17) !important;
    border-radius: 0 !important;
    background: transparent !important;
}
body.tvillar-app .sidebar-menu .treeview-menu > li { margin: 2px 0; }
body.tvillar-app .sidebar-menu .treeview-menu > li > a {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    min-height: 34px;
    padding: 8px 10px !important;
    color: rgba(235,245,249,.86) !important;
    font-size: 13px !important;
    font-weight: 590 !important;
    line-height: 1.42;
    letter-spacing: .003em;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
}
body.tvillar-app .sidebar-menu .treeview-menu > li > a i { margin-top: 5px; color: rgba(117,231,223,.82) !important; font-size: 7px; }
body.tvillar-app .sidebar-menu .treeview-menu > li > a:hover,
body.tvillar-app .sidebar-menu .treeview-menu > li.tv-route-current > a { color: #fff !important; font-weight: 720 !important; background: rgba(255,255,255,.09) !important; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
body.tvillar-app .sidebar-menu > li > a:focus-visible,
body.tvillar-app .sidebar-menu .treeview-menu > li > a:focus-visible { outline: 2px solid rgba(117,231,223,.92); outline-offset: 2px; }
body.tvillar-app .sidebar-menu li.tv-menu-filter-hidden { display: none !important; }

body.tvillar-app .app-sidebar-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 3px !important;
    padding: 13px 10px 3px !important;
    color: rgba(220,238,246,.55) !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
}
.app-sidebar-footer-mark { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 850; border-radius: 9px; background: linear-gradient(135deg, var(--tv-coral-500), #f28f59); box-shadow: 0 6px 16px rgba(240,75,103,.2); }
body.tvillar-app .app-sidebar-footer > span:last-child { min-width: 0; display: flex; flex-direction: column; }
body.tvillar-app .app-sidebar-footer strong { color: rgba(255,255,255,.88); font-size: 10px; letter-spacing: .12em; }
body.tvillar-app .app-sidebar-footer small { max-width: 185px; overflow: hidden; color: rgba(220,238,246,.45); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
body.tvillar-app .slicknav_menu { display: none !important; }

/* Route content and typography */
.tv-route-view { width: 100%; max-width: 100%; min-width: 0; overflow-x: visible; animation: tvRouteIn .38s var(--tv-ease); }
.tv-route-view.tv-route-loading { opacity: .55; transform: translateY(5px); }
.tv-route-view > .row { margin-right: 0 !important; margin-left: 0 !important; }
.tv-route-view > .row > .panel { width: 100%; }
body.tvillar-app .content .row:not(.tv-preserve-row) { margin-right: -8px; margin-left: -8px; }
body.tvillar-app .content [class*="col-"] { min-width: 0; padding-right: 8px; padding-left: 8px; }
body.tvillar-app .home-dash-shell,
body.tvillar-app .home-dash-hero-grid,
body.tvillar-app .home-dash-grid,
body.tvillar-app .home-dash-panels,
body.tvillar-app .home-dash-panel,
body.tvillar-app .home-dash-docctrl-panels,
body.tvillar-app .home-dash-missing-panels { max-width: 100% !important; min-width: 0 !important; }
body.tvillar-app .home-dash-panels > *,
body.tvillar-app .home-dash-hero-grid > *,
body.tvillar-app .home-dash-grid > *,
body.tvillar-app .home-dash-docctrl-panels > *,
body.tvillar-app .home-dash-missing-panels > * { min-width: 0 !important; }
body.tvillar-app .home-dash-panel.tv-table-host { width: 100%; overflow-x: auto; }
body.tvillar-app h1,
body.tvillar-app h2,
body.tvillar-app h3,
body.tvillar-app h4,
body.tvillar-app h5,
body.tvillar-app h6 { color: var(--tv-ink); font-family: inherit !important; letter-spacing: -.025em; }

/* Encabezados con fondo oscuro: el contraste debe ganar a la tipografía global. */
body.tvillar-app .taller-lite-hero h1,
body.tvillar-app .taller-lite-hero h2,
body.tvillar-app .taller-lite-hero h3,
body.tvillar-app .taller-lite-hero small,
body.tvillar-app .taller-lite-hero p,
body.tvillar-app .os-hero h1,
body.tvillar-app .os-hero h2,
body.tvillar-app .os-hero h3,
body.tvillar-app .os-hero .os-hero-kicker,
body.tvillar-app .os-hero p,
body.tvillar-app .cf-shell__heading .cf-shell__eyebrow,
body.tvillar-app .cf-shell__heading .cf-shell__title,
body.tvillar-app .cf-shell__heading .cf-shell__subtitle,
body.tvillar-app .ge-shell__heading .ge-shell__eyebrow,
body.tvillar-app .ge-shell__heading .ge-shell__title,
body.tvillar-app .ge-shell__heading .ge-shell__subtitle {
    color: #fff !important;
}
body.tvillar-app .panel-heading.cf-shell__heading,
body.tvillar-app .panel-heading.ge-shell__heading {
    display: block !important;
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.12) !important;
    background:
        radial-gradient(circle at 92% -30%, rgba(var(--tv-accent-rgb),.42), transparent 22rem),
        linear-gradient(118deg, var(--tv-navy-950) 0%, var(--tv-navy-800) 62%, var(--tv-navy-700) 145%) !important;
}

@keyframes tvRouteIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Surfaces and cards */
body.tvillar-app .panel,
body.tvillar-app .box,
body.tvillar-app .app-card,
body.tvillar-app .cfg-card {
    overflow: visible;
    color: var(--tv-ink);
    border: 1px solid rgba(207,220,230,.82) !important;
    border-radius: var(--tv-radius-lg) !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: var(--tv-shadow-md) !important;
}
body.tvillar-app .panel { margin-bottom: 22px !important; }
body.tvillar-app .panel::before,
body.tvillar-app .panel::after { display: table; content: " "; }
body.tvillar-app .panel::after { clear: both; }
body.tvillar-app .panel-heading,
body.tvillar-app .box-header {
    position: relative;
    min-height: 57px;
    display: flex;
    align-items: center;
    padding: 17px 21px !important;
    color: var(--tv-navy-900) !important;
    font-size: 15px !important;
    font-weight: 780 !important;
    letter-spacing: -.012em;
    border: 0 !important;
    border-bottom: 1px solid var(--tv-line-soft) !important;
    border-radius: var(--tv-radius-lg) var(--tv-radius-lg) 0 0 !important;
    background: linear-gradient(110deg, #ffffff 0%, #f4fbfb 55%, #fff7f8 100%) !important;
}
body.tvillar-app .panel-heading::before,
body.tvillar-app .box-header::before { content: ""; width: 4px; height: 24px; margin-right: 11px; border-radius: 99px; background: linear-gradient(180deg, var(--tv-teal-500), var(--tv-coral-500)); box-shadow: 0 4px 10px rgba(11,166,166,.18); }
body.tvillar-app .panel-title,
body.tvillar-app .box-title { color: inherit !important; font-size: inherit !important; font-weight: inherit !important; }
body.tvillar-app .panel-body,
body.tvillar-app .box-body { min-width: 0; padding: 20px 21px 22px !important; color: var(--tv-ink); }
body.tvillar-app .panel-footer,
body.tvillar-app .box-footer { padding: 15px 21px; border: 0; border-top: 1px solid var(--tv-line-soft); border-radius: 0 0 var(--tv-radius-lg) var(--tv-radius-lg); background: #f9fbfc; }

body.tvillar-app .well,
body.tvillar-app .jumbotron { color: var(--tv-ink); border: 1px solid var(--tv-line) !important; border-radius: var(--tv-radius-md) !important; background: linear-gradient(135deg, #f7fbfc, #f8f9fd) !important; box-shadow: none !important; }
body.tvillar-app hr { border-color: var(--tv-line-soft); }

/* Forms */
body.tvillar-app label,
body.tvillar-app .control-label { margin-bottom: 7px; color: #465b70 !important; font-size: 11.5px; font-weight: 740 !important; letter-spacing: .018em; }
body.tvillar-app .form-group { margin-bottom: 17px; }
body.tvillar-app .form-control {
    width: 100%;
    height: 42px !important;
    padding: 9px 12px !important;
    color: var(--tv-ink) !important;
    font-size: 13px !important;
    line-height: 1.4;
    border: 1px solid #cedae4 !important;
    border-radius: 12px !important;
    outline: 0;
    background-color: #fff !important;
    box-shadow: inset 0 1px 1px rgba(7,24,45,.025) !important;
}
body.tvillar-app .form-control:hover { border-color: #aebfcd !important; }
body.tvillar-app .form-control:focus { border-color: var(--tv-teal-500) !important; box-shadow: 0 0 0 4px rgba(11,166,166,.11) !important; }
body.tvillar-app .form-control[disabled],
body.tvillar-app .form-control[readonly],
body.tvillar-app fieldset[disabled] .form-control { color: #6f7e8d !important; background: #f1f5f7 !important; opacity: 1; }
body.tvillar-app textarea.form-control { min-height: 88px !important; resize: vertical !important; border-radius: 13px !important; }
body.tvillar-app select.form-control { padding-right: 35px !important; background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px !important; }
body.tvillar-app input[type="file"].form-control { height: auto !important; min-height: 42px; padding: 7px 9px !important; }
body.tvillar-app input[type="checkbox"],
body.tvillar-app input[type="radio"] { accent-color: var(--tv-teal-600); }

body.tvillar-app .input-group { width: 100%; }
body.tvillar-app .input-group-addon {
    min-width: 43px;
    padding: 9px 12px;
    color: var(--tv-teal-600) !important;
    border: 1px solid #cedae4 !important;
    border-right: 0 !important;
    border-radius: 12px 0 0 12px !important;
    background: #eef8f7 !important;
}
body.tvillar-app .input-group .form-control { border-radius: 0 12px 12px 0 !important; }
body.tvillar-app .input-group-btn:last-child > .btn { height: 42px; border-radius: 0 12px 12px 0 !important; }

/* Campo con prefijo: el icono y el control comparten una sola carcasa. */
body.tvillar-app .input-group.tv-input-composite:not(.input-pill) {
    width: 100%;
    min-height: 42px;
    display: flex !important;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #cedae4;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(7,24,45,.025);
    transition: border-color .16s ease, box-shadow .16s ease;
}
body.tvillar-app .input-group.tv-input-composite:not(.input-pill):hover { border-color: #aebfcd; }
body.tvillar-app .input-group.tv-input-composite:not(.input-pill):focus-within {
    border-color: var(--tv-teal-500);
    box-shadow: 0 0 0 4px rgba(11,166,166,.11);
}
body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .input-group-addon {
    min-width: 42px;
    flex: 0 0 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 9px 11px !important;
    border: 0 !important;
    border-right: 1px solid #cedae4 !important;
    border-radius: 0 !important;
    background: #eef8f7 !important;
}
body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .form-control {
    min-width: 0;
    height: 40px !important;
    flex: 1 1 auto;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > textarea.form-control {
    min-height: 76px !important;
}
body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .form-control[disabled],
body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .form-control[readonly] {
    background: #f1f5f7 !important;
}
body.tvillar-app .input-group.tv-input-composite > .tv-input-host {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
}
body.tvillar-app .input-group.tv-input-composite > .tv-input-host > .form-control {
    width: 100% !important;
    min-width: 0;
    height: 40px !important;
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 9px 35px 9px 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Campo con acción: una sola pieza visual, con un único borde exterior.
   Sustituye la geometría tabular de Bootstrap y evita uniones duplicadas. */
body.tvillar-app .input-group.input-pill {
    width: 100%;
    height: 42px;
    display: flex !important;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #cedae4;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(7,24,45,.025);
    transition: border-color .16s ease, box-shadow .16s ease;
}
body.tvillar-app .input-group.input-pill:hover { border-color: #aebfcd; }
body.tvillar-app .input-group.input-pill:focus-within {
    border-color: var(--tv-teal-500);
    box-shadow: 0 0 0 4px rgba(11,166,166,.11);
}
body.tvillar-app .input-group.input-pill > .form-control {
    min-width: 0;
    height: 40px !important;
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 9px 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.tvillar-app .input-group.input-pill > .form-control[disabled],
body.tvillar-app .input-group.input-pill > .form-control[readonly] {
    background: #f1f5f7 !important;
}
body.tvillar-app .input-group.input-pill > .input-group-addon {
    min-width: 43px;
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border: 0 !important;
    border-right: 1px solid #cedae4 !important;
    border-radius: 0 !important;
}
body.tvillar-app .input-group.input-pill > .input-group-btn {
    width: 44px !important;
    flex: 0 0 44px;
    display: flex !important;
    align-items: stretch;
    position: static;
}
body.tvillar-app .input-group.input-pill > .input-group-btn > .btn,
body.tvillar-app .input-group.input-pill > .input-group-btn > .btn-flat {
    width: 44px !important;
    min-width: 44px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 10px !important;
    color: var(--tv-navy-700) !important;
    border: 0 !important;
    border-left: 1px solid #cedae4 !important;
    border-radius: 0 !important;
    background: #f4f8fa !important;
    box-shadow: none !important;
    transform: none !important;
}
body.tvillar-app .input-group.input-pill > .input-group-btn > .btn:hover,
body.tvillar-app .input-group.input-pill > .input-group-btn > .btn:focus {
    color: var(--tv-teal-700) !important;
    background: #e6f5f4 !important;
}
body.tvillar-app .input-group.input-pill > .input-group-btn > .btn .tv-icon {
    width: 17px;
    height: 17px;
}
/* Los grupos con una acción escrita (Buscar unidad, Guardar, Seleccionar, etc.)
   reservan el ancho de su etiqueta; sólo las acciones puramente iconográficas
   permanecen cuadradas. */
body.tvillar-app .input-group.input-pill.tv-input-text-action > .input-group-btn {
    width: auto !important;
    min-width: 44px;
    flex: 0 0 auto;
}
body.tvillar-app .input-group.input-pill.tv-input-text-action > .input-group-btn > .tv-input-text-action__button {
    width: auto !important;
    min-width: 96px !important;
    padding: 0 15px !important;
    gap: 7px;
    white-space: nowrap !important;
}
body.tvillar-app .help-block { color: var(--tv-muted); font-size: 11px; }

body.tvillar-app .select2-container { max-width: 100%; }
body.tvillar-app .select2-container .select2-selection--single,
body.tvillar-app .select2-container--default .select2-selection--multiple,
body.tvillar-app .chosen-container-single .chosen-single {
    min-height: 42px !important;
    color: var(--tv-ink) !important;
    border: 1px solid #cedae4 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.tvillar-app .select2-selection__rendered { line-height: 40px !important; }
body.tvillar-app .select2-selection__arrow { height: 40px !important; }
body.tvillar-app .select2-dropdown,
body.tvillar-app .chosen-container .chosen-drop { overflow: hidden; border: 1px solid var(--tv-line) !important; border-radius: 12px !important; box-shadow: var(--tv-shadow-md) !important; }

/* Buttons */
body.tvillar-app .btn,
body.tvillar-app .mtto-btn {
    min-height: 40px;
    padding: 9px 16px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--tv-navy-800);
    font-size: 12px !important;
    font-weight: 750 !important;
    line-height: 1.25;
    text-shadow: none !important;
    border: 1px solid #cedae4 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 5px 12px rgba(7,24,45,.07) !important;
    white-space: normal;
}
body.tvillar-app .btn:hover,
body.tvillar-app .mtto-btn:hover { color: var(--tv-navy-900); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(7,24,45,.11) !important; }
body.tvillar-app .btn:focus,
body.tvillar-app .mtto-btn:focus { outline: 0 !important; box-shadow: 0 0 0 4px rgba(11,166,166,.12) !important; }
body.tvillar-app .btn-primary,
body.tvillar-app .mtto-btn--primary { color: #fff !important; border-color: var(--tv-navy-800) !important; background: linear-gradient(135deg, var(--tv-navy-800), var(--tv-teal-600)) !important; box-shadow: 0 8px 19px rgba(18,54,87,.20) !important; }
body.tvillar-app .btn-primary:hover,
body.tvillar-app .mtto-btn--primary:hover { border-color: var(--tv-teal-600) !important; background: linear-gradient(135deg, var(--tv-navy-700), var(--tv-teal-500)) !important; }
body.tvillar-app .btn-info { color: #087476 !important; border-color: #b9e3e1 !important; background: #e8f9f7 !important; box-shadow: none !important; }
body.tvillar-app .btn-success { color: #137151 !important; border-color: #b9dfd0 !important; background: #eaf8f1 !important; box-shadow: none !important; }
body.tvillar-app .btn-warning { color: #8a5a09 !important; border-color: #efd49e !important; background: #fff6df !important; box-shadow: none !important; }
body.tvillar-app .btn-danger { color: #fff !important; border-color: var(--tv-coral-600) !important; background: linear-gradient(135deg, var(--tv-coral-500), #d92f4c) !important; box-shadow: 0 7px 17px rgba(222,54,82,.19) !important; }
body.tvillar-app .btn-default,
body.tvillar-app .mtto-btn--secondary { color: var(--tv-navy-800) !important; border-color: #cedae4 !important; background: #fff !important; }
body.tvillar-app .btn-link { min-height: 0; padding: 5px !important; color: var(--tv-teal-600) !important; border-color: transparent !important; background: transparent !important; box-shadow: none !important; }
body.tvillar-app .btn-xs { min-height: 31px; padding: 6px 10px !important; font-size: 10px !important; border-radius: 9px !important; }
body.tvillar-app .btn-sm { min-height: 35px; padding: 7px 12px !important; font-size: 11px !important; }
body.tvillar-app .btn-lg { min-height: 48px; padding: 12px 20px !important; font-size: 14px !important; }
body.tvillar-app .btn-group > .btn { border-radius: 0 !important; }
body.tvillar-app .btn-group > .btn:first-child { border-radius: 12px 0 0 12px !important; }
body.tvillar-app .btn-group > .btn:last-child { border-radius: 0 12px 12px 0 !important; }

/* Tables and DataTables */
body.tvillar-app .table-responsive,
body.tvillar-app .dataTables_wrapper,
body.tvillar-app [id$="Lista"] { max-width: 100%; }
body.tvillar-app .tv-table-host { width: 100%; max-width: 100%; overflow-x: auto; padding-right: 6px; padding-left: 6px; scroll-padding: 0 6px; -webkit-overflow-scrolling: touch; }
body.tvillar-app .table-responsive { width: 100%; overflow-x: auto; overflow-y: visible; padding: 0 6px 8px !important; border: 0; border-radius: 0; }
body.tvillar-app .dataTables_wrapper { width: 100%; overflow: visible; padding: 2px 6px 8px; }
body.tvillar-app table.table,
body.tvillar-app table.dataTable {
    width: 100%;
    margin: 8px 0 12px !important;
    color: #26394e;
    font-size: 12.25px !important;
    line-height: 1.42;
    border: 1px solid var(--tv-line) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 14px !important;
    background: #fff !important;
}
body.tvillar-app .table > thead > tr,
body.tvillar-app table.dataTable > thead > tr { background: linear-gradient(105deg, var(--tv-navy-900), var(--tv-navy-700)) !important; }
body.tvillar-app .table > thead > tr > th,
body.tvillar-app table.dataTable > thead > tr > th {
    position: relative;
    padding: 12px 10px !important;
    color: rgba(255,255,255,.92) !important;
    font-size: 10.25px !important;
    font-weight: 780 !important;
    line-height: 1.35;
    letter-spacing: .055em !important;
    text-transform: uppercase;
    vertical-align: middle !important;
    border: 0 !important;
    border-right: 0 !important;
    background-color: transparent !important;
    box-shadow: inset -1px 0 rgba(255,255,255,.08);
}
body.tvillar-app .table > thead > tr > th:first-child { border-radius: 13px 0 0 0; }
body.tvillar-app .table > thead > tr > th:last-child { border-right: 0 !important; border-radius: 0 13px 0 0; box-shadow: none; }
body.tvillar-app .table > thead > tr > th:first-child,
body.tvillar-app .table > tbody > tr > td:first-child { padding-left: 14px !important; }
body.tvillar-app .table > thead > tr > th:last-child,
body.tvillar-app .table > tbody > tr > td:last-child { padding-right: 14px !important; }

/* DataTables con scroll crea un thead invisible para medir columnas. No debe
   recuperar altura ni color porque aparece como una segunda franja cortada. */
body.tvillar-app .dataTables_scrollBody table.dataTable > thead,
body.tvillar-app .dataTables_scrollBody table.dataTable > thead > tr {
    height: 0 !important;
    visibility: hidden !important;
    background: transparent !important;
}
body.tvillar-app .dataTables_scrollBody table.dataTable > thead > tr > th {
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 10.25px !important;
    line-height: 0 !important;
    border: 0 !important;
}
body.tvillar-app .dataTables_scroll {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 14px;
}
body.tvillar-app .dataTables_scrollHead,
body.tvillar-app .dataTables_scrollBody {
    width: 100% !important;
    max-width: 100% !important;
}
body.tvillar-app .dataTables_scrollHead {
    overflow: hidden !important;
    border: 1px solid var(--tv-line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
}
body.tvillar-app .dataTables_scrollHeadInner {
    width: 100% !important;
    padding: 0 1px;
    box-sizing: border-box !important;
}
body.tvillar-app .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: visible !important;
    border: 1px solid var(--tv-line);
    border-top: 0;
    border-radius: 0 0 14px 14px;
}
body.tvillar-app .dataTables_scrollHead table.dataTable,
body.tvillar-app .dataTables_scrollBody table.dataTable {
    width: 100% !important;
    min-width: var(--tv-table-min-width, 100%) !important;
    box-sizing: border-box !important;
    table-layout: fixed !important;
    border: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}
body.tvillar-app .dataTables_scrollHead table.dataTable { width: calc(100% - 1px) !important; }
body.tvillar-app .table > tbody > tr > td,
body.tvillar-app table.dataTable > tbody > tr > td {
    padding: 12px 10px !important;
    color: #32475b !important;
    vertical-align: middle !important;
    border: 0 !important;
    border-bottom: 1px solid var(--tv-line-soft) !important;
    background: transparent !important;
}
body.tvillar-app table td > .form-control,
body.tvillar-app table td > .input-group,
body.tvillar-app table td > .select2-container {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
body.tvillar-app .table > tbody > tr:nth-child(even),
body.tvillar-app table.dataTable.stripe > tbody > tr:nth-child(even) { background: #f8fbfc !important; }
body.tvillar-app .table > tbody > tr:hover,
body.tvillar-app table.dataTable > tbody > tr:hover { background: #eff9f8 !important; box-shadow: inset 3px 0 0 var(--tv-teal-500); }
body.tvillar-app .table > tbody > tr:last-child > td { border-bottom: 0 !important; }
body.tvillar-app .table td .btn,
body.tvillar-app .table td button:not(.mtto-btn) {
    width: auto !important;
    min-width: 31px !important;
    height: auto !important;
    min-height: 31px !important;
    margin: 2px !important;
    padding: 6px 10px !important;
    color: var(--tv-navy-800) !important;
    border: 1px solid #d4dfe7 !important;
    border-radius: 9px !important;
    background-color: #fff !important;
    box-shadow: 0 3px 9px rgba(7,24,45,.07) !important;
}
body.tvillar-app .table td .btn-danger { color: var(--tv-coral-600) !important; border-color: #f1bdc6 !important; background: var(--tv-coral-100) !important; }
body.tvillar-app .table td .btn-success { color: #137151 !important; border-color: #b9dfd0 !important; background: #eef9f4 !important; }
body.tvillar-app .table td .btn[style*="background-image"],
body.tvillar-app .table td button[style*="background-image"],
body.tvillar-app .table td .btn:has(> img),
body.tvillar-app .table td button:has(> img) { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; padding: 5px !important; border-radius: 10px !important; background-repeat: no-repeat !important; background-position: center !important; background-size: 17px 17px !important; }
body.tvillar-app .table td .btn img,
body.tvillar-app .table td button img { width: 17px !important; height: 17px !important; object-fit: contain; }

/* Action columns are sized from their real controls. DataTables renders a
   separate header table, so both copies receive the same explicit minimum. */
body.tvillar-app table .tv-actions-head,
body.tvillar-app table .tv-actions-cell {
    width: var(--tv-actions-width, 112px) !important;
    min-width: var(--tv-actions-width, 112px) !important;
    max-width: none !important;
    white-space: nowrap !important;
}
body.tvillar-app table .tv-actions-cell {
    overflow: visible !important;
    text-align: center;
}
body.tvillar-app table .tv-actions-cell > .mtto-action,
body.tvillar-app table .tv-actions-cell > button,
body.tvillar-app table .tv-actions-cell > a.btn { vertical-align: middle; }
body.tvillar-app table .tv-actions-cell .tv-actions-group,
body.tvillar-app table .tv-actions-cell .ge-table-actions,
body.tvillar-app table .tv-actions-cell .cf-row-actions,
body.tvillar-app table .tv-actions-cell .fact-viaje-action-list,
body.tvillar-app table .tv-actions-cell .viaje-tabla-action-wrap,
body.tvillar-app table .tv-actions-cell .remdes-action-wrap {
    width: max-content !important;
    max-width: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    flex-wrap: nowrap !important;
    gap: 7px !important;
}

/* Esquema único para mercancías. Los anchos se aplican por columna física a
   la tabla del cuerpo y al encabezado clonado de DataTables. Esto elimina el
   cálculo independiente que desalineaba títulos, campos y acciones. */
body.tvillar-app .tv-cargo-grid {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
body.tvillar-app table.tv-cargo-table {
    table-layout: fixed !important;
}
body.tvillar-app table.tv-cargo-table > thead > tr > th,
body.tvillar-app table.tv-cargo-table > tbody > tr > td {
    box-sizing: border-box !important;
    overflow: hidden;
}
body.tvillar-app table.tv-cargo-table > tbody > tr > td {
    padding: 12px 10px !important;
}
body.tvillar-app table.tv-cargo-table .form-control {
    min-width: 0;
    max-width: 100%;
}
body.tvillar-app table.tv-cargo-table textarea.form-control {
    min-height: 72px !important;
}

body.tvillar-app table.tv-cargo-table--edit { min-width: 1074px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(1),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(1) { width: 64px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(2),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(2) { width: 112px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(3),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(3) { width: 112px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(4),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(4) { width: 164px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(5),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(5) { width: 350px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(6),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(6) { width: 132px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(7),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(7),
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(8),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(8),
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(9),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(9),
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(10),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(10) { width: 180px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(11),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(11) { width: 150px !important; }
body.tvillar-app table.tv-cargo-table--edit > thead > tr > :nth-child(12),
body.tvillar-app table.tv-cargo-table--edit > tbody > tr > :nth-child(12) { width: 140px !important; }

body.tvillar-app .importacion-activa table.tv-cargo-table--edit { min-width: 1974px !important; }

body.tvillar-app table.tv-cargo-table--preview { min-width: 1178px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(1),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(1) { width: 64px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(2),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(2),
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(3),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(3) { width: 116px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(4),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(4) { width: 124px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(5),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(5) { width: 176px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(6),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(6) { width: 350px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(7),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(7) { width: 128px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(8),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(8),
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(9),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(9),
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(10),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(10),
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(11),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(11),
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(12),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(12) { width: 180px !important; }
body.tvillar-app table.tv-cargo-table--preview > thead > tr > :nth-child(13),
body.tvillar-app table.tv-cargo-table--preview > tbody > tr > :nth-child(13) { width: 104px !important; }
body.tvillar-app .importacion-activa table.tv-cargo-table--preview { min-width: 2078px !important; }

body.tvillar-app .dataTables_length,
body.tvillar-app .dataTables_filter { margin: 7px 0 12px; color: var(--tv-muted); font-size: 12px; font-weight: 650; }
body.tvillar-app .dataTables_length select { width: auto; height: 34px !important; padding: 5px 27px 5px 9px !important; border-radius: 9px !important; }
body.tvillar-app .dataTables_filter input { width: min(250px, 62vw); height: 36px !important; margin-left: 7px; padding: 7px 11px !important; border: 1px solid #cedae4 !important; border-radius: 10px !important; outline: 0; }
body.tvillar-app .dataTables_filter input:focus { border-color: var(--tv-teal-500) !important; box-shadow: 0 0 0 3px rgba(11,166,166,.10); }
body.tvillar-app .dataTables_info { padding-top: 12px !important; color: var(--tv-muted); font-size: 11.5px; font-weight: 560; }
body.tvillar-app .pagination { margin: 10px 0 !important; }
body.tvillar-app .pagination > li > a,
body.tvillar-app .pagination > li > span { min-width: 34px; margin: 0 2px; padding: 7px 9px; color: var(--tv-navy-700); text-align: center; border: 1px solid var(--tv-line) !important; border-radius: 9px !important; background: #fff; }
body.tvillar-app .pagination > .active > a,
body.tvillar-app .pagination > .active > span { color: #fff !important; border-color: var(--tv-teal-600) !important; background: var(--tv-teal-600) !important; box-shadow: 0 5px 12px rgba(7,139,141,.18); }

/* Tabs, navs, breadcrumbs */
body.tvillar-app .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 17px;
    padding: 6px !important;
    border: 1px solid var(--tv-line-soft) !important;
    border-radius: 14px !important;
    background: #f2f6f8 !important;
}
body.tvillar-app .nav-tabs > li { float: none !important; margin: 0 !important; }
body.tvillar-app .nav-tabs > li > a {
    min-height: 37px;
    margin: 0 !important;
    padding: 9px 14px !important;
    color: var(--tv-muted) !important;
    font-size: 11.5px;
    font-weight: 730;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
}
body.tvillar-app .nav-tabs > li > a:hover { color: var(--tv-navy-800) !important; background: rgba(255,255,255,.72) !important; }
body.tvillar-app .nav-tabs > li.active > a,
body.tvillar-app .nav-tabs > li.active > a:hover,
body.tvillar-app .nav-tabs > li.active > a:focus { color: var(--tv-navy-900) !important; border-color: #d8e3ea !important; background: #fff !important; box-shadow: 0 5px 14px rgba(7,24,45,.08); }
body.tvillar-app .tab-content { min-width: 0; }
body.tvillar-app .breadcrumb { padding: 9px 13px; border-radius: 11px; background: rgba(255,255,255,.72); }

/* Modals */
body.tvillar-app.modal-open { overflow: hidden !important; }
body.tvillar-app .modal-backdrop.in { opacity: .58; }
body.tvillar-app .modal-backdrop { background: var(--tv-navy-950); backdrop-filter: blur(4px); }
body.tvillar-app .modal { padding: 18px 0 !important; }
body.tvillar-app .modal-dialog { width: min(94vw, 680px); margin: 18px auto !important; }
body.tvillar-app .modal-dialog.modal-lg { width: min(95vw, 1120px); }
body.tvillar-app .modal-dialog.modal-xl { width: min(96vw, 1380px) !important; max-width: 1380px !important; }
body.tvillar-app .modal-content { overflow: hidden; border: 0 !important; border-radius: 22px !important; background: #fff; box-shadow: 0 30px 80px rgba(3,16,30,.28) !important; }
body.tvillar-app .modal.tv-modal--legacy-wide .modal-dialog { width: min(94vw, var(--tv-modal-preferred-width, 900px)) !important; }
body.tvillar-app .modal.tv-modal--table .modal-dialog { width: min(94vw, 1180px) !important; }
body.tvillar-app .modal.tv-modal--legacy-wide .modal-content,
body.tvillar-app .modal.tv-modal--table .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
}
body.tvillar-app .modal-header {
    min-height: 65px;
    padding: 19px 22px !important;
    color: #fff !important;
    border: 0 !important;
    background:
        radial-gradient(circle at 90% 10%, rgba(81,213,205,.22), transparent 15rem),
        linear-gradient(120deg, var(--tv-navy-900), var(--tv-navy-700)) !important;
}
body.tvillar-app .modal-header .modal-title,
body.tvillar-app .modal-header h4,
body.tvillar-app .modal-header h5 { margin: 0; color: #fff !important; font-size: 17px !important; font-weight: 760 !important; }
body.tvillar-app .modal-header .close { margin-top: -4px; color: #fff !important; font-size: 26px; text-shadow: none; opacity: .76; }
body.tvillar-app .modal-header .close:hover { opacity: 1; transform: rotate(4deg); }
body.tvillar-app .modal-body { max-height: calc(100vh - 190px); padding: 22px !important; overflow-y: auto; color: var(--tv-ink); }
body.tvillar-app .modal-footer { padding: 14px 22px 18px !important; border-top: 1px solid var(--tv-line-soft) !important; background: #f9fbfc; }

/* Second-pass visual polish: compact modal chrome and semantic actions. */
body.tvillar-app .modal-backdrop { background: #061526 !important; }
body.tvillar-app .modal-backdrop.in { opacity: .66 !important; }
body.tvillar-app .modal-content {
    border: 1px solid rgba(255,255,255,.34) !important;
    border-radius: 25px !important;
    box-shadow: 0 34px 95px rgba(3,16,30,.38), 0 0 0 1px rgba(7,24,45,.06) !important;
}
body.tvillar-app .modal-header,
body.tvillar-app .modal-header.tv-modal-header {
    min-height: 62px !important;
    padding: 13px 16px 13px 20px !important;
    display: flex !important;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    background:
        radial-gradient(circle at 88% -40%, rgba(var(--tv-accent-rgb),.40), transparent 18rem),
        linear-gradient(112deg, var(--tv-navy-950) 0%, var(--tv-navy-800) 58%, var(--tv-navy-700) 145%) !important;
}
body.tvillar-app .modal-header .modal-title,
body.tvillar-app .modal-header h4,
body.tvillar-app .modal-header h5 {
    order: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 780 !important;
    letter-spacing: -.01em !important;
}
.tv-modal-title-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8ce9e0;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 11px;
    background: rgba(255,255,255,.09);
}
.tv-modal-title-icon .tv-icon { width: 17px; height: 17px; stroke-width: 2; }
body.tvillar-app .modal-header .close,
body.tvillar-app .modal-header .tv-modal-close {
    order: 2;
    float: none !important;
    flex: 0 0 36px;
    width: 36px !important;
    height: 36px !important;
    min-height: 36px;
    margin: 0 0 0 auto !important;
    padding: 9px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.82) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 11px !important;
    background: rgba(255,255,255,.08) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}
/* Cabeceras especiales (taller, evidencias y expedientes) también usan el
   mismo blanco táctil, aunque no estén construidas con .modal-header. */
body.tvillar-app .modal .os-modal-header .tv-modal-close {
    float: none !important;
    flex: 0 0 36px;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
    margin: 0 0 0 auto !important;
    padding: 9px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: var(--tv-navy-700) !important;
    border: 1px solid #cedae4 !important;
    border-radius: 11px !important;
    background: #f4f8fa !important;
    box-shadow: none !important;
    opacity: 1 !important;
}
body.tvillar-app .modal .os-modal-header .tv-modal-close:hover,
body.tvillar-app .modal .os-modal-header .tv-modal-close:focus {
    color: var(--tv-teal-700) !important;
    background: #e6f5f4 !important;
}
body.tvillar-app .modal .os-modal-header .tv-modal-close .tv-icon { width: 17px; height: 17px; }

/* El modal de piezas tiene una cabecera editorial propia. Se declara como
   cuadrícula para que el título no termine empujado al extremo por el flex
   genérico de las demás cabeceras. */
body.tvillar-app .taller-piece-modal .modal-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 36px;
    grid-template-areas:
        "eyebrow close"
        "title close"
        "copy close";
    align-items: start;
    gap: 7px 18px;
    padding: 20px 22px !important;
}
body.tvillar-app .taller-piece-modal .taller-piece-modal__eyebrow {
    grid-area: eyebrow;
    justify-self: start;
    margin: 0;
    color: #8ce9e0;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.08);
}
body.tvillar-app .taller-piece-modal .modal-title {
    grid-area: title;
    order: initial;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 1.12;
}
body.tvillar-app .taller-piece-modal .taller-piece-modal__copy {
    grid-area: copy;
    margin: 0;
    color: #c7d6e1;
    line-height: 1.55;
}
body.tvillar-app .taller-piece-modal .modal-header .tv-modal-close {
    grid-area: close;
    align-self: start;
}
body.tvillar-app .modal-header .close:hover,
body.tvillar-app .modal-header .tv-modal-close:hover {
    color: #fff !important;
    background: rgba(255,255,255,.16) !important;
    transform: none;
}
body.tvillar-app .modal-header .tv-modal-close .tv-icon { width: 17px; height: 17px; }
body.tvillar-app .modal-body {
    padding: 20px !important;
    background: linear-gradient(180deg, #fff 0%, #fbfdfe 100%) !important;
}
body.tvillar-app .modal-footer {
    min-height: 64px;
    padding: 12px 20px !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    background: #f7fafc !important;
}

body.tvillar-app .tv-icon-action,
body.tvillar-app button.tv-icon-action,
body.tvillar-app a.tv-icon-action {
    --tv-action-color: #31506c;
    --tv-action-bg: #eef4f7;
    --tv-action-border: #d8e3ea;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    flex: 0 0 38px !important;
    margin: 0 !important;
    padding: 9px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: var(--tv-action-color) !important;
    border: 1px solid var(--tv-action-border) !important;
    border-radius: 12px !important;
    background-color: var(--tv-action-bg) !important;
    background-image: none !important;
    box-shadow: 0 5px 12px rgba(7,24,45,.08) !important;
}
body.tvillar-app .tv-icon-action[data-tv-tone="info"] { --tv-action-color: #17648a; --tv-action-bg: #eaf6fb; --tv-action-border: #c8e5f1; }
body.tvillar-app .tv-icon-action[data-tv-tone="success"] { --tv-action-color: #087b69; --tv-action-bg: #e8f8f4; --tv-action-border: #bfe8dc; }
body.tvillar-app .tv-icon-action[data-tv-tone="warning"] { --tv-action-color: #9a6506; --tv-action-bg: #fff6df; --tv-action-border: #efd9a8; }
body.tvillar-app .tv-icon-action[data-tv-tone="danger"] { --tv-action-color: #cf3650; --tv-action-bg: #fff0f3; --tv-action-border: #f1c6cf; }
body.tvillar-app .table td button.tv-icon-action,
body.tvillar-app .table td a.tv-icon-action,
body.tvillar-app table td button.tv-icon-action,
body.tvillar-app table td a.tv-icon-action {
    color: var(--tv-action-color) !important;
    border-color: var(--tv-action-border) !important;
    background: var(--tv-action-bg) !important;
}
body.tvillar-app .table td button.tv-icon-action:not(.tv-labeled-action),
body.tvillar-app .table td a.tv-icon-action:not(.tv-labeled-action),
body.tvillar-app table td button.tv-icon-action:not(.tv-labeled-action),
body.tvillar-app table td a.tv-icon-action:not(.tv-labeled-action) {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    flex-basis: 38px !important;
    margin: 0 !important;
    padding: 9px !important;
}
body.tvillar-app .tv-icon-action:hover,
body.tvillar-app .tv-icon-action:focus {
    color: #fff !important;
    border-color: var(--tv-action-color) !important;
    background-color: var(--tv-action-color) !important;
    box-shadow: 0 9px 20px rgba(7,24,45,.18) !important;
    transform: translateY(-2px);
}
body.tvillar-app .table td button.tv-icon-action:hover,
body.tvillar-app .table td button.tv-icon-action:focus,
body.tvillar-app .table td a.tv-icon-action:hover,
body.tvillar-app .table td a.tv-icon-action:focus {
    color: #fff !important;
    border-color: var(--tv-action-color) !important;
    background: var(--tv-action-color) !important;
}
body.tvillar-app .tv-icon-action .tv-icon { width: 18px; height: 18px; stroke-width: 2; }
body.tvillar-app .tv-icon-action.tv-labeled-action,
body.tvillar-app button.tv-icon-action.tv-labeled-action,
body.tvillar-app a.tv-icon-action.tv-labeled-action {
    width: auto !important;
    min-width: 108px !important;
    max-width: 100%;
    padding: 8px 12px !important;
    gap: 7px;
    font-size: 11px !important;
    font-weight: 760 !important;
    white-space: nowrap !important;
}
body.tvillar-app .tv-icon-action.tv-labeled-action .tv-action-label { display: inline; }
body.tvillar-app .fact-viaje-action-list,
body.tvillar-app .viaje-tabla-action-wrap,
body.tvillar-app .remdes-action-wrap { gap: 7px !important; align-items: center !important; }

body.tvillar-app .fact-viaje-btn {
    min-height: 40px !important;
    padding: 9px 16px !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 760 !important;
    border: 1px solid var(--tv-teal-600) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--tv-navy-800), var(--tv-teal-600)) !important;
    box-shadow: 0 9px 20px rgba(7,139,141,.20) !important;
}
body.tvillar-app .fact-viaje-btn:hover { background: linear-gradient(135deg, var(--tv-navy-700), var(--tv-teal-500)) !important; transform: translateY(-1px); }

/* Columnas de formulario que sólo contienen una acción pertenecen a la misma
   línea visual que los campos vecinos, no al borde superior de la fila. */
body.tvillar-app .form-group.tv-form-action-slot {
    min-height: 69px;
    display: flex !important;
    align-items: flex-end;
    justify-content: center;
}
body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn {
    width: 100%;
    min-height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
body.tvillar-app .form-group.tv-form-action-slot .tv-icon-action { margin-bottom: 2px !important; }
body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn > .btn-danger {
    width: 44px !important;
    min-width: 44px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 0 1px !important;
    padding: 10px !important;
    color: var(--tv-coral-500) !important;
    border: 1px solid #f3c4cc !important;
    border-radius: 12px !important;
    background: #fff4f6 !important;
    box-shadow: 0 5px 12px rgba(191,46,72,.08) !important;
    transform: none !important;
}
body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn > .btn-danger:hover,
body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn > .btn-danger:focus {
    color: #c62e49 !important;
    border-color: #efaeb9 !important;
    background: #ffe9ed !important;
}

body.tvillar-app #modalFacturasViaje .modal-dialog { width: min(92vw, 1180px) !important; }
body.tvillar-app #modalFacturasViaje .modal-content { border-radius: 25px !important; }
body.tvillar-app #modalFacturasViaje .modal-header { padding: 13px 16px 13px 20px !important; background: radial-gradient(circle at 88% -40%, rgba(var(--tv-accent-rgb),.40), transparent 18rem), linear-gradient(112deg, var(--tv-navy-950) 0%, var(--tv-navy-800) 58%, var(--tv-navy-700) 145%) !important; }
body.tvillar-app #modalFacturasViaje .modal-title { color: #fff !important; font-size: 16px !important; font-weight: 780 !important; }
body.tvillar-app #modalFacturasViaje .modal-body { padding: 18px 20px 20px !important; background: #fbfdfe !important; }
body.tvillar-app #modalFacturasViaje .fact-viaje-toolbar {
    margin: 0 0 16px;
    padding: 0 0 14px !important;
    gap: 14px;
    border-bottom: 1px solid var(--tv-line-soft) !important;
}
body.tvillar-app #modalFacturasViaje .fact-viaje-table-wrap { padding: 0 !important; }
body.tvillar-app #modalFacturasViaje .modal-footer { padding: 12px 20px !important; background: #f7fafc !important; border-top: 1px solid var(--tv-line-soft) !important; }
body.tvillar-app #modalFacturasViaje .modal-footer .btn-default { min-width: 100px; height: 40px; border-radius: 12px !important; }

/* Feedback */
body.tvillar-app .alert { position: relative; padding: 13px 16px 13px 18px; color: var(--tv-ink); border: 1px solid transparent; border-left-width: 4px !important; border-radius: 13px; box-shadow: none; }
body.tvillar-app .alert-info { border-color: #bee5e2; border-left-color: var(--tv-teal-500) !important; background: #ecfbf9; }
body.tvillar-app .alert-success { border-color: #bde4d3; border-left-color: #2aa879 !important; background: #edf9f3; }
body.tvillar-app .alert-warning { border-color: #f1daa9; border-left-color: var(--tv-gold-500) !important; background: #fff8e8; }
body.tvillar-app .alert-danger { border-color: #f2c1ca; border-left-color: var(--tv-coral-500) !important; background: var(--tv-coral-100); }
body.tvillar-app .label,
body.tvillar-app .badge { padding: 5px 9px; font-size: 10.5px; font-weight: 780; letter-spacing: .025em; border-radius: 999px; }
body.tvillar-app .label-primary { background: var(--tv-navy-700) !important; }
body.tvillar-app .label-info { background: var(--tv-teal-600) !important; }
body.tvillar-app .label-success { background: #24936b !important; }
body.tvillar-app .label-warning { color: #6e4705 !important; background: #f7c75e !important; }
body.tvillar-app .label-danger { background: var(--tv-coral-600) !important; }
.tv-status-pill {
    max-width: 100%;
    min-height: 26px;
    padding: 5px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #42566a;
    font-size: 10.5px;
    font-weight: 760;
    line-height: 1.3;
    border: 1px solid #d5e0e8;
    border-radius: 999px;
    background: #f3f7f9;
}
.tv-status-pill::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(66,86,106,.10); }
.tv-status-pill[data-tv-status-tone="success"] { color: #08745b; border-color: #b9dfd1; background: #eaf8f2; }
.tv-status-pill[data-tv-status-tone="warning"] { color: #8a5a09; border-color: #ecd39e; background: #fff6df; }
.tv-status-pill[data-tv-status-tone="danger"] { color: #c82f4a; border-color: #efbdc7; background: #fff0f3; }
body.tvillar-app .tv-legacy-status-cell { text-align: center; }
body.tvillar-app .tv-legacy-status-cell .tv-status-pill {
    max-width: 230px;
    white-space: normal;
    line-height: 1.35;
}
body.tvillar-app .tv-empty-value {
    display: inline-flex;
    align-items: center;
    color: #8090a0;
    font-size: 11.5px;
    font-weight: 620;
    font-style: italic;
    white-space: nowrap;
}
body.tvillar-app .tv-empty-value--unavailable {
    padding: 5px 9px;
    color: #8b6170;
    border: 1px solid #ead7de;
    border-radius: 999px;
    background: #fbf5f7;
    font-style: normal;
}
html[data-tv-mode="dark"] body.tvillar-app .tv-status-pill { color: #c7d6e1; border-color: #40566a; background: #162a3b; }
html[data-tv-mode="dark"] body.tvillar-app .tv-status-pill[data-tv-status-tone="success"] { color: #82e5bd; border-color: rgba(71,192,139,.36); background: rgba(35,143,96,.16); }
html[data-tv-mode="dark"] body.tvillar-app .tv-status-pill[data-tv-status-tone="warning"] { color: #ffd27f; border-color: rgba(242,184,75,.36); background: rgba(242,184,75,.14); }
html[data-tv-mode="dark"] body.tvillar-app .tv-status-pill[data-tv-status-tone="danger"] { color: #ff9eb0; border-color: rgba(240,75,103,.38); background: rgba(240,75,103,.14); }
html[data-tv-mode="dark"] body.tvillar-app .tv-empty-value { color: #91a5b6; }
html[data-tv-mode="dark"] body.tvillar-app .tv-empty-value--unavailable { color: #d5a8b5; border-color: #503545; background: #261d28; }
body.tvillar-app .progress { height: 9px; overflow: hidden; border-radius: 99px; background: #e7eef3; box-shadow: none; }
body.tvillar-app .progress-bar { background: linear-gradient(90deg, var(--tv-teal-500), #48cfc7); box-shadow: none; }

/* Dropdowns, datepicker and SweetAlert */
body.tvillar-app .dropdown-menu { padding: 7px; border: 1px solid var(--tv-line); border-radius: 13px; background: #fff; box-shadow: var(--tv-shadow-md); }
body.tvillar-app .dropdown-menu > li > a { padding: 9px 11px; color: var(--tv-ink); font-size: 12px; border-radius: 9px; }
body.tvillar-app .dropdown-menu > li > a:hover { color: var(--tv-navy-900); background: #edf8f7; }
body.tvillar-app .ui-datepicker { padding: 10px; border: 1px solid var(--tv-line) !important; border-radius: 14px; box-shadow: var(--tv-shadow-lg); }
body.tvillar-app .sweet-alert,
body.tvillar-app .swal2-modal { border-radius: 22px !important; box-shadow: var(--tv-shadow-lg) !important; }

/* Footer and utilities */
body.tvillar-app #footer {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    width: auto !important;
    min-height: 52px;
    margin: 0;
    padding: 0 clamp(18px, 2.4vw, 38px);
    color: var(--tv-muted);
    line-height: normal;
    border-top: 1px solid rgba(207,220,230,.8);
    background: rgba(255,255,255,.62);
}
.tv-footer-inner { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 10.5px; }
.tv-footer-inner strong { color: var(--tv-navy-800); letter-spacing: .1em; }
.tv-footer-status { display: inline-flex; align-items: center; gap: 7px; }
.tv-footer-status i { width: 7px; height: 7px; border-radius: 50%; background: #28bd86; box-shadow: 0 0 0 4px rgba(40,189,134,.12); }
.tv-ui-back-top { position: fixed; right: 22px; bottom: 22px; z-index: 1020; width: 43px; height: 43px; display: flex; align-items: center; justify-content: center; color: #fff; border: 0; border-radius: 13px; background: linear-gradient(135deg, var(--tv-navy-800), var(--tv-teal-600)); box-shadow: 0 10px 24px rgba(7,24,45,.19); opacity: 0; pointer-events: none; transform: translateY(8px); }
.tv-ui-back-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.tv-ui-back-top:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(7,24,45,.25); }
/* Accent propagation */
body.tvillar-app::before { background: radial-gradient(circle at 92% 5%, rgba(var(--tv-accent-rgb), .10), transparent 24rem), radial-gradient(circle at 7% 94%, rgba(240,75,103,.07), transparent 28rem), linear-gradient(135deg, rgba(255,255,255,.46), transparent 48%); }
body.tvillar-app .navbar.app-header::after { background: linear-gradient(90deg, var(--tv-teal-500), rgba(var(--tv-accent-rgb),.15) 38%, transparent 72%); }
body.tvillar-app .app-icon-button,
body.tvillar-app .app-icon-button i,
.app-page-context-icon,
.app-date-chip i,
body.tvillar-app .app-sidebar-section-icon { color: var(--tv-accent-on-dark) !important; }
body.tvillar-app .app-page-context-icon,
body.tvillar-app .app-sidebar-section-icon { border-color: rgba(var(--tv-accent-rgb),.25); background: rgba(var(--tv-accent-rgb),.10); }
body.tvillar-app .app-user-avatar { background: linear-gradient(135deg, var(--tv-teal-500), var(--tv-navy-700)) !important; }
body.tvillar-app .sidebar-menu > li > a > i:first-child { color: var(--tv-accent-on-dark) !important; }
body.tvillar-app .sidebar-menu > li.active > a,
body.tvillar-app .sidebar-menu > li.tv-route-active > a { border-color: rgba(var(--tv-accent-rgb),.22) !important; background: linear-gradient(100deg, rgba(var(--tv-accent-rgb),.26), rgba(255,255,255,.055)) !important; box-shadow: inset 3px 0 0 var(--tv-teal-500); }

/* Appearance customizer */
.tv-theme-icon { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tv-theme-launcher { position: fixed; top: 42%; right: 0; z-index: 1065; width: 48px; height: 52px; display: flex; align-items: center; justify-content: center; color: #fff; border: 1px solid rgba(255,255,255,.25); border-right: 0; border-radius: 15px 0 0 15px; background: linear-gradient(145deg, var(--tv-navy-800), var(--tv-teal-600)); box-shadow: 0 12px 28px rgba(7,24,45,.24); }
.tv-theme-launcher:hover { width: 54px; background: linear-gradient(145deg, var(--tv-navy-700), var(--tv-teal-500)); }
.tv-theme-launcher:focus { outline: 0; box-shadow: 0 0 0 3px rgba(var(--tv-accent-rgb),.22), 0 12px 28px rgba(7,24,45,.24); }
.tv-theme-backdrop { position: fixed; inset: 0; z-index: 1070; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(3,14,27,.42); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; pointer-events: none; }
.tv-theme-panel { position: fixed; top: 0; right: 0; z-index: 1075; width: min(390px, calc(100vw - 20px)); height: 100vh; display: flex; flex-direction: column; color: var(--tv-ink); border-left: 1px solid var(--tv-line); background: var(--tv-surface); box-shadow: -25px 0 65px rgba(3,16,30,.20); transform: translateX(105%); transition: transform .32s var(--tv-ease); }
.tv-theme-customizer.is-open .tv-theme-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
.tv-theme-customizer.is-open .tv-theme-panel { transform: none; }
.tv-theme-panel__header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 25px; border-bottom: 1px solid var(--tv-line); background: radial-gradient(circle at 12% 10%, rgba(var(--tv-accent-rgb),.16), transparent 13rem), linear-gradient(135deg, rgba(var(--tv-accent-rgb),.07), transparent); }
.tv-theme-panel__header strong { display: block; color: var(--tv-ink); font-size: 20px; font-weight: 780; letter-spacing: -.025em; }
.tv-theme-panel__header small { display: block; margin-top: 5px; color: var(--tv-muted); font-size: 12px; }
.tv-theme-close { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; color: var(--tv-muted); border: 1px solid var(--tv-line); border-radius: 12px; background: var(--tv-surface); }
.tv-theme-close:hover { color: var(--tv-ink); border-color: var(--tv-teal-500); }
.tv-theme-panel__body { flex: 1 1 auto; padding: 28px 25px; overflow-y: auto; }
.tv-theme-section + .tv-theme-section { margin-top: 34px; }
.tv-theme-section__label { display: block; margin-bottom: 14px; color: var(--tv-ink); font-size: 14px; font-weight: 760; }
.tv-theme-swatches { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 9px; }
.tv-theme-swatch { position: relative; width: 100%; aspect-ratio: 1; padding: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid var(--tv-line); border-radius: 14px; background: var(--tv-surface); }
.tv-theme-swatch > span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #536176; border-radius: 10px; background: var(--tv-swatch); }
.tv-theme-swatch:hover { border-color: var(--tv-teal-500); transform: translateY(-2px); }
.tv-theme-swatch.is-selected { border-color: var(--tv-teal-500); box-shadow: 0 0 0 3px rgba(var(--tv-accent-rgb),.12); }
.tv-theme-swatch.is-selected::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border: 2px solid var(--tv-surface); border-radius: 50%; background: var(--tv-teal-500); }
.tv-theme-swatch--custom { overflow: hidden; }
.tv-theme-swatch--custom input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tv-theme-swatch--custom > span { background: linear-gradient(135deg, #ffd166, #ef476f 35%, #7b61ff 67%, #18b7a0); }
.tv-theme-swatch--custom .tv-theme-icon { width: 22px; height: 22px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.tv-theme-modes { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.tv-theme-modes button { min-height: 90px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--tv-muted); border: 2px solid var(--tv-line); border-radius: 16px; background: var(--tv-surface); }
.tv-theme-modes button .tv-theme-icon { width: 25px; height: 25px; }
.tv-theme-modes button span { font-size: 11px; font-weight: 720; }
.tv-theme-modes button:hover { color: var(--tv-ink); border-color: var(--tv-teal-500); }
.tv-theme-modes button.is-selected { color: var(--tv-teal-600); border-color: var(--tv-teal-500); background: var(--tv-teal-100); box-shadow: 0 0 0 3px rgba(var(--tv-accent-rgb),.10); }
.tv-theme-section--comfort { padding-top: 1px; }
.tv-theme-preference {
    padding: 15px;
    border: 1px solid var(--tv-line);
    border-radius: 16px;
    background: linear-gradient(145deg, var(--tv-surface), rgba(var(--tv-accent-rgb),.035));
}
.tv-theme-preference + .tv-theme-preference { margin-top: 11px; }
.tv-theme-preference__name { display: flex; align-items: flex-start; gap: 11px; color: var(--tv-ink); }
.tv-theme-preference__name > .tv-theme-icon { width: 21px; height: 21px; flex: 0 0 21px; margin-top: 2px; color: var(--tv-teal-600); }
.tv-theme-preference__name > span { min-width: 0; display: flex; flex-direction: column; }
.tv-theme-preference__name strong { font-size: 12.5px; font-weight: 780; }
.tv-theme-preference__name small { margin-top: 3px; color: var(--tv-muted); font-size: 10.5px; line-height: 1.45; }
.tv-theme-segmented { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; margin-top: 12px; padding: 4px; border: 1px solid var(--tv-line-soft); border-radius: 12px; background: rgba(121,142,160,.10); }
.tv-theme-segmented button { min-height: 35px; padding: 7px 9px; color: var(--tv-muted); font-size: 10.5px; font-weight: 720; border: 1px solid transparent; border-radius: 9px; background: transparent; box-shadow: none; }
.tv-theme-segmented button:hover { color: var(--tv-ink); background: rgba(255,255,255,.58); }
.tv-theme-segmented button.is-selected { color: var(--tv-teal-600); border-color: rgba(var(--tv-accent-rgb),.20); background: var(--tv-surface); box-shadow: 0 4px 10px rgba(7,24,45,.08); }
.tv-theme-note { margin: 28px 0 0; padding: 12px 14px; color: var(--tv-muted); font-size: 10.5px; line-height: 1.55; border: 1px solid var(--tv-line-soft); border-radius: 12px; background: rgba(var(--tv-accent-rgb),.045); }
.tv-theme-panel__footer { padding: 16px 25px 22px; border-top: 1px solid var(--tv-line); background: var(--tv-surface); }
.tv-theme-reset { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--tv-muted); border: 1px solid var(--tv-line); border-radius: 13px; background: transparent; }
.tv-theme-reset:hover { color: var(--tv-coral-600); border-color: rgba(240,75,103,.35); background: var(--tv-coral-100); }

.tv-empty-state { padding: 38px 20px; color: var(--tv-muted); text-align: center; }

/* Comfort and accessibility controls */
html[data-tv-density="comfortable"] body.tvillar-app .table > tbody > tr > td,
html[data-tv-density="comfortable"] body.tvillar-app table.dataTable > tbody > tr > td { padding-top: 13px !important; padding-bottom: 13px !important; }
html[data-tv-density="comfortable"] body.tvillar-app .table > thead > tr > th,
html[data-tv-density="comfortable"] body.tvillar-app table.dataTable > thead > tr > th { padding-top: 13px !important; padding-bottom: 13px !important; }
html[data-tv-density="compact"] body.tvillar-app .table > tbody > tr > td,
html[data-tv-density="compact"] body.tvillar-app table.dataTable > tbody > tr > td { padding-top: 7px !important; padding-bottom: 7px !important; }
html[data-tv-density="compact"] body.tvillar-app .table > thead > tr > th,
html[data-tv-density="compact"] body.tvillar-app table.dataTable > thead > tr > th { padding-top: 9px !important; padding-bottom: 9px !important; }

html[data-tv-text="large"] body.tvillar-app { font-size: 16px; }
html[data-tv-text="large"] body.tvillar-app .sidebar-menu > li > a { min-height: 49px; font-size: 16px !important; }
html[data-tv-text="large"] body.tvillar-app .sidebar-menu .treeview-menu > li > a { min-height: 39px; font-size: 14.5px !important; }
html[data-tv-text="large"] body.tvillar-app .app-menu-search input { font-size: 15px; }
html[data-tv-text="large"] body.tvillar-app label,
html[data-tv-text="large"] body.tvillar-app .control-label { font-size: 13px !important; }
html[data-tv-text="large"] body.tvillar-app .form-control,
html[data-tv-text="large"] body.tvillar-app .select2-selection__rendered,
html[data-tv-text="large"] body.tvillar-app .chosen-container { font-size: 14.5px !important; }
html[data-tv-text="large"] body.tvillar-app .btn,
html[data-tv-text="large"] body.tvillar-app .mtto-btn { font-size: 13.5px !important; }
html[data-tv-text="large"] body.tvillar-app table.table,
html[data-tv-text="large"] body.tvillar-app table.dataTable { font-size: 13.5px !important; }
html[data-tv-text="large"] body.tvillar-app .table > thead > tr > th,
html[data-tv-text="large"] body.tvillar-app table.dataTable > thead > tr > th { font-size: 11.5px !important; }
html[data-tv-text="large"] body.tvillar-app .dataTables_length,
html[data-tv-text="large"] body.tvillar-app .dataTables_filter,
html[data-tv-text="large"] body.tvillar-app .dataTables_info { font-size: 13px !important; }
html[data-tv-text="large"] body.tvillar-app .label,
html[data-tv-text="large"] body.tvillar-app .badge { font-size: 11.5px; }

html[data-tv-contrast="high"] body.tvillar-app { --tv-muted: #43566b; --tv-subtle: #5d6f82; --tv-line: #bac8d5; --tv-line-soft: #d7e0e8; }
html[data-tv-contrast="high"] body.tvillar-app .sidebar-menu > li > a { color: #fff !important; font-weight: 780 !important; }
html[data-tv-contrast="high"] body.tvillar-app .sidebar-menu .treeview-menu > li > a { color: #f0f8fb !important; font-weight: 680 !important; }
html[data-tv-contrast="high"] body.tvillar-app .app-menu-search input::placeholder { color: #f1f9fc; }
html[data-tv-contrast="high"] body.tvillar-app .form-control { border-width: 2px !important; }
html[data-tv-contrast="high"] body.tvillar-app .input-group.tv-input-composite { border-width: 2px; }
html[data-tv-contrast="high"] body.tvillar-app .table > tbody > tr > td,
html[data-tv-contrast="high"] body.tvillar-app table.dataTable > tbody > tr > td { color: #152b40 !important; font-weight: 560; border-bottom-color: #c9d4de !important; }
html[data-tv-mode="dark"][data-tv-contrast="high"] body.tvillar-app { --tv-ink: #fff; --tv-muted: #d0dde7; --tv-subtle: #b8c8d5; --tv-line: #587086; --tv-line-soft: #3a5063; }
html[data-tv-mode="dark"][data-tv-contrast="high"] body.tvillar-app .table > tbody > tr > td,
html[data-tv-mode="dark"][data-tv-contrast="high"] body.tvillar-app table.dataTable > tbody > tr > td { color: #fff !important; border-bottom-color: #40586c !important; }
html[data-tv-mode="dark"][data-tv-contrast="high"] body.tvillar-app label,
html[data-tv-mode="dark"][data-tv-contrast="high"] body.tvillar-app .control-label { color: #f0f6fa !important; }
html[data-tv-mode="dark"][data-tv-contrast="high"] body.tvillar-app .form-control::placeholder { color: #acbdca !important; }

body.tvillar-app button:focus-visible,
body.tvillar-app a:focus-visible,
body.tvillar-app input:focus-visible,
body.tvillar-app select:focus-visible,
body.tvillar-app textarea:focus-visible { outline: 3px solid rgba(var(--tv-accent-rgb),.50) !important; outline-offset: 2px; }
body.tvillar-app .btn[disabled],
body.tvillar-app button[disabled] { cursor: not-allowed !important; opacity: .58 !important; transform: none !important; box-shadow: none !important; }
body.tvillar-app td.dataTables_empty { min-height: 150px; padding: 48px 20px !important; color: var(--tv-muted) !important; font-size: 13px !important; font-weight: 650; text-align: center; background: radial-gradient(circle at center, rgba(var(--tv-accent-rgb),.07), transparent 12rem) !important; }

.tv-route-view.tv-route-loading::before {
    content: "";
    position: fixed;
    top: var(--tv-header-height);
    right: 0;
    left: var(--tv-sidebar-width);
    z-index: 1060;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--tv-teal-500), var(--tv-coral-500), transparent);
    background-size: 220% 100%;
    animation: tvRouteProgress .9s linear infinite;
}
body.tvillar-app.tv-sidebar-collapsed .tv-route-view.tv-route-loading::before { left: 0; }
@keyframes tvRouteProgress { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Dark appearance */
html[data-tv-mode="dark"] body.tvillar-app::before { background: radial-gradient(circle at 92% 5%, rgba(var(--tv-accent-rgb),.12), transparent 24rem), linear-gradient(135deg, rgba(255,255,255,.025), transparent 48%); }
html[data-tv-mode="dark"] body.tvillar-app .panel,
html[data-tv-mode="dark"] body.tvillar-app .box,
html[data-tv-mode="dark"] body.tvillar-app .app-card,
html[data-tv-mode="dark"] body.tvillar-app .cfg-card,
html[data-tv-mode="dark"] body.tvillar-app .modal-content,
html[data-tv-mode="dark"] body.tvillar-app .user-menu-card,
html[data-tv-mode="dark"] body.tvillar-app .dropdown-menu { color: var(--tv-ink) !important; border-color: var(--tv-line) !important; background: var(--tv-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .panel-heading,
html[data-tv-mode="dark"] body.tvillar-app .box-header,
html[data-tv-mode="dark"] body.tvillar-app .modal-header,
html[data-tv-mode="dark"] body.tvillar-app .user-card-header { color: #fff !important; border-color: var(--tv-line-soft) !important; background: linear-gradient(110deg, #122536, #10212f) !important; }
html[data-tv-mode="dark"] body.tvillar-app .panel-body,
html[data-tv-mode="dark"] body.tvillar-app .box-body,
html[data-tv-mode="dark"] body.tvillar-app .modal-body,
html[data-tv-mode="dark"] body.tvillar-app .panel-footer,
html[data-tv-mode="dark"] body.tvillar-app .box-footer,
html[data-tv-mode="dark"] body.tvillar-app .modal-footer { color: var(--tv-ink) !important; border-color: var(--tv-line-soft) !important; background: var(--tv-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app label,
html[data-tv-mode="dark"] body.tvillar-app .control-label { color: #becbd6 !important; }
html[data-tv-mode="dark"] body.tvillar-app .form-control,
html[data-tv-mode="dark"] body.tvillar-app .select2-container .select2-selection--single,
html[data-tv-mode="dark"] body.tvillar-app .select2-container--default .select2-selection--multiple,
html[data-tv-mode="dark"] body.tvillar-app .chosen-container-single .chosen-single,
html[data-tv-mode="dark"] body.tvillar-app .input-group-addon { color: var(--tv-ink) !important; border-color: #34495c !important; background: #0d1b28 !important; }
html[data-tv-mode="dark"] body.tvillar-app .btn-default,
html[data-tv-mode="dark"] body.tvillar-app .mtto-btn--secondary { color: var(--tv-ink) !important; border-color: #34495c !important; background: #142536 !important; }
html[data-tv-mode="dark"] body.tvillar-app table.table,
html[data-tv-mode="dark"] body.tvillar-app table.dataTable { color: var(--tv-ink); border-color: var(--tv-line) !important; background: var(--tv-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr > td,
html[data-tv-mode="dark"] body.tvillar-app table.dataTable > tbody > tr > td { color: #cedae4 !important; border-color: var(--tv-line-soft) !important; }
html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr:nth-child(even),
html[data-tv-mode="dark"] body.tvillar-app table.dataTable.stripe > tbody > tr:nth-child(even) { background: #122433 !important; }
html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr,
html[data-tv-mode="dark"] body.tvillar-app .table-striped > tbody > tr:nth-of-type(odd) { background: var(--tv-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr.odd,
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr.even,
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr:nth-of-type(odd),
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr:nth-of-type(even) { background: var(--tv-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr:hover,
html[data-tv-mode="dark"] body.tvillar-app table.dataTable > tbody > tr:hover { background: #173044 !important; }
html[data-tv-mode="dark"] body.tvillar-app .table td .btn,
html[data-tv-mode="dark"] body.tvillar-app .table td button:not(.mtto-btn) { color: #dce8f0 !important; border-color: #385064 !important; background-color: #142738 !important; }
html[data-tv-mode="dark"] body.tvillar-app .well,
html[data-tv-mode="dark"] body.tvillar-app .jumbotron { color: var(--tv-ink); border-color: var(--tv-line) !important; background: #10202e !important; }
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs > li > a,
html[data-tv-mode="dark"] body.tvillar-app .dropdown-menu > li > a { color: #bdcbd7; }
html[data-tv-mode="dark"] body.tvillar-app .dropdown-menu > li > a:hover { color: #fff; background: #1a3144; }
html[data-tv-mode="dark"] .tv-theme-modes button.is-selected { color: var(--tv-accent-on-dark); background: rgba(var(--tv-accent-rgb),.16); }

/* Dark theme completion: shared controls, overlays and route-specific surfaces. */
html[data-tv-mode="dark"] body.tvillar-app {
    --tv-dark-surface: #0f1e2b;
    --tv-dark-raised: #142638;
    --tv-dark-soft: #192d3f;
    --tv-dark-line: #294156;
    --tv-dark-text: #e7eef5;
    --tv-dark-muted: #9fb0c0;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group { background: transparent !important; }
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill) {
    border-color: #34495c;
    background: #0d1b28 !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.18);
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill):hover { border-color: #516a7f; }
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill):focus-within {
    border-color: var(--tv-teal-500);
    box-shadow: 0 0 0 4px rgba(var(--tv-accent-rgb),.18);
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .input-group-addon {
    color: #bcd0de !important;
    border-color: #34495c !important;
    background: #142536 !important;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .form-control {
    color: var(--tv-dark-text) !important;
    background: #0d1b28 !important;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .form-control[disabled],
html[data-tv-mode="dark"] body.tvillar-app .input-group.tv-input-composite:not(.input-pill) > .form-control[readonly] {
    color: #a9bac8 !important;
    background: #101f2d !important;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill {
    border-color: #34495c;
    background: #0d1b28 !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.18);
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill:hover { border-color: #516a7f; }
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill:focus-within {
    border-color: var(--tv-teal-500);
    box-shadow: 0 0 0 4px rgba(var(--tv-accent-rgb),.18);
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .form-control {
    color: var(--tv-dark-text) !important;
    background: #0d1b28 !important;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .form-control[disabled],
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .form-control[readonly] {
    color: #a9bac8 !important;
    background: #101f2d !important;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .input-group-addon,
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .input-group-btn > .btn,
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .input-group-btn > .btn-flat {
    color: #bcd0de !important;
    border-color: #34495c !important;
    background: #142536 !important;
}
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .input-group-btn > .btn:hover,
html[data-tv-mode="dark"] body.tvillar-app .input-group.input-pill > .input-group-btn > .btn:focus {
    color: #fff !important;
    background: rgba(var(--tv-accent-rgb),.23) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn > .btn-danger {
    color: #ff8da0 !important;
    border-color: rgba(255,112,137,.34) !important;
    background: rgba(210,49,78,.13) !important;
    box-shadow: none !important;
}
html[data-tv-mode="dark"] body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn > .btn-danger:hover,
html[data-tv-mode="dark"] body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn > .btn-danger:focus {
    color: #ffc1cc !important;
    border-color: rgba(255,142,160,.55) !important;
    background: rgba(223,61,90,.22) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .form-control::placeholder { color: #73879a !important; opacity: 1; }
html[data-tv-mode="dark"] body.tvillar-app .form-control[disabled],
html[data-tv-mode="dark"] body.tvillar-app .form-control[readonly],
html[data-tv-mode="dark"] body.tvillar-app fieldset[disabled] .form-control { color: #8799aa !important; background: #101f2d !important; opacity: 1; }
html[data-tv-mode="dark"] body.tvillar-app select option { color: var(--tv-dark-text); background: var(--tv-dark-raised); }
html[data-tv-mode="dark"] body.tvillar-app .help-block,
html[data-tv-mode="dark"] body.tvillar-app .text-muted,
html[data-tv-mode="dark"] body.tvillar-app small { color: var(--tv-dark-muted) !important; }
html[data-tv-mode="dark"] body.tvillar-app hr { border-color: var(--tv-dark-line) !important; }
html[data-tv-mode="dark"] body.tvillar-app #footer { color: var(--tv-dark-muted); border-color: var(--tv-dark-line); background: #091724 !important; }
html[data-tv-mode="dark"] body.tvillar-app #footer strong { color: var(--tv-accent-on-dark); }
html[data-tv-mode="dark"] body.tvillar-app .pagination > li > a,
html[data-tv-mode="dark"] body.tvillar-app .pagination > li > span { color: #c5d2de !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }
html[data-tv-mode="dark"] body.tvillar-app .pagination > .active > a,
html[data-tv-mode="dark"] body.tvillar-app .pagination > .active > span { color: #fff !important; border-color: var(--tv-teal-500) !important; background: var(--tv-teal-600) !important; }
html[data-tv-mode="dark"] body.tvillar-app .pagination > .disabled > a,
html[data-tv-mode="dark"] body.tvillar-app .pagination > .disabled > span { color: #66798b !important; background: #0c1925 !important; }
html[data-tv-mode="dark"] body.tvillar-app .dataTables_info,
html[data-tv-mode="dark"] body.tvillar-app .dataTables_length,
html[data-tv-mode="dark"] body.tvillar-app .dataTables_filter { color: var(--tv-dark-muted) !important; }
html[data-tv-mode="dark"] body.tvillar-app .dataTables_filter input {
    color: var(--tv-dark-text) !important;
    border-color: #344c60 !important;
    background: #0d1d2a !important;
}
html[data-tv-mode="dark"] body.tvillar-app .dataTables_filter input:focus {
    border-color: var(--tv-teal-500) !important;
    background: #102433 !important;
    box-shadow: 0 0 0 3px rgba(var(--tv-accent-rgb),.16) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs { border-color: var(--tv-dark-line) !important; }
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs {
    background: #0c1a27 !important;
}
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs > li > a:hover {
    color: #fff !important;
    background: var(--tv-dark-soft) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs > li.active > a,
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs > li.active > a:hover,
html[data-tv-mode="dark"] body.tvillar-app .nav-tabs > li.active > a:focus { color: #fff !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }

html[data-tv-mode="dark"] body.tvillar-app .select2-dropdown,
html[data-tv-mode="dark"] body.tvillar-app .select2-container--default .select2-results__option,
html[data-tv-mode="dark"] body.tvillar-app .chosen-container .chosen-drop,
html[data-tv-mode="dark"] body.tvillar-app .chosen-container .chosen-results,
html[data-tv-mode="dark"] body.tvillar-app .ui-datepicker,
html[data-tv-mode="dark"] body.tvillar-app .ui-autocomplete,
html[data-tv-mode="dark"] body.tvillar-app .bootstrap-datetimepicker-widget,
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }
/* SweetAlert2 legacy draws success with opaque animated masks. They must
   match the popup surface; the vendor's white masks otherwise remain visible. */
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal .swal2-icon.swal2-success::before,
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal .swal2-icon.swal2-success::after,
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal .swal2-icon.swal2-success .fix {
    background: var(--tv-dark-raised) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal h2,
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal .swal2-content {
    color: var(--tv-dark-text) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .swal2-modal .swal2-content {
    font-weight: 400;
    line-height: 1.5;
}
html[data-tv-mode="dark"] body.tvillar-app .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-tv-mode="dark"] body.tvillar-app .select2-container--default .select2-results__option[aria-selected="true"],
html[data-tv-mode="dark"] body.tvillar-app .chosen-container .chosen-results li.highlighted,
html[data-tv-mode="dark"] body.tvillar-app .ui-menu-item-wrapper.ui-state-active { color: #fff !important; background: var(--tv-teal-600) !important; }
html[data-tv-mode="dark"] body.tvillar-app .modal-backdrop { background: #020810 !important; }
html[data-tv-mode="dark"] body.tvillar-app .modal-backdrop.in { opacity: .48 !important; }
html[data-tv-mode="dark"] body.tvillar-app #modalFacturasViaje .modal-body,
html[data-tv-mode="dark"] body.tvillar-app #modalFacturasViaje .modal-footer { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }

html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr,
html[data-tv-mode="dark"] body.tvillar-app table.dataTable > tbody > tr,
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr.odd,
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr:nth-of-type(odd) { background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr:nth-child(even),
html[data-tv-mode="dark"] body.tvillar-app table.dataTable > tbody > tr.even,
html[data-tv-mode="dark"] body.tvillar-app table.table.table-striped > tbody > tr:nth-of-type(even) { background: #122535 !important; }
html[data-tv-mode="dark"] body.tvillar-app .table > tbody > tr:hover,
html[data-tv-mode="dark"] body.tvillar-app table.dataTable > tbody > tr:hover { background: #19344a !important; }
html[data-tv-mode="dark"] body.tvillar-app .table td .tv-icon-action[data-tv-tone="info"],
html[data-tv-mode="dark"] body.tvillar-app table td .tv-icon-action[data-tv-tone="info"] {
    color: #70c9e7 !important;
    border-color: rgba(112,201,231,.34) !important;
    background: rgba(42,139,176,.16) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .table td .tv-icon-action[data-tv-tone="success"],
html[data-tv-mode="dark"] body.tvillar-app table td .tv-icon-action[data-tv-tone="success"] {
    color: #63d8bd !important;
    border-color: rgba(99,216,189,.34) !important;
    background: rgba(24,153,126,.16) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .table td .tv-icon-action[data-tv-tone="danger"],
html[data-tv-mode="dark"] body.tvillar-app table td .tv-icon-action[data-tv-tone="danger"] {
    color: #ff8298 !important;
    border-color: rgba(255,130,152,.35) !important;
    background: rgba(214,57,84,.16) !important;
}

/* Dashboard */
html[data-tv-mode="dark"] body.tvillar-app .home-dash-hero { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: radial-gradient(circle at 92% 0%, rgba(var(--tv-accent-rgb),.20), transparent 24rem), linear-gradient(135deg, #102233, #0c1b28) !important; }
html[data-tv-mode="dark"] body.tvillar-app .home-dash-meta-chip { color: #c9d6e1 !important; border-color: var(--tv-dark-line) !important; background: rgba(255,255,255,.06) !important; }
html[data-tv-mode="dark"] body.tvillar-app .home-dash-kpi,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-panel,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-status-card,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-docctrl-card,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-coverage-card,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-docctrl-subpanel { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; box-shadow: 0 12px 30px rgba(0,0,0,.16) !important; }
html[data-tv-mode="dark"] body.tvillar-app .home-dash-quick-link,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-bar-item,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-doc-item,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-docalert-item,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-missing-item,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-empty,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-table-wrap { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .home-dash-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-shell h3,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-shell strong,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-kpi-value,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-panel-title { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .home-dash-copy,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-panel-copy,
html[data-tv-mode="dark"] body.tvillar-app .home-dash-kpi-foot { color: var(--tv-dark-muted) !important; }

/* Taller, almacén e inventario */
html[data-tv-mode="dark"] body.tvillar-app .os-filter-shell,
html[data-tv-mode="dark"] body.tvillar-app .os-summary-card,
html[data-tv-mode="dark"] body.tvillar-app .os-radar-card,
html[data-tv-mode="dark"] body.tvillar-app .os-kpi-card,
html[data-tv-mode="dark"] body.tvillar-app .os-panel,
html[data-tv-mode="dark"] body.tvillar-app .os-tech-card,
html[data-tv-mode="dark"] body.tvillar-app .os-evidence-card,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-form-panel,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-summary-panel,
html[data-tv-mode="dark"] body.tvillar-app .taller-lite-panel,
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-section { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-signal-item,
html[data-tv-mode="dark"] body.tvillar-app .os-checklist-item,
html[data-tv-mode="dark"] body.tvillar-app .os-empty-state,
html[data-tv-mode="dark"] body.tvillar-app .os-direct-box,
html[data-tv-mode="dark"] body.tvillar-app .os-meta-item,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-intro,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-field-card,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-hint-box,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-status-card,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-summary-card,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-target-card,
html[data-tv-mode="dark"] body.tvillar-app .taller-import-note,
html[data-tv-mode="dark"] body.tvillar-app .taller-ops-box,
html[data-tv-mode="dark"] body.tvillar-app .taller-ops-card,
html[data-tv-mode="dark"] body.tvillar-app .taller-ops-item,
html[data-tv-mode="dark"] body.tvillar-app .taller-ops-empty,
html[data-tv-mode="dark"] body.tvillar-app .taller-table-shell { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-filter-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .os-filter-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .os-summary-card strong,
html[data-tv-mode="dark"] body.tvillar-app .os-summary-value,
html[data-tv-mode="dark"] body.tvillar-app .os-panel-title,
html[data-tv-mode="dark"] body.tvillar-app .os-direct-box-title,
html[data-tv-mode="dark"] body.tvillar-app .taller-lite-panel h1,
html[data-tv-mode="dark"] body.tvillar-app .taller-lite-panel h2,
html[data-tv-mode="dark"] body.tvillar-app .taller-lite-panel h3,
html[data-tv-mode="dark"] body.tvillar-app .taller-lite-title { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-panel-subtitle,
html[data-tv-mode="dark"] body.tvillar-app .os-summary-label,
html[data-tv-mode="dark"] body.tvillar-app .os-summary-note,
html[data-tv-mode="dark"] body.tvillar-app .os-meta-item strong,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-intro span,
html[data-tv-mode="dark"] body.tvillar-app .taller-lite-subtitle,
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-section__head small,
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-hint { color: var(--tv-dark-muted) !important; }
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-section__head strong { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-field label { color: #c8d6e1 !important; }
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-field .taller-piece-required { color: #ff91a3 !important; }
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-field .taller-piece-optional { color: #aebdcc !important; }
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-chip.is-soft,
html[data-tv-mode="dark"] body.tvillar-app .taller-piece-chip.is-info { color: #cfe1ee !important; background: var(--tv-dark-soft) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-action-primary { color: #fff !important; border-color: var(--tv-teal-500) !important; background: linear-gradient(135deg, var(--tv-navy-700), var(--tv-teal-600)) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-action-secondary,
html[data-tv-mode="dark"] body.tvillar-app .os-chip-btn.is-soft { color: #dce8f1 !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-soft) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-chip-btn.is-warn { color: #ffd27f !important; border-color: rgba(242,184,75,.30) !important; background: rgba(242,184,75,.12) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-meta-item span,
html[data-tv-mode="dark"] body.tvillar-app .os-kpi-title,
html[data-tv-mode="dark"] body.tvillar-app .os-kpi-value,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-intro strong { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .os-picker-btn {
    color: #dce8f1 !important;
    border-color: var(--tv-dark-line) !important;
    background: var(--tv-dark-soft) !important;
    box-shadow: none !important;
}
html[data-tv-mode="dark"] body.tvillar-app .os-picker-btn:hover,
html[data-tv-mode="dark"] body.tvillar-app .os-picker-btn:focus {
    color: #fff !important;
    border-color: var(--tv-teal-500) !important;
    background: #1b354a !important;
}
html[data-tv-mode="dark"] body.tvillar-app .os-modal-header,
html[data-tv-mode="dark"] body.tvillar-app .os-modal-body,
html[data-tv-mode="dark"] body.tvillar-app .os-modal-footer,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-modal .os-modal-header,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-modal .os-modal-body,
html[data-tv-mode="dark"] body.tvillar-app .os-preventive-modal .os-modal-footer {
    color: var(--tv-dark-text) !important;
    border-color: var(--tv-dark-line) !important;
    background: var(--tv-dark-surface) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .modal .os-modal-header .tv-modal-close {
    color: #d9e6ef !important;
    border-color: #3c566c !important;
    background: #172b3c !important;
}
html[data-tv-mode="dark"] body.tvillar-app .modal .os-modal-header .tv-modal-close:hover,
html[data-tv-mode="dark"] body.tvillar-app .modal .os-modal-header .tv-modal-close:focus {
    color: #fff !important;
    border-color: var(--tv-teal-500) !important;
    background: #1b354a !important;
}

/* Punto de venta y caja */
html[data-tv-mode="dark"] body.tvillar-app .caja-card,
html[data-tv-mode="dark"] body.tvillar-app .pos-hero,
html[data-tv-mode="dark"] body.tvillar-app .pos-card { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; box-shadow: 0 12px 28px rgba(0,0,0,.15) !important; }
html[data-tv-mode="dark"] body.tvillar-app .caja-pill,
html[data-tv-mode="dark"] body.tvillar-app .pos-pill,
html[data-tv-mode="dark"] body.tvillar-app .pos-cat,
html[data-tv-mode="dark"] body.tvillar-app .pos-prod,
html[data-tv-mode="dark"] body.tvillar-app .pos-pay,
html[data-tv-mode="dark"] body.tvillar-app .pos-total { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .caja-card h1,
html[data-tv-mode="dark"] body.tvillar-app .caja-card h2,
html[data-tv-mode="dark"] body.tvillar-app .caja-card h3,
html[data-tv-mode="dark"] body.tvillar-app .pos-hero h1,
html[data-tv-mode="dark"] body.tvillar-app .pos-hero h2,
html[data-tv-mode="dark"] body.tvillar-app .pos-card h1,
html[data-tv-mode="dark"] body.tvillar-app .pos-card h2,
html[data-tv-mode="dark"] body.tvillar-app .pos-card h3 { color: var(--tv-dark-text) !important; }

/* Finanzas */
html[data-tv-mode="dark"] body.tvillar-app .ge-command-surface,
html[data-tv-mode="dark"] body.tvillar-app .ge-filter-surface,
html[data-tv-mode="dark"] body.tvillar-app .ge-analytics-surface,
html[data-tv-mode="dark"] body.tvillar-app .ge-operation-surface,
html[data-tv-mode="dark"] body.tvillar-app .ge-performance-surface,
html[data-tv-mode="dark"] body.tvillar-app .ge-table-surface,
html[data-tv-mode="dark"] body.tvillar-app .ge-alias-panel,
html[data-tv-mode="dark"] body.tvillar-app .cf-filter-surface,
html[data-tv-mode="dark"] body.tvillar-app .cf-table-block,
html[data-tv-mode="dark"] body.tvillar-app .cf-table-shell,
html[data-tv-mode="dark"] body.tvillar-app .cf-section-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-sub-block,
html[data-tv-mode="dark"] body.tvillar-app .cf-accordion-shell,
html[data-tv-mode="dark"] body.tvillar-app .cf-inv-bridge-shell,
html[data-tv-mode="dark"] body.tvillar-app .cf-provider-table-shell { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }
html[data-tv-mode="dark"] body.tvillar-app .ge-kpi-card,
html[data-tv-mode="dark"] body.tvillar-app .ge-analytic-card,
html[data-tv-mode="dark"] body.tvillar-app .ge-performance-card,
html[data-tv-mode="dark"] body.tvillar-app .ge-rank-item,
html[data-tv-mode="dark"] body.tvillar-app .ge-modal-card,
html[data-tv-mode="dark"] body.tvillar-app .ge-mini-table-empty,
html[data-tv-mode="dark"] body.tvillar-app .ge-highlight-empty,
html[data-tv-mode="dark"] body.tvillar-app .ge-chart-empty,
html[data-tv-mode="dark"] body.tvillar-app .cf-kpi-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-action-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-aging-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-flow-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-note-pill,
html[data-tv-mode="dark"] body.tvillar-app .cf-provider-summary-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-inv-bridge-card,
html[data-tv-mode="dark"] body.tvillar-app .cf-inv-bridge-empty { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .ge-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .ge-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .ge-shell h3,
html[data-tv-mode="dark"] body.tvillar-app .ge-shell strong,
html[data-tv-mode="dark"] body.tvillar-app .cf-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .cf-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .cf-shell h3,
html[data-tv-mode="dark"] body.tvillar-app .cf-shell strong { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .cf-hero-copy p,
html[data-tv-mode="dark"] body.tvillar-app .ge-shell__body p { color: var(--tv-dark-muted) !important; }

/* Depósito */
html[data-tv-mode="dark"] body.tvillar-app .dep-shell { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: #0b1925 !important; }
html[data-tv-mode="dark"] body.tvillar-app .dep-module-card,
html[data-tv-mode="dark"] body.tvillar-app .dep-dark-card,
html[data-tv-mode="dark"] body.tvillar-app .dep-section-card,
html[data-tv-mode="dark"] body.tvillar-app .dep-table-card { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }
html[data-tv-mode="dark"] body.tvillar-app .dep-help,
html[data-tv-mode="dark"] body.tvillar-app .dep-flow-card,
html[data-tv-mode="dark"] body.tvillar-app .dep-step-card,
html[data-tv-mode="dark"] body.tvillar-app .dep-quick-item,
html[data-tv-mode="dark"] body.tvillar-app .dep-kpi,
html[data-tv-mode="dark"] body.tvillar-app .dep-repair-preview,
html[data-tv-mode="dark"] body.tvillar-app .dep-autocomplete-list { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .dep-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .dep-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .dep-shell h3,
html[data-tv-mode="dark"] body.tvillar-app .dep-shell h4,
html[data-tv-mode="dark"] body.tvillar-app .dep-shell strong { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .dep-title,
html[data-tv-mode="dark"] body.tvillar-app .dep-module-title,
html[data-tv-mode="dark"] body.tvillar-app .dep-kpi-value,
html[data-tv-mode="dark"] body.tvillar-app .dep-flow-step { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .dep-subtitle,
html[data-tv-mode="dark"] body.tvillar-app .dep-module-desc,
html[data-tv-mode="dark"] body.tvillar-app .dep-kpi-label,
html[data-tv-mode="dark"] body.tvillar-app .dep-flow-text { color: var(--tv-dark-muted) !important; }

/* Configuración y nómina */
html[data-tv-mode="dark"] body.tvillar-app .cfg-logo-box { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-surface) !important; }
html[data-tv-mode="dark"] body.tvillar-app .cfg-logo-preview { border-color: var(--tv-dark-line) !important; background: repeating-conic-gradient(#f4f7fa 0 25%, #e5ebf0 0 50%) 50% / 14px 14px !important; }
html[data-tv-mode="dark"] body.tvillar-app .nomgen-card,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-filter-card,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-block,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-kpi-card,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-detail-card,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-flow-card,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-empty,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-table-shell,
html[data-tv-mode="dark"] body.tvillar-app .nopre-card,
html[data-tv-mode="dark"] body.tvillar-app .nopre-filter-card,
html[data-tv-mode="dark"] body.tvillar-app .nopre-block,
html[data-tv-mode="dark"] body.tvillar-app .nopre-liquidacion-block,
html[data-tv-mode="dark"] body.tvillar-app .nopre-liquidacion-card,
html[data-tv-mode="dark"] body.tvillar-app .nopre-liquidacion-shell,
html[data-tv-mode="dark"] body.tvillar-app .nopre-trips-shell,
html[data-tv-mode="dark"] body.tvillar-app .nopre-trips-table-card,
html[data-tv-mode="dark"] body.tvillar-app .nopre-trips-table-shell { color: var(--tv-dark-text) !important; border-color: var(--tv-dark-line) !important; background: var(--tv-dark-raised) !important; }
html[data-tv-mode="dark"] body.tvillar-app .nomgen-body,
html[data-tv-mode="dark"] body.tvillar-app .nopre-body { color: var(--tv-dark-text) !important; background: #0d1c29 !important; }
html[data-tv-mode="dark"] body.tvillar-app .nomgen-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-shell h3,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-shell strong,
html[data-tv-mode="dark"] body.tvillar-app .nopre-shell h1,
html[data-tv-mode="dark"] body.tvillar-app .nopre-shell h2,
html[data-tv-mode="dark"] body.tvillar-app .nopre-shell h3,
html[data-tv-mode="dark"] body.tvillar-app .nopre-shell strong { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .home-dash-kpi-label,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-kpi-eyebrow,
html[data-tv-mode="dark"] body.tvillar-app .nomgen-filter-note,
html[data-tv-mode="dark"] body.tvillar-app .nopre-filter-note { color: var(--tv-dark-muted) !important; }

/* Operadores 360: elimina superficies claras residuales en filtros y modales RH. */
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-toolbar-card,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-card,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-checkitem,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-empty {
    color: var(--tv-dark-text) !important;
    border-color: var(--tv-dark-line) !important;
    background: var(--tv-dark-raised) !important;
    box-shadow: 0 12px 28px rgba(0,0,0,.16) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-card--hero {
    background: radial-gradient(circle at top right, rgba(var(--tv-accent-rgb),.14), transparent 34%), var(--tv-dark-raised) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-card h4,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-card h5,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-value { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-label,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-copy,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-side-copy,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-checkcopy,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-footnote,
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-history { color: var(--tv-dark-muted) !important; }
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-chip {
    color: #c9d7e2 !important;
    border-color: #385269 !important;
    background: #172c3e !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-chip--alert {
    color: #f2c67b !important;
    border-color: #68522f !important;
    background: #392e1d !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-rh-table thead th {
    color: #e5edf4 !important;
    border-color: #35516a !important;
    background: #18374f !important;
}
html[data-tv-mode="dark"] body.tvillar-app .foto-uploader {
    border-color: #496176 !important;
    background: #0d1d2b !important;
}
html[data-tv-mode="dark"] body.tvillar-app .foto-preview {
    color: #9fb0bf !important;
    background: #182c3d !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-modal .modal-content {
    color: var(--tv-dark-text) !important;
    background: radial-gradient(circle at top right, rgba(var(--tv-accent-rgb),.13), transparent 28%), var(--tv-dark-surface) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-modal .modal-header {
    border-color: var(--tv-dark-line) !important;
    background: linear-gradient(135deg, rgba(var(--tv-accent-rgb),.14), transparent 58%), var(--tv-dark-raised) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-header__eyebrow,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-header__chip {
    color: #cedbe5 !important;
    border-color: #3b5468 !important;
    background: #172b3d !important;
    box-shadow: none !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-modal .modal-title,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-summary__value,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card__title,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card__heading { color: var(--tv-dark-text) !important; }
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-header__text,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card__text,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card__copy,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-copy { color: var(--tv-dark-muted) !important; }
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-summary__item,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card--hero {
    color: var(--tv-dark-text) !important;
    border-color: var(--tv-dark-line) !important;
    background: var(--tv-dark-raised) !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.15) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card__eyebrow,
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-card__kicker {
    color: var(--tv-accent-on-dark) !important;
    background: rgba(var(--tv-accent-rgb),.14) !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-field label { color: #c8d5df !important; }
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-field .input-group-addon {
    color: #aebfcd !important;
    border-color: #385166 !important;
    background: #132637 !important;
}
html[data-tv-mode="dark"] body.tvillar-app .oper-deduccion-modal .modal-footer {
    border-color: var(--tv-dark-line) !important;
    background: var(--tv-dark-surface) !important;
}

/* Semantic actions keep their meaning without introducing white islands. */
html[data-tv-mode="dark"] body.tvillar-app #btnDesRepHist { color: #8ce0ba !important; border-color: rgba(65,190,130,.34) !important; background: rgba(38,145,96,.15) !important; }
html[data-tv-mode="dark"] body.tvillar-app #btnRecuperaTimbradoStuck { color: #ffd27f !important; border-color: rgba(242,184,75,.34) !important; background: rgba(242,184,75,.13) !important; }

/* Login */
html.tvillar-login-shell,
body.tvillar-login { min-height: 100%; }
body.tvillar-login *,
body.tvillar-login *::before,
body.tvillar-login *::after { box-sizing: border-box; }
body.tvillar-login.bg-black {
    position: relative;
    overflow-x: hidden;
    color: var(--tv-ink) !important;
    font-family: Inter, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background:
        radial-gradient(circle at 13% 14%, rgba(11,166,166,.20), transparent 24rem),
        radial-gradient(circle at 92% 86%, rgba(240,75,103,.14), transparent 26rem),
        linear-gradient(145deg, #eaf3f6 0%, #f8fbfc 46%, #edf4f7 100%) !important;
}
body.tvillar-login::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .34; background-image: radial-gradient(rgba(18,54,87,.24) .65px, transparent .65px); background-size: 19px 19px; mask-image: linear-gradient(120deg, #000, transparent 62%); }
body.tvillar-login .auth-wrapper {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 38px 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
    align-items: stretch !important;
    gap: 0;
}
.auth-showcase {
    position: relative;
    min-height: 650px;
    display: flex;
    align-items: flex-end;
    padding: clamp(38px, 5vw, 68px);
    overflow: hidden;
    color: #fff;
    border-radius: 32px 0 0 32px;
    background:
        linear-gradient(90deg, rgba(5,20,38,.91) 0%, rgba(5,24,43,.78) 48%, rgba(5,25,43,.30) 100%),
        linear-gradient(0deg, rgba(4,18,33,.76) 0%, rgba(4,18,33,.10) 58%, rgba(4,18,33,.26) 100%),
        url('../img/login-logistics-control-hero.webp') 62% center / cover no-repeat,
        #07182d;
    box-shadow: 0 30px 70px rgba(7,24,45,.20);
}
.auth-showcase::before { content: ""; position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, #000, transparent 72%); }
.auth-showcase::after { display: none; content: none; }
.auth-showcase-orb { display: none; }
.auth-showcase-orb--one { top: 70px; right: 70px; width: 150px; height: 150px; background: linear-gradient(135deg, rgba(255,255,255,.19), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.17); }
.auth-showcase-orb--two { top: 155px; right: 185px; width: 52px; height: 52px; background: var(--tv-coral-500); box-shadow: 0 20px 45px rgba(240,75,103,.28); }
.auth-showcase-content { position: relative; z-index: 2; max-width: 580px; }
.auth-showcase-badge { width: fit-content; margin-bottom: 22px; padding: 8px 12px; color: rgba(255,255,255,.88); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.auth-showcase-badge i { margin-right: 6px; color: #78e3da; }
.auth-showcase h1 { margin: 0 0 20px; color: #fff; font-size: clamp(42px, 5vw, 68px); font-weight: 780; line-height: .99; letter-spacing: -.055em; }
.auth-showcase h1 span { color: #75e0d7; }
.auth-showcase-content > p { max-width: 530px; margin: 0 0 32px; color: rgba(235,249,252,.73); font-size: 15px; line-height: 1.65; }
.auth-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.auth-feature { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid rgba(255,255,255,.11); border-radius: 15px; background: rgba(255,255,255,.07); backdrop-filter: blur(10px); }
.auth-feature > i { flex: 0 0 31px; width: 31px; height: 31px; display: flex; align-items: center; justify-content: center; color: #84e7df; border-radius: 9px; background: rgba(255,255,255,.09); }
.auth-feature span { min-width: 0; color: rgba(233,248,251,.62); font-size: 9px; line-height: 1.35; }
.auth-feature strong { display: block; color: #fff; font-size: 10.5px; }

body.tvillar-login .auth-card {
    width: 100% !important;
    max-width: none !important;
    min-height: 650px;
    margin: 0 !important;
    padding: clamp(38px, 5vw, 68px) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(207,220,230,.88) !important;
    border-left: 0 !important;
    border-radius: 0 32px 32px 0 !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 20px 30px 70px rgba(7,24,45,.14) !important;
    backdrop-filter: blur(16px);
}
body.tvillar-login .auth-logo { align-items: flex-start !important; margin-bottom: 25px !important; }
body.tvillar-login .auth-logo img { width: auto !important; max-width: 190px !important; max-height: 78px; object-fit: contain; }
.auth-welcome { margin-bottom: 27px; }
.auth-eyebrow { display: block; margin-bottom: 7px; color: var(--tv-teal-600); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.auth-welcome h2 { margin: 0 0 8px; color: var(--tv-navy-900); font-size: 31px; font-weight: 780; letter-spacing: -.04em; }
.auth-welcome p { margin: 0; color: var(--tv-muted); font-size: 12.5px; line-height: 1.55; }
body.tvillar-login .form-group { margin-bottom: 17px; }
body.tvillar-login .auth-field-label { margin-bottom: 7px; color: #40546a; font-size: 11px; font-weight: 750; }
body.tvillar-login .auth-input-wrapper { min-height: 49px; padding: 4px 11px !important; gap: 9px; border: 1px solid #cedae4 !important; border-radius: 14px !important; background: #f8fafb !important; }
body.tvillar-login .auth-input-wrapper:focus-within { border-color: var(--tv-teal-500) !important; background: #fff !important; box-shadow: 0 0 0 4px rgba(11,166,166,.10) !important; }
body.tvillar-login .auth-input-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--tv-teal-600) !important; border-radius: 9px; background: #e7f7f5; }
body.tvillar-login .auth-input { width: 100%; height: 39px; padding: 0 !important; color: var(--tv-ink) !important; font-size: 13px !important; }
.auth-password-toggle { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; color: var(--tv-subtle); border: 0; border-radius: 9px; background: transparent; }
.auth-password-toggle:hover { color: var(--tv-teal-600); background: #eaf7f6; }
body.tvillar-login .auth-button { min-height: 49px; gap: 11px; border-radius: 14px !important; background: linear-gradient(135deg, var(--tv-navy-800), var(--tv-teal-600)) !important; box-shadow: 0 12px 25px rgba(18,54,87,.22) !important; }
body.tvillar-login .auth-button:hover { background: linear-gradient(135deg, var(--tv-navy-700), var(--tv-teal-500)) !important; box-shadow: 0 16px 32px rgba(7,139,141,.25) !important; transform: translateY(-2px); }
body.tvillar-login .auth-button i { font-size: 11px; }
body.tvillar-login .auth-footer-text { margin-top: 18px; color: var(--tv-subtle); font-size: 10.5px; }

/* Responsive */
@media (max-width: 1180px) {
    .app-page-context { display: none; }
    body.tvillar-app .app-brand-title { max-width: 225px; }
}

@media (max-width: 991px) {
    :root { --tv-sidebar-width: 280px; --tv-header-height: 70px; }
    body.tvillar-app .navbar.app-header { padding: 0 15px !important; }
    body.tvillar-app .navbar.app-header::before { display: none; }
    body.tvillar-app .app-brand { position: static; width: auto; transform: none; }
    body.tvillar-app .leftmenu,
    body.tvillar-app .leftmenu.app-sidebar { transform: translateX(-105%); box-shadow: none; }
    body.tvillar-app .right-side { margin-left: 0 !important; }
    body.tvillar-app::before { left: 0; }
    body.tvillar-app.tv-sidebar-open .leftmenu { transform: translateX(0); box-shadow: 18px 0 48px rgba(3,16,30,.28); }
    body.tvillar-app.tv-sidebar-open .tv-sidebar-backdrop { display: block; }
    body.tvillar-app section.content { padding: 20px 15px 38px !important; }
    body.tvillar-app .app-date-chip { display: none; }
    body.tvillar-app .modal { padding: 8px 0 !important; }
    body.tvillar-app .modal-dialog,
    body.tvillar-app .modal-dialog.modal-lg,
    body.tvillar-app .modal-dialog.modal-xl { width: calc(100% - 18px) !important; margin: 8px auto !important; }
    body.tvillar-app .modal-body { max-height: calc(100vh - 155px); padding: 17px !important; }

    body.tvillar-login .auth-wrapper { width: min(940px, calc(100% - 28px)); grid-template-columns: .9fr 1fr; padding: 24px 0 !important; }
    .auth-showcase { min-height: 610px; padding: 34px; }
    .auth-showcase h1 { font-size: 46px; }
    .auth-feature-grid { grid-template-columns: 1fr; }
    body.tvillar-login .auth-card { min-height: 610px; padding: 40px !important; }
}

@media (max-width: 767px) {
    body.tvillar-app .app-icon-button { flex-basis: 40px; width: 40px !important; height: 40px !important; }
    body.tvillar-app .app-brand-logo { width: 40px !important; height: 40px !important; }
    body.tvillar-app .app-brand-title { max-width: 42vw; font-size: 10.5px !important; }
    body.tvillar-app .app-brand-subtitle { max-width: 42vw; overflow: hidden; font-size: 9px !important; text-overflow: ellipsis; white-space: nowrap; }
    body.tvillar-app .app-user-meta { display: none !important; }
    body.tvillar-app .app-user-avatar { width: 38px !important; height: 38px !important; flex-basis: 38px; }
    body.tvillar-app .panel-heading,
    body.tvillar-app .box-header { min-height: 52px; padding: 14px 16px !important; font-size: 14px !important; }
    body.tvillar-app .panel-body,
    body.tvillar-app .box-body { padding: 16px !important; }
    body.tvillar-app .content .row:not(.tv-preserve-row) { margin-right: -6px; margin-left: -6px; }
    body.tvillar-app .content [class*="col-"] { padding-right: 6px; padding-left: 6px; }
    body.tvillar-app .form-group { margin-bottom: 13px; }
    body.tvillar-app .form-group.tv-form-action-slot {
        min-height: 0;
        align-items: center;
        justify-content: flex-start;
    }
    body.tvillar-app .form-group.tv-form-action-slot > .input-group-btn { justify-content: flex-start; }
    body.tvillar-app .form-control { font-size: 16px !important; }
    body.tvillar-app .btn,
    body.tvillar-app .mtto-btn { min-height: 42px; }
    body.tvillar-app .mtto-actions--primary {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 9px;
    }
    body.tvillar-app .mtto-actions--primary > .btn,
    body.tvillar-app .mtto-actions--primary > .mtto-btn {
        min-width: 0 !important;
        flex: 1 1 135px;
    }
    body.tvillar-app .nav-tabs { flex-wrap: nowrap; overflow-x: auto; }
    body.tvillar-app .nav-tabs > li { flex: 0 0 auto; }
    .tv-footer-inner { justify-content: center; text-align: center; }
    .tv-footer-status { display: none; }

    body.tvillar-login .auth-wrapper { width: min(500px, calc(100% - 24px)); display: flex !important; padding: 20px 0 !important; }
    .auth-showcase { display: none; }
    body.tvillar-login .auth-card { min-width: 0 !important; max-width: 100% !important; min-height: calc(100vh - 40px); padding: 34px 27px !important; overflow: hidden; border: 1px solid rgba(207,220,230,.88) !important; border-radius: 26px !important; box-shadow: 0 22px 55px rgba(7,24,45,.16) !important; }
    body.tvillar-login .auth-input-wrapper { width: 100%; max-width: 100%; }
    body.tvillar-login .auth-input { min-width: 0; width: 0 !important; flex: 1 1 auto; }
    body.tvillar-login .auth-button { width: 100%; max-width: 100%; }
    body.tvillar-login .auth-logo { align-items: center !important; }
    .auth-welcome { text-align: center; }
}

@media (max-width: 575px) {
    body.tvillar-app .app-brand-text { display: none; }
    body.tvillar-app .app-header-left { gap: 10px; }
    body.tvillar-app .app-header-right { margin-left: auto; }
    .tv-theme-panel { width: 100vw; max-width: 100vw; }
    .tv-theme-launcher { top: auto; bottom: 82px; }
    .tv-theme-panel__header { min-height: 96px; padding: 21px 19px; }
    .tv-theme-panel__body { padding: 24px 19px; }
    .tv-theme-panel__footer { padding: 14px 19px 18px; }
    .tv-theme-swatches { gap: 7px; }
}

@media (max-width: 420px) {
    body.tvillar-app section.content { padding-right: 10px !important; padding-left: 10px !important; }
    body.tvillar-app .panel,
    body.tvillar-app .box { border-radius: 16px !important; }
    body.tvillar-app .panel-body,
    body.tvillar-app .box-body { padding: 13px !important; }
    body.tvillar-app .btn,
    body.tvillar-app .mtto-btn { max-width: 100%; }
    body.tvillar-login .auth-card { padding: 28px 21px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Descripción inmediata y uniforme para todos los botones de icono. */
.tv-instant-tooltip {
    position: fixed;
    z-index: 100000;
    width: max-content;
    max-width: min(260px, calc(100vw - 20px));
    padding: 8px 11px;
    color: #fff;
    background: #142a3d;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 9px;
    box-shadow: 0 10px 24px rgba(7,29,48,.22);
    font-family: var(--tv-font, inherit);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    letter-spacing: .01em;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 60ms ease, transform 60ms ease;
}

.tv-instant-tooltip::after {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -6px;
    content: '';
    border: 6px solid transparent;
    border-top-color: #142a3d;
}

.tv-instant-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.tv-instant-tooltip.is-below { transform: translateY(-2px); }
.tv-instant-tooltip.is-below.is-visible { transform: translateY(0); }
.tv-instant-tooltip.is-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #142a3d;
}

html[data-tv-mode="dark"] .tv-instant-tooltip {
    color: #102536;
    background: #f4f8fb;
    border-color: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,.36);
}

html[data-tv-mode="dark"] .tv-instant-tooltip::after {
    border-top-color: #f4f8fb;
}

html[data-tv-mode="dark"] .tv-instant-tooltip.is-below::after {
    border-top-color: transparent;
    border-bottom-color: #f4f8fb;
}

@media print {
    body.tvillar-app > .header,
    body.tvillar-app .leftmenu,
    body.tvillar-app #footer,
    .tv-ui-back-top,
    .tv-instant-tooltip { display: none !important; }
    body.tvillar-app .wrapper { padding-top: 0 !important; }
    body.tvillar-app .right-side { margin-left: 0 !important; }
    body.tvillar-app section.content { padding: 0 !important; }
    body.tvillar-app .panel,
    body.tvillar-app .box { border: 1px solid #ddd !important; box-shadow: none !important; }
}
