/* ========================================================================
   MytsI26 — site.css  (alineado con diseño CarXIntegral)
   ======================================================================== */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
    --myts-primary:            #4285f4;
    --myts-primary-dark:       #2f6fd6;
    --myts-accent:             #6a9df7;
    --myts-sidebar-width:      248px;
    --myts-sidebar-collapsed:  64px;
    --myts-topbar-height:      60px;
    --myts-bg:                 #f3f7fa;
    --myts-card-bg:            #ffffff;
    --myts-text:               #1e293b;
    --myts-text-muted:         #64748b;
    --myts-border:             #cbd5e1;
    --myts-success:            #34a853;
    --myts-warning:            #fbbc04;
    --myts-danger:             #ea4335;
    --myts-sidebar-bg:         #ffffff;
    --myts-sidebar-text:       #475569;
    --myts-sidebar-active:     #2f6fd6;
    --myts-sidebar-hover:      #f8fafc;
    --myts-glass-bg:           linear-gradient(135deg, rgba(255,255,255,.62), rgba(255,255,255,.34));
    --myts-glass-border:       rgba(255,255,255,.56);
    --myts-glass-shadow:       0 10px 26px rgba(15,23,42,.10);
    --myts-transition:         .2s ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
@media (min-width: 992px) { html { font-size: 15px; } }
body {
    background-color: var(--myts-bg);
    color: var(--myts-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Blindaje de tema claro para evitar overrides accidentales de colores globales */
html[data-bs-theme="light"] {
    --myts-bg: #f1f5f9;                 /* Bright, clean canvas background */
    --myts-card-bg: #ffffff;            /* Pure white card bg to create high contrast with canvas */
    --myts-border: #cbd5e1;             /* Solid, visible gray-blue border */
    --myts-sidebar-bg: #f8fafc;         /* Cool, clean gray-blue sidebar */
    --myts-topbar-bg: #ffffff;          /* Topbar matches card background */
    --myts-card-header-bg: #f8fafc;     /* Clean, light gray-blue for headers */
    
    /* Bootstrap theme color overrides */
    --bs-body-bg: #f1f5f9;
    --bs-card-bg: #ffffff;
    --bs-border-color: #cbd5e1;
    --bs-card-border-color: #cbd5e1;
    --bs-list-group-bg: #ffffff;
    --bs-list-group-border-color: #cbd5e1;
    --bs-modal-bg: #ffffff;
    --bs-modal-border-color: #cbd5e1;
}
html[data-bs-theme="light"] body {
    background-color: #f1f5f9 !important;
    background-image: radial-gradient(at 50% 0%, #ffffff 0%, #f1f5f9 50%, #e2e8f0 100%) !important;
    background-attachment: fixed !important;
}

/* Light theme card enhancements (shadows, top inner highlights, and hovers) */
html[data-bs-theme="light"] .dash-card,
html[data-bs-theme="light"] .table-card,
html[data-bs-theme="light"] .config-card,
html[data-bs-theme="light"] .dashboard-shell {
    border-radius: 0.5rem !important;
    border-color: var(--myts-border) !important;
    box-shadow: 
        0 4px 6px -1px rgba(15, 23, 42, 0.08), 
        0 2px 4px -2px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* table-card nunca se levanta con transform en hover:
   el .dataTables_processing está posicionado dentro del card y si el card
   se mueve al hacer hover el puntero sale/entra del card creando espasmos. */
html[data-bs-theme="light"] .dash-card:hover,
html[data-bs-theme="light"] .config-card:hover {
    border-color: rgba(66, 133, 244, 0.42) !important;
    box-shadow: 
        0 10px 15px -3px rgba(15, 23, 42, 0.08), 
        0 4px 6px -4px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(66, 133, 244, 0.05) !important;
    transform: translateY(-2px) !important;
}

html[data-bs-theme="light"] .table-card:hover {
    border-color: rgba(66, 133, 244, 0.42) !important;
    box-shadow: 
        0 10px 15px -3px rgba(15, 23, 42, 0.08), 
        0 4px 6px -4px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(66, 133, 244, 0.05) !important;
    /* Sin transform: ningún elemento posicionado dentro del card debe moverse al hacer hover */
}

/* ── Topbar ────────────────────────────────────────────────────────────── */
.myts-topbar {
    height: var(--myts-topbar-height);
    background: var(--myts-topbar-bg, #ffffff);
    border-bottom: 1px solid var(--myts-border);
    box-shadow: 0 1px 4px rgba(15,23,42,.06);
    z-index: 1030;
}
.myts-topbar .navbar-brand { font-weight: 700; letter-spacing: -.35px; color: var(--myts-text); }
.myts-topbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
}
.myts-brand-mark {
    width: 1.62rem;
    height: 1.62rem;
    border-radius: .45rem;
    object-fit: cover;
    box-shadow: 0 3px 8px rgba(15,23,42,.16);
    border: 1px solid rgba(148,163,184,.25);
}
.myts-topbar .navbar-brand .brand-myts { color: var(--myts-accent); }
.myts-topbar .navbar-brand .brand-app { color: var(--myts-text-muted); font-size: .82em; margin-left: 4px; }
.myts-topbar .empresa-badge {
    font-size: .75rem;
    background: #f3f7ff;
    color: var(--myts-primary-dark);
    padding: .35rem .75rem;
    border-radius: .35rem;
    border: 1px solid rgba(66,133,244,.2);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.myts-topbar .user-info { font-size: .8rem; color: var(--myts-text-muted); display: inline-flex; align-items: center; gap: .25rem; }
.myts-topbar .user-link { color: inherit; text-decoration: none; }
.myts-topbar .user-link:hover { color: var(--myts-primary); }
.myts-topbar .user-avatar-icon { font-size: 1.65rem; line-height: 1; color: var(--myts-primary-dark); }
.myts-topbar .user-avatar-img {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(66,133,244,.3);
    background: #f4f8ff;
}
.myts-topbar .user-menu-toggle {
    border: 1px solid var(--myts-border);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 2.2rem;
    padding: .2rem .55rem;
    border-radius: .45rem;
}
.myts-topbar .user-menu-toggle:hover {
    background: #f6f9ff;
    border-color: rgba(66,133,244,.3);
}
.myts-topbar .user-menu-name {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.myts-topbar .user-menu-dropdown {
    min-width: 220px;
}
.myts-user-offcanvas {
    width: min(360px, 92vw);
    border-left: 1px solid rgba(66,133,244,.2);
    background: linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
    box-shadow: -10px 0 28px rgba(15,23,42,.16);
}
.myts-user-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--myts-border);
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(240,247,255,.86));
}
.myts-user-offcanvas .offcanvas-body {
    background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,.1));
}
.myts-user-offcanvas-avatar {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(66,133,244,.28);
}
.myts-user-offcanvas-avatar-icon {
    font-size: 2rem;
    color: var(--myts-primary-dark);
    line-height: 1;
}
.myts-user-menu-list .list-group-item {
    border: 1px solid rgba(66,133,244,.16);
    margin-bottom: .55rem;
    border-radius: .7rem;
    padding: .82rem .75rem;
    font-weight: 600;
    color: var(--myts-text);
    background: linear-gradient(180deg, #ffffff, #f3f8ff);
    box-shadow: 0 5px 12px rgba(15,23,42,.06);
}
.myts-user-menu-list .list-group-item:hover {
    border-color: rgba(66,133,244,.36);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(66,133,244,.12);
}

.myts-user-card {
    border: 1px solid rgba(66,133,244,.22);
    border-radius: .9rem;
    padding: .85rem .9rem;
    background: linear-gradient(135deg, rgba(238,246,255,.95), rgba(223,238,255,.82));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 18px rgba(66,133,244,.12);
}
.myts-user-card-title {
    font-weight: 700;
    color: #23477e;
    margin-bottom: .2rem;
}
.myts-user-card-text {
    color: #4c607b;
    font-size: .84rem;
    line-height: 1.35;
}
#sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    min-height: 2rem;
    padding: .08rem .2rem;
    border: 0 !important;
    border-radius: .45rem;
    background: transparent;
    color: var(--myts-text);
    box-shadow: none;
    text-decoration: none;
    margin-right: .2rem;
}
#sidebar-toggle:hover {
    background: rgba(66,133,244,.08);
    color: var(--myts-text);
}
.theme-toggle {
    background: #ffffff;
    border: 1px solid transparent;
    color: var(--myts-text-muted);
    font-size: 1.05rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    cursor: pointer;
    transition: color var(--myts-transition), background var(--myts-transition), border-color var(--myts-transition);
    border-radius: .35rem;
}
.theme-toggle:hover {
    color: var(--myts-primary-dark);
    background: #f5f8fd;
    border-color: var(--myts-border);
}

.perfil-avatar-lg {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(66,133,244,.28);
    background: #f5f8fe;
}

.perfil-avatar-placeholder {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--myts-primary-dark);
    border: 2px dashed rgba(66,133,244,.34);
    background: #f5f8fe;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.myts-sidebar {
    width: var(--myts-sidebar-width);
    background: var(--myts-sidebar-bg);
    border-right: 1px solid var(--myts-border);
    position: fixed;
    top: var(--myts-topbar-height);
    left: 0;
    bottom: 0;
    z-index: 1020;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--myts-transition), transform var(--myts-transition);
    scrollbar-width: thin;
    scrollbar-color: var(--myts-sidebar-hover) transparent;
    box-shadow: 2px 0 8px rgba(15,23,42,.04);
}
.myts-sidebar .nav-link {
    color: var(--myts-sidebar-text);
    padding: .7rem .9rem;
    font-size: .82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: .35rem;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    margin: 2px 10px;
    transition: background var(--myts-transition), color var(--myts-transition), border-color var(--myts-transition);
    white-space: nowrap;
}
.myts-sidebar .nav-link:hover {
    background: var(--myts-sidebar-hover);
    border-color: rgba(66,133,244,.12);
    color: var(--myts-sidebar-active);
}
.myts-sidebar .nav-link.active {
    background: #eef4ff;
    color: var(--myts-sidebar-active);
    border-color: rgba(66,133,244,.18);
    border-left-color: var(--myts-primary);
    box-shadow: none;
}
.myts-sidebar .nav-link i { width: 20px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }
.myts-sidebar .nav-link .sidebar-bitrix-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: -0.2em;
}
.myts-sidebar .sidebar-section {
    padding: .65rem 1rem .3rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #8a98ad;
    opacity: 1;
    font-weight: 700;
    margin-top: .5rem;
}
.myts-sidebar.collapsed { width: var(--myts-sidebar-collapsed); }
.myts-sidebar.collapsed .nav-link span,
.myts-sidebar.collapsed .sidebar-section { display: none; }
.myts-sidebar.collapsed .nav-link { justify-content: center; padding: .65rem .5rem; margin: 2px 4px; }

/* ── Main content ──────────────────────────────────────────────────────── */
.myts-main {
    margin-left: var(--myts-sidebar-width);
    margin-top: var(--myts-topbar-height);
    padding: 1rem 1.25rem 1.25rem;
    transition: margin-left var(--myts-transition);
    min-height: calc(100vh - var(--myts-topbar-height));
    background: var(--myts-glass-bg);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-left: 1px solid var(--myts-glass-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.36), var(--myts-glass-shadow);
}
.myts-main.expanded { margin-left: var(--myts-sidebar-collapsed); }

.myts-mobile-nav {
    display: none;
}

.myts-mobile-nav-item {
    text-decoration: none;
}

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .myts-topbar .user-menu {
        display: none;
    }
    .myts-sidebar { transform: translateX(-100%); width: var(--myts-sidebar-width) !important; }
    .myts-sidebar.show { transform: translateX(0); }
    .myts-main { margin-left: 0 !important; padding-bottom: 5.4rem; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1019; }
    .sidebar-overlay.show { display: block; }

    .myts-mobile-nav {
        position: fixed;
        left: .55rem;
        right: .55rem;
        bottom: calc(.45rem + env(safe-area-inset-bottom));
        z-index: 1045;
        height: 4.65rem;
        padding: .44rem .5rem;
        background: linear-gradient(138deg, rgba(15,23,42,.9), rgba(30,41,59,.84));
        border: 1px solid rgba(191,219,254,.34);
        border-top-color: rgba(255,255,255,.46);
        border-radius: 1.05rem;
        backdrop-filter: blur(16px) saturate(165%);
        -webkit-backdrop-filter: blur(16px) saturate(165%);
        box-shadow: 0 12px 28px rgba(2,6,23,.36), 0 0 0 1px rgba(15,23,42,.1);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: .24rem;
    }

    .myts-mobile-nav::before {
        content: "";
        position: absolute;
        left: .5rem;
        right: .5rem;
        top: .26rem;
        height: 1px;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.78), rgba(255,255,255,.08));
        pointer-events: none;
    }

    .myts-mobile-nav-item {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .14rem;
        min-width: 0;
        border-radius: .45rem;
        color: rgba(255,255,255,.86);
        font-weight: 700;
        font-size: .6rem;
        letter-spacing: .01em;
        border: 1px solid transparent;
        background: transparent;
        padding: 0;
        text-shadow: 0 1px 1px rgba(2,6,23,.42);
    }

    .myts-mobile-nav-item i {
        font-size: 1.2rem;
        line-height: 1;
    }

    .myts-mobile-nav-avatar {
        width: 1.55rem;
        height: 1.55rem;
        border-radius: 50%;
        object-fit: cover;
        border: 1px solid rgba(147,197,253,.45);
    }

    .myts-mobile-nav-item.is-active {
        color: #ffffff;
        background: linear-gradient(145deg, rgba(37,99,235,.42), rgba(29,78,216,.34));
        border-color: rgba(147,197,253,.55);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 10px rgba(37,99,235,.22);
    }

    .myts-mobile-nav-button {
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
    }
}

/* ── Page header ───────────────────────────────────────────────────────── */
.page-header {
    margin-bottom: 1rem;
    gap: .75rem;
    flex-wrap: wrap;
    padding-bottom: .55rem;
    border-bottom: 1px solid #e6edf5;
}
.page-header h1 { font-size: 1.28rem; font-weight: 700; margin: 0; color: #334155; }
.page-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}
.page-header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid var(--myts-border);
    border-radius: .35rem;
    background: var(--myts-card-bg);
    color: #5b6b80;
    text-decoration: none;
    transition: transform var(--myts-transition), border-color var(--myts-transition), color var(--myts-transition), box-shadow var(--myts-transition);
}
button.page-header-action {
    cursor: pointer;
    padding: 0;
}
.page-header-action:hover {
    color: var(--myts-primary-dark);
    background: #f4f8fd;
    border-color: rgba(26,115,232,.26);
    box-shadow: 0 4px 8px rgba(15,23,42,.06);
    transform: translateY(-1px);
}
.page-header-action.is-active {
    color: var(--myts-primary-dark);
    background: #eef5ff;
    border-color: rgba(26,115,232,.38);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.dash-card,
.table-card,
.config-card {
    background: var(--myts-card-bg);
    border: 1px solid var(--myts-border);
    border-radius: 0.35rem;
    transition: box-shadow var(--myts-transition), border-color var(--myts-transition);
}
/* Solo dash-card y config-card tienen transform en transición;
   table-card queda excluido para evitar el bug de hover-loop con .dataTables_processing */
.dash-card,
.config-card {
    transition: box-shadow var(--myts-transition), border-color var(--myts-transition), transform var(--myts-transition);
}

.dash-card {
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}

.table-card {
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.table-card .card-header {
    background: var(--myts-card-header-bg, #f8fafc);
    border-bottom: 1px solid var(--myts-border);
    padding: .75rem 1rem;
    color: #1e293b;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}
.table-card .card-body { padding: .75rem; }

/* ── Título de vista dentro del card-header ─────────────────────────────── */
.myts-card-title {
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: var(--myts-primary, #1a73e8);
    background: rgba(26, 115, 232, 0.08);
    border: 1px solid rgba(26, 115, 232, 0.14);
    border-radius: 6px;
    padding: 0.28rem 0.75rem;
}
[data-bs-theme="dark"] .myts-card-title {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.18);
}

.myts-grid-scroll-x {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.myts-grid-wide {
    min-width: 980px;
}

.dash-card:hover {
    border-color: rgba(66, 133, 244, 0.28);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
}

.config-card {
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}
.config-card:hover {
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
    border-color: rgba(66, 133, 244, 0.28);
    transform: translateY(-2px);
}

.config-icon {
    width: 60px;
    height: 60px;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(66,133,244,.18);
    color: var(--myts-text);
    background: linear-gradient(180deg, #eef4f8 0%, var(--myts-card-bg) 72%);
    box-shadow: 0 6px 12px rgba(15,23,42,.07);
}
.dashboard-shell {
    border: 1px solid var(--myts-border);
    border-radius: .42rem;
    padding: .85rem;
    background: var(--myts-card-bg);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}
.dashboard-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}
.dashboard-header-main {
    min-width: 0;
}
.dashboard-header-identidad {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.dashboard-header-pill {
    display: inline-flex;
    align-items: center;
    padding: .22rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--myts-border);
    background: #f6f9fd;
    color: var(--myts-text-muted);
    font-size: .75rem;
    font-weight: 700;
}
.dashboard-quick-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    width: 100%;
    padding: .1rem .2rem;
}
.dashboard-quick-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .4rem;
    border: 1px solid var(--myts-border);
    color: var(--myts-primary-dark);
    background: #f7faff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
}
.dashboard-quick-icon:hover {
    border-color: rgba(66,133,244,.35);
    background: #eef4ff;
    color: var(--myts-primary-dark);
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--myts-primary), #7aa7f8);
}
.dashboard-kicker {
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--myts-text-muted);
}
.dashboard-hero .dashboard-kicker { color: var(--myts-primary-dark); margin-bottom: .75rem; }
.dashboard-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.05;
    margin: 0 0 .75rem;
    font-weight: 700;
}
.dashboard-brand-lockup {
    display: inline-flex;
    align-items: center;
    padding: .48rem .58rem;
    border-radius: .7rem;
    border: 1px solid rgba(66,133,244,.2);
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(243,248,255,.82));
    box-shadow: 0 8px 16px rgba(15,23,42,.08);
}
.dashboard-brand-logo {
    width: min(100%, 310px);
    height: auto;
    display: block;
}
.dashboard-copy { max-width: 56ch; color: var(--myts-text-muted); font-size: .98rem; }
.dashboard-hero-side {
    min-width: min(100%, 240px);
    display: grid;
    gap: .85rem;
}
.dashboard-pill {
    padding: .9rem 1rem;
    border-radius: .5rem;
    background: #f6f9fd;
    border: 1px solid var(--myts-border);
    backdrop-filter: none;
}
.dashboard-pill-label {
    display: block;
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
    margin-bottom: .2rem;
}
.dashboard-section-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--myts-text);
}
.dashboard-assistant-card { border-radius: .35rem; }
.dashboard-rule {
    display: flex;
    gap: .8rem;
    padding: .9rem 0;
    border-top: 1px solid var(--myts-border);
}
.dashboard-rule:first-of-type {
    border-top: none;
    padding-top: .25rem;
}
.dashboard-rule i {
    font-size: 1.1rem;
    color: var(--myts-accent);
    margin-top: .15rem;
}
.dashboard-rule strong {
    display: block;
    margin-bottom: .15rem;
}
.dashboard-rule span {
    color: var(--myts-text-muted);
    line-height: 1.45;
}
.dashboard-module-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-height: 100%;
    padding: 1rem;
    border-radius: .35rem;
    border: 1px solid var(--myts-border);
    background: var(--myts-card-bg);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-module-card:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: rgba(66, 133, 244, 0.28);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
}
.dashboard-module-card h4 {
    margin: .1rem 0 .2rem;
    font-size: 1rem;
    font-weight: 700;
}
.dashboard-module-card p {
    margin: 0;
    color: var(--myts-text-muted);
    line-height: 1.45;
}
.dashboard-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: .35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.dashboard-icon-clients { background: rgba(26,115,232,.12); color: #1a73e8; }
.dashboard-icon-orders { background: rgba(14,116,144,.14); color: #0e7490; }
.dashboard-icon-potentials { background: rgba(251,188,4,.18); color: #a16207; }
.dashboard-icon-accounts { background: rgba(52,168,83,.16); color: #15803d; }
.dashboard-icon-quotes { background: rgba(168,85,247,.14); color: #7e22ce; }
.dashboard-icon-articles { background: rgba(245,158,11,.16); color: #b45309; }
.dashboard-icon-settings { background: rgba(100,116,139,.16); color: #334155; }
.dashboard-widget {
    border-radius: .35rem;
    padding: 1rem;
    border: 1px solid var(--myts-border);
    background: var(--myts-card-bg);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}
.dashboard-widget-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.dashboard-warning {
    border: 1px solid rgba(251,188,4,.28);
    border-radius: .35rem;
    background: #fff9e8;
}
.dashboard-metric-card {
    display: block;
    height: 100%;
    padding: 1rem;
    border-radius: .35rem;
    border: 1px solid var(--myts-border);
    background: var(--myts-card-bg);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-metric-card:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15,23,42,.08);
}
.dashboard-metric-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .85rem;
}
.dashboard-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: .35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: rgba(15,23,42,.08);
}
.dashboard-metric-title {
    font-size: .86rem;
    font-weight: 700;
}
.dashboard-metric-value {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1;
    font-weight: 800;
    margin-bottom: .4rem;
}
.dashboard-metric-copy {
    color: var(--myts-text-muted);
    line-height: 1.45;
}
.dashboard-metric-potentials .dashboard-metric-icon { background: rgba(251,188,4,.18); color: #a16207; }
.dashboard-metric-accounts .dashboard-metric-icon { background: rgba(52,168,83,.16); color: #15803d; }
.dashboard-metric-quotes .dashboard-metric-icon { background: rgba(168,85,247,.14); color: #7e22ce; }
.dashboard-metric-articles .dashboard-metric-icon { background: rgba(14,116,144,.14); color: #0e7490; }
.dashboard-recent-list {
    display: grid;
    gap: .75rem;
}
.dashboard-recent-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .85rem;
    padding: .85rem .95rem;
    border-radius: .35rem;
    border: 1px solid var(--myts-border);
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease;
}
.dashboard-recent-item:hover {
    color: inherit;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15,23,42,.08);
}
.dashboard-recent-main {
    min-width: 0;
}
.dashboard-recent-main strong,
.dashboard-recent-main span,
.dashboard-recent-side small {
    display: block;
}
.dashboard-recent-main strong {
    font-size: .93rem;
    margin-bottom: .2rem;
}
.dashboard-recent-main span,
.dashboard-recent-side small {
    color: var(--myts-text-muted);
    line-height: 1.4;
}
.dashboard-recent-side {
    text-align: right;
    flex-shrink: 0;
}
.dashboard-recent-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(26,115,232,.1);
    color: var(--myts-primary);
    font-size: .72rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.dashboard-search-results {
    display: grid;
    gap: .65rem;
    max-height: 350px;
    overflow: auto;
    padding-right: .15rem;
}
.dashboard-search-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .8rem;
    text-align: left;
    padding: .85rem .95rem;
    border-radius: .35rem;
    border: 1px solid var(--myts-border);
    background: var(--myts-card-bg);
    color: inherit;
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.dashboard-search-item:hover {
    border-color: rgba(26,115,232,.28);
    background: #f6f9fd;
}
.dashboard-search-card {
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
}
.dashboard-search-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}
.dashboard-search-code {
    min-width: 92px;
    font-weight: 700;
    color: var(--myts-primary);
}
.dashboard-search-description {
    flex: 1;
    color: var(--myts-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dashboard-search-copy {
    flex-shrink: 0;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--myts-text-muted);
}
@media (max-width: 767.98px) {
    .myts-brand-mark {
        width: 1.45rem;
        height: 1.45rem;
    }
    .myts-topbar .navbar-brand .brand-myts,
    .myts-topbar .navbar-brand .brand-app {
        font-size: .95rem;
    }
    .dashboard-brand-lockup {
        width: 100%;
        justify-content: center;
        padding: .45rem;
    }
    .dashboard-brand-logo {
        width: min(100%, 270px);
    }
    .dashboard-shell-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .dashboard-header-identidad {
        width: 100%;
        order: 2;
    }
}

/* ── DataTables ────────────────────────────────────────────────────────── */
table.dataTable thead th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--myts-text-muted);
    border-bottom: 2px solid var(--myts-border) !important;
}
table.dataTable tbody td {
    font-size: .86rem;
    vertical-align: middle;
    padding: .45rem .6rem;
    line-height: 1.22;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--myts-primary) !important;
    color: #fff !important;
    border-color: var(--myts-primary) !important;
    border-radius: .25rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-myts { background: var(--myts-primary); color: #fff; border: none; }
.btn-myts:hover { background: var(--myts-primary-dark); color: #fff; }
.btn-ficha-grid {
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-ficha-grid i { line-height: 1; }
.form-control:focus { border-color: var(--myts-primary); box-shadow: 0 0 0 .2rem rgba(26,115,232,.15); }

.form-control,
.form-select {
    min-height: 32px;
    padding-top: .24rem;
    padding-bottom: .24rem;
    font-size: .86rem;
}

.form-control-sm,
.form-select-sm,
.btn-sm {
    min-height: 30px;
    padding-top: .2rem;
    padding-bottom: .2rem;
    font-size: .81rem;
}

.myts-cell-clip {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.myts-grid-filters-compact .form-control,
.myts-grid-filters-compact .form-select {
    min-width: 150px;
}

/* ── Fichas CRM ───────────────────────────────────────────────────────── */
.myts-ficha-tabs {
    border-bottom: 1px solid var(--myts-border);
    gap: .35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    padding-bottom: .1rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.myts-ficha-tabs::-webkit-scrollbar { height: 7px; }
.myts-ficha-tabs::-webkit-scrollbar-thumb {
    background: #c5d2e5;
    border-radius: 99px;
}
.myts-ficha-tabs .nav-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}
.myts-ficha-tabs {
    border-bottom: 1px solid var(--myts-border);
    gap: .25rem;
    padding-bottom: 0;
}
.myts-ficha-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid var(--myts-border);
    color: #5e6f84;
    font-weight: 700;
    padding: .3rem .58rem;
    font-size: .83rem;
    background: linear-gradient(180deg, #f8fafc, #eef3f9);
    border-radius: .35rem .35rem 0 0;
    margin-bottom: -1px;
    white-space: nowrap;
}
.myts-ficha-tabs .nav-link:hover {
    border-color: var(--myts-border);
    background: #ffffff;
    color: var(--myts-primary-dark);
}
.myts-ficha-tabs .nav-link.active {
    color: var(--myts-primary-dark);
    background: var(--myts-card-bg);
    border-color: var(--myts-border) var(--myts-border) var(--myts-card-bg);
    box-shadow: inset 0 3px 0 rgba(66,133,244,.95);
}
.myts-ficha-tabs .nav-link i {
    font-size: .9rem;
    line-height: 1;
}
.myts-tab-text {
    display: inline;
}
.myts-ficha-tabs-icons-only .myts-tab-text {
    display: none;
}
.myts-ficha-tabs-icons-only .nav-link {
    min-width: 2.1rem;
    justify-content: center;
    padding-left: .48rem;
    padding-right: .48rem;
}
.myts-ficha-tabs-icons-only .nav-link i {
    margin-right: 0 !important;
    font-size: .98rem;
}
.myts-ficha-tabpane { padding-top: .35rem; }
.myts-ficha-panel {
    position: relative;
    overflow: hidden;
    border-radius: .25rem;
    background: #ffffff;
    border: 1px solid rgba(47,111,214,.38);
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.myts-ficha-panel::before {
    display: none;
}
.myts-ficha-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    flex-wrap: wrap;
    padding: .46rem .8rem .44rem .8rem;
    background: linear-gradient(180deg, #4f88ee 0%, #2f6fd6 100%);
    border-bottom: 1px solid #2459ae;
    color: #ffffff;
}
.myts-ficha-panel-header[data-myts-panel-clickable="true"] {
    cursor: pointer;
}
.myts-ficha-panel-header-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: nowrap;
    overflow: hidden;
}
.myts-ficha-panel-header-main[data-myts-panel-clickable="true"] {
    cursor: pointer;
    user-select: none;
}
.myts-ficha-panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
    margin-left: auto;
    flex-shrink: 0;
}
.myts-ficha-panel-header-compact {
    padding-top: .66rem;
    padding-bottom: .62rem;
}
.myts-ficha-kicker {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.1;
    text-transform: uppercase;
    color: rgba(232,241,255,.92);
    white-space: nowrap;
}
.myts-ficha-panel-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .9rem;
    color: #ffffff;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}
.myts-ficha-panel-title span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.myts-ficha-panel-title i { color: #ffffff; }
.myts-ficha-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 .45rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.16);
    color: #ffffff;
    font-size: .72rem;
    font-weight: 800;
}
.myts-ficha-inline-badge-square {
    min-width: 1.52rem;
    height: 1.44rem;
    padding: 0 .4rem;
    border-radius: .28rem;
}
.myts-ficha-print-btn {
    display: inline-flex;
    align-items: center;
    gap: .36rem;
    min-height: 2rem;
    padding: .34rem .72rem;
    font-size: .78rem;
}
.myts-ficha-print-btn i {
    font-size: .9rem;
    line-height: 1;
}
.myts-ficha-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: .35rem;
    background: rgba(255,255,255,.14);
    color: #ffffff;
    transition: all .2s ease;
}
.myts-ficha-panel-toggle span { display: none; }
.myts-ficha-panel-toggle:hover {
    border-color: rgba(255,255,255,.42);
    color: var(--myts-primary-dark);
    background: #ffffff;
}
.myts-ficha-panel-toggle i {
    font-size: .9rem;
    line-height: 1;
}

.myts-ficha-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: .35rem;
    background: rgba(255,255,255,.18);
    color: #ffffff;
    transition: all .2s ease;
}

.myts-ficha-header-icon i {
    font-size: .92rem;
    line-height: 1;
}

.myts-ficha-header-icon:hover {
    border-color: rgba(255,255,255,.5);
    color: var(--myts-primary-dark);
    background: #ffffff;
}

.myts-map-close-fab {
    position: absolute;
    top: .6rem;
    right: .6rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .45rem;
    border: 1px solid rgba(15,23,42,.18);
    background: rgba(255,255,255,.9);
    color: #0f172a;
}

.myts-map-close-fab:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(15,23,42,.28);
}
.myts-ficha-panel-collapse {
    transition: height .2s ease;
}
.myts-ficha-panel-body {
    padding: 1rem;
    background: #ffffff;
}
.myts-ficha-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .35rem .9rem;
}
.myts-ficha-summary-item {
    min-height: 100%;
    padding: .38rem .12rem;
    border: 0;
    border-bottom: 1px dashed #d5e1f2;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.myts-ficha-summary-label {
    display: block;
    margin-bottom: .18rem;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
}
.myts-ficha-summary-value {
    font-size: .93rem;
    font-weight: 600;
    line-height: 1.28;
    color: var(--myts-text);
}
/* ── Datastrip: fila de datos clave sin cajoncitos ── */
.myts-ficha-datastrip {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .5rem 0;
    padding: .1rem 0;
}
.myts-ficha-datastrip-item {
    display: flex;
    flex-direction: column;
    gap: .22rem;
    padding: .45rem 1.5rem .45rem 0;
    margin-right: 1.5rem;
    border-right: 1px solid var(--myts-border);
}
.myts-ficha-datastrip-item:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}
.myts-ficha-datastrip-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
    white-space: nowrap;
}
.myts-ficha-datastrip-value {
    font-size: .93rem;
    font-weight: 600;
    color: var(--myts-text);
    overflow-wrap: break-word;
}
.myts-ficha-datastrip-value-inline {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.myts-ficha-inline-separator {
    color: var(--myts-text-muted);
    font-weight: 600;
}
.myts-ficha-inline-link {
    color: var(--myts-primary);
    font-weight: 700;
    text-decoration: none;
}
.myts-ficha-inline-link:hover {
    text-decoration: underline;
}
.myts-ficha-total-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 0;
    background: transparent;
    color: var(--myts-primary);
    font-size: .78rem;
    font-weight: 700;
    padding: 0;
    line-height: 1;
}
.myts-ficha-total-detail-btn:hover {
    color: #204f9d;
    text-decoration: underline;
}
.myts-ficha-kv-list {
    display: grid;
    gap: .75rem;
}
.myts-ficha-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: .75rem;
}
.myts-ficha-kv-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .52rem .72rem;
}
.myts-ficha-kv-item {
    display: grid;
    grid-template-columns: minmax(132px, 150px) 1fr;
    gap: .7rem;
    align-items: start;
    padding: .42rem .12rem;
    border: 0;
    border-bottom: 1px dashed #d5e1f2;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.myts-ficha-kv-grid-compact .myts-ficha-kv-item {
    grid-template-columns: minmax(120px, 148px) 1fr;
    gap: .56rem;
    padding-top: .34rem;
    padding-bottom: .34rem;
}
.myts-ficha-panel-header .btn-myts {
    background: #ffffff;
    color: var(--myts-primary-dark);
    border: 1px solid rgba(255,255,255,.28);
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.myts-ficha-panel-header .btn-myts:hover {
    background: #eef4ff;
    color: #204f9d;
    border-color: rgba(255,255,255,.4);
}
.myts-ficha-kv-grid-leyendas {
    grid-template-columns: repeat(5, minmax(165px, 1fr));
}
@media (max-width: 1399.98px) {
    .myts-ficha-kv-grid-leyendas {
        grid-template-columns: repeat(3, minmax(190px, 1fr));
    }
}
@media (max-width: 991.98px) {
    .myts-ficha-kv-grid-leyendas {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}
.myts-ficha-kv-item-wide { grid-column: 1 / -1; }
.myts-ficha-kv-label {
    margin: 0;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
}
.myts-ficha-kv-value {
    margin: 0;
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--myts-text);
}
.myts-ficha-kv-value a {
    color: var(--myts-primary);
    font-weight: 700;
    text-decoration: none;
}
.myts-ficha-kv-value a:hover { text-decoration: underline; }
.myts-ficha-empty {
    color: var(--myts-text-muted);
    font-weight: 500;
}

/* ── Fichas compactas (B7) ── */
.myts-ficha-compact .myts-ficha-summary-item {
    padding-top: .2rem;
    padding-bottom: .2rem;
}
.myts-ficha-compact .myts-ficha-summary-grid {
    gap: .15rem .75rem;
}
.myts-ficha-compact .myts-ficha-summary-value {
    line-height: 1.3;
}
.myts-ficha-compact .myts-ficha-kv-item {
    padding-top: .2rem;
    padding-bottom: .2rem;
    gap: .15rem;
}
.myts-ficha-compact .myts-ficha-kv-grid {
    gap: .15rem .75rem;
}
.myts-ficha-compact .myts-ficha-kv-value {
    line-height: 1.3;
}
@media (min-width: 992px) {
    .myts-ficha-compact .myts-ficha-kv-item {
        grid-template-columns: minmax(132px, 38%) 1fr;
        align-items: baseline;
    }
    .myts-ficha-compact .myts-ficha-kv-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .myts-ficha-compact .myts-ficha-kv-item-codigo-enlazado {
        grid-column: 1 / -1;
        grid-template-columns: minmax(200px, max-content) 1fr;
    }
}
@media (max-width: 767.98px) {
    .myts-ficha-compact .myts-ficha-kv-grid,
    .myts-ficha-compact .myts-ficha-summary-grid {
        grid-template-columns: 1fr;
    }
    .myts-ficha-compact .myts-ficha-kv-item {
        grid-template-columns: 1fr;
        gap: .15rem;
    }
    .myts-ficha-compact .myts-ficha-kv-label {
        margin-bottom: 0;
    }
}
.myts-listado-compact .myts-table td,
.myts-listado-compact .myts-table th {
    padding-top: .3rem;
    padding-bottom: .3rem;
}
.myts-listado-compact .table td,
.myts-listado-compact .table th {
    padding-top: .3rem;
    padding-bottom: .3rem;
}
.myts-totales-col {
    margin-left: auto;
}

/* ── Cotizaciones: panel Totales (layout tipo checkout) ── */
.myts-totales-panel-body {
    padding-top: 1rem;
    padding-bottom: 1.1rem;
}
.myts-totales-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 1.25rem 1.75rem;
    align-items: stretch;
}
.myts-totales-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    gap: .35rem;
    padding: 1.15rem 1.25rem;
    border-radius: .75rem;
    border: 1px solid rgba(66, 133, 244, .22);
    background: linear-gradient(145deg, rgba(66, 133, 244, .1) 0%, rgba(66, 133, 244, .03) 100%);
    min-height: 100%;
}
.myts-totales-aside-kicker {
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
    font-weight: 600;
}
.myts-totales-aside-amount {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--myts-sidebar-active, #1a56db);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}
.myts-totales-aside-dolar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .5rem;
    margin-top: .15rem;
    font-size: .92rem;
}
.myts-totales-sheet {
    border: 1px solid var(--myts-border);
    border-radius: .75rem;
    padding: .85rem 1rem 1rem;
    background: var(--myts-surface-elevated, rgba(255, 255, 255, .55));
}
.myts-totales-sheet-section + .myts-totales-sheet-section {
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px dashed var(--myts-border);
}
.myts-totales-sheet-title {
    font-size: .68rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--myts-text-muted);
    margin-bottom: .45rem;
}
.myts-totales-sheet-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .35rem 0;
}
.myts-totales-sheet-row-emphasis {
    margin-top: .25rem;
    padding-top: .55rem;
    border-top: 1px solid var(--myts-border);
    font-weight: 600;
}
.myts-totales-sheet-label {
    font-size: .84rem;
    color: var(--myts-text-muted);
}
.myts-totales-sheet-value {
    font-size: .95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.myts-totales-adjust-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1rem;
    margin-bottom: .35rem;
}
.myts-totales-adjust-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.myts-totales-adjust-cell .input-group-sm .form-control,
.myts-totales-adjust-cell .input-group-sm .input-group-text {
    font-size: .82rem;
}
@media (max-width: 991.98px) {
    .myts-totales-layout {
        grid-template-columns: 1fr;
    }
    /* DOM: desglose primero, total final al pie (después de bonif/recargos) */
    .myts-totales-aside {
        margin-top: .25rem;
    }
    .myts-totales-adjust-grid-3 {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 575.98px) {
    .myts-totales-adjust-grid {
        grid-template-columns: 1fr;
    }
}
[data-bs-theme="dark"] .myts-totales-aside {
    border-color: rgba(96, 165, 250, .28);
    background: linear-gradient(145deg, rgba(59, 130, 246, .16) 0%, rgba(15, 23, 42, .35) 100%);
}
[data-bs-theme="dark"] .myts-totales-aside-amount {
    color: #93c5fd;
}
[data-bs-theme="dark"] .myts-totales-sheet {
    background: rgba(255, 255, 255, .03);
}

/* Barra fija Guardar/Cancelar — alta y duplicado de cotización */
.myts-cotizacion-form-page {
    padding-bottom: 5.25rem;
}
.myts-cotizacion-actions-bar {
    position: fixed;
    left: var(--myts-sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: var(--myts-card-bg);
    border-top: 1px solid var(--myts-border);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, .08);
    padding: .7rem 1.25rem calc(.7rem + env(safe-area-inset-bottom));
}
.myts-main.expanded .myts-cotizacion-actions-bar {
    left: var(--myts-sidebar-collapsed);
}
.myts-cotizacion-actions-bar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}
.myts-cotizacion-actions-total {
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}
.myts-cotizacion-actions-total-label {
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
    font-weight: 600;
}
.myts-cotizacion-actions-total-value {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    color: var(--myts-primary-dark, #1a73e8);
}
.myts-cotizacion-actions-buttons {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
@media (max-width: 991.98px) {
    .myts-cotizacion-form-page {
        padding-bottom: 10rem;
    }
    .myts-cotizacion-actions-bar {
        left: 0;
        bottom: calc(5.35rem + env(safe-area-inset-bottom));
    }
    .myts-cotizacion-actions-bar-inner {
        justify-content: stretch;
    }
    .myts-cotizacion-actions-total {
        flex: 1 1 auto;
    }
    .myts-cotizacion-actions-buttons {
        flex: 0 0 auto;
    }
}
[data-bs-theme="dark"] .myts-cotizacion-actions-bar {
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .35);
}

.myts-importes-modal-grid {
    display: grid;
    gap: .35rem;
}
.myts-importes-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .85rem;
    padding: .5rem .35rem;
    border-bottom: 1px dashed #d5e1f2;
    color: var(--myts-text);
}
.myts-importes-modal-row strong {
    white-space: nowrap;
}
.myts-importes-modal-row-total {
    border-bottom-style: solid;
    border-bottom-color: var(--myts-border);
    font-size: 1rem;
}
.myts-articulos-shell {
    padding: .85rem 1rem 1rem;
}
.myts-articulos-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: transparent;
    margin: 0;
}
.myts-articulos-table thead th {
    padding: .85rem .95rem;
    border-bottom: 1px solid rgba(26,115,232,.16);
    background: linear-gradient(180deg, rgba(26,115,232,.08), rgba(255,255,255,.86));
    color: var(--myts-text-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.myts-articulos-table tbody td {
    padding: 1rem .95rem;
    border-bottom: 1px solid rgba(26,115,232,.08);
    background: transparent;
    color: var(--myts-text);
    vertical-align: middle;
}
.myts-articulos-table tbody tr:hover td {
    background: rgba(26,115,232,.035);
}
.myts-articulos-col-item,
.myts-articulos-col-code {
    white-space: nowrap;
    font-weight: 700;
}
.myts-articulos-col-desc {
    min-width: 240px;
    font-weight: 700;
}
.myts-articulos-col-metric {
    white-space: nowrap;
}
.myts-articulos-mobile-list {
    display: grid;
    gap: .85rem;
    padding: .95rem;
}
.myts-articulo-card {
    border: 1px solid var(--myts-border);
    border-radius: .35rem;
    background: #ffffff;
    padding: .95rem;
}
.myts-articulo-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin-bottom: .75rem;
}
.myts-articulo-chip {
    display: inline-flex;
    align-items: center;
    padding: .3rem .55rem;
    border-radius: 999px;
    background: rgba(26,115,232,.1);
    color: var(--myts-primary);
    font-size: .74rem;
    font-weight: 800;
}
.myts-articulo-code {
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
}
.myts-articulo-title {
    margin: 0 0 .8rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--myts-text);
}
.myts-articulo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}
.myts-articulo-field {
    padding: .75rem .8rem;
    border: 1px solid var(--myts-border);
    border-radius: .35rem;
    background: #f9fbfe;
}
.myts-articulo-field-label {
    display: block;
    margin-bottom: .25rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--myts-text-muted);
}
.myts-articulo-field-value {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: var(--myts-text);
}
.myts-articulos-empty {
    padding: 1.15rem 1rem;
    color: var(--myts-text-muted);
    text-align: center;
}
@media (max-width: 767.98px) {
    .myts-ficha-panel-header,
    .myts-ficha-panel-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .myts-ficha-panel-header-actions {
        width: auto;
        justify-content: flex-end;
        margin-left: 0;
    }
    .myts-ficha-header-icon,
    .myts-ficha-panel-toggle {
        width: 1.8rem;
        height: 1.8rem;
        min-height: 1.8rem;
    }
    .myts-ficha-kv-grid { grid-template-columns: 1fr; }
    .myts-ficha-kv-item { grid-template-columns: 1fr; gap: .45rem; }
    .myts-articulo-grid { grid-template-columns: 1fr 1fr; }
}
.crm-meta {
    display: block;
    font-size: .78rem;
    color: var(--myts-text-muted);
    margin-top: .2rem;
}

/* ── Auth pages ────────────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef4ff 0%, #f7f9fc 100%);
}
.auth-card {
    background: var(--myts-card-bg);
    border: 1px solid rgba(66,133,244,.18);
    border-radius: .45rem;
    box-shadow: 0 12px 30px rgba(47,111,214,.12);
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
}
.auth-card .auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-card .auth-logo .brand-myts { font-size: 2rem; font-weight: 800; color: var(--myts-accent); }
.auth-card .auth-logo .brand-app { font-size: 1rem; color: var(--myts-text-muted); display: block; }
.auth-card .form-label { font-size: .8rem; font-weight: 600; color: var(--myts-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.auth-card .btn-auth { width: 100%; padding: .65rem; font-weight: 600; font-size: .95rem; }

/* ── BlockUI ───────────────────────────────────────────────────────────── */
.myts-blockui {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
    pointer-events: none;
    background: transparent;
    backdrop-filter: none;
}
.myts-blockui.show {
    display: flex;
    pointer-events: auto;
}
.myts-blockui-card {
    min-width: 260px; max-width: min(92vw, 460px);
    display: inline-flex; align-items: center; gap: .7rem;
    padding: .8rem 1rem; border-radius: .65rem;
    background: var(--myts-card-bg); border: 1px solid var(--myts-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.myts-blockui-spinner {
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    border: 2px solid var(--myts-primary); border-right-color: transparent;
    animation: myts-spin .8s linear infinite; flex-shrink: 0;
}
.myts-blockui-text { color: var(--myts-text); font-size: .92rem; }
body.myts-blocking { overflow: hidden; }
/* Nunca tapar un modal con el overlay de bloqueo */
body.modal-open .myts-blockui { display: none !important; }

/* Si queda un backdrop sin modal visible, mantenerlo invisible para no ensuciar la UI */
.modal-backdrop:not(.show) { opacity: 0 !important; }
@keyframes myts-spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.myts-toast {
    font-size: .88rem !important;
    padding: .6rem .85rem !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */
.menu-item-hidden { display: none !important; }

/* ── jQuery UI autocomplete ────────────────────────────────────────────── */
.ui-autocomplete {
    max-height: 250px; overflow-y: auto; overflow-x: hidden;
    border-radius: .375rem; box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border: 1px solid var(--myts-border); background: var(--myts-card-bg);
    z-index: 1050 !important; font-size: .875rem;
}
.ui-autocomplete .ui-menu-item-wrapper {
    padding: .45rem .75rem; color: var(--myts-text); border-bottom: 1px solid var(--myts-border);
}
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active {
    background: var(--myts-primary) !important; color: #fff !important;
    border-color: var(--myts-primary) !important; border-radius: 0; margin: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   DARK THEME
   ════════════════════════════════════════════════════════════════════════ */
[data-bs-theme="dark"] {
    --myts-bg:           #111827;
    --myts-card-bg:      #1f2937;
    --myts-text:         #e5eef9;
    --myts-text-muted:   #9fb0c7;
    --myts-border:       #334155;
    --myts-sidebar-bg:   #0f172a;
    --myts-sidebar-hover:#162235;
    --myts-glass-bg:     linear-gradient(135deg, rgba(15,23,42,.52), rgba(15,23,42,.36));
    --myts-glass-border: rgba(148,163,184,.22);
    --myts-glass-shadow: 0 12px 28px rgba(2,6,23,.38);

    /* Bootstrap theme color overrides para modo oscuro */
    --bs-body-bg: #0b1120;
    --bs-card-bg: #1f2937;
    --bs-border-color: #334155;
    --bs-card-border-color: #334155;
    --bs-list-group-bg: #1f2937;
    --bs-list-group-border-color: #334155;
    --bs-modal-bg: #1f2937;
    --bs-modal-border-color: #334155;
}
[data-bs-theme="dark"] body {
    background-color: #0b1120;
    background-image: linear-gradient(180deg, #0b1120 0%, #111827 100%);
    background-attachment: fixed;
}
[data-bs-theme="dark"] .myts-topbar {
    background: #111827;
    border-bottom-color: rgba(148,163,184,.18);
    backdrop-filter: none;
    box-shadow: 0 1px 4px rgba(2,6,23,.3);
}
[data-bs-theme="dark"] .myts-sidebar {
    background: #0f172a;
    border-right: 1px solid rgba(148,163,184,.18);
    backdrop-filter: none;
    box-shadow: 2px 0 8px rgba(2,6,23,.16);
}
[data-bs-theme="dark"] .myts-mobile-nav {
    background: linear-gradient(138deg, rgba(8,13,23,.94), rgba(15,23,42,.88));
    border-color: rgba(148,163,184,.3);
    border-top-color: rgba(255,255,255,.36);
    box-shadow: 0 14px 30px rgba(1,4,9,.55), 0 0 0 1px rgba(148,163,184,.12);
}
[data-bs-theme="dark"] .myts-mobile-nav-item {
    color: rgba(255,255,255,.84);
}
[data-bs-theme="dark"] .myts-mobile-nav-item.is-active {
    color: #ffffff;
    background: linear-gradient(145deg, rgba(37,99,235,.5), rgba(30,64,175,.42));
    border-color: rgba(125,211,252,.52);
}
[data-bs-theme="dark"] .myts-user-menu-list .list-group-item {
    border-color: rgba(148,163,184,.26);
    color: #e5eef9;
    background: linear-gradient(180deg, rgba(30,41,59,.95), rgba(15,23,42,.9));
    box-shadow: 0 8px 16px rgba(2,6,23,.35);
}
[data-bs-theme="dark"] .myts-user-menu-list .list-group-item:hover {
    border-color: rgba(125,211,252,.45);
    box-shadow: 0 10px 18px rgba(14,116,144,.24);
}
[data-bs-theme="dark"] .myts-user-offcanvas {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-left-color: rgba(148,163,184,.24);
    box-shadow: -10px 0 28px rgba(2,6,23,.48);
}
[data-bs-theme="dark"] .myts-user-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, rgba(30,41,59,.92), rgba(15,23,42,.82));
    border-bottom-color: rgba(148,163,184,.22);
}
[data-bs-theme="dark"] .myts-user-offcanvas .offcanvas-body {
    background: linear-gradient(180deg, rgba(15,23,42,.5), rgba(2,6,23,.2));
}
[data-bs-theme="dark"] .myts-user-card {
    border-color: rgba(125,211,252,.24);
    background: linear-gradient(135deg, rgba(30,58,138,.3), rgba(14,116,144,.18));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(2,6,23,.38);
}
[data-bs-theme="dark"] .myts-user-card-title {
    color: #dbeafe;
}
[data-bs-theme="dark"] .myts-user-card-text {
    color: #bfd2ea;
}
[data-bs-theme="dark"] .myts-sidebar .nav-link { color: #b6c4d8; }
[data-bs-theme="dark"] .myts-sidebar .nav-link:hover {
    background: rgba(59,130,246,.12);
    border-color: rgba(96,165,250,.16);
    color: #e5efff;
}
[data-bs-theme="dark"] .myts-sidebar .nav-link.active {
    background: rgba(59,130,246,.16);
    color: #f8fbff;
    border-color: rgba(96,165,250,.22);
    border-left-color: #60a5fa;
    box-shadow: none;
}
[data-bs-theme="dark"] .myts-sidebar .sidebar-section { color: #7c8fa8; }
[data-bs-theme="dark"] .auth-card { background: #1f2937; }
[data-bs-theme="dark"] .auth-wrapper { background: linear-gradient(180deg, #0b1120 0%, #111827 100%); }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select { background-color: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .input-group-text { background-color: #334155; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .dash-card,
[data-bs-theme="dark"] .table-card,
[data-bs-theme="dark"] .config-card,
[data-bs-theme="dark"] .modal-content {
    background: #1f2937;
    border-color: rgba(148,163,184,.22);
    box-shadow: 0 2px 8px rgba(2,6,23,.28);
    backdrop-filter: none;
}
[data-bs-theme="dark"] .table-card .card-header {
    background: linear-gradient(180deg, rgba(51,65,85,.95), rgba(30,41,59,.98));
    border-bottom: 1px solid rgba(148,163,184,.18);
    color: #dbeafe;
}
[data-bs-theme="dark"] .myts-ficha-panel {
    background: #111827;
    border-color: rgba(96,165,250,.34);
}
[data-bs-theme="dark"] .myts-ficha-panel-header {
    background: linear-gradient(180deg, #295faa 0%, #1f4c8d 100%);
    border-bottom-color: #173c71;
    color: #eef5ff;
}
[data-bs-theme="dark"] .page-header-action {
    background: rgba(15,23,42,.72);
    border-color: rgba(148,163,184,.22);
    color: #dbe6f5;
}
[data-bs-theme="dark"] .page-header-action:hover {
    color: #7dd3fc;
    border-color: rgba(56,189,248,.32);
}
[data-bs-theme="dark"] .page-header-action.is-active {
    color: #bfdbfe;
    background: rgba(30,64,175,.3);
    border-color: rgba(96,165,250,.5);
}
[data-bs-theme="dark"] .myts-ficha-panel-toggle {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.2);
    color: #eef5ff;
}
[data-bs-theme="dark"] .myts-ficha-panel-toggle:hover {
    border-color: rgba(255,255,255,.35);
    color: #1f4c8d;
    background: #ffffff;
}
[data-bs-theme="dark"] .myts-ficha-header-icon {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.22);
    color: #eef5ff;
}
[data-bs-theme="dark"] .myts-ficha-header-icon:hover {
    border-color: rgba(255,255,255,.38);
    color: #1f4c8d;
    background: #ffffff;
}
[data-bs-theme="dark"] .myts-map-close-fab {
    border-color: rgba(148,163,184,.35);
    background: rgba(15,23,42,.78);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .myts-map-close-fab:hover {
    border-color: rgba(191,219,254,.48);
    background: rgba(15,23,42,.92);
    color: #ffffff;
}
[data-bs-theme="dark"] .myts-ficha-kicker { color: #d5e6ff; }
[data-bs-theme="dark"] .myts-ficha-inline-badge {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.18);
    color: #eef5ff;
}
[data-bs-theme="dark"] .myts-ficha-panel-body {
    background: #111827;
}
[data-bs-theme="dark"] .myts-ficha-summary-item,
[data-bs-theme="dark"] .myts-ficha-kv-item {
    border-color: rgba(96,165,250,.16);
    background: #0b1220;
}
[data-bs-theme="dark"] .myts-ficha-panel-header .btn-myts {
    background: #ffffff;
    color: #1f4c8d;
    border-color: rgba(255,255,255,.24);
}
[data-bs-theme="dark"] .myts-ficha-panel-header .btn-myts:hover {
    background: #dbeafe;
    color: #173c71;
}
[data-bs-theme="dark"] .myts-ficha-datastrip-item {
    border-right-color: rgba(148,163,184,.22);
}
[data-bs-theme="dark"] .dashboard-hero {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-color: rgba(96,165,250,.22);
    color: #e5eef9;
}
[data-bs-theme="dark"] .myts-brand-mark {
    border-color: rgba(147,197,253,.34);
    box-shadow: 0 4px 12px rgba(2,6,23,.45);
}
[data-bs-theme="dark"] .dashboard-brand-lockup {
    border-color: rgba(147,197,253,.28);
    background: linear-gradient(180deg, rgba(17,24,39,.9), rgba(15,23,42,.8));
    box-shadow: 0 10px 20px rgba(2,6,23,.45);
}
[data-bs-theme="dark"] .dashboard-hero .dashboard-kicker { color: #93c5fd; }
[data-bs-theme="dark"] .dashboard-copy { color: #b7c5d9; }
[data-bs-theme="dark"] .dashboard-pill {
    background: #111827;
    border-color: rgba(148,163,184,.18);
}
[data-bs-theme="dark"] .myts-articulos-table thead th {
    background: linear-gradient(180deg, rgba(37,99,235,.18), rgba(15,23,42,.88));
    border-bottom-color: rgba(148,163,184,.22);
}
[data-bs-theme="dark"] .myts-articulos-table tbody td {
    border-bottom-color: rgba(148,163,184,.14);
}
[data-bs-theme="dark"] .myts-articulos-table tbody tr:hover td {
    background: rgba(37,99,235,.12);
}
[data-bs-theme="dark"] .myts-articulo-card {
    border-color: rgba(96,165,250,.18);
    background: linear-gradient(180deg, rgba(15,23,42,.68), rgba(30,41,59,.52));
}
[data-bs-theme="dark"] .myts-articulo-chip {
    background: rgba(56,189,248,.14);
    color: #7dd3fc;
}
[data-bs-theme="dark"] .myts-articulo-field {
    background: rgba(15,23,42,.72);
    border-color: rgba(96,165,250,.14);
}
[data-bs-theme="dark"] .myts-ficha-kv-value a { color: #93c5fd; }
[data-bs-theme="dark"] .myts-ficha-empty { color: #94a3b8; }
[data-bs-theme="dark"] .config-card:hover { box-shadow: 0 16px 36px rgba(2,6,23,.55) !important; }
[data-bs-theme="dark"] .dashboard-widget,
[data-bs-theme="dark"] .dashboard-metric-card,
[data-bs-theme="dark"] .dashboard-search-item,
[data-bs-theme="dark"] .dashboard-recent-item {
    background: #111827;
    border-color: rgba(148,163,184,.18);
}
[data-bs-theme="dark"] .dashboard-module-card {
    box-shadow: 0 12px 24px rgba(2,6,23,.22);
}
[data-bs-theme="dark"] .dashboard-module-card:hover {
    box-shadow: 0 18px 34px rgba(2,6,23,.38);
    border-color: rgba(96,165,250,.28);
}
[data-bs-theme="dark"] .dashboard-icon-settings { color: #cbd5e1; }
[data-bs-theme="dark"] .modal-header.bg-primary {
    background: linear-gradient(135deg, rgba(37,99,235,.92), rgba(30,64,175,.9)) !important;
}
[data-bs-theme="dark"] .swal2-popup { background: #1e293b !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .swal2-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .myts-toast {
    background: #0f172a !important; color: #e2e8f0 !important;
    border: 1px solid rgba(148,163,184,.28) !important;
}
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent; --bs-table-color: #e2e8f0;
    --bs-table-border-color: #334155;
    --bs-table-hover-bg: rgba(255,255,255,.05); --bs-table-hover-color: #e2e8f0;
}
[data-bs-theme="dark"] table.dataTable thead th { color: #94a3b8; border-bottom-color: #334155 !important; }
[data-bs-theme="dark"] table.dataTable tbody td { color: #e2e8f0; }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length label { color: #94a3b8; }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select { background-color: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button { color: #94a3b8 !important; }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: #334155 !important; color: #e2e8f0 !important; border-color: #334155 !important; }
[data-bs-theme="dark"] .myts-blockui { background: rgba(2,6,23,.56); }
[data-bs-theme="dark"] .myts-blockui-card { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .ui-autocomplete { background: #1e293b; border-color: #475569; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .ui-autocomplete .ui-menu-item-wrapper { color: #e2e8f0; border-bottom-color: #334155; }

/* ===== ASISTENTE DE VOZ ===== */
#btn-voice.listening { color: var(--myts-danger, #ef4444); animation: myts-pulse 1s infinite; }
@keyframes myts-pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.voice-cmd-link { display:flex; align-items:center; padding:.35rem .5rem; border-radius:.375rem; color:var(--myts-text); text-decoration:none; transition:background .15s; }
.voice-cmd-link:hover { background:var(--myts-hover-bg, rgba(0,0,0,.06)); color:var(--myts-primary); }
[data-bs-theme="dark"] .voice-cmd-link:hover { background:rgba(255,255,255,.08); }
.voice-result-head {
    font-size: .78rem;
    color: var(--myts-text-muted);
    margin-bottom: .45rem;
}
.voice-result-empty {
    font-size: .78rem;
    color: var(--myts-text-muted);
    padding: .45rem 0;
}
.voice-result-item {
    width: 100%;
    display: block;
    text-align: left;
    padding: .55rem .65rem;
    border-radius: .35rem;
    border: 1px solid var(--myts-border);
    background: transparent;
    margin-bottom: .45rem;
}
.voice-result-item:hover {
    border-color: rgba(26,115,232,.28);
    background: rgba(26,115,232,.04);
}
.voice-result-code,
.voice-result-description {
    display: block;
}
.voice-result-code {
    font-weight: 700;
    color: var(--myts-primary);
}
.voice-result-description {
    font-size: .78rem;
    color: var(--myts-text-muted);
    margin-top: .15rem;
}
[data-bs-theme="dark"] .dashboard-recent-item,
[data-bs-theme="dark"] .dashboard-search-item,
[data-bs-theme="dark"] .voice-result-item {
    background: rgba(15,23,42,.46);
}
[data-bs-theme="dark"] .dashboard-search-item:hover,
[data-bs-theme="dark"] .voice-result-item:hover {
    background: rgba(96,165,250,.08);
}

/* ── Dark theme bugfixes ── */
[data-bs-theme="dark"] .dashboard-warning {
    background: rgba(251, 188, 4, 0.08);
    border-color: rgba(251, 188, 4, 0.28);
    color: #fef08a;
}

[data-bs-theme="dark"] .myts-topbar .user-menu-toggle {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 0.22);
    color: #e5eef9;
}

[data-bs-theme="dark"] .myts-topbar .user-menu-toggle:hover {
    background: #374151;
    border-color: rgba(96, 165, 250, 0.32);
}

/* Elevación y sombra adaptada en modo oscuro para dash-card y config-card */
[data-bs-theme="dark"] .dash-card:hover {
    border-color: rgba(96, 165, 250, 0.35) !important;
    box-shadow: 
        0 10px 20px -3px rgba(2, 6, 23, 0.45), 
        0 6px 8px -4px rgba(2, 6, 23, 0.35),
        0 0 0 1px rgba(96, 165, 250, 0.08) !important;
    transform: translateY(-2px) !important;
}

[data-bs-theme="dark"] .config-card:hover {
    border-color: rgba(96, 165, 250, 0.35) !important;
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.55) !important;
    transform: translateY(-2px) !important;
}

/* Feedback de hover para table-card sin provocar translateY (evita saltos) */
[data-bs-theme="dark"] .table-card:hover {
    border-color: rgba(96, 165, 250, 0.35) !important;
    box-shadow: 
        0 10px 20px -3px rgba(2, 6, 23, 0.45), 
        0 6px 8px -4px rgba(2, 6, 23, 0.35),
        0 0 0 1px rgba(96, 165, 250, 0.08) !important;
}

/* Corrección para botones de cabecera en hover en tema oscuro */
[data-bs-theme="dark"] .page-header-action:hover {
    background: rgba(30, 41, 59, 0.9) !important;
}

/* Selector de temas (theme-toggle) en tema oscuro */
[data-bs-theme="dark"] .theme-toggle {
    background: #1f2937;
    border-color: #334155;
    color: #9fb0c7;
}
[data-bs-theme="dark"] .theme-toggle:hover {
    background: #2d3748;
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.28);
}

/* Accesos rápidos (quick icons) en tema oscuro */
[data-bs-theme="dark"] .dashboard-quick-icon {
    background: #1f2937;
    border-color: #334155;
    color: #60a5fa;
}
[data-bs-theme="dark"] .dashboard-quick-icon:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}

/* Sombras de métricas y hover de elementos recientes en modo oscuro */
[data-bs-theme="dark"] .dashboard-metric-card:hover {
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.4) !important;
}

[data-bs-theme="dark"] .dashboard-recent-item:hover {
    background: rgba(96, 165, 250, 0.08) !important;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35) !important;
}

/* ── Unified Grid System & Badges (Option A) ── */
.myts-table {
    width: 100% !important;
    border-collapse: collapse;
    color: var(--myts-text);
    background: var(--myts-card-bg);
}

/* Light theme table header — gris pizarra neutro (sin azul) */
html[data-bs-theme="light"] .myts-table-header {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

html[data-bs-theme="light"] .myts-table-header th {
    background-color: #f8fafc !important;
    color: #475569 !important;
}

/* Dark theme table header */
[data-bs-theme="dark"] .myts-table-header {
    background: rgba(30, 41, 59, 0.45) !important;
    color: #9fb0c7 !important;
    border-bottom: 2px solid var(--myts-border) !important;
}

[data-bs-theme="dark"] .myts-table-header th {
    background-color: rgba(30, 41, 59, 0.45) !important;
    color: #9fb0c7 !important;
}

.myts-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    padding: 0.65rem 0.85rem;
    border-bottom: 2px solid var(--myts-border);
}

.myts-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--myts-border);
    vertical-align: middle;
    font-size: 0.82rem;
}

/* Light theme table rows */
html[data-bs-theme="light"] .myts-table tr {
    background-color: var(--myts-card-bg) !important;
}
html[data-bs-theme="light"] .myts-table tr:nth-of-type(even) {
    background-color: #f8fafc !important;
}
html[data-bs-theme="light"] .myts-table tr:hover {
    background: #f1f5f9 !important;
}

/* Dark theme table rows */
[data-bs-theme="dark"] .myts-table tr {
    background-color: var(--myts-card-bg) !important;
}
[data-bs-theme="dark"] .myts-table tr:nth-of-type(even) {
    background-color: rgba(30, 41, 59, 0.2) !important;
}
[data-bs-theme="dark"] .myts-table tr:hover {
    background: rgba(96, 165, 250, 0.08) !important;
}

.myts-link {
    color: var(--myts-primary-dark, #2563eb);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.myts-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

[data-bs-theme="dark"] .myts-link {
    color: #60a5fa;
}

[data-bs-theme="dark"] .myts-link:hover {
    color: #93c5fd;
}

/* Unified Badge System */
.myts-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9999px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Estado badges en tablas: esquinas menos redondeadas */
.myts-badge-estado {
    border-radius: 4px;
}

/* Light theme badges */
.myts-badge-success   { background: #e6f4ea; color: #137333; border: 1px solid rgba(19, 115, 51, 0.12); }
.myts-badge-info      { background: #e8f0fe; color: #1a73e8; border: 1px solid rgba(26, 115, 232, 0.12); }
.myts-badge-primary   { background: #f3e8ff; color: #7627d2; border: 1px solid rgba(118, 39, 210, 0.12); }
.myts-badge-secondary { background: #f1f3f4; color: #3c4043; border: 1px solid rgba(60, 64, 67, 0.12); }
.myts-badge-danger    { background: #fce8e6; color: #c5221f; border: 1px solid rgba(197, 34, 31, 0.12); }

/* Dark theme badges */
[data-bs-theme="dark"] .myts-badge-success   { background: rgba(34, 197, 94, 0.08); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }
[data-bs-theme="dark"] .myts-badge-info      { background: rgba(56, 189, 248, 0.08); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.2); }
[data-bs-theme="dark"] .myts-badge-primary   { background: rgba(59, 130, 246, 0.08); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
[data-bs-theme="dark"] .myts-badge-secondary { background: rgba(148, 163, 184, 0.08); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }
[data-bs-theme="dark"] .myts-badge-danger    { background: rgba(239, 68, 68, 0.08); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }

/* DataTables Integration Footer & Pagination */
.dataTables_wrapper {
    display: flow-root !important;
    background: var(--myts-card-bg);
}

/* 1. Support for Vanilla DataTables layout (without row wrap) */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    border-top: 1px solid var(--myts-border);
    background: var(--myts-card-bg);
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_info {
    float: left;
    width: 50%;
    text-align: left;
    padding: 0.95rem 1.25rem !important;
    font-size: 0.82rem;
    color: var(--myts-text-muted);
}

.dataTables_wrapper .dataTables_paginate {
    float: right;
    width: 50%;
    text-align: right;
    padding: 0.65rem 1.25rem !important;
}

/* 2. Support for Bootstrap-wrapped DataTables layout */
.dataTables_wrapper .row:last-child {
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--myts-border);
    background: var(--myts-card-bg);
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-items: center;
}

.dataTables_wrapper .row:last-child .dataTables_info,
.dataTables_wrapper .row:last-child .dataTables_paginate {
    border-top: none !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.32rem 0.75rem !important;
    margin-left: 4px !important;
    border-radius: 0.35rem !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--myts-text-muted) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    transition: all 0.15s ease-in-out !important;
    display: inline-block;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(66, 133, 244, 0.08) !important;
    color: var(--myts-primary-dark) !important;
    border-color: rgba(66, 133, 244, 0.15) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--myts-primary) !important;
    color: #ffffff !important;
    border-color: var(--myts-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    color: #cbd5e1 !important;
    background: transparent !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
}

/* Dark mode overrides */
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(96, 165, 250, 0.12) !important;
    color: #f8fafc !important;
    border-color: rgba(96, 165, 250, 0.2) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #475569 !important;
    background: transparent !important;
    border-color: transparent !important;
}

/* Responsiveness for Vanilla DataTables footer */
@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        width: 100% !important;
        text-align: center !important;
    }
    .dataTables_wrapper .dataTables_paginate {
        border-top: none !important;
        padding-top: 0.2rem !important;
        padding-bottom: 0.95rem !important;
    }
}

/* ── Hotfix móvil (demo VPN / :8443) ───────────────────────────────────── */
@media (max-width: 991.98px) {
    html { font-size: 16px !important; }
    body { max-width: 100vw; overflow-x: hidden; }
    .myts-main .container-fluid,
    .myts-main .container { max-width: 100%; padding-left: .75rem; padding-right: .75rem; }
    .dashboard-shell-header .dashboard-section-title { font-size: 1.15rem; }
    .dashboard-kpi-value { font-size: 1.35rem !important; }
    .row.g-3 > [class*="col-sm-6"] { flex: 0 0 100%; max-width: 100%; }
}
@media (max-width: 575.98px) {
    .auth-wrapper {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .auth-card {
        max-width: none;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .auth-card .card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
}


