/* =============================================================================
 * Grupo Negreiros ERP — Ultra-Modern Futuristic Dark SaaS Design System
 * Inspired by High-End Operations & Telemetry Dashboards
 * ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root,
[data-bs-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-subtle: #ffffff;
    
    --border-color: #e2e8f0;
    --border-color-light: #cbd5e1;
    --border-color-focus: #0284c7;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent-cyan: #0284c7;
    --accent-cyan-rgb: 2, 132, 199;
    --accent-emerald: #059669;
    --accent-emerald-rgb: 5, 150, 105;
    --accent-amber: #d97706;
    --accent-amber-rgb: 217, 119, 6;
    --accent-blue: #2563eb;
    --accent-blue-rgb: 37, 99, 235;
    --accent-rose: #dc2626;
    --accent-rose-rgb: 220, 38, 38;
    --accent-purple: #7c3aed;

    --brand: #0284c7;
    --brand-rgb: 2, 132, 199;

    --sidebar-collapsed-w: 68px;
    --sidebar-expanded-w: 250px;
    --topbar-h: 64px;

    --card-radius: 12px;
    --btn-radius: 8px;
    --pill-radius: 8px;

    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);

    /* Bootstrap theme overrides for light theme */
    --bs-body-bg: var(--bg-base);
    --bs-body-color: var(--text-primary);
    --bs-secondary-color: var(--text-secondary);
    --bs-border-color: var(--border-color);
    --bs-card-bg: var(--bg-surface);
    --bs-card-cap-bg: var(--bg-surface);
    --bs-card-border-color: var(--border-color);
    --bs-card-color: var(--text-primary);
    --bs-tertiary-bg: var(--bg-surface-elevated);
    --bs-secondary-bg: var(--bg-surface-elevated);
    --panel-surface: var(--bg-surface);
}

/* Dark theme overrides when explicitly toggled */
[data-bs-theme="dark"] {
    --bg-base: #0b0e14;
    --bg-surface: #111622;
    --bg-surface-elevated: #161d2d;
    --bg-surface-subtle: #0d121c;
    --border-color: #1a2234;
    --border-color-light: #243048;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-cyan: #38bdf8;
    --accent-cyan-rgb: 56, 189, 248;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-blue: #3b82f6;
    --btn-primary-bg: #0284c7;
    --btn-primary-hover: #0369a1;
    --bs-body-bg: var(--bg-base);
    --bs-body-color: var(--text-primary);
    --bs-secondary-color: var(--text-secondary);
    --bs-border-color: var(--border-color);
    --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
    --bs-card-bg: var(--bg-surface);
    --bs-card-cap-bg: var(--bg-surface);
    --bs-card-border-color: var(--border-color);
    --bs-card-color: var(--text-primary);
    --bs-tertiary-bg: var(--bg-surface-elevated);
    --bs-secondary-bg: var(--bg-surface-elevated);
    --panel-surface: var(--bg-surface);
}

/* Global Dark Mode Protection for Cards, Forms, and Utility Classes */
[data-bs-theme="dark"] .card {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--bg-surface) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-surface-elevated) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

/* btn-light y table-light (29 y 25 usos) quedaban claros en modo oscuro */
[data-bs-theme="dark"] .btn-light {
    --bs-btn-bg: var(--bg-surface-elevated);
    --bs-btn-border-color: var(--border-color);
    --bs-btn-color: var(--text-primary);
    --bs-btn-hover-bg: var(--bg-surface);
    --bs-btn-hover-border-color: var(--border-color);
    --bs-btn-hover-color: var(--text-primary);
    --bs-btn-active-bg: var(--bg-surface);
    --bs-btn-active-color: var(--text-primary);
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > * > * {
    --bs-table-bg: var(--bg-surface-elevated);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    background-color: var(--bg-surface-elevated) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-select {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-primary);
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* =============================================================================
 * Modern Ultra-Thin Rounded Scrollbars (Global)
 * Matches premium modern OS and executive telemetry design
 * ============================================================================= */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

[data-bs-theme="dark"] * {
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 116, 139, 0.6);
}

[data-bs-theme="dark"] *::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme="dark"] *::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.45);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* =============================================================================
 * Shell v2 (29/10/2026): menú lateral + barra superior, igual en Blade y Vue
 *  - ≥ 1200 px: menú con nombres (se puede reducir a íconos; se recuerda)
 *  - 992–1199 px o reducido: barra de íconos; al pasar el mouse se despliega
 *    ENCIMA del contenido (no lo empuja ni lo reacomoda)
 *  - < 992 px: el menú sale de la pantalla y se abre como panel deslizable
 * ============================================================================= */
.panel-shell {
    --sb-w: var(--sidebar-expanded-w);
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-base);
}

.panel-sidebar {
    position: relative;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--sb-w);
    width: var(--sb-w);
    height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    transition: width var(--dur-3) var(--ease-out), flex-basis var(--dur-3) var(--ease-out), margin var(--dur-3) var(--ease-out),
        box-shadow var(--dur-3) var(--ease-out), transform 300ms var(--ease-out);
}

/* Cabecera del menú: logo + botón */
.sidebar-header {
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.85rem;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.sidebar-toggle-btn:hover { background: var(--bg-surface-elevated); color: var(--text-primary); }
.sidebar-toggle-btn:active { transform: scale(0.94); }
.sidebar-toggle-btn:focus-visible { outline: none; box-shadow: var(--ring); }

.sidebar-logo-link { display: flex; align-items: center; min-width: 0; text-decoration: none; order: -1; margin-right: auto; }
.sidebar-logo-img { max-height: 32px; max-width: 150px; width: auto; height: auto; object-fit: contain; }

/* Navegación */
.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.65rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.sidebar-nav:hover { scrollbar-color: rgba(148, 163, 184, 0.35) transparent; }

.nav-heading {
    padding: 1rem 0.6rem 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-heading:first-child { padding-top: 0.5rem; }

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    height: 36px;
    padding: 0 0.6rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.sidebar-link .bi { font-size: 1.05rem; width: 20px; flex-shrink: 0; text-align: center; color: var(--text-muted); transition: color var(--dur-1) var(--ease-out); }
.sidebar-link .link-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar-link:hover { background: var(--bg-surface-elevated); color: var(--text-primary); }
.sidebar-link:hover .bi { color: var(--text-primary); }
.sidebar-link:focus-visible { outline: none; box-shadow: var(--ring); }

/* Activo: fondo con el color de la marca y una marca a la izquierda */
.sidebar-link.active { background: rgba(var(--brand-rgb), 0.1); color: var(--brand); font-weight: 600; }
.sidebar-link.active .bi { color: var(--brand); }
.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -0.65rem;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}

.sidebar-link .sidebar-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    font-size: 0.66rem !important;
    font-weight: 700;
    background-color: var(--accent-rose) !important;
    color: #fff !important;
}

/* Pie: sello de conexión segura */
.sidebar-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border-color);
}
.sidebar-shield-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 32px;
    padding: 0 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-emerald);
    background: rgba(var(--accent-emerald-rgb), 0.08);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-shield-btn i { font-size: 0.95rem; }
.sidebar-shield-btn::after { content: "Conexión segura"; }

/* ---------- Barra de íconos: reducido a mano (≥ 992 px) o pantalla mediana (992–1199 px) ----------
   Las mismas reglas van dos veces: CSS no permite unir una media query con un atributo en un solo selector. */
@media (min-width: 992px) {
    :root[data-sidebar="rail"] .panel-shell { --sb-w: var(--sidebar-collapsed-w); }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-header { justify-content: center; padding: 0; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) :is(.sidebar-logo-link, .link-label) { display: none; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-shield-btn::after { content: none; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .nav-heading { height: 1px; padding: 0; margin: 0.6rem 0.4rem; background: var(--border-color); color: transparent; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-nav { padding-inline: 0.5rem; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-link { justify-content: center; padding: 0; height: 40px; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-link .bi { font-size: 1.15rem; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-link.active::before { left: -0.5rem; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-badge { position: absolute; top: 3px; right: 6px; min-width: 15px; height: 15px; font-size: 0.58rem !important; padding: 0 3px !important; border: 2px solid var(--bg-surface); box-sizing: content-box; }
    :root[data-sidebar="rail"] .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-footer { justify-content: center; padding-inline: 0; }
    /* Al pasar el mouse se despliega ENCIMA: el margen negativo evita que el contenido se mueva */
    :root[data-sidebar="rail"] .panel-sidebar:is(:hover, :has(:focus-visible)) {
        flex-basis: var(--sidebar-expanded-w);
        width: var(--sidebar-expanded-w);
        margin-right: calc(var(--sidebar-collapsed-w) - var(--sidebar-expanded-w));
        box-shadow: var(--shadow-lg);
    }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .panel-shell { --sb-w: var(--sidebar-collapsed-w); }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-header { justify-content: center; padding: 0; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) :is(.sidebar-logo-link, .link-label) { display: none; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-shield-btn::after { content: none; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .nav-heading { height: 1px; padding: 0; margin: 0.6rem 0.4rem; background: var(--border-color); color: transparent; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-nav { padding-inline: 0.5rem; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-link { justify-content: center; padding: 0; height: 40px; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-link .bi { font-size: 1.15rem; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-link.active::before { left: -0.5rem; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-badge { position: absolute; top: 3px; right: 6px; min-width: 15px; height: 15px; font-size: 0.58rem !important; padding: 0 3px !important; border: 2px solid var(--bg-surface); box-sizing: content-box; }
    .panel-sidebar:not(:hover):not(:has(:focus-visible)) .sidebar-footer { justify-content: center; padding-inline: 0; }
    .panel-sidebar:is(:hover, :has(:focus-visible)) {
        flex-basis: var(--sidebar-expanded-w);
        width: var(--sidebar-expanded-w);
        margin-right: calc(var(--sidebar-collapsed-w) - var(--sidebar-expanded-w));
        box-shadow: var(--shadow-lg);
    }
}

/* ---------- Panel deslizable en celular y tablet ---------- */
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .panel-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        flex-basis: auto;
        transform: translateX(-100%);
        box-shadow: none;
        visibility: hidden;
        transition: transform 300ms var(--ease-out), visibility 0s linear 300ms, box-shadow 300ms var(--ease-out);
    }
    .panel-sidebar.is-open {
        transform: none;
        visibility: visible;
        box-shadow: var(--shadow-lg);
        transition: transform 300ms var(--ease-out), visibility 0s, box-shadow 300ms var(--ease-out);
    }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 300ms var(--ease-out);
    }
    .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
    .sidebar-link { height: 42px; font-size: 0.9rem; }
    /* Dentro del panel el botón del encabezado cierra */
    .sidebar-header .sidebar-toggle-btn .bi::before { content: "\f659"; }
}

/* ---------- Contenido ---------- */
.panel-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background-color: var(--bg-base);
}

.panel-topbar {
    position: relative;
    z-index: 1020;
    flex-shrink: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}
.topbar-left { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.topbar-company { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); min-width: 0; }

.topbar-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.topbar-icon-btn:hover { background: var(--bg-surface-elevated); color: var(--text-primary); }
.topbar-icon-btn:active { transform: scale(0.94); }
.topbar-icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Buscador (Ctrl+K) */
.topbar-search-container { width: 240px; margin-right: 0.35rem; }
.topbar-search-box {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.topbar-search-box:hover { border-color: var(--border-color-light); background: var(--bg-surface); }
.topbar-search-box:focus-visible { outline: none; box-shadow: var(--ring); }
.topbar-search-box .search-box-text { flex: 1 1 auto; text-align: left; }
.topbar-search-kbd {
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.65rem;
    font-weight: 600;
}

.command-palette-kbd {
    background: var(--bg-surface-elevated) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    font-weight: 600 !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 0.72rem !important;
    display: inline-block;
}

/* Contador de notificaciones */
.badge-count {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid var(--bg-surface);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    box-sizing: content-box;
}
.badge-count-blue { background: var(--brand); color: var(--brand-text, #fff); }
.badge-count-red { background: var(--accent-rose); color: #fff; }

/* Usuario */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.25rem;
    padding: 0.2rem 0.45rem 0.2rem 0.2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: background-color var(--dur-1) var(--ease-out);
}
.topbar-user:hover { background: var(--bg-surface-elevated); }
.topbar-user:focus-visible { outline: none; box-shadow: var(--ring); }
.topbar-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.topbar-user-info { line-height: 1.2; text-align: left; }
.topbar-user-name { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.topbar-user-role { display: block; font-size: 0.7rem; color: var(--text-muted); }

/* Área de la pantalla: nada se sale de lado */
.panel-content {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 2rem 3rem;
}

@media (max-width: 991.98px) {
    .panel-topbar { padding: 0 1rem; }
    .panel-content { padding: 1.25rem 1rem 2.5rem; }
}
@media (max-width: 575.98px) {
    .topbar-user .bi-chevron-down { display: none; }
    .panel-content { padding: 1rem 0.85rem 2rem; }
}

/* Header Controls (Date pill, Search, Action) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.date-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.date-filter-pill .divider {
    color: var(--border-color-light);
}

.search-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-pill-btn:hover {
    border-color: var(--border-color-focus);
    color: var(--text-primary);
}

.search-pill-btn kbd {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Header Company Switcher (clean pill beside calendar) */
.header-company-select {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 0.8rem;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.header-company-select select {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    padding-right: 0.25rem;
}

/* Action button: Ver Marcaciones (clean, solid, NO underline, NO ugly border) */
.btn-action-clean {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.15rem;
    border-radius: var(--btn-radius);
    background: var(--brand);
    color: #ffffff !important;
    border: none !important;
    text-decoration: none !important;
    font-size: 0.825rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(var(--brand-rgb), 0.3);
}

.btn-action-clean:hover {
    background: #0369a1;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(var(--brand-rgb), 0.35);
    transform: translateY(-1px);
}

.btn-action-clean:focus,
.btn-action-clean:active {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* =============================================================================
 * KPI Metric Cards (With Clean Top Accent Borders)
 * ============================================================================= */
.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-color-light);
}

/* Top accent colored lines */
.kpi-card.accent-emerald {
    border-top: 3px solid var(--accent-emerald) !important;
}
.kpi-card.accent-amber {
    border-top: 3px solid var(--accent-amber) !important;
}
.kpi-card.accent-cyan {
    border-top: 3px solid var(--accent-cyan) !important;
}
.kpi-card.accent-blue {
    border-top: 3px solid var(--accent-blue) !important;
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.kpi-title {
    font-size: 0.725rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.kpi-icon-squircle {
    width: 36px;
    height: 36px;
    border-radius: var(--btn-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.kpi-icon-squircle.cyan {
    background: rgba(var(--accent-cyan-rgb), 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(var(--accent-cyan-rgb), 0.25);
}
.kpi-icon-squircle.emerald {
    background: rgba(var(--accent-emerald-rgb), 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(var(--accent-emerald-rgb), 0.25);
}
.kpi-icon-squircle.blue {
    background: rgba(var(--accent-blue-rgb), 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(var(--accent-blue-rgb), 0.25);
}
.kpi-icon-squircle.amber {
    background: rgba(var(--accent-amber-rgb), 0.1);
    color: var(--accent-amber);
    border: 1px solid rgba(var(--accent-amber-rgb), 0.25);
}

.kpi-number {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-feature-settings: "tnum" 1;
    margin-bottom: 0.65rem;
}

.kpi-number.emerald {
    color: var(--accent-emerald);
}

.kpi-footer-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.775rem;
    color: var(--text-secondary);
}

.kpi-footer-bullet {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bullet-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.bullet-dot.emerald { background: var(--accent-emerald); }
.bullet-dot.blue { background: var(--accent-blue); }
.bullet-dot.amber { background: var(--accent-amber); }
.bullet-dot.cyan { background: var(--accent-cyan); }
.bullet-dot.rose { background: var(--accent-rose); }

.live-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #059669;
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
    animation: livePulseGlow 2s infinite;
}

@keyframes livePulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* Animación de giro para el botón de sincronizar sin recargar */
@keyframes spinSync {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.is-spinning {
    animation: spinSync 0.6s linear infinite !important;
    display: inline-block;
}

/* Command Palette Styles (Ctrl+K) */
.command-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.command-palette-item {
    transition: all 0.15s ease;
    cursor: pointer;
}

.command-palette-item:hover,
.command-palette-item.is-selected {
    background-color: #f0f9ff !important;
    border-color: #bae6fd !important;
}

.command-palette-item:hover .command-item-icon,
.command-palette-item.is-selected .command-item-icon {
    background-color: var(--brand);
    color: #ffffff;
}

[data-bs-theme="dark"] .command-palette-item:hover,
[data-bs-theme="dark"] .command-palette-item.is-selected {
    background-color: #1a2336 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .command-palette-item:hover .command-item-icon,
[data-bs-theme="dark"] .command-palette-item.is-selected .command-item-icon {
    background-color: var(--brand);
    color: #ffffff;
}

/* Dropdown Menus in Light Theme */
.date-filter-dropdown,
.user-profile-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}

.user-profile-dropdown .dropdown-item {
    color: #334155 !important;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.user-profile-dropdown .dropdown-item:hover {
    background-color: #f8fafc !important;
    color: var(--brand) !important;
}

.user-profile-dropdown .dropdown-item.text-danger:hover {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

/* SVG Circular Progress Ring */
.progress-dial-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.progress-dial-group:last-child {
    border-bottom: none;
}

.circular-dial-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.circular-dial-wrapper svg {
    transform: rotate(-90deg);
}

.dial-bg {
    fill: none;
    stroke: var(--bg-surface-elevated);
    stroke-width: 4;
}

.dial-meter {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.dial-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.dial-details {
    flex-grow: 1;
    min-width: 0;
}

.dial-details-title {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.dial-details-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: "tnum" 1;
}

.dial-details-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Map frame */
.map-frame {
    width: 100%;
    height: 380px;
    border-radius: var(--btn-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    overflow: hidden;
}

/* =============================================================================
 * Forms, Controls & Tables in Dark Theme
 * ============================================================================= */
.form-control,
.form-select {
    background-color: var(--bg-surface-elevated) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--btn-radius) !important;
    height: 38px;
    font-size: 0.85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-cyan-rgb), 0.15) !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
}

.bg-success-subtle {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--accent-emerald) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.bg-warning-subtle {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--accent-amber) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.bg-danger-subtle {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--accent-rose) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.bg-info-subtle,
.bg-primary-subtle {
    background: rgba(var(--accent-cyan-rgb), 0.1) !important;
    color: var(--accent-cyan) !important;
    border: 1px solid rgba(var(--accent-cyan-rgb), 0.25) !important;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    background-color: currentColor;
    flex-shrink: 0;
}

.tenant-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.725rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 2px;
    line-height: 1.3;
    vertical-align: middle;
}

.tenant-badge i {
    font-size: 0.75rem;
    color: var(--accent-cyan, var(--brand));
    margin: 0 !important;
}

/* =============================================================================
 * Modern Compact Toast Notifications (Clean, Compact, Perfect Icon-Text Alignment)
 * ============================================================================= */
/* Pila estilo Sonner: el aviso más nuevo al frente, los anteriores asoman detrás
   (más chicos y atenuados) y la pila se despliega al pasar el mouse o con el foco. */
.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1095;
    display: grid;
    justify-items: end;
    width: min(356px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast-stack > .alert {
    --i: 0;
    grid-area: 1 / 1;
    pointer-events: auto;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    width: 100% !important;
    padding: 0.75rem 0.75rem 0.75rem 0.8rem !important;
    margin: 0 !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md, 10px) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 12px 32px -8px rgba(15, 23, 42, 0.16) !important;
    transform-origin: top center;
    transform: translateY(calc(var(--i) * 10px)) scale(calc(1 - var(--i) * 0.05));
    opacity: calc(1 - var(--i) * 0.25);
    transition: transform 400ms var(--ease-out), opacity 400ms var(--ease-out);
    animation: toastIn 400ms var(--ease-out) both;
}

.toast-stack > .alert:nth-last-child(2) { --i: 1; }
.toast-stack > .alert:nth-last-child(3) { --i: 2; }
.toast-stack > .alert:nth-last-child(n+4) { --i: 3; opacity: 0; pointer-events: none; }

/* Desplegada: cada aviso baja su propia altura más 8 px */
.toast-stack:is(:hover, :has(:focus-visible)) > .alert {
    transform: translateY(calc(var(--i) * (100% + 8px)));
    opacity: 1;
}
.toast-stack:is(:hover, :has(:focus-visible)) > .alert:nth-last-child(n+4) { pointer-events: auto; }

[data-bs-theme="dark"] .toast-stack > .alert {
    background: #1a2131 !important;
    border-color: #273047 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

@keyframes toastIn {
    from { opacity: 0; translate: 0 -100%; }
}

.toast-stack > .alert.is-leaving,
.toast-leave-active {
    opacity: 0 !important;
    translate: 24px 0;
    transition: opacity 200ms var(--ease-out), translate 200ms var(--ease-out) !important;
}

@media (max-width: 575.98px) {
    .toast-stack { left: 1rem; right: 1rem; width: auto; justify-items: stretch; }
}

/* Toast Icon Badge (Perfect Circle, Centered Icon) */
.toast-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.toast-badge-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.toast-badge-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.toast-badge-info {
    background: #f0f9ff;
    color: var(--brand);
    border: 1px solid #bae6fd;
}
.toast-badge-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

[data-bs-theme="dark"] .toast-badge-success {
    background: rgba(5, 150, 105, 0.2);
    border-color: rgba(5, 150, 105, 0.4);
    color: #34d399;
}
[data-bs-theme="dark"] .toast-badge-danger {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
    color: #f87171;
}
[data-bs-theme="dark"] .toast-badge-info {
    background: rgba(var(--brand-rgb), 0.2);
    border-color: rgba(var(--brand-rgb), 0.4);
    color: #38bdf8;
}
[data-bs-theme="dark"] .toast-badge-warning {
    background: rgba(217, 119, 6, 0.2);
    border-color: rgba(217, 119, 6, 0.4);
    color: #fbbf24;
}

/* Toast Content Block (Aligned Next to Icon) */
.toast-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex-grow: 1;
}

.toast-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin: 0;
}

[data-bs-theme="dark"] .toast-title {
    color: #f8fafc;
}

.toast-text {
    font-size: 0.725rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.3;
    margin-top: 1px;
    white-space: normal;
    word-break: break-word;
}

[data-bs-theme="dark"] .toast-text {
    color: #94a3b8;
}

/* Toast Close Button */
.toast-close-btn {
    background: transparent;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-left: 0.35rem;
    line-height: 1;
}

.toast-close-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

[data-bs-theme="dark"] .toast-close-btn:hover {
    color: #ffffff;
    background: #2d3748;
}

/* =============================================================================
 * Interactive 2-Column Calendar Popover (Matching Reference Screenshot 1)
 * ============================================================================= */
/* =============================================================================
 * Compact & Theme-Adaptive 2-Column Calendar Popover (Screenshot 1 Design)
 * ============================================================================= */
.calendar-pro-popover {
    width: 520px !important;
    max-width: 95vw !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
    color: var(--text-primary) !important;
    padding: 0 !important;
    overflow: hidden !important;
    z-index: 1060;
}

.calendar-pro-popover.popover-single-date {
    width: 310px !important;
    max-width: 100% !important;
}

[data-bs-theme="dark"] .calendar-pro-popover {
    background: #181d28 !important;
    border-color: #2a3447 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5) !important;
}

.calendar-pro-grid {
    display: flex;
    min-height: 310px;
}

.calendar-sidebar-presets {
    width: 170px !important;
    flex-shrink: 0 !important;
    border-right: 1px solid var(--border-color);
    padding: 0.85rem 0.65rem !important;
    background: var(--bg-surface-elevated);
}

[data-bs-theme="dark"] .calendar-sidebar-presets {
    background: #141822;
    border-right-color: #242c3d;
}

.calendar-presets-heading {
    font-size: 0.68rem !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    padding: 0 0.5rem !important;
    white-space: nowrap !important;
}

.calendar-preset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem !important;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem !important;
    font-weight: 500;
    text-align: left;
    white-space: nowrap !important;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.2rem;
}

.calendar-preset-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .calendar-preset-btn:hover {
    background: #1e2638;
    color: #ffffff;
}

.calendar-preset-btn.is-active {
    background: rgba(var(--accent-cyan-rgb), 0.12);
    color: var(--accent-cyan);
    font-weight: 700;
    border-color: rgba(var(--accent-cyan-rgb), 0.3);
}

.calendar-preset-btn .bi-check-lg {
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

.calendar-content-pane {
    flex-grow: 1;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
}

.calendar-date-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.calendar-input-field {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-bs-theme="dark"] .calendar-input-field {
    background: #0f131a;
    border-color: #2a3447;
}

.calendar-input-field.is-active,
.calendar-input-field:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(var(--accent-cyan-rgb), 0.2);
}

.calendar-input-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-input-field input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0;
    width: 100%;
}

.calendar-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.calendar-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.calendar-nav-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .calendar-nav-btn:hover {
    background: #242c3d;
    color: #ffffff;
}

.calendar-month-title {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    margin-bottom: 0.65rem;
}

.calendar-day-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.2rem 0;
    text-transform: uppercase;
}

.calendar-day-cell {
    width: 28px;
    height: 28px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.775rem;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
}

.calendar-day-cell:hover:not(.is-disabled) {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .calendar-day-cell:hover:not(.is-disabled) {
    background: #263147;
    color: #ffffff;
}

.calendar-day-cell.is-outside-month {
    color: var(--text-muted);
    opacity: 0.4;
}

.calendar-day-cell.is-selected-start {
    background: var(--accent-emerald) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.calendar-day-cell.is-in-range {
    background: rgba(16, 185, 129, 0.2) !important;
    color: var(--text-primary) !important;
    border-radius: 0;
}

.calendar-day-cell.is-selected-end {
    border: 1px solid var(--accent-emerald) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    background: var(--accent-emerald) !important;
}

.calendar-helper-note {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    margin-top: auto;
}

.calendar-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.65rem;
}

.calendar-btn-cancel {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-btn-cancel:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}

.calendar-btn-apply {
    background: var(--accent-cyan);
    border: none;
    color: #ffffff;
    font-size: 0.775rem;
    font-weight: 700;
    padding: 0.38rem 1.15rem;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(var(--brand-rgb), 0.3);
    transition: all 0.15s ease;
}

.calendar-btn-apply:hover {
    background: #0369a1;
    box-shadow: 0 3px 8px rgba(var(--brand-rgb), 0.4);
}

/* =============================================================================
 * Strict Selfie Image Constraints & Stream Pagination (Screenshot 5 Fix)
 * ============================================================================= */
.selfie-wrapper {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================================================
 * Avatars & Employee Thumbnails (Uniform, Fixed Dimensions, Never Overflow)
 * ============================================================================= */
.avatar {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--brand);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    overflow: hidden !important;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.avatar-sm {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    font-size: 0.725rem;
}

.avatar-lg {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    font-size: 1.25rem;
}

.selfie-thumb {
    width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    max-height: 44px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.selfie-thumb:hover {
    transform: scale(1.08);
}

.selfie-thumb.is-outside {
    border: 2px solid var(--accent-rose) !important;
}

.attendance-selfie-thumb-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.attendance-selfie-thumb-wrapper.is-outside {
    border: 2px solid #ef4444 !important;
}

.attendance-selfie-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.18s ease;
}

.attendance-selfie-thumb-wrapper:hover .attendance-selfie-thumb {
    transform: scale(1.15);
}

.attendance-selfie-thumb-wrapper .selfie-zoom-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.attendance-selfie-thumb-wrapper:hover .selfie-zoom-badge {
    opacity: 1;
}

.stream-list {
    max-height: 290px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.stream-list::-webkit-scrollbar {
    width: 4px;
}
.stream-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* ==========================================================================
   Icon Action Buttons for Tables (.btn-table-action)
   ========================================================================== */
.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-surface, #ffffff);
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    transition: all 0.18s ease;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    line-height: 1;
}

.btn-table-action:hover {
    color: var(--accent-cyan, var(--brand));
    border-color: var(--brand);
    background: rgba(var(--brand-rgb), 0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(var(--brand-rgb), 0.12);
}

.btn-table-action.btn-action-edit:hover {
    color: var(--brand);
    border-color: #38bdf8;
    background: #f0f9ff;
}

.btn-table-action.btn-action-view:hover {
    color: #059669;
    border-color: #34d399;
    background: #ecfdf5;
}

.btn-table-action.btn-action-danger:hover {
    color: #dc2626;
    border-color: #f87171;
    background: #fef2f2;
}

/* ==========================================================================
   Company Module - Avatars
   ========================================================================== */
.company-avatar-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.company-avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

/* ==========================================================================
   Global Multi-Tenant Banner
   ========================================================================== */
.global-view-banner {
    display: flex;
    align-items: center;
    background: rgba(var(--brand-rgb), 0.08);
    border: 1px solid rgba(var(--brand-rgb), 0.22);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.global-view-banner.alert,
.global-view-banner.alert-primary {
    background-color: rgba(var(--brand-rgb), 0.08) !important;
    border-color: rgba(var(--brand-rgb), 0.22) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .global-view-banner,
[data-bs-theme="dark"] .global-view-banner.alert,
[data-bs-theme="dark"] .global-view-banner.alert-primary {
    background-color: rgba(var(--brand-rgb), 0.12) !important;
    border-color: rgba(0, 210, 255, 0.25) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .global-view-banner i,
[data-bs-theme="dark"] .global-view-banner .text-primary {
    color: var(--accent-cyan, #00d2ff) !important;
}

[data-bs-theme="dark"] .global-view-banner div {
    color: #e2e8f0 !important;
}

.platform-indicator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(var(--brand-rgb), 0.15);
    color: var(--accent-cyan, var(--brand));
    font-size: 1.2rem;
    flex-shrink: 0;
}

.platform-overview-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.3;
}

.platform-overview-desc {
    font-size: 0.825rem;
    color: var(--text-muted);
    display: block;
}

.platform-overview-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.775rem;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #86efac;
    white-space: nowrap;
}

/* Domain Addon (Seamlessly integrated) */
.input-domain-wrapper {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    transition: all 0.15s ease;
}

.input-domain-wrapper:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.input-domain-wrapper input {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    height: 38px;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    flex: 1;
}

.input-domain-wrapper .domain-suffix {
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
    color: #64748b;
    padding: 0 0.85rem;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-family: monospace;
    font-weight: 500;
}

/* ==========================================================================
   Executive Dropdowns: Topbar Tenant Selector & Dashboard Filters
   ========================================================================== */

/* Topbar Dropdown Container */
.topbar-tenant-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    margin-right: 0.35rem;
}

/* Trigger Buttons (Topbar & Dashboard) */
.topbar-tenant-btn,
.header-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 38px;
    padding: 0 0.75rem 0 0.5rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.825rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    outline: none;
}

.topbar-tenant-btn {
    min-width: 11rem;
    max-width: 16.5rem;
}

.header-filter-btn {
    min-width: 9.5rem;
    max-width: 14rem;
}

.topbar-tenant-btn:hover,
.header-filter-btn:hover {
    border-color: var(--border-color-focus, var(--brand));
    background: var(--bg-surface-elevated);
    box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.08);
    color: var(--text-primary);
}

.topbar-tenant-btn:focus-visible,
.header-filter-btn:focus-visible,
.show > .topbar-tenant-btn,
.show > .header-filter-btn {
    outline: none;
    border-color: var(--border-color-focus, var(--brand));
    box-shadow: 0 0 0 3px rgba(var(--accent-cyan-rgb, 2, 132, 199), 0.16);
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Button Icon Pill */
.tenant-btn-icon,
.header-filter-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(var(--accent-cyan-rgb, 2, 132, 199), 0.1);
    color: var(--accent-cyan, var(--brand));
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.topbar-tenant-btn:hover .tenant-btn-icon,
.header-filter-btn:hover .header-filter-icon-box {
    transform: scale(1.05);
}

/* Button Text */
.tenant-btn-text,
.header-filter-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chevron */
.tenant-btn-chevron,
.header-filter-chevron {
    color: var(--text-muted, #64748b);
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-left: auto;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
}

.show > .topbar-tenant-btn .tenant-btn-chevron,
.show > .header-filter-btn .header-filter-chevron {
    transform: rotate(180deg);
    color: var(--accent-cyan, var(--brand));
}

/* Dropdown Popover Menus */
.topbar-tenant-menu,
.header-filter-menu {
    min-width: 280px;
    max-width: min(340px, 94vw);
    max-height: 400px;
    margin-top: 6px !important;
    padding: 0.45rem;
    background: var(--bg-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Selector de empresa del topbar: siempre justo debajo del botón (data-bs-display="static",
   sin Popper que lo voltee hacia arriba) y sin pasar del alto de la ventana */
.topbar-tenant-menu {
    position: absolute;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin-top: 0.5rem !important;
    z-index: 1080;
    max-height: min(400px, calc(100vh - var(--topbar-h, 64px) - 1.5rem));
    overflow-y: auto;
}

/* Menu Header */
.tenant-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.5rem 0.3rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
}

.tenant-menu-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.tenant-menu-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
}

/* Search Box */
.tenant-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 0.1rem 0.25rem 0.35rem;
}

.tenant-search-icon {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
}

.tenant-search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-family: inherit;
    padding: 0;
}

.tenant-search-input::placeholder {
    color: var(--text-muted, #94a3b8);
}

/* Options List */
.tenant-options-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.1rem;
}

.tenant-options-list::-webkit-scrollbar {
    width: 5px;
}
.tenant-options-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Divider */
.tenant-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.3rem 0.4rem;
}

/* Menu Items (Buttons) */
.tenant-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s ease;
    user-select: none;
}

.tenant-menu-item:hover {
    background: var(--bg-surface-elevated);
}

.tenant-menu-item.is-selected {
    background: rgba(var(--accent-cyan-rgb, 2, 132, 199), 0.08);
}

.tenant-menu-item.is-selected .tenant-item-name {
    color: var(--accent-cyan, var(--brand));
    font-weight: 700;
}

/* Item Icons */
.tenant-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tenant-item-icon.is-global {
    background: rgba(var(--accent-cyan-rgb, 2, 132, 199), 0.12);
    color: var(--accent-cyan, var(--brand));
}

.tenant-item-icon.is-tenant {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Item Content */
.tenant-item-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tenant-item-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tenant-item-sub {
    font-size: 0.69rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

/* Checkmark */
.tenant-item-check {
    font-size: 0.95rem;
    color: var(--accent-cyan, var(--brand));
    font-weight: 700;
    flex-shrink: 0;
    margin-left: auto;
}

/* Empty State */
.tenant-empty-search {
    padding: 0.8rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Fallback/Legacy Compatibility for .topbar-tenant-selector */
.topbar-tenant-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    height: 38px;
    min-width: 11rem;
    max-width: 16.5rem;
    margin-left: 0.5rem;
    padding: 0 2rem 0 0.65rem;
    gap: 0.5rem;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.topbar-tenant-selector:hover {
    border-color: var(--border-color-focus, var(--brand));
    background: var(--bg-surface-elevated);
    box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.08);
}

.topbar-tenant-selector:focus-within {
    border-color: var(--border-color-focus, var(--brand));
    box-shadow: 0 0 0 3px rgba(var(--accent-cyan-rgb, 2, 132, 199), 0.16);
}

.tenant-selector-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan, var(--brand));
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tenant-selector-select {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    line-height: 1.2;
}

.tenant-selector-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.65rem;
    pointer-events: none;
}

/* Dark Mode Tokens */
[data-bs-theme="dark"] .topbar-tenant-btn,
[data-bs-theme="dark"] .header-filter-btn {
    background: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .topbar-tenant-btn:hover,
[data-bs-theme="dark"] .header-filter-btn:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .topbar-tenant-menu,
[data-bs-theme="dark"] .header-filter-menu {
    background: var(--bg-surface);
    border-color: var(--border-color-light);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.6);
}

[data-bs-theme="dark"] .tenant-menu-header {
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .tenant-search-box {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .tenant-search-input {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .tenant-menu-divider {
    background: var(--border-color);
}

[data-bs-theme="dark"] .tenant-menu-item:hover {
    background: var(--bg-surface-elevated);
}

[data-bs-theme="dark"] .tenant-item-icon.is-tenant {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color-light);
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .topbar-tenant-selector {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .topbar-tenant-selector:hover {
    border-color: var(--accent-cyan) !important;
    background: var(--bg-surface-elevated) !important;
}

[data-bs-theme="dark"] .tenant-selector-select {
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .tenant-selector-icon {
    color: var(--accent-cyan) !important;
}

/* Responsiveness */
@media (max-width: 575.98px) {
    .header-controls {
        width: 100%;
        gap: 0.5rem;
    }

    .header-controls > *,
    .header-filter-dropdown,
    .header-filter-btn {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .topbar-tenant-dropdown {
        margin-left: 0.25rem;
        margin-right: 0.15rem;
    }

    .topbar-tenant-btn {
        min-width: 9rem;
        max-width: 12rem;
    }
}

/* ==========================================================================
   User Profile Dropdown (Light & Dark Adaptive)
   ========================================================================== */
.user-profile-dropdown {
    min-width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 0.25rem 0;
}

.user-profile-header {
    border-color: #f1f5f9 !important;
}

.user-profile-name {
    color: #0f172a;
}

.user-profile-email {
    color: #64748b;
    font-size: 0.75rem;
}

.user-profile-item {
    color: #0f172a;
    font-size: 0.825rem;
    font-weight: 500;
    transition: all 0.12s ease;
}

.user-profile-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.user-profile-item i {
    color: #64748b;
}

.user-profile-divider {
    border-color: #f1f5f9 !important;
    margin: 0.25rem 0;
}

.user-profile-logout {
    font-size: 0.825rem;
    font-weight: 600;
}

[data-bs-theme="dark"] .user-profile-dropdown {
    background: #111622 !important;
    border-color: #243048 !important;
    box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme="dark"] .user-profile-header,
[data-bs-theme="dark"] .user-profile-divider {
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .user-profile-name {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .user-profile-email {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .user-profile-item {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .user-profile-item:hover {
    background: #1a2234 !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .user-profile-item i {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .user-profile-logout:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
}

/* ==========================================================================
   Modal - Segmented Tabs, Section Cards & Executive Styling
   ========================================================================== */
.modal-company-dialog {
    max-width: 980px;
    margin: 1.25rem auto !important;
}

.modal-company-dialog .modal-content {
    border-radius: 10px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 2.8rem) !important;
    max-height: 860px !important;
}

.modal-company-dialog form#companyForm {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
}

.modal-company-dialog .modal-header {
    flex-shrink: 0 !important;
    padding: 1.1rem 1.75rem 1rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

.modal-company-dialog .modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 1rem 1.75rem 1.25rem !important;
}

.modal-segmented-nav {
    flex-shrink: 0 !important;
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
    margin: 0.65rem 1.75rem 0.5rem;
}

.modal-segmented-nav .nav-item {
    flex: 1;
}

.modal-segmented-nav .nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.825rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    background: transparent !important;
    transition: all 0.18s ease !important;
    cursor: pointer;
}

.modal-segmented-nav .nav-link:hover {
    color: var(--brand) !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

.modal-segmented-nav .nav-link.active {
    background: #ffffff !important;
    color: var(--brand) !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

.modal-section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
}

.modal-section-title {
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.modal-section-title i {
    color: var(--brand);
    font-size: 0.95rem;
}

.modal-company-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.85rem !important;
    padding: 1.15rem 1.75rem 1.6rem !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* ==========================================================================
   Tablero en Vivo (Live Board) Styles
   ========================================================================== */
.live-board-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.live-pulse-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    height: 36px;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05);
}

[data-bs-theme="dark"] .live-pulse-badge {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.3);
    color: #34d399;
}

.live-refresh-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.live-refresh-btn:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.live-refresh-btn:active {
    transform: scale(0.95);
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulseAnim 1.8s infinite;
}

@keyframes livePulseAnim {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.live-status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.live-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--border-color-light);
}

.live-status-card.active {
    border-color: var(--accent-cyan) !important;
    background: rgba(var(--brand-rgb), 0.08) !important;
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.15) !important;
}

[data-bs-theme="dark"] .live-status-card.active {
    border-color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12) !important;
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.2) !important;
}

.live-status-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-cyan);
}

.live-status-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.live-status-val {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.live-status-label {
    font-size: 0.725rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

.live-collab-row {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.15rem;
    transition: all 0.15s ease;
    background: var(--bg-surface);
}

.live-collab-row:last-child {
    border-bottom: none;
}

.live-collab-row:hover {
    background: var(--bg-surface-elevated);
}

.live-collab-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--accent-cyan);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    user-select: none;
}

.live-collab-avatar.has-photo {
    cursor: pointer;
}

.live-collab-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.18s ease;
}

.live-collab-avatar:hover img {
    transform: scale(1.1);
}

.live-collab-primary {
    flex: 1 1 230px;
    min-width: 0;
}

.live-collab-name {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.live-collab-subtitle {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.live-collab-time-line {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.live-collab-company-cell {
    flex: 0 1 180px;
    min-width: 0;
}

.live-company-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.3rem 0.65rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px !important;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-collab-location-cell {
    flex: 0 0 auto;
    min-width: 135px;
    text-align: right;
}

.live-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px !important;
    font-size: 0.725rem;
    font-weight: 600;
    white-space: nowrap;
}

.live-location-badge.in-range {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.28);
}

[data-bs-theme="dark"] .live-location-badge.in-range {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.live-location-badge.out-range {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

[data-bs-theme="dark"] .live-location-badge.out-range {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
}

.live-collab-status {
    flex: 0 0 auto;
    min-width: 95px;
    text-align: right;
}

.live-collab-status .badge {
    border-radius: 6px !important;
}

/* Leaflet Map Dark Mode Tiles and Controls (Radar Telemetry Aesthetic) */
[data-bs-theme="dark"] #liveBoardMap {
    background-color: #0b0e14;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-tile-pane {
    filter: brightness(0.62) invert(1) contrast(2.8) hue-rotate(200deg) saturate(0.3) brightness(0.72);
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-container {
    background: #0b0e14;
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-bar a {
    background-color: var(--bg-surface-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-bar a:hover {
    background-color: var(--bg-surface);
    color: var(--accent-cyan);
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-popup-content-wrapper,
[data-bs-theme="dark"] #liveBoardMap .leaflet-popup-tip {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-control-attribution {
    background: rgba(11, 14, 20, 0.75);
    color: var(--text-muted);
}

[data-bs-theme="dark"] #liveBoardMap .leaflet-control-attribution a {
    color: var(--accent-cyan);
}

@media (max-width: 767.98px) {
    .live-collab-row {
        flex-wrap: wrap;
        gap: 0.65rem;
        padding: 0.85rem 1rem;
    }
    .live-collab-company-cell {
        order: 3;
        flex: 1 0 100%;
    }
    .live-collab-location-cell {
        order: 4;
        text-align: left !important;
        flex: 1 0 auto;
    }
    .live-collab-status {
        order: 2;
        margin-left: auto;
    }
}

/* ==========================================================================
   Attendance Module (Marcaciones y GPS)
   ========================================================================== */
.attendance-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.attendance-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.attendance-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.attendance-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.attendance-kpi-val {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary, #0f172a);
}

.attendance-kpi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.attendance-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.attendance-filter-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.35rem;
    display: block;
}

.attendance-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.attendance-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 2;
}

.attendance-search-wrapper .attendance-search-input {
    padding-left: 36px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    font-size: 0.875rem;
    width: 100%;
    background: var(--bg-surface, #ffffff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.attendance-search-wrapper .attendance-search-input:focus {
    border-color: var(--brand, var(--brand));
    outline: 0;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.attendance-filter-input,
.attendance-filter-select {
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    font-size: 0.875rem;
    background: var(--bg-surface, #ffffff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.attendance-filter-input:focus,
.attendance-filter-select:focus {
    border-color: var(--brand, var(--brand));
    outline: 0;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

/* User avatar */
.attendance-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.attendance-user-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    font-size: 0.825rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #bae6fd;
}

/* =============================================================================
 * Evidence Modal (Auditoría Forense de Marcación) — Light & Dark Mode
 * ============================================================================= */
#evidenceModal {
    z-index: 1070 !important;
}

#evidenceModal .modal-content {
    border-radius: 14px !important;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
[data-bs-theme="dark"] #evidenceModal .modal-content {
    background: #111622;
    border-color: #1a2234;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.7);
}

#evidenceModal .modal-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}
[data-bs-theme="dark"] #evidenceModal .modal-header {
    background: #111622;
    border-bottom-color: #1a2234;
}

[data-bs-theme="dark"] #evidenceModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

#evidenceModal .modal-body {
    overflow: hidden;
    padding: 1.15rem 1.25rem;
    background: #f8fafc;
}
[data-bs-theme="dark"] #evidenceModal .modal-body {
    background: #0d121c;
}

.evidence-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
[data-bs-theme="dark"] .evidence-header-icon {
    background: rgba(0, 210, 255, 0.15);
    color: #38bdf8;
}

.evidence-moment-tabs {
    background: #e2e8f0;
    padding: 3px;
    border-radius: 8px;
    display: flex;
    gap: 3px;
    height: 36px;
    border: 1px solid #cbd5e1;
}
[data-bs-theme="dark"] .evidence-moment-tabs {
    background: #161d2d;
    border-color: #243048;
}

.evidence-moment-tab {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #64748b;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    cursor: pointer;
    line-height: 1;
}
[data-bs-theme="dark"] .evidence-moment-tab {
    color: #94a3b8;
}

.evidence-moment-tab:hover {
    color: #0f172a;
}
[data-bs-theme="dark"] .evidence-moment-tab:hover {
    color: #f8fafc;
}

.evidence-moment-tab.active {
    background: #ffffff;
    color: var(--brand);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}
[data-bs-theme="dark"] .evidence-moment-tab.active {
    background: #243048;
    color: #38bdf8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.evidence-selfie-box {
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-bs-theme="dark"] .evidence-selfie-box {
    background: #111622;
    border-color: #1a2234;
}

.evidence-no-photo-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
}
[data-bs-theme="dark"] .evidence-no-photo-icon {
    background: #1a2234;
    color: #94a3b8;
}

.evidence-facts-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    height: 236px;
    display: flex;
    flex-direction: column;
}
[data-bs-theme="dark"] .evidence-facts-box {
    background: #111622;
    border-color: #1a2234;
}

.evidence-facts-scroll {
    overflow-y: auto;
    flex: 1 1 auto;
    padding-right: 4px;
}

.evidence-facts-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.35;
}

.evidence-facts-grid dt {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}
[data-bs-theme="dark"] .evidence-facts-grid dt {
    color: #94a3b8;
}

.evidence-facts-grid dd {
    margin: 0;
    color: #0f172a;
    font-weight: 500;
    word-break: break-word;
}
[data-bs-theme="dark"] .evidence-facts-grid dd {
    color: #f1f5f9;
}

.evidence-map-wrapper {
    background: #0b0e14;
}

.evidence-map-recenter-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #334155;
    transition: all 0.15s ease;
}
[data-bs-theme="dark"] .evidence-map-recenter-btn {
    background: #161d2d;
    border-color: #243048;
    color: #cbd5e1;
}
.evidence-map-recenter-btn:hover {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
}

[data-bs-theme="dark"] #evidenceMap .leaflet-tile-pane {
    filter: brightness(0.85) contrast(1.1) invert(0.9) hue-rotate(180deg);
}

/* =============================================================================
 * Command Palette (Ctrl+K) — Sleek Executive Search Modal
 * Light & Dark Mode
 * ============================================================================= */
#commandPaletteModal .modal-dialog {
    max-width: 620px;
    margin: 3.5rem auto 1rem;
}

.command-palette-content {
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .command-palette-content {
    background: #111622;
    border-color: #1a2234;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
}

.command-palette-header {
    padding: 0.85rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

[data-bs-theme="dark"] .command-palette-header {
    background: #0d121c;
    border-bottom-color: #1a2234;
}

.command-palette-search-icon {
    font-size: 1.15rem;
    color: var(--brand);
    flex-shrink: 0;
}
[data-bs-theme="dark"] .command-palette-search-icon {
    color: #38bdf8;
}

.command-palette-input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
    width: 100%;
    padding: 0.25rem 0.5rem;
}
[data-bs-theme="dark"] .command-palette-input {
    color: #f8fafc;
}
.command-palette-input::placeholder {
    color: #94a3b8;
}

.command-palette-kbd-esc {
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
[data-bs-theme="dark"] .command-palette-kbd-esc {
    background: #161d2d;
    border-color: #243048;
    color: #94a3b8;
    box-shadow: none;
}

.command-palette-body {
    padding: 0.6rem;
    max-height: 400px;
    overflow-y: auto;
    background: #ffffff;
}
[data-bs-theme="dark"] .command-palette-body {
    background: #111622;
}

.command-palette-section-title {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.675rem;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.4rem 0.75rem 0.3rem;
}
[data-bs-theme="dark"] .command-palette-section-title {
    color: #94a3b8;
}

.command-palette-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.command-palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    text-decoration: none !important;
    background: transparent;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.command-palette-item:hover,
.command-palette-item.is-selected {
    background: #f1f5f9;
    border-color: #e2e8f0;
}
[data-bs-theme="dark"] .command-palette-item:hover,
[data-bs-theme="dark"] .command-palette-item.is-selected {
    background: #161d2d;
    border-color: #243048;
}

.command-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    background: rgba(var(--brand-rgb), 0.08);
    color: var(--brand);
    border: 1px solid rgba(var(--brand-rgb), 0.18);
    flex-shrink: 0;
}
[data-bs-theme="dark"] .command-item-icon {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
}

.command-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #0f172a;
    line-height: 1.25;
}
[data-bs-theme="dark"] .command-item-title {
    color: #f8fafc;
}

.command-item-sub {
    font-size: 0.725rem;
    color: #64748b;
    margin-top: 1px;
}
[data-bs-theme="dark"] .command-item-sub {
    color: #94a3b8;
}

.command-item-arrow {
    font-size: 0.75rem;
    color: #94a3b8;
    opacity: 0.6;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.command-palette-item:hover .command-item-arrow,
.command-palette-item.is-selected .command-item-arrow {
    opacity: 1;
    transform: translateX(2px);
    color: var(--brand);
}
[data-bs-theme="dark"] .command-palette-item:hover .command-item-arrow,
[data-bs-theme="dark"] .command-palette-item.is-selected .command-item-arrow {
    color: #38bdf8;
}

.command-palette-footer {
    padding: 0.55rem 1.15rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}
[data-bs-theme="dark"] .command-palette-footer {
    background: #0d121c;
    border-top-color: #1a2234;
    color: #94a3b8;
}

.command-palette-kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.675rem;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
[data-bs-theme="dark"] .command-palette-kbd {
    background: #161d2d;
    border-color: #243048;
    color: #cbd5e1;
    box-shadow: none;
}

/* =============================================================================
 * Attendance Attempts & Forensics Module (Intentos Rechazados & Seguridad GPS)
 * ============================================================================= */

/* Subtítulos de KPI con separación garantizada para los iconos */

/* Pills con esquinas moderadas / menos redondas (6px en vez de pill 50px) */
.attempts-pill {
    border-radius: 6px !important;
    font-size: 0.725rem;
    font-weight: 600;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    line-height: 1.25;
    border: 1px solid transparent;
}
.attempts-pill i {
    font-size: 0.775rem;
    line-height: 1;
    margin-right: 6px !important;
}
.attempts-pill .badge-dot {
    margin-right: 6px !important;
}

/* Caja de mensaje de motivo compacta con elipsis elegante */
.attempts-msg-box {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 270px;
}

.attempts-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.attempts-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand, var(--brand));
    font-weight: 700;
    font-size: 0.825rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(var(--brand-rgb), 0.25);
}

[data-bs-theme="dark"] .attempts-avatar-circle {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.attempts-btn-audit {
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.775rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.attempts-btn-audit:hover {
    background: var(--brand, var(--brand));
    color: #ffffff;
    border-color: var(--brand, var(--brand));
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.25);
}

.attempts-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.attempts-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand, var(--brand));
    font-weight: 700;
    font-size: 0.825rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(var(--brand-rgb), 0.25);
}

[data-bs-theme="dark"] .attempts-avatar-circle {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.attempts-btn-audit {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.775rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.attempts-btn-audit:hover {
    background: var(--brand, var(--brand));
    color: #ffffff;
    border-color: var(--brand, var(--brand));
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.25);
}

/* Modal de Auditoría Forense */
#attemptAuditModal .modal-content {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

#attemptAuditModal .modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

#attemptAuditModal .modal-body {
    padding: 1.5rem;
    background: var(--bg-base);
}

#attemptAuditModal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.audit-card-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
}

.audit-field-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.audit-field-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

/* =============================================================================
 * Enterprise Table Pagination & Controls (Adaptive Light & Dark)
 * ============================================================================= */
.table-pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.table-pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.table-pagination-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.per-page-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.per-page-selector select.form-select {
    padding: 0.2rem 1.75rem 0.2rem 0.6rem;
    font-size: 0.8125rem;
    font-weight: 600;
    height: 32px;
    border-radius: 6px;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.per-page-selector select.form-select:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

.pagination {
    margin-bottom: 0;
    gap: 4px;
}

.pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 6px !important;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    line-height: 1;
}

.pagination .page-item .page-link:hover {
    background-color: var(--bg-surface-elevated);
    border-color: var(--border-color-light);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(var(--accent-cyan-rgb), 0.35);
}

.pagination .page-item.disabled .page-link {
    background-color: var(--bg-surface-elevated);
    border-color: var(--border-color);
    color: var(--text-muted);
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-page-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* =============================================================================
 * Aprobaciones: zona que se recarga por AJAX, motivo y comentario de revisión
 * ============================================================================= */
.appr-dynamic-area {
    position: relative;
    transition: opacity 0.2s ease;
}

.appr-dynamic-area.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.appr-review-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    margin-top: 4px;
    max-width: 260px;
    line-height: 1.35;
}
.appr-reason { min-width: 180px; max-width: 280px; font-size: 0.82rem; line-height: 1.4; color: var(--text-primary); }

/* =============================================================================
 * Onboarding Module (Executive Redesign — Clean, Spaced, Adaptive Light/Dark)
 * ============================================================================= */
.onb-dynamic-area {
    position: relative;
    transition: opacity 0.2s ease;
}

.onb-dynamic-area.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.onb-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.735rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.3;
}

/* =============================================================================
 * Onboarding Modal Dialog — Executive Detail & Actions
 * ============================================================================= */
#onboardingModal {
    z-index: 1070 !important;
}

#onboardingModal .modal-content {
    border-radius: 14px !important;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

#onboardingModal .modal-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

#onboardingModal .modal-body {
    padding: 1.25rem 1.4rem;
    background: var(--bg-surface-elevated);
    max-height: calc(85vh - 130px);
    overflow-y: auto;
}

#onboardingModal .modal-footer {
    padding: 0.85rem 1.4rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.onb-modal-section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.15rem;
}

.onb-modal-section-title {
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.onb-modal-section-title i.bi {
    margin-right: 0.55rem;
    display: inline-block;
    vertical-align: -0.1em;
}

.onb-stage-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.onb-stage-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.onb-stage-item:first-child {
    padding-top: 0;
}

.onb-stage-icon-wrap {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.onb-stage-missing {
    font-size: 0.775rem;
    line-height: 1.45;
    margin-top: 0.35rem;
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.onb-stage-missing i.bi {
    flex-shrink: 0;
    font-size: 0.85rem;
    margin-top: 1px;
}

.onb-action-approve-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 1.15rem;
}

.onb-action-reject-box {
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 8px;
    padding: 1.15rem;
}

.onb-action-approve-box .fw-bold i.bi,
.onb-action-reject-box .fw-bold i.bi {
    margin-right: 0.55rem;
    display: inline-block;
    vertical-align: -0.1em;
}

/* =============================================================================
 * Onboarding Settings Modal & Cards — High Polish, Spaced, Adaptive
 * ============================================================================= */
#onboardingSettingsModal {
    z-index: 1070 !important;
}

#onboardingSettingsModal .modal-content {
    border-radius: 14px !important;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

#onboardingSettingsModal .modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

#onboardingSettingsModal .modal-body {
    padding: 1.5rem 1.75rem;
    background: var(--bg-surface-elevated);
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

#onboardingSettingsModal .modal-footer {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.onb-settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.onb-settings-card:hover {
    border-color: rgba(var(--accent-cyan-rgb), 0.35);
}

.onb-settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.onb-stage-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.badge-icon-personal {
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand);
    border: 1px solid rgba(var(--brand-rgb), 0.2);
}

.badge-icon-uniforms {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-icon-documents {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-icon-induction {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.onb-switch-lg {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.onb-switch-lg .form-check-input {
    width: 2.75rem;
    height: 1.45rem;
    cursor: pointer;
    margin: 0;
}

.onb-switch-lg .form-check-input:checked {
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.onb-settings-desc {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-top: 0.65rem;
    margin-bottom: 0;
    padding-left: 50px;
}

.onb-settings-extra {
    margin-top: 0.85rem;
    padding-left: 50px;
}

.onb-docs-panel {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.onb-induction-panel {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

/* =============================================================================
 * Expediente y Legajo del Colaborador — Executive Full Page & Modal Styles
 * ============================================================================= */
.legajo-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.legajo-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.legajo-avatar-initials {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    background: rgba(var(--brand-rgb), 0.12);
    border: 1px solid rgba(var(--brand-rgb), 0.25);
    color: var(--brand);
    flex-shrink: 0;
}

.legajo-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.legajo-stat-item {
    padding: 0 1.25rem;
    border-right: 1px solid var(--border-color);
}

.legajo-stat-item:last-child {
    border-right: none;
}

.legajo-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.legajo-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legajo-stat-note {
    font-size: 0.725rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legajo-tabs {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.legajo-tab-btn {
    padding: 0.65rem 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
}

.legajo-tab-btn:hover {
    color: var(--text-primary);
}

.legajo-tab-btn.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 700;
}

.legajo-tab-badge {
    font-size: 0.7rem;
    padding: 0.12rem 0.5rem;
    border-radius: 9999px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.legajo-tab-btn.active .legajo-tab-badge {
    background: rgba(var(--brand-rgb), 0.12);
    border-color: rgba(var(--brand-rgb), 0.25);
    color: var(--brand);
}

.legajo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.legajo-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease;
}

.legajo-section:hover {
    border-color: rgba(var(--brand-rgb), 0.35);
}

.legajo-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.legajo-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.legajo-section-title i {
    color: var(--brand);
    font-size: 0.95rem;
}

.legajo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.legajo-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.legajo-label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.legajo-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.legajo-value.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.legajo-copy-btn {
    background: transparent;
    border: none;
    padding: 0.15rem 0.35rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 4px;
    line-height: 1;
}

.legajo-copy-btn:hover {
    color: var(--brand);
    background: rgba(var(--brand-rgb), 0.12);
}

.legajo-card-table {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.legajo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
    margin-bottom: 0;
}

.legajo-table th {
    background: var(--bg-surface-elevated);
    padding: 0.75rem 1.25rem;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.legajo-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.legajo-table tr:last-child td {
    border-bottom: none;
}

.legajo-table tr:hover td {
    background: rgba(var(--brand-rgb), 0.03);
}

.legajo-sizes-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.legajo-size-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.legajo-size-chip-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legajo-size-chip-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.legajo-size-chip-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.legajo-size-chip-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand);
}

@media (max-width: 991px) {
    .legajo-grid {
        grid-template-columns: 1fr;
    }
    .legajo-stat-strip {
        grid-template-columns: repeat(2, 1fr);
    }
    .legajo-sizes-row {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
 * Estilos Compartidos de Modal de Edición de Colaborador y Micro-Toast
 * ============================================================================= */
.emp-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
}
.emp-modal-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}
.emp-modal-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(var(--brand-rgb), 0.25);
    flex-shrink: 0;
}
.emp-modal-nav-wrap {
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
}
.emp-modal-tabs {
    gap: 0.5rem;
}
.emp-modal-tabs .nav-link {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 7px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
}
.emp-modal-tabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.emp-modal-tabs .nav-link.active {
    background: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.25);
}
.emp-modal-body {
    padding: 1.25rem;
    max-height: calc(85vh - 180px);
    overflow-y: auto;
}
.emp-section-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.15rem;
}
.emp-section-title {
    font-size: 0.775rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.emp-section-title i {
    color: var(--accent-cyan);
    font-size: 0.9rem;
}
.emp-form-label {
    display: block;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.emp-form-input {
    width: 100%;
    height: 38px;
    padding: 0.45rem 0.75rem;
    font-size: 0.825rem;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.15s ease;
}
.emp-form-select {
    width: 100%;
    height: 38px;
    padding: 0.45rem 2.35rem 0.45rem 0.85rem !important;
    font-size: 0.825rem;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 13px 9px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.emp-form-input:focus,
.emp-form-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}
.emp-form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}
.emp-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(var(--brand-rgb), 0.08);
    border: 1px solid rgba(var(--brand-rgb), 0.2);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    font-size: 0.775rem;
    color: var(--text-primary);
}
.emp-info-banner i {
    color: var(--accent-cyan);
    font-size: 0.95rem;
    margin-top: 2px;
}
.emp-switch-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
}
.emp-branches-container {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}
.emp-branch-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    transition: border-color 0.15s ease;
}
.emp-branch-option-row:hover {
    border-color: var(--accent-cyan);
}
.emp-modal-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}
.emp-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1090;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.15rem;
    border-radius: 10px;
    background: var(--bg-surface-elevated, #161d2d);
    border: 1px solid var(--border-color, #243048);
    color: var(--text-primary, #ffffff);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    font-size: 0.825rem;
    font-weight: 600;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.emp-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.emp-toast.tone-success {
    border-color: rgba(16, 185, 129, 0.4);
}
.emp-toast.tone-success i {
    color: #10b981;
    font-size: 1.05rem;
}
.emp-toast.tone-danger {
    border-color: rgba(239, 68, 68, 0.4);
}
.emp-toast.tone-danger i {
    color: #ef4444;
    font-size: 1.05rem;
}

/* ==========================================================================
   Botones Ejecutivos Compartidos (.emp-btn-primary)
   ========================================================================== */
.emp-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.525rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--brand);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.25);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    line-height: 1.4;
}

.emp-btn-primary:hover {
    background: #0369a1;
    border-color: rgba(56, 189, 248, 0.55);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.35);
}

.emp-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(var(--brand-rgb), 0.2);
}

.emp-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

[data-bs-theme="dark"] .emp-btn-primary {
    background: var(--brand);
    border-color: rgba(56, 189, 248, 0.35);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .emp-btn-primary:hover {
    background: #0369a1;
    border-color: rgba(56, 189, 248, 0.6);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(var(--brand-rgb), 0.4);
}

/* =============================================================================
   Canal Ético — Executive Whistleblowing & Case Management Design System
   ============================================================================= */

/* =============================================================================
   Canal Ético — Executive Filter Tabs & Controls Toolbar
   ============================================================================= */

/* =============================================================================
   Canal Ético — Badges, Pills & Icon Polish
   ============================================================================= */

.ethics-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.ethics-code-badge i {
    line-height: 1;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ethics-unread-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #ef4444;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: ethicsPulse 1.6s infinite cubic-bezier(0.66, 0, 0, 1);
    flex-shrink: 0;
}

@keyframes ethicsPulse {
    to {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.ethics-origin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.725rem;
    font-weight: 600;
    line-height: 1.3;
}

.ethics-origin-pill i {
    line-height: 1;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ethics-origin-pill.origin-web {
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.22);
    color: var(--text-secondary);
}

.ethics-origin-pill.origin-app {
    background: rgba(var(--brand-rgb), 0.1);
    border: 1px solid rgba(var(--brand-rgb), 0.22);
    color: var(--accent-cyan);
}

/* =============================================================================
   Table Action Buttons — Scalable & Consistent
   ============================================================================= */

.btn-table-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-table-action:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: var(--bg-surface);
}

.ethics-table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    background: var(--bg-surface-elevated);
}

.ethics-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.ethics-row {
    transition: background-color 0.15s ease;
}

.ethics-row:hover {
    background-color: var(--bg-surface-elevated) !important;
}

.ethics-row.row-unread {
    background-color: rgba(var(--brand-rgb), 0.03);
}

#ethicsDynamicWrapper {
    transition: opacity 0.18s ease;
}

#ethicsDynamicWrapper.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

/* =============================================================================
   Canal Ético — Executive Modal 2-Column Workspace
   ============================================================================= */

/* Timeline & Chat Thread */
.ethics-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    max-height: 380px;
    overflow-y: auto;
}

.ethics-chat-item {
    display: flex;
    gap: 0.65rem;
    max-width: 88%;
}

.ethics-chat-item.from-reporter {
    align-self: flex-start;
}

.ethics-chat-item.from-investigator {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ethics-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    font-weight: 700;
}

.ethics-chat-avatar.avatar-reporter {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.ethics-chat-avatar.avatar-investigator {
    background: rgba(var(--brand-rgb), 0.15);
    border: 1px solid rgba(var(--brand-rgb), 0.3);
    color: var(--accent-cyan);
}

.ethics-chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.55;
    position: relative;
}

.ethics-chat-item.from-reporter .ethics-chat-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-top-left-radius: 2px;
}

.ethics-chat-item.from-investigator .ethics-chat-bubble {
    background: rgba(var(--brand-rgb), 0.08);
    border: 1px solid rgba(var(--brand-rgb), 0.25);
    color: var(--text-primary);
    border-top-right-radius: 2px;
}

.ethics-chat-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modern Composer */

.ethics-photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.ethics-photo-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    width: 96px;
    height: 96px;
    display: inline-block;
}

.ethics-photo-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-cyan);
}

.ethics-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ethics-photo-card .photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    color: #fff;
    font-size: 1.25rem;
    transition: opacity 0.15s ease;
}

.ethics-photo-card:hover .photo-overlay {
    opacity: 1;
}

/* ==========================================================================
   CANAL ÉTICO - MODAL EJECUTIVO ESTÁNDAR
   ========================================================================== */
#ethicsQuickModal .modal-dialog {
    max-width: 840px !important;
    width: 92% !important;
    margin: 2rem auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: calc(100% - 4rem) !important;
}

#ethicsModalContainer.emp-modal-content {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45) !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: min(620px, calc(100vh - 4.5rem)) !important;
    overflow: hidden !important;
}

#ethicsModalContainer .emp-modal-header {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.75rem 1.15rem !important;
    flex-shrink: 0 !important;
}

#ethicsModalContainer .emp-modal-nav-wrap {
    background: var(--bg-surface-elevated) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.35rem 1.15rem !important;
    flex-shrink: 0 !important;
}

#ethicsModalContainer .emp-modal-tabs .nav-link {
    padding: 0.35rem 0.75rem;
    font-size: 0.785rem;
}

#ethicsModalContainer .emp-modal-body {
    padding: 0.85rem 1.15rem !important;
    background: var(--bg-surface-elevated) !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

#ethicsModalContainer .modal-footer {
    background: var(--bg-surface) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 0.6rem 1.15rem !important;
    flex-shrink: 0 !important;
}

#ethicsModalContainer .btn-close:focus {
    box-shadow: none;
}

#ethicsModalContainer .emp-section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.95rem;
    margin-bottom: 0.65rem;
}

#ethicsModalContainer .emp-section-card:last-child {
    margin-bottom: 0;
}

#ethicsModalContainer .emp-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

/* Declaración de hechos denunciados - Caja centrada con padding simétrico */
.ethics-declaration-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.15rem !important;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: auto;
}

/* Área de redacción de mensaje - Amplia, distinguible y ejecutiva */
.ethics-reply-textarea {
    width: 100%;
    min-height: 75px !important;
    background: var(--bg-surface) !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0.75rem 0.95rem !important;
    font-size: 0.875rem !important;
    line-height: 1.55 !important;
    color: var(--text-primary) !important;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ethics-reply-textarea:focus {
    outline: none !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18) !important;
}

.ethics-reply-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

/* Tarjeta y badge de identidad reservada */
.ethics-identity-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 1rem 1.25rem;
}

.ethics-identity-data-card {
    background: rgba(var(--brand-rgb), 0.04);
    border: 1px solid rgba(var(--brand-rgb), 0.22);
    border-radius: 8px;
    padding: 1.15rem 1.25rem;
    margin-top: 1rem;
    animation: fadeInEthics 0.25s ease-out;
}

@keyframes fadeInEthics {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Switch ejecutivo de alto contraste y excelente visibilidad */
.emp-custom-switch {
    width: 44px !important;
    height: 23px !important;
    cursor: pointer !important;
    background-color: #cbd5e1 !important;
    border: 1.5px solid #94a3b8 !important;
    border-radius: 24px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23334155'/%3e%3c/svg%3e") !important;
    background-position: left 2px center !important;
    background-size: contain !important;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, background-position 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12) !important;
    flex-shrink: 0;
}

.emp-custom-switch:hover {
    border-color: #64748b !important;
    background-color: #c0ccdc !important;
}

.emp-custom-switch:focus {
    outline: none !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.25) !important;
}

.emp-custom-switch:checked {
    background-color: var(--accent-cyan) !important;
    border-color: var(--accent-cyan) !important;
    background-position: right 2px center !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
    box-shadow: 0 2px 5px rgba(var(--brand-rgb), 0.35) !important;
}

[data-bs-theme="dark"] .emp-custom-switch {
    background-color: #334155 !important;
    border-color: #64748b !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23e2e8f0'/%3e%3c/svg%3e") !important;
}

[data-bs-theme="dark"] .emp-custom-switch:hover {
    background-color: #3d4d65 !important;
    border-color: #94a3b8 !important;
}

[data-bs-theme="dark"] .emp-custom-switch:checked {
    background-color: var(--accent-cyan) !important;
    border-color: var(--accent-cyan) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

/* =============================================================================
 * Executive Squircle Badges & Pills (No Exaggerated 50rem Capsule Corners)
 * ============================================================================= */
.badge,
.rounded-pill,
.status-pill {
    border-radius: 6px !important;
}

.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* =============================================================================
 * ERP Executive Data Tables (Clean, Compact, High-Density Corporate)
 * ============================================================================= */
.emp-table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
}

.emp-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.emp-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.emp-table th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0.95rem;
    white-space: nowrap;
}

.emp-table td {
    padding: 0.75rem 0.95rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 0.825rem;
    background: var(--bg-surface);
}

.emp-table tr:last-child td {
    border-bottom: none;
}

.emp-table tr:hover td {
    background: var(--bg-surface-elevated);
}

.emp-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-table-action {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-table-action:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(var(--brand-rgb), 0.08);
    transform: translateY(-1px);
}

.btn-table-action.btn-table-delete:hover {
    color: var(--accent-rose);
    border-color: var(--accent-rose);
    background: rgba(220, 38, 38, 0.08);
}

/* =============================================================================
 * Executive Standard Modal Dialogs (Shared System Across Blade & Vue)
 * ============================================================================= */
.emp-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    overflow: hidden;
}

.emp-modal-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.emp-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(var(--brand-rgb), 0.25);
    flex-shrink: 0;
}

.emp-modal-icon.tone-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}

.emp-modal-nav-wrap {
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
}

.emp-modal-tabs {
    gap: 0.5rem;
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.emp-modal-tabs .nav-link {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 7px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.emp-modal-tabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.emp-modal-tabs .nav-link.active {
    background: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.25);
}

.emp-modal-body {
    padding: 1.25rem;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.emp-modal-footer {
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.emp-section-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
}

.emp-section-title {
    font-size: 0.775rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.emp-section-title i {
    color: var(--accent-cyan);
    font-size: 0.9rem;
}

/* =============================================================================
 * Executive Collaborator Selector in Modals (Search, Avatars, Checkboxes)
 * ============================================================================= */
.collaborator-picker-list {
    max-height: 230px;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.collaborator-picker-list::-webkit-scrollbar {
    width: 6px;
}

.collaborator-picker-list::-webkit-scrollbar-track {
    background: transparent;
}

.collaborator-picker-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.collaborator-picker-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    user-select: none;
    cursor: pointer;
}

.collaborator-picker-row:hover {
    background: var(--bg-surface-elevated);
    border-color: rgba(var(--brand-rgb), 0.4);
}

.collaborator-picker-row.is-selected {
    background: rgba(var(--brand-rgb), 0.08) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 1px 4px rgba(var(--brand-rgb), 0.15);
}

[data-bs-theme="dark"] .collaborator-picker-row.is-selected {
    background: rgba(var(--brand-rgb), 0.18) !important;
    border-color: var(--accent-cyan) !important;
}

.custom-check-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #94a3b8 !important;
    background: #ffffff !important;
    color: #ffffff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.collaborator-picker-row:hover .custom-check-box:not(.is-checked) {
    border-color: var(--accent-cyan, var(--brand)) !important;
}

.custom-check-box.is-checked {
    background: var(--accent-cyan, var(--brand)) !important;
    border-color: var(--accent-cyan, var(--brand)) !important;
    box-shadow: 0 2px 5px rgba(var(--brand-rgb), 0.3) !important;
}

[data-bs-theme="dark"] .custom-check-box {
    border: 2px solid #64748b !important;
    background: #0f172a !important;
}

[data-bs-theme="dark"] .custom-check-box.is-checked {
    background: var(--accent-cyan, var(--brand)) !important;
    border-color: var(--accent-cyan, var(--brand)) !important;
}

.collab-search-input {
    height: 42px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s ease;
}

.collab-search-input:focus {
    border-color: var(--accent-cyan, var(--brand)) !important;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15) !important;
    background: #ffffff !important;
}

[data-bs-theme="dark"] .collab-search-input {
    border: 1.5px solid #334155 !important;
    background: #0f172a !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .collab-search-input:focus {
    border-color: var(--accent-cyan, var(--brand)) !important;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.25) !important;
}

.collab-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.725rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.collaborator-picker-row.is-selected .collab-avatar {
    background: var(--accent-cyan);
    color: #ffffff;
}

/* ==========================================================================
   Working Days Selector: Single Horizontal Row (7 Columns)
   ========================================================================== */
.working-days-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
}

@media (max-width: 640px) {
    .working-days-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

.day-pill-btn {
    border-radius: 8px !important;
    height: 38px !important;
    padding: 0.35rem 0.35rem !important;
    font-size: 0.785rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    gap: 5px !important;
    width: 100% !important;
}

.day-pill-btn i {
    font-size: 0.75rem !important;
    margin-right: 2px !important;
}

/* =============================================================================
   MÓDULO SUCURSALES Y GEOCERCAS GPS (DISEÑO ESPACIOSO Y ELEGANTE)
   ============================================================================= */

.branches-page-wrapper {
    width: 100%;
}

.branches-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
}

.branches-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #2563eb 100%);
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.branches-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.branches-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.branches-kpi-pill {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.branches-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

/* Botón Limpiar Filtros Mejorado (Esquinas menos redondas, diseño profesional) */
.btn-branch-reset {
    height: 38px;
    padding: 0 14px;
    border-radius: 6px !important;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--bg-surface, #ffffff);
    color: var(--text-secondary, #475569);
    font-size: 0.825rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    text-decoration: none;
}

.btn-branch-reset:hover {
    background: var(--bg-surface-elevated, #f1f5f9);
    border-color: #94a3b8;
    color: var(--text-primary, #0f172a);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-branch-reset i {
    font-size: 0.85rem;
    color: var(--accent-cyan, var(--brand));
    transition: transform 0.25s ease;
}

.btn-branch-reset:hover i {
    transform: rotate(-180deg);
}

/* Tarjeta / Chip Contador de Resultados (No suelto ni plano, esquinas menos redondas) */
.branches-counter-card {
    height: 38px;
    padding: 0 14px;
    border-radius: 6px !important;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-surface-elevated, #f8fafc);
    color: var(--text-secondary, #475569);
    font-size: 0.825rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.branches-counter-card .counter-icon {
    font-size: 0.9rem;
    color: var(--accent-cyan, var(--brand));
    flex-shrink: 0;
}

.branches-counter-card .counter-text {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

/* Tarjeta de Sucursal (Espaciosa, sin amontonamiento) */
.branch-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.branch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(var(--brand-rgb), 0.35) !important;
}

.branch-card-header {
    background: var(--bg-surface, #ffffff);
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.branch-type-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-right: 14px;
}

.branch-type-agency    { background: rgba(var(--brand-rgb), 0.12); color: var(--brand); }
.branch-type-terminal  { background: rgba(14, 165, 233, 0.12); color: var(--brand); }
.branch-type-warehouse { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.branch-type-workshop  { background: rgba(99, 102, 241, 0.14); color: #6366f1; }
.branch-type-corporate { background: rgba(147, 51, 234, 0.14); color: #9333ea; }

.branch-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin-bottom: 6px;
    line-height: 1.3;
}

.branch-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.branch-status-active {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.28);
}

.branch-status-inactive {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.28);
}

.branch-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.branch-status-dot.active {
    background-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.branch-status-dot.inactive {
    background-color: #64748b;
}

/* Cuerpo de la Tarjeta */
.branch-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.branch-address-box {
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.branch-address-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-right: 2px;
}

/* Métricas Operativas */
.branch-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.branch-stat-mini-card {
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    height: 100%;
}

.branch-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #64748b);
}

.branch-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.branch-stat-val .unit {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.85;
}

/* Filas Estructuradas con Espacio Respetado */
.branch-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.branch-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    gap: 12px;
}

.branch-icon-pill {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-right: 8px;
}

.branch-info-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.branch-info-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 175px;
}

/* Pie de Tarjeta */
.branch-card-footer {
    padding: 14px 20px;
    background: var(--bg-surface-elevated, #f8fafc);
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.branch-coords-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-secondary, #64748b);
}

.branch-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.95rem;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--bg-surface, #ffffff);
    transition: all 0.15s ease;
}

.branch-action-btn-edit {
    color: var(--brand);
    border-color: rgba(var(--brand-rgb), 0.35);
}

.branch-action-btn-edit:hover {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
}

.branch-action-btn-delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}

.branch-action-btn-delete:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Modales y Mapas */
.branch-modal-section-card {
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.branch-map-container {
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
}

.branch-map-overlay-hint {
    background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.85);
    backdrop-filter: blur(4px);
    padding: 5px 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.735rem;
}

/* Colores Auxiliares */
.text-emerald { color: #059669 !important; }
.bg-emerald-subtle { background-color: rgba(5, 150, 105, 0.12) !important; }
.text-amber { color: #d97706 !important; }
.bg-amber-subtle { background-color: rgba(245, 158, 11, 0.14) !important; }

/* Soporte Modo Oscuro */
[data-bs-theme="dark"] .branches-header-card,
[data-bs-theme="dark"] .branches-kpi-card,
[data-bs-theme="dark"] .branches-filter-card,
[data-bs-theme="dark"] .branch-card {
    background: var(--bg-surface, #111622) !important;
    border-color: var(--border-color, #1a2234) !important;
}

[data-bs-theme="dark"] .branch-card-header {
    background: var(--bg-surface, #111622) !important;
    border-bottom-color: #1a2234 !important;
}

[data-bs-theme="dark"] .branch-title {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .branch-address-box,
[data-bs-theme="dark"] .branch-stat-mini-card,
[data-bs-theme="dark"] .branch-info-box {
    background: #161f30 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .branch-info-val {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .branch-card-footer {
    background: #0d121c !important;
    border-top-color: #1a2234 !important;
}

[data-bs-theme="dark"] .branch-coords-pill {
    background: #161f30 !important;
    border-color: #243048 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .branch-action-btn,
[data-bs-theme="dark"] .btn-branch-reset,
[data-bs-theme="dark"] .branches-counter-card {
    background: #161f30 !important;
    border-color: #243048 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .btn-branch-reset:hover {
    background: #1c273e !important;
    color: #f8fafc !important;
    border-color: #38bdf8 !important;
}

[data-bs-theme="dark"] .branches-counter-card .counter-text {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .branch-modal-section-card {
    background: #161f30 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .branch-map-container {
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .branch-map-overlay-hint {
    background: rgba(17, 22, 34, 0.9) !important;
    border-color: #243048 !important;
    color: #94a3b8 !important;
}

/* =============================================================================
 * KPI Icon Base Styles & Boletas de Pago (Payslips) Design
 * ============================================================================= */
.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.payslips-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.payslips-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #2563eb 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.payslips-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.payslips-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.payslips-kpi-pill {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.payslips-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.payslips-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

[data-bs-theme="dark"] .payslips-header-card,
[data-bs-theme="dark"] .payslips-kpi-card,
[data-bs-theme="dark"] .payslips-filter-card,
[data-bs-theme="dark"] .payslips-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* Modal Header Icon & Spacing */
.modal-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-right: 14px !important;
}

/* Executive Switch Card */
.payslip-executive-switch-card {
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.payslip-executive-switch-card.is-active {
    background: rgba(var(--brand-rgb), 0.05) !important;
    border-color: var(--brand) !important;
}

.custom-executive-switch {
    width: 46px !important;
    height: 24px !important;
    cursor: pointer;
    background-color: #cbd5e1 !important;
    border: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
    transition: background-position 0.2s ease-in-out, background-color 0.2s ease-in-out !important;
}

.custom-executive-switch:checked {
    background-color: var(--brand) !important;
    box-shadow: 0 0 8px rgba(var(--brand-rgb), 0.4) !important;
}

[data-bs-theme="dark"] .payslip-executive-switch-card {
    background: #161f30 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .payslip-executive-switch-card.is-active {
    background: rgba(var(--brand-rgb), 0.15) !important;
    border-color: #38bdf8 !important;
}

/* Executive Back Button */
.btn-executive-back {
    height: 38px;
    padding: 0 16px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-secondary, #475569);
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #cbd5e1);
    transition: all 0.15s ease;
}

.btn-executive-back:hover {
    background: var(--bg-surface, #ffffff);
    color: var(--brand);
    border-color: var(--brand);
    transform: translateX(-2px);
}

[data-bs-theme="dark"] .btn-executive-back {
    background: #161f30 !important;
    border-color: #243048 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .btn-executive-back:hover {
    background: #1c273e !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

.payslip-info-alert {
    background: rgba(var(--brand-rgb), 0.08) !important;
    color: #0369a1 !important;
    border: 1px solid rgba(var(--brand-rgb), 0.15) !important;
}

[data-bs-theme="dark"] .payslip-info-alert {
    background: rgba(var(--brand-rgb), 0.12) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    color: #e0f2fe !important;
}

[data-bs-theme="dark"] .payslip-info-alert strong {
    color: #38bdf8 !important;
}

/* =============================================================================
 * Training Module — Executive Design System (LMS & Certificaciones)
 * ============================================================================= */
.training-page-wrapper {
    width: 100%;
}

.training-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.training-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #6366f1 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.training-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.training-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.training-kpi-pill {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.training-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.training-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

.training-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.training-item-box {
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

.training-item-box:hover {
    border-color: #cbd5e1;
}

.training-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.825rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Soporte de Modo Oscuro para Training */
[data-bs-theme="dark"] .training-header-card,
[data-bs-theme="dark"] .training-kpi-card,
[data-bs-theme="dark"] .training-filter-card,
[data-bs-theme="dark"] .training-table-card,
[data-bs-theme="dark"] .training-section-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .training-item-box {
    background: #161f30 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .training-item-box:hover {
    border-color: #334155 !important;
}

/* =============================================================================
 * Modern Unified Form Controls (SaaS Style) — Eliminates Clunky Input-Groups
 * ============================================================================= */
.modern-field-group {
    margin-bottom: 0.5rem;
}

.modern-field-label {
    display: block;
    font-size: 0.785rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.35rem;
}

.modern-field-label .required-star {
    color: #dc2626;
    margin-left: 2px;
}

.modern-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.modern-input-wrapper:hover {
    border-color: #94a3b8;
}

.modern-input-wrapper:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.modern-input-icon {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    color: var(--text-muted, #64748b);
    pointer-events: none;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-input-wrapper:focus-within .modern-input-icon {
    color: var(--brand);
}

.modern-input-control {
    width: 100%;
    height: 40px;
    padding: 8px 12px 8px 38px;
    border: none;
    background: transparent;
    color: var(--text-primary, #0f172a);
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
}

.modern-input-control::placeholder {
    color: var(--text-muted, #94a3b8);
    opacity: 0.8;
}

.modern-input-control:focus {
    outline: none;
    box-shadow: none;
}

select.modern-input-control {
    padding-left: 38px !important;
    padding-right: 36px !important;
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 12px 10px !important;
}

select.modern-input-control option {
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
}

.modern-input-suffix {
    padding-right: 12px;
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

/* =============================================================================
 * Executive Segmented Control Filter Bar (Apple / Linear Style)
 * ============================================================================= */
.training-segmented-bar {
    display: inline-flex;
    align-items: center;
    /* En pantallas angostas se desliza de lado en vez de salirse de la pantalla */
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 3px;
    gap: 4px;
}

.training-segmented-item {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px !important;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 7px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.training-segmented-item i {
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.training-segmented-item:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.03);
}

.training-segmented-item.is-active {
    background: var(--bg-surface, #ffffff);
    color: var(--accent-cyan, var(--brand));
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.training-segmented-pill {
    padding: 2px 8px;
    font-size: 0.725rem;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary, #64748b);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.training-segmented-item.is-active .training-segmented-pill {
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand);
}

/* Modo Oscuro para Controles Modernos y Segmented Bar */
[data-bs-theme="dark"] .modern-input-wrapper {
    background: #111622 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .modern-input-wrapper:hover {
    border-color: #3b4d6b !important;
}

[data-bs-theme="dark"] .modern-input-wrapper:focus-within {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

[data-bs-theme="dark"] .modern-input-control {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] select.modern-input-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

[data-bs-theme="dark"] select.modern-input-control option {
    background: #111622 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .modern-input-icon {
    color: #64748b !important;
}

[data-bs-theme="dark"] .modern-input-wrapper:focus-within .modern-input-icon {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .modern-input-suffix {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .training-segmented-bar {
    background: #0d131f !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .training-segmented-item {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .training-segmented-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .training-segmented-item.is-active {
    background: #1a2234 !important;
    color: #38bdf8 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .training-segmented-pill {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .training-segmented-item.is-active .training-segmented-pill {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #38bdf8 !important;
}

/* =============================================================================
 * Announcements Module — Executive Design System (Comunicados y Avisos)
 * ============================================================================= */
.announcements-page-wrapper {
    width: 100%;
}

.announcements-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.announcements-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #ec4899 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.announcements-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.announcements-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.announcements-kpi-pill {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.announcements-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.announcements-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

.announcements-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

/* Soporte de Modo Oscuro para Announcements */
[data-bs-theme="dark"] .announcements-header-card,
[data-bs-theme="dark"] .announcements-kpi-card,
[data-bs-theme="dark"] .announcements-filter-card,
[data-bs-theme="dark"] .announcements-table-card,
[data-bs-theme="dark"] .announcements-section-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* =============================================================================
 * Benefits Module — Executive Design System (Beneficios Corporativos)
 * ============================================================================= */
.benefits-page-wrapper {
    width: 100%;
}

.benefits-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.benefits-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981 0%, var(--brand) 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.benefits-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.benefits-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.benefits-kpi-pill {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.benefits-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.benefits-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.benefits-benefit-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.benefits-benefit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
}

.benefits-card-media {
    height: 150px;
    width: 100%;
    overflow: hidden;
}

.benefits-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.benefits-benefit-card:hover .benefits-card-img {
    transform: scale(1.05);
}

.benefits-card-title {
    font-size: 1rem;
    line-height: 1.35;
    transition: color 0.15s ease;
}

.benefits-card-title:hover {
    color: var(--accent-cyan, var(--brand)) !important;
}

.benefits-card-footer {
    background: var(--bg-surface-elevated, #f8fafc);
}

/* Soporte Dark Mode para Benefits */
[data-bs-theme="dark"] .benefits-header-card,
[data-bs-theme="dark"] .benefits-kpi-card,
[data-bs-theme="dark"] .benefits-filter-card,
[data-bs-theme="dark"] .benefits-section-card,
[data-bs-theme="dark"] .benefits-benefit-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .benefits-card-footer {
    background: #0f131d !important;
    border-top-color: #1e2638 !important;
}

/* =============================================================================
 * Birthdays Module — Executive Design System (Cumpleaños y Celebraciones)
 * ============================================================================= */
.birthdays-page-wrapper {
    width: 100%;
}

.birthdays-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.birthdays-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.birthdays-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.birthdays-months-bar {
    background: var(--bg-surface, #ffffff);
}

.birthdays-month-btn {
    border-radius: 8px !important;
    padding: 0.4rem 0.75rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
}

.birthdays-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

/* Soporte Dark Mode para Birthdays */
[data-bs-theme="dark"] .birthdays-header-card,
[data-bs-theme="dark"] .birthdays-section-card,
[data-bs-theme="dark"] .birthdays-months-bar,
[data-bs-theme="dark"] .birthdays-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .table-danger-subtle {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* =============================================================================
 * Company Documents Module — Executive Design System (Documentos de Empresa)
 * ============================================================================= */
.company-docs-page-wrapper {
    width: 100%;
}

.company-docs-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.company-docs-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #6366f1 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.company-docs-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.company-docs-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.company-docs-kpi-pill {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.company-docs-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.company-docs-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.company-docs-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

.company-docs-pdf-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.company-docs-doc-title {
    font-size: 0.95rem;
    line-height: 1.35;
    transition: color 0.15s ease;
}

.company-docs-doc-title:hover {
    color: var(--accent-cyan, var(--brand)) !important;
}

/* Soporte Dark Mode para Company Docs */
[data-bs-theme="dark"] .company-docs-header-card,
[data-bs-theme="dark"] .company-docs-kpi-card,
[data-bs-theme="dark"] .company-docs-filter-card,
[data-bs-theme="dark"] .company-docs-section-card,
[data-bs-theme="dark"] .company-docs-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* =============================================================================
 * Documents Module — Executive Design System (Legajos Digitales)
 * ============================================================================= */
.documents-page-wrapper {
    width: 100%;
}

.documents-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.documents-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #059669 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.documents-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.documents-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.documents-kpi-pill {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.documents-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.documents-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.documents-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

/* Soporte Dark Mode para Documents */
[data-bs-theme="dark"] .documents-header-card,
[data-bs-theme="dark"] .documents-kpi-card,
[data-bs-theme="dark"] .documents-filter-card,
[data-bs-theme="dark"] .documents-section-card,
[data-bs-theme="dark"] .documents-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* =============================================================================
 * Uniforms Module — Executive Design System (Dotación y Tallas)
 * ============================================================================= */
.uniforms-page-wrapper {
    width: 100%;
}

.uniforms-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.uniforms-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f59e0b 0%, var(--brand) 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.uniforms-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.uniforms-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.uniforms-kpi-pill {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.uniforms-section-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.uniforms-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.uniforms-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

/* Soporte Dark Mode para Uniforms */
[data-bs-theme="dark"] .uniforms-header-card,
[data-bs-theme="dark"] .uniforms-kpi-card,
[data-bs-theme="dark"] .uniforms-filter-card,
[data-bs-theme="dark"] .uniforms-section-card,
[data-bs-theme="dark"] .uniforms-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* =============================================================================
 * Payroll Module — Executive Design System (Cruce con Planilla)
 * ============================================================================= */
.payroll-page-wrapper {
    width: 100%;
}

.payroll-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.payroll-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.payroll-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.payroll-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.payroll-kpi-pill {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.payroll-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
}

.payroll-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

/* Soporte Dark Mode para Payroll */
[data-bs-theme="dark"] .payroll-header-card,
[data-bs-theme="dark"] .payroll-kpi-card,
[data-bs-theme="dark"] .payroll-filter-card,
[data-bs-theme="dark"] .payroll-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* =============================================================================
 * Reports Module — Executive Design System (Reportes de Asistencia)
 * ============================================================================= */
.reports-page-wrapper {
    width: 100%;
}

.reports-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.reports-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand) 0%, #3b82f6 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.reports-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reports-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06) !important;
}

.reports-kpi-pill {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.reports-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.reports-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    overflow: hidden;
}

/* Executive Tabs for Reports */
.reports-nav-tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.reports-nav-tabs {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.reports-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 9px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.reports-nav-tab:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.04);
}

.reports-nav-tab.is-active {
    background: var(--bg-surface, #ffffff);
    color: var(--accent-cyan, var(--brand));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.reports-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: visible !important;
    position: relative;
}

.reports-filter-single-row,
.reports-filter-bar-row {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    overflow: visible;
}

.reports-filter-inline-controls,
.reports-filter-controls {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.reports-segmented-bar .training-segmented-item {
    padding: 5px 9px;
    gap: 5px !important;
    font-size: 0.78rem;
    white-space: nowrap;
}

.reports-segmented-bar .training-segmented-pill {
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: 700;
}

.reports-filter-inline-controls .date-filter-pill {
    height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    gap: 0.45rem;
    white-space: nowrap;
}

.reports-filter-inline-controls .modern-input-wrapper {
    height: 36px;
}

.reports-filter-inline-controls .modern-input-control {
    height: 36px;
    font-size: 0.8rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

@media (max-width: 1199.98px) {
    .reports-filter-single-row {
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
}

.reports-filter-single-row::-webkit-scrollbar {
    height: 4px;
}

.reports-filter-single-row::-webkit-scrollbar-thumb {
    background: var(--border-color, #cbd5e1);
    border-radius: 4px;
}

.reports-tab-transition {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.reports-tab-transition.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Soporte Dark Mode para Reports */
[data-bs-theme="dark"] .reports-header-card,
[data-bs-theme="dark"] .reports-kpi-card,
[data-bs-theme="dark"] .reports-filter-card,
[data-bs-theme="dark"] .reports-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .reports-nav-tabs {
    background: #0f1420 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .reports-nav-tab {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .reports-nav-tab:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .reports-nav-tab.is-active {
    background: #1e2638 !important;
    color: #38bdf8 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* =============================================================================
 * Module: Settings Hub & Navigation
 * ============================================================================= */

.settings-global-notice {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.07) 0%, rgba(var(--brand-rgb), 0.02) 100%);
    border: 1px solid rgba(var(--brand-rgb), 0.2);
    border-left: 4px solid var(--accent-cyan, var(--brand));
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.04);
}

.settings-notice-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--accent-cyan, var(--brand));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.settings-notice-title {
    color: var(--text-primary, #0f172a);
    font-size: 0.925rem;
    font-weight: 700;
}

.settings-notice-text {
    color: #334155;
    font-size: 0.825rem;
    line-height: 1.5;
}

.settings-helper-text {
    color: #475569;
    font-size: 0.775rem;
    line-height: 1.45;
}

.color-inherit-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1px solid var(--border-color, #cbd5e1);
    color: var(--text-primary, #0f172a);
    font-family: var(--font-monospace, monospace);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
}

/* =============================================================================
 * Module 9: Settings Mobile
 * ============================================================================= */
.mobile-settings-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    transition: all 0.2s ease;
}

.mobile-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    padding: 1rem 1.15rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.mobile-setting-item {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    transition: background 0.15s ease;
}

.mobile-setting-item:last-child {
    border-bottom: none;
}

.mobile-setting-item:hover {
    background: rgba(var(--brand-rgb), 0.025);
}

.mobile-setting-child {
    padding-left: 3rem !important;
    position: relative;
    background: rgba(0, 0, 0, 0.015);
}

.mobile-setting-child::before {
    content: '';
    position: absolute;
    left: 1.65rem;
    top: 0;
    bottom: 50%;
    width: 2px;
    background: var(--accent-cyan, var(--brand));
    opacity: 0.4;
}

.mobile-setting-child::after {
    content: '';
    position: absolute;
    left: 1.65rem;
    top: 50%;
    width: 14px;
    height: 2px;
    background: var(--accent-cyan, var(--brand));
    opacity: 0.4;
}

.mobile-setting-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.doc-tile-card {
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-surface, #ffffff);
}

.doc-tile-card:hover {
    border-color: var(--brand);
    background: rgba(var(--brand-rgb), 0.03);
}

.doc-tile-card.active {
    border-color: var(--brand);
    background: rgba(var(--brand-rgb), 0.08);
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.1);
}

/* =============================================================================
 * Module 10: Settings Branding
 * ============================================================================= */
.branding-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    transition: all 0.2s ease;
}

.branding-nav-tabs {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 1.5rem;
}

.branding-nav-tabs .nav-link {
    border: none;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    padding: 8px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.branding-nav-tabs .nav-link:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.04);
}

.branding-nav-tabs .nav-link.active {
    background: var(--bg-surface, #ffffff);
    color: var(--accent-cyan, var(--brand));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.image-upload-card {
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    padding: 1rem;
    background: var(--bg-surface, #ffffff);
    transition: border-color 0.2s ease;
}

.image-upload-card:hover {
    border-color: rgba(var(--brand-rgb), 0.3);
}

.image-preview-zone {
    height: 104px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-elevated, #f8fafc);
    border: 1.5px dashed var(--border-color, #cbd5e1);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.settings-action-bar {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* =============================================================================
 * Soporte Dark Mode para Settings (Mobile & Branding)
 * ============================================================================= */
[data-bs-theme="dark"] .mobile-settings-card,
[data-bs-theme="dark"] .mobile-kpi-card,
[data-bs-theme="dark"] .doc-tile-card,
[data-bs-theme="dark"] .branding-card,
[data-bs-theme="dark"] .image-upload-card,
[data-bs-theme="dark"] .settings-action-bar {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .branding-nav-tabs {
    background: #0f1420 !important;
    border-color: #243048 !important;
}

[data-bs-theme="dark"] .branding-nav-tabs .nav-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .branding-nav-tabs .nav-link:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .branding-nav-tabs .nav-link.active {
    background: #1e2638 !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .settings-global-notice {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12) 0%, rgba(var(--brand-rgb), 0.04) 100%);
    border-color: rgba(56, 189, 248, 0.25);
    border-left-color: #38bdf8;
}

[data-bs-theme="dark"] .settings-notice-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

[data-bs-theme="dark"] .settings-notice-title {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .settings-notice-text {
    color: #94a3b8;
}

[data-bs-theme="dark"] .settings-helper-text {
    color: #94a3b8;
}

[data-bs-theme="dark"] .color-inherit-chip {
    background: #171f2e;
    border-color: #2a354c;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .mobile-setting-item:hover {
    background: rgba(var(--brand-rgb), 0.06);
}

[data-bs-theme="dark"] .mobile-setting-child {
    background: rgba(255, 255, 255, 0.015);
}

[data-bs-theme="dark"] .image-preview-zone {
    background: #0d121d !important;
    border-color: #1e2638 !important;
}

/* =============================================================================
 * Module 11: Settings Integrations
 * ============================================================================= */
.integrations-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .integrations-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

/* Botones de acción y prueba con contraste profesional (Light & Dark) */
.btn-integration-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(var(--brand-rgb), 0.08);
    border: 1.5px solid rgba(var(--brand-rgb), 0.35);
    color: var(--brand);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(var(--brand-rgb), 0.05);
}

.btn-integration-action:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.25);
    transform: translateY(-1px);
}

.btn-integration-action:active:not(:disabled) {
    transform: translateY(0);
}

.btn-integration-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botón Regenerar Secreto (Ámbar con alto contraste legible en modo claro) */
.btn-integration-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(217, 119, 6, 0.09);
    border: 1.5px solid rgba(217, 119, 6, 0.4);
    color: #b45309; /* Contraste > 5.2:1 en fondo blanco */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.05);
}

.btn-integration-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
    transform: translateY(-1px);
}

.btn-integration-warning:active:not(:disabled) {
    transform: translateY(0);
}

.btn-integration-warning:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botón Actualizar / Secundario */
.btn-integration-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 8px;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1.5px solid var(--border-color, #cbd5e1);
    color: var(--text-primary, #0f172a);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-integration-secondary:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.25);
    transform: translateY(-1px);
}

.btn-integration-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-integration-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botones de acción rápida dentro de inputs (Ver/Ocultar y Copiar) */
.btn-input-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1px solid var(--border-color, #cbd5e1);
    color: var(--text-secondary, #475569);
    font-size: 0.85rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-input-action:hover {
    background: rgba(var(--brand-rgb), 0.12);
    border-color: rgba(var(--brand-rgb), 0.4);
    color: var(--brand);
}

.btn-input-action:active {
    transform: scale(0.95);
}

/* Soporte Dark Mode para botones de integraciones */
[data-bs-theme="dark"] .btn-integration-action {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

[data-bs-theme="dark"] .btn-integration-action:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-integration-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

[data-bs-theme="dark"] .btn-integration-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-integration-secondary {
    background: #171f2e;
    border-color: #243048;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btn-integration-secondary:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-input-action {
    background: #171f2e;
    border-color: #243048;
    color: #94a3b8;
}

[data-bs-theme="dark"] .btn-input-action:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

/* Botones de acción en tablas (desplegables, ver, editar) */
.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 0.8125rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-table-action:hover {
    background: rgba(var(--brand-rgb), 0.12);
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
}

.btn-table-action.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

[data-bs-theme="dark"] .btn-table-action {
    background: #171f2e;
    border-color: #243048;
    color: #94a3b8;
}

[data-bs-theme="dark"] .btn-table-action:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .btn-table-action.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

/* =============================================================================
 * Module 12: Audit Log
 * ============================================================================= */
.audit-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.audit-filter-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
}

.audit-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    overflow: hidden;
}

/* Filtros Rápidos Segmentados Ejecutivos (Esquinas sutiles 8px, NO píldoras) */
.audit-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.audit-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 8px; /* Esquinas sutiles y elegantes para ERP corporativo */
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #334155);
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    user-select: none;
}

.audit-filter-chip:hover {
    background: var(--bg-surface-elevated, #f8fafc);
    border-color: #94a3b8;
    color: var(--text-primary, #0f172a);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.audit-filter-chip:active {
    transform: translateY(0);
}

/* Badge de conteo interno para cada chip */
.audit-chip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 5px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    transition: all 0.15s ease;
}

/* Iconos semánticos con color acentuado incluso al estar inactivos */
.audit-filter-chip .chip-icon-success { color: #10b981; }
.audit-filter-chip .chip-icon-primary { color: var(--brand); }
.audit-filter-chip .chip-icon-warning { color: #f59e0b; }
.audit-filter-chip .chip-icon-danger  { color: #ef4444; }

/* Estados Activos (Colores ejecutivos con alto contraste WCAG) */
.audit-filter-chip.is-active-all {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.3);
}
.audit-filter-chip.is-active-all .audit-chip-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.audit-filter-chip.is-active-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: #047857;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}
.audit-filter-chip.is-active-success .chip-icon-success {
    color: #047857;
}
.audit-filter-chip.is-active-success .audit-chip-badge {
    background: #10b981;
    color: #ffffff;
}

.audit-filter-chip.is-active-primary {
    background: rgba(var(--brand-rgb), 0.12);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.2);
}
.audit-filter-chip.is-active-primary .chip-icon-primary {
    color: var(--brand);
}
.audit-filter-chip.is-active-primary .audit-chip-badge {
    background: var(--brand);
    color: #ffffff;
}

.audit-filter-chip.is-active-warning {
    background: rgba(245, 158, 11, 0.14);
    border-color: #d97706;
    color: #b45309;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}
.audit-filter-chip.is-active-warning .chip-icon-warning {
    color: #b45309;
}
.audit-filter-chip.is-active-warning .audit-chip-badge {
    background: #d97706;
    color: #ffffff;
}

.audit-filter-chip.is-active-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}
.audit-filter-chip.is-active-danger .chip-icon-danger {
    color: #b91c1c;
}
.audit-filter-chip.is-active-danger .audit-chip-badge {
    background: #ef4444;
    color: #ffffff;
}

/* Botón Limpiar Filtros */
.btn-audit-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.75rem;
    font-size: 0.785rem;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #dc2626;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-audit-clear:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

/* Dark mode para Auditoría */
[data-bs-theme="dark"] .audit-kpi-card,
[data-bs-theme="dark"] .audit-filter-card,
[data-bs-theme="dark"] .audit-table-card {
    background: #111622 !important;
    border-color: #1e2638 !important;
}

[data-bs-theme="dark"] .audit-filter-chip {
    background: #171f2e;
    border-color: #243048;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .audit-filter-chip:hover {
    background: #1e293b;
    border-color: #3b4b68;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .audit-chip-badge {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

[data-bs-theme="dark"] .audit-filter-chip.is-active-all {
    background: var(--brand);
    border-color: #38bdf8;
    color: #ffffff;
}

[data-bs-theme="dark"] .audit-filter-chip.is-active-success {
    background: rgba(16, 185, 129, 0.18);
    border-color: #10b981;
    color: #34d399;
}

[data-bs-theme="dark"] .audit-filter-chip.is-active-primary {
    background: rgba(var(--brand-rgb), 0.18);
    border-color: var(--brand);
    color: #38bdf8;
}

[data-bs-theme="dark"] .audit-filter-chip.is-active-warning {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #fbbf24;
}

[data-bs-theme="dark"] .audit-filter-chip.is-active-danger {
    background: rgba(239, 68, 68, 0.18);
    border-color: #ef4444;
    color: #f87171;
}

[data-bs-theme="dark"] .btn-audit-clear {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

[data-bs-theme="dark"] .btn-audit-clear:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}






















/* =============================================================================
   SELECTOR "¿EN QUÉ EMPRESA?" (Super Admin en la vista global)
   ============================================================================= */
.tenant-picker-backdrop-page {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--border-color-light);
}

.tenant-picker-card {
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--bg-surface);
}

.tenant-picker-search {
    position: relative;
}

.tenant-picker-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tenant-picker-search input {
    padding-left: 34px;
    height: 40px;
    border-radius: var(--btn-radius);
}

.tenant-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tenant-picker-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.tenant-picker-option:hover {
    border-color: var(--border-color-light);
    background: var(--bg-surface-elevated);
}

.tenant-picker-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tenant-picker-option:has(input:checked) {
    border-color: var(--brand);
    background: rgba(var(--brand-rgb), .06);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12);
}

.tenant-picker-option:has(input:focus-visible) {
    outline: 2px solid var(--border-color-focus);
    outline-offset: 2px;
}

.tenant-picker-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--brand);
    background: rgba(var(--brand-rgb), .1);
}

.tenant-picker-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.tenant-picker-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tenant-picker-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tenant-picker-check {
    color: var(--brand);
    opacity: 0;
    transition: opacity .15s ease;
}

.tenant-picker-option:has(input:checked) .tenant-picker-check {
    opacity: 1;
}

/* =============================================================================
 * Skeleton loaders
 * Una región con .sk-loading (o aria-busy desde Panel.skeleton) convierte sus
 * filas de tabla, tarjetas KPI, listas y gráficos en siluetas con brillo, sin
 * cambiar su tamaño: al llegar los datos no hay saltos. Solo CSS sobre el DOM
 * que ya existe (no se inyecta HTML) y una sola animación de fondo compartida
 * (background-attachment: fixed) para que el brillo vaya sincronizado.
 * ============================================================================= */
:root,
[data-bs-theme="light"] {
    --sk-base: #e8edf3;
    --sk-shine: #f8fafc;
}

[data-bs-theme="dark"] {
    --sk-base: #1a2234;
    --sk-shine: #26324a;
}

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

.sk-bar,
.sk-loading tbody td::after,
.sk-loading :is([class*="kpi-card"], .list-group-item, [data-sk])::after,
.sk-loading div:has(> canvas)::after {
    background-color: var(--sk-base);
    background-image: linear-gradient(100deg, var(--sk-base) 35%, var(--sk-shine) 50%, var(--sk-base) 65%);
    background-size: 200% 100%;
    background-attachment: fixed;
    animation: sk-shimmer 1.4s linear infinite;
}

.sk-bar {
    display: block;
    height: .7rem;
    border-radius: 6px;
}

.sk-loading {
    cursor: progress;
}

/* Mientras carga no se puede pulsar lo que va a cambiar */
.sk-loading :is(tbody, [class*="kpi-card"], .list-group, [data-sk]) {
    pointer-events: none;
    user-select: none;
}

/* Tablas: cada celda es una barra; la fila conserva su alto */
.sk-loading tbody td {
    position: relative;
    color: transparent !important;
}

.sk-loading tbody td > * {
    visibility: hidden;
}

.sk-loading tbody td::after {
    content: "";
    position: absolute;
    left: .75rem;
    right: 28%;
    top: 50%;
    height: .65rem;
    margin-top: -.325rem;
    border-radius: 6px;
}

.sk-loading tbody tr:nth-child(3n+2) td::after { right: 42%; }
.sk-loading tbody tr:nth-child(3n) td::after { right: 18%; }
.sk-loading tbody tr td:last-child::after { left: auto; width: 3.5rem; right: .75rem; }

/* Tarjetas KPI y filas de lista: cifra, etiqueta y detalle */
.sk-loading :is([class*="kpi-card"], .list-group-item, [data-sk]) {
    position: relative;
    overflow: hidden;
}

.sk-loading :is([class*="kpi-card"], .list-group-item, [data-sk]) > * {
    visibility: hidden;
}

.sk-loading [class*="kpi-card"]::after {
    content: "";
    position: absolute;
    inset: 1rem;
    width: auto;
    height: auto;
    -webkit-mask:
        linear-gradient(#000 0 0) 0 0 / 55% .7rem no-repeat,
        linear-gradient(#000 0 0) 0 1.6rem / 40% 1.8rem no-repeat,
        linear-gradient(#000 0 0) 0 4.1rem / 75% .6rem no-repeat;
    mask:
        linear-gradient(#000 0 0) 0 0 / 55% .7rem no-repeat,
        linear-gradient(#000 0 0) 0 1.6rem / 40% 1.8rem no-repeat,
        linear-gradient(#000 0 0) 0 4.1rem / 75% .6rem no-repeat;
}

/* Fila de lista: avatar redondo y dos líneas */
.sk-loading .list-group-item::after {
    content: "";
    position: absolute;
    inset: .5rem .5rem .5rem .5rem;
    -webkit-mask:
        radial-gradient(circle 18px at 18px 50%, #000 98%, transparent) 0 0 / 36px 100% no-repeat,
        linear-gradient(#000 0 0) 50px calc(50% - .55rem) / 45% .65rem no-repeat,
        linear-gradient(#000 0 0) 50px calc(50% + .45rem) / 30% .55rem no-repeat;
    mask:
        radial-gradient(circle 18px at 18px 50%, #000 98%, transparent) 0 0 / 36px 100% no-repeat,
        linear-gradient(#000 0 0) 50px calc(50% - .55rem) / 45% .65rem no-repeat,
        linear-gradient(#000 0 0) 50px calc(50% + .45rem) / 30% .55rem no-repeat;
}

/* Gráficos y bloques marcados con data-sk: un panel completo */
.sk-loading div:has(> canvas) {
    position: relative;
}

.sk-loading div:has(> canvas) > canvas {
    visibility: hidden;
}

.sk-loading :is(div:has(> canvas), [data-sk])::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--card-radius);
}

/* Spinners y velos antiguos de las tablas: la silueta los reemplaza */
.sk-loading :is(.table-loading-overlay, [id$="LoadingOverlay"], [id$="Loader"]) {
    display: none !important;
}

/* Los diálogos que viven dentro de la región no se tocan */
.sk-loading .modal :is(tbody td, [class*="kpi-card"], .list-group-item) {
    color: inherit !important;
    pointer-events: auto;
}

.sk-loading .modal :is(tbody td, [class*="kpi-card"], .list-group-item) > * {
    visibility: visible;
}

.sk-loading .modal :is(tbody td, [class*="kpi-card"], .list-group-item)::after {
    content: none;
}

@media (prefers-reduced-motion: reduce) {
    .sk-bar,
    .sk-loading tbody td::after,
    .sk-loading :is([class*="kpi-card"], .list-group-item, [data-sk])::after,
    .sk-loading div:has(> canvas)::after {
        animation: none;
    }
}

/* ==========================================================================
   Utilidades de medio paso (p-2.5, gap-1.5, mt-0.5...)
   Bootstrap 5 solo trae 0-5: sin esto esas clases no hacen nada y el
   contenido queda pegado (p. ej. las fichas de "Mi cuenta").
   Escala: 0.5 = .125rem, 1.5 = .375rem, 2.5 = .75rem, 3.5 = 1.25rem
   ========================================================================== */
.p-0\.5 { padding: .125rem !important; }
.p-1\.5 { padding: .375rem !important; }
.p-2\.5 { padding: .75rem !important; }
.p-3\.5 { padding: 1.25rem !important; }
.px-0\.5 { padding-left: .125rem !important; padding-right: .125rem !important; }
.px-1\.5 { padding-left: .375rem !important; padding-right: .375rem !important; }
.px-2\.5 { padding-left: .75rem !important; padding-right: .75rem !important; }
.px-3\.5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.py-0\.5 { padding-top: .125rem !important; padding-bottom: .125rem !important; }
.py-1\.5 { padding-top: .375rem !important; padding-bottom: .375rem !important; }
.py-2\.5 { padding-top: .75rem !important; padding-bottom: .75rem !important; }
.py-3\.5 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
.pt-0\.5 { padding-top: .125rem !important; }
.pt-1\.5 { padding-top: .375rem !important; }
.pt-2\.5 { padding-top: .75rem !important; }
.pt-3\.5 { padding-top: 1.25rem !important; }
.pb-0\.5 { padding-bottom: .125rem !important; }
.pb-1\.5 { padding-bottom: .375rem !important; }
.pb-2\.5 { padding-bottom: .75rem !important; }
.pb-3\.5 { padding-bottom: 1.25rem !important; }
.ps-0\.5 { padding-left: .125rem !important; }
.ps-1\.5 { padding-left: .375rem !important; }
.ps-2\.5 { padding-left: .75rem !important; }
.ps-3\.5 { padding-left: 1.25rem !important; }
.pe-0\.5 { padding-right: .125rem !important; }
.pe-1\.5 { padding-right: .375rem !important; }
.pe-2\.5 { padding-right: .75rem !important; }
.pe-3\.5 { padding-right: 1.25rem !important; }
.m-0\.5 { margin: .125rem !important; }
.m-1\.5 { margin: .375rem !important; }
.m-2\.5 { margin: .75rem !important; }
.m-3\.5 { margin: 1.25rem !important; }
.mx-0\.5 { margin-left: .125rem !important; margin-right: .125rem !important; }
.mx-1\.5 { margin-left: .375rem !important; margin-right: .375rem !important; }
.mx-2\.5 { margin-left: .75rem !important; margin-right: .75rem !important; }
.mx-3\.5 { margin-left: 1.25rem !important; margin-right: 1.25rem !important; }
.my-0\.5 { margin-top: .125rem !important; margin-bottom: .125rem !important; }
.my-1\.5 { margin-top: .375rem !important; margin-bottom: .375rem !important; }
.my-2\.5 { margin-top: .75rem !important; margin-bottom: .75rem !important; }
.my-3\.5 { margin-top: 1.25rem !important; margin-bottom: 1.25rem !important; }
.mt-0\.5 { margin-top: .125rem !important; }
.mt-1\.5 { margin-top: .375rem !important; }
.mt-2\.5 { margin-top: .75rem !important; }
.mt-3\.5 { margin-top: 1.25rem !important; }
.mb-0\.5 { margin-bottom: .125rem !important; }
.mb-1\.5 { margin-bottom: .375rem !important; }
.mb-2\.5 { margin-bottom: .75rem !important; }
.mb-3\.5 { margin-bottom: 1.25rem !important; }
.ms-0\.5 { margin-left: .125rem !important; }
.ms-1\.5 { margin-left: .375rem !important; }
.ms-2\.5 { margin-left: .75rem !important; }
.ms-3\.5 { margin-left: 1.25rem !important; }
.me-0\.5 { margin-right: .125rem !important; }
.me-1\.5 { margin-right: .375rem !important; }
.me-2\.5 { margin-right: .75rem !important; }
.me-3\.5 { margin-right: 1.25rem !important; }
.gap-0\.5 { gap: .125rem !important; }
.gap-1\.5 { gap: .375rem !important; }
.gap-2\.5 { gap: .75rem !important; }
.gap-3\.5 { gap: 1.25rem !important; }

/* Selector global de empresas en celular: ocupa el ancho disponible sin pegarse */
@media (max-width: 575.98px) {
    .topbar-tenant-selector { min-width: 0; max-width: 58vw; padding-left: .75rem; }
}

/* ==========================================================================
   Barra de filtros compartida (Panel.filters): buscador, selectores y etiquetas
   de los filtros activos. Persistente y con los colores de la marca.
   ========================================================================== */
.filter-bar { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 14px;
    padding: .9rem 1rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04); }
.filter-bar-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.filter-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.filter-search > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.filter-search input { width: 100%; height: 40px; padding: .45rem .9rem .45rem 2.4rem; border-radius: 10px; border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg); color: var(--bs-body-color); font-size: .875rem; transition: border-color .15s, box-shadow .15s, background .15s; }
.filter-select { flex: 0 1 190px; min-width: 150px; height: 40px; padding: .45rem 2.2rem .45rem .85rem; border-radius: 10px; border: 1px solid var(--bs-border-color);
    background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); font-size: .85rem; cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right .8rem center; background-size: 11px 7px; transition: border-color .15s, box-shadow .15s; }
.filter-search input:focus, .filter-select:focus { outline: none; border-color: var(--brand); background-color: var(--bs-body-bg); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }
.filter-select.is-set { border-color: rgba(var(--brand-rgb), .55); background-color: rgba(var(--brand-rgb), .06); color: var(--brand); font-weight: 600; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .7rem; }
.filter-chips[hidden] { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .4rem .25rem .7rem; border-radius: 999px; font-size: .78rem;
    border: 1px solid rgba(var(--brand-rgb), .3); background: rgba(var(--brand-rgb), .08); color: var(--bs-body-color); cursor: pointer; transition: background .15s; }
.filter-chip:hover { background: rgba(var(--brand-rgb), .16); }
.filter-chip-label { color: var(--bs-secondary-color); }
.filter-chip i { font-size: .65rem; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(var(--brand-rgb), .15); }
.filter-chip-clear { border: 0; background: none; color: var(--brand); font-size: .78rem; font-weight: 600; padding: .25rem .4rem; cursor: pointer; }
.filter-chip-clear:hover { text-decoration: underline; }
@media (max-width: 575.98px) { .filter-select { flex: 1 1 calc(50% - .3rem); min-width: 0; } }

/* =============================================================================
 * Base compartida v2 (29/10/2026): tokens de movimiento, superficies y foco
 * Criterios: animaciones cortas con ease-out, solo transform/opacity, nada
 * crece desde 0, foco visible con teclado, color de la marca de la empresa.
 * ============================================================================= */
:root {
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --dur-1: 120ms;
    --dur-2: 180ms;
    --dur-3: 240ms;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --ring: 0 0 0 3px rgba(var(--brand-rgb), 0.22);
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 24px 48px -12px rgba(15, 23, 42, 0.18);
}

[data-bs-theme="dark"] {
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 24px -6px rgba(0, 0, 0, 0.5), 0 32px 64px -16px rgba(0, 0, 0, 0.6);
    --ring: 0 0 0 3px rgba(var(--brand-rgb), 0.35);
    --accent-emerald-rgb: 16, 185, 129;
    --accent-amber-rgb: 245, 158, 11;
    --accent-blue-rgb: 59, 130, 246;
    --accent-rose: #f87171;
    --accent-rose-rgb: 248, 113, 113;
}

/* Cifras alineadas en tablas, totales y métricas */
.table, .tabular, [class*="kpi-number"], .dash-kpi-value { font-variant-numeric: tabular-nums; }

/* Botones: respuesta táctil al presionar (sin animar el color en cada tecla) */
.btn {
    transition: color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out),
        border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn:active:not(:disabled):not(.disabled) { transform: scale(0.97); }
.btn:focus-visible, .btn-close:focus-visible, .form-check-input:focus-visible,
a:focus-visible, [role="button"]:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible {
    outline: none;
    box-shadow: var(--ring) !important;
}

/* Campos: borde y anillo con el color de la marca */
.form-control, .form-select {
    transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.form-control:hover:not(:focus):not(:disabled), .form-select:hover:not(:focus):not(:disabled) { border-color: var(--border-color-light) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand) !important; box-shadow: var(--ring) !important; }
.form-control::placeholder { color: var(--text-muted); opacity: 0.8; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }

/* Tablas: encabezado discreto, fila que se ilumina sin saltos */
.table tbody tr > * { transition: background-color var(--dur-1) var(--ease-out); }
.table-hover > tbody > tr:hover > * { background-color: rgba(var(--brand-rgb), 0.035) !important; }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { background-color: rgba(255, 255, 255, 0.025) !important; }
.table tbody tr:last-child > td { border-bottom-color: transparent; }

/* Diálogos: entran con escala 0.96 → 1 y fondo con desenfoque suave */
.modal-backdrop { --bs-backdrop-bg: #0f172a; --bs-backdrop-opacity: 0.4; }
.modal-backdrop.show { backdrop-filter: blur(2px); }
.modal.fade .modal-dialog { transform: translateY(6px) scale(0.96); transition: transform var(--dur-3) var(--ease-out); }
.modal.show .modal-dialog { transform: none; }
.modal.modal-static .modal-dialog { transform: scale(1.015); }
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--border-color); padding: 1rem 1.25rem; }
.modal-title { font-weight: 700; letter-spacing: -0.015em; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top-color: var(--border-color); padding: 0.75rem 1.25rem; background: var(--bg-surface-elevated); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Menús desplegables: aparecen desde su origen (translate, no transform: Popper usa transform) */
.dropdown-menu { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border-color: var(--border-color); }
.dropdown-menu.show { animation: dropdownIn var(--dur-2) var(--ease-out); }
@keyframes dropdownIn { from { opacity: 0; translate: 0 -4px; } }
.dropdown-item { border-radius: var(--radius-sm); transition: background-color var(--dur-1) var(--ease-out); }

/* Tarjetas genéricas: borde fino y sombra mínima */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }

/* Sin movimiento para quien lo pide al sistema */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .btn:active:not(:disabled):not(.disabled) { transform: none; }
}

/* =============================================================================
 * Dashboard v2: jerarquía clara (título → cifras → detalle), tarjetas con borde
 * fino, colores de estado solo donde informan y estados vacíos con mensaje.
 * ============================================================================= */
.dash-notice {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 0.9rem; margin-bottom: 1.25rem;
    background: rgba(var(--brand-rgb), 0.06); border: 1px solid rgba(var(--brand-rgb), 0.18);
    border-radius: var(--radius-md); font-size: 0.82rem; color: var(--text-secondary);
}
.dash-notice > i { color: var(--brand); font-size: 1rem; }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.dash-head-text { min-width: 0; }
.dash-eyebrow { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.35rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.dash-title { margin: 0; font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; color: var(--text-primary); }
.dash-subtitle { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.dash-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.dash-live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-emerald); flex-shrink: 0; }
.dash-live-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: dashPing 2s var(--ease-out) infinite; }
@keyframes dashPing { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

/* Estado de la telemetría */
.dash-status { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.dash-status-items { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.dash-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; height: 28px; padding: 0 0.65rem;
    font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
    background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 999px;
}
.dash-chip i { font-size: 0.8rem; color: var(--text-muted); }
.dash-chip.is-ok { color: var(--accent-emerald); border-color: rgba(var(--accent-emerald-rgb), 0.3); background: rgba(var(--accent-emerald-rgb), 0.06); }
.dash-chip.is-ok i { color: inherit; }
.dash-live-pill { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.dash-icon-btn {
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-secondary);
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.dash-icon-btn:hover { color: var(--text-primary); background: var(--bg-surface-elevated); }
.dash-icon-btn:active { transform: scale(0.94); }
.dash-icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Indicadores */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.dash-kpi-card {
    display: flex; flex-direction: column; gap: 0.6rem; min-width: 0;
    padding: 1.1rem 1.15rem 1rem; background: var(--bg-surface);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.dash-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.dash-kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.dash-kpi-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 0.9rem; }
.dash-kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--text-primary); }
.dash-kpi-meta { display: flex; align-items: center; gap: 0.35rem 1rem; flex-wrap: wrap; margin-top: auto; font-size: 0.75rem; color: var(--text-muted); }
.dash-kpi-meta b { color: var(--text-primary); font-weight: 700; }

.tone-brand { --tone: var(--brand-rgb); }
.tone-emerald { --tone: var(--accent-emerald-rgb); }
.tone-amber { --tone: var(--accent-amber-rgb); }
.tone-blue { --tone: var(--accent-blue-rgb); }
.tone-rose { --tone: var(--accent-rose-rgb); }
.dash-kpi-icon[class*="tone-"] { background: rgba(var(--tone), 0.1); color: rgb(var(--tone)); }
.dash-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--tone, var(--brand-rgb))); vertical-align: 1px; margin-right: 0.2rem; }

.dash-meter { position: relative; height: 6px; border-radius: 999px; background: var(--bg-surface-elevated); }
.dash-meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: rgb(var(--tone)); transition: width 600ms var(--ease-out); }
.dash-meter-goal { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text-muted); opacity: 0.5; }

/* Paneles */
.dash-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.dash-grid-3 { grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr); }
.dash-grid-2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.dash-panel {
    display: flex; flex-direction: column; min-width: 0;
    padding: 1.1rem 1.15rem; background: var(--bg-surface);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.dash-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-panel-title { margin: 0; font-size: 0.9rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.dash-panel-sub { margin: 0.15rem 0 0; font-size: 0.75rem; color: var(--text-muted); }
.dash-panel-foot {
    display: flex; justify-content: space-between; gap: 0.5rem; margin: auto -1.15rem -1.1rem; padding: 0.6rem 1.15rem;
    font-size: 0.72rem; color: var(--text-muted); border-top: 1px solid var(--border-color);
    background: var(--bg-surface-elevated); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dash-dials .progress-dial-group { padding: 0.75rem 0; }
.dash-dials .progress-dial-group:first-child { padding-top: 0; }
.dash-dials .dial-meter { transition: stroke-dashoffset 600ms var(--ease-out); }
.dash-dials .dial-details-title { text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.dash-dials .dial-details-val { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.dash-chart { position: relative; }
.dash-chart-empty, .dash-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    text-align: center; padding: 1.5rem 1rem;
}
.dash-chart-empty { position: absolute; inset: 0; background: var(--bg-surface); animation: dashFade var(--dur-3) var(--ease-out); }
.dash-chart-empty[hidden] { display: none; }
@keyframes dashFade { from { opacity: 0; } }
.dash-empty-icon {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.4rem;
    border-radius: 12px; font-size: 1.1rem; color: var(--text-muted);
    background: var(--bg-surface-elevated); border: 1px solid var(--border-color);
}
.dash-empty-title { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.dash-empty-text { margin: 0; max-width: 30ch; font-size: 0.75rem; color: var(--text-muted); }

.dash-map { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-color); }
.dash-legend { display: flex; gap: 0.4rem 1rem; flex-wrap: wrap; margin-top: 0.75rem; font-size: 0.72rem; color: var(--text-muted); }

/* Marcaciones en vivo */
.dash-feed .stream-list { max-height: 300px; overflow-y: auto; margin: 0 -0.5rem; }
.dash-feed .list-group-item {
    border: 0; border-radius: var(--radius-md); background: transparent; padding: 0.55rem 0.5rem !important;
    transition: background-color var(--dur-1) var(--ease-out); animation: dashFeedIn 400ms var(--ease-out) both;
}
.dash-feed .list-group-item:hover { background: var(--bg-surface-elevated); }
@keyframes dashFeedIn { from { opacity: 0; translate: 0 -6px; } }
.dash-feed-name { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.dash-feed-meta { font-size: 0.74rem; color: var(--text-muted); }
.dash-feed-time { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; margin-bottom: 0.15rem; }

@media (max-width: 1399.98px) {
    .dash-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .dash-grid-3 > :first-child { grid-column: 1 / -1; }
    .dash-grid-3 > :first-child .dash-dials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
    .dash-grid-3 > :first-child .progress-dial-group { padding: 0; border: 0; }
}
@media (max-width: 1199.98px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .dash-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .dash-grid-3 > :first-child .dash-dials { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .dash-grid-3 > :first-child .progress-dial-group { padding: 0.75rem 0; }
    .dash-head { align-items: flex-start; }
}
@media (max-width: 575.98px) {
    .dash-controls { width: 100%; }
    .dash-controls > * { flex: 1 1 100%; min-width: 0; }
    .dash-controls :is(.header-filter-btn, .date-filter-pill) { width: 100%; max-width: none; }
    .dash-controls .date-filter-pill { justify-content: flex-start; flex-wrap: wrap; gap: 0.15rem 0.4rem; font-size: 0.78rem; text-align: left; }
}
@media (max-width: 575.98px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .dash-kpi-card { padding: 0.8rem 0.85rem; gap: 0.45rem; }
    .dash-kpi-label { font-size: 0.74rem; }
    .dash-kpi-icon { width: 26px; height: 26px; font-size: 0.8rem; }
    .dash-kpi-value { font-size: 1.45rem; }
    .dash-kpi-value.kpi-money { font-size: 1.05rem; }
    .dash-kpi-meta { font-size: 0.7rem; gap: 0.25rem 0.6rem; }
}

/* =============================================================================
 * Celular: nada se sale de la pantalla (revisado en las 50 pantallas del menú)
 * Las barras de pestañas se deslizan de lado, las tablas tienen su propio
 * desplazamiento y los buscadores de ancho fijo toman todo el ancho.
 * ============================================================================= */
@media (max-width: 767.98px) {

    /* Tablas sin .table-responsive: el contenedor se desliza, la página no */
    .panel-content :has(> table):not(.table-responsive) { overflow-x: auto; }

    /* Calendario mensual: 7 columnas legibles con desplazamiento propio */
    .panel-content .cal-grid-card { overflow-x: auto; }
    .panel-content .cal-grid-card > :is(.cal-grid-header, .cal-grid-body) { min-width: 640px; }

    /* Buscadores y selectores con ancho fijo en línea */
    .panel-content .modern-input-wrapper.flex-shrink-0 { flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; }
    .panel-content .reports-filter-inline-controls { flex-wrap: wrap; }
    .panel-content .reports-filter-inline-controls > * { min-width: 0; max-width: 100%; }

    /* Filas título + acción: si no caben, la acción baja (solo cuando no hay espacio) */
    .panel-content .d-flex.justify-content-between:not(.flex-nowrap) { flex-wrap: wrap; }
    /* Ícono + texto: el texto se ajusta en vez de empujar la fila */
    .panel-content .d-flex > div:last-child { min-width: 0; }
    .panel-content .d-flex:has(> :is(h1, h2, .h5, .h6) + .badge) { flex-wrap: wrap; }
}

/* =============================================================================
 * Componentes de pantalla v2 (Tesorería primero; las demás pantallas los reusan)
 * page-head · surface · seg-tabs · filter-row · data-table · status-pill ·
 * icon-btn · selection-bar · table-cards (tabla → tarjetas en celular)
 * ============================================================================= */
.tone-neutral { --tone: 100, 116, 139; }

/* Encabezado de pantalla */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head-text { min-width: 0; }
.page-title { margin: 0; font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; color: var(--text-primary); }
.page-subtitle { margin: 0.3rem 0 0; max-width: 64ch; font-size: 0.85rem; color: var(--text-secondary); }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.page-actions .btn { font-weight: 600; font-size: 0.84rem; }

/* Superficie: tarjeta de contenido con borde fino */
.surface { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); min-width: 0; }
.surface-pad { padding: 1.1rem 1.25rem; }
.surface-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color); }
.surface-title { margin: 0; font-size: 0.92rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.surface-sub { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.surface-toolbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.surface-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.65rem 1rem; border-top: 1px solid var(--border-color); }
@media (min-width: 992px) { .border-end-lg { border-right: 1px solid var(--border-color); } }

/* Pestañas segmentadas */
.seg-tabs { display: inline-flex; gap: 2px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--bg-surface-elevated); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.seg-tab {
    display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; height: 32px; padding: 0 0.75rem;
    border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; white-space: nowrap;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.seg-tab:hover { color: var(--text-primary); }
.seg-tab.is-active { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border-color); }
.seg-tab:focus-visible { outline: none; box-shadow: var(--ring); }

.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(var(--tone, 100, 116, 139), 0.14); color: rgb(var(--tone, 100, 116, 139)); }
[data-bs-theme="dark"] .count-pill:not([class*="tone-"]) { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

/* Fila de filtros */
.filter-row { display: flex; align-items: center; gap: 0.6rem 0.75rem; flex-wrap: wrap; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.search-field { position: relative; flex: 1 1 280px; max-width: 440px; }
.search-field > .bi { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
.search-field .form-control { padding-left: 2.1rem !important; }
.range-field { display: inline-flex; align-items: center; gap: 0.35rem; }
.range-field .form-control { width: 150px; }
.range-sep { color: var(--text-muted); }

/* Barra de selección múltiple */
.selection-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.55rem 1rem; background: rgba(var(--brand-rgb), 0.05); border-bottom: 1px solid rgba(var(--brand-rgb), 0.15); }

/* Tabla de datos */
.data-table { --bs-table-bg: transparent; }
.data-table > thead > tr > th {
    position: sticky; top: 0; z-index: 1;
    padding: 0.6rem 1rem; background: var(--bg-surface-elevated); color: var(--text-muted);
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}
.data-table > tbody > tr > td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-color); }
.data-table > tbody > tr:not(.row-detail):not(.row-empty):hover > td { background: rgba(var(--brand-rgb), 0.03); }
[data-bs-theme="dark"] .data-table > tbody > tr:not(.row-detail):not(.row-empty):hover > td { background: rgba(255, 255, 255, 0.025); }
.data-table > tbody > tr.is-overdue > td:first-child { box-shadow: inset 3px 0 0 var(--accent-rose); }
.data-table > tbody > tr.is-paid .cell-amount { color: var(--accent-emerald); }
.data-table .row-detail > td { padding: 0.25rem 1rem 0.75rem 1.5rem; background: var(--bg-surface-elevated); }
.data-table .row-detail .table { --bs-table-bg: transparent; }
.data-table .row-detail .table th { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; background: transparent; padding: 0.5rem; }
.data-table .row-detail .table td { padding: 0.5rem; background: transparent; }
.data-table .row-empty > td { padding: 2.5rem 1rem; border-bottom: 0; }

.cell-main { min-width: 240px; }
.cell-main .min-w-0 { max-width: 340px; }
.cell-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.cell-sub { font-size: 0.75rem; color: var(--text-muted); }
.cell-sub a { color: var(--brand); text-decoration: none; }
.cell-sub a:hover { text-decoration: underline; }
.cell-amount { font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.cell-link-warn { display: inline-flex; align-items: center; margin-top: 0.35rem; font-size: 0.75rem; font-weight: 600; color: var(--bs-warning-text-emphasis); text-decoration: none; }
.cell-link-warn:hover { text-decoration: underline; }
.cell-actions { width: 1%; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; flex-wrap: nowrap; }
.row-actions .btn { white-space: nowrap; font-weight: 600; }
.row-date { width: 140px; }

/* Etiqueta de estado */
.status-pill {
    display: inline-flex; align-items: center; gap: 0.3rem; height: 22px; padding: 0 0.5rem;
    border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap;
    background: rgba(var(--tone, 100, 116, 139), 0.1); color: rgb(var(--tone, 100, 116, 139));
}
.status-pill .bi { font-size: 0.75rem; }
[data-bs-theme="dark"] .status-pill { background: rgba(var(--tone, 148, 163, 184), 0.16); }

/* Botón de ícono */
.icon-btn {
    width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary);
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--bg-surface-elevated); color: var(--text-primary); border-color: var(--border-color); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Lista simple (cuentas, elementos de configuración) */
.list-plain { list-style: none; margin: 0; padding: 0.35rem 0; }
.list-plain-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1.25rem; }
.list-plain-item + .list-plain-item { border-top: 1px solid var(--border-color); }
.list-plain-item.is-muted { opacity: 0.6; }
.list-plain-icon { width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(var(--brand-rgb), 0.08); color: var(--brand); }
.empty-inline { padding: 1rem 1.25rem; font-size: 0.8rem; color: var(--text-muted); }

/* Importes en indicadores: varias monedas sin romper la jerarquía */
.kpi-money { font-size: 1.5rem; }
.kpi-money-extra { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Paneles que se abren y cierran */
.reveal-enter-active { transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); }
.reveal-leave-active { transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.reveal-enter-from, .reveal-leave-to { opacity: 0; transform: translateY(-4px); }

/* Tabla → tarjetas en celular: cada fila es una tarjeta con sus etiquetas */
@media (max-width: 767.98px) {
    .table-cards > thead { display: none; }
    .data-table.table-cards > tbody > tr > td { background: transparent !important; }
    .table-cards, .table-cards > tbody, .table-cards > tbody > tr, .table-cards > tbody > tr > td { display: block; width: 100%; }
    .table-cards > tbody > tr:not(.row-detail):not(.row-empty) { position: relative; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-color); }
    .table-cards > tbody > tr > td { padding: 0 !important; border: 0 !important; text-align: left !important; max-width: none; min-width: 0; }
    .table-cards > tbody > tr > td + td { margin-top: 0.5rem; }
    .table-cards > tbody > tr > td[data-label] { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 0.5rem; align-items: baseline; }
    .table-cards > tbody > tr > td[data-label] > * { grid-column: 2; justify-self: start; max-width: 100%; }
    .table-cards > tbody > tr > td[data-label]::before { content: attr(data-label); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
    .table-cards > tbody > tr > td.cell-main { display: block; }
    .table-cards > tbody > tr > td.cell-main::before { content: none; }
    .table-cards > tbody > tr.is-overdue { box-shadow: inset 3px 0 0 var(--accent-rose); }
    .table-cards > tbody > tr.is-overdue > td:first-child { box-shadow: none; }
    .table-cards .cell-title, .table-cards .cell-sub { white-space: normal; }
    .table-cards .row-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 0.75rem; }
    .table-cards .row-date { flex: 1 1 140px; }
    .table-cards > tbody > tr.row-detail > td { padding: 0.5rem 1rem 0.75rem !important; }
    .table-cards > tbody > tr.row-detail .table thead { display: none; }
    .table-cards > tbody > tr.row-detail .table tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--border-color); }
    .table-cards > tbody > tr.row-detail .table td { display: flex; justify-content: space-between; gap: 0.5rem; border: 0; padding: 0.1rem 0 !important; text-align: right; }
    .table-cards > tbody > tr.row-detail .table td[data-label]::before { content: attr(data-label); color: var(--text-muted); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
    .table-responsive:has(> .table-cards) { overflow-x: visible; }
    .search-field { max-width: none; flex-basis: 100%; }
    .range-field { flex: 1 1 100%; min-width: 0; }
    .range-field .form-control { width: auto; flex: 1 1 0; min-width: 0; }
    .page-actions { width: 100%; }
    .page-actions .btn-primary { order: -1; flex: 1 1 100%; }
    .page-actions .btn:not(.btn-primary) { flex: 1 1 auto; white-space: nowrap; }
}

/* Fila que abre el detalle y código del documento (RQ, OC…) */
.data-table > tbody > tr.is-clickable { cursor: pointer; }
.cell-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.cell-code:hover { text-decoration: underline; }

/* Indicadores de tres, selector de periodo y tarjetas por concepto */
.dash-kpis.dash-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.period-field { min-width: 140px; }
.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.concept-card { padding: 0.85rem 1rem; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.concept-card-title { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.concept-card-value { margin-top: 0.2rem; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
@media (max-width: 575.98px) {
    .dash-kpis.dash-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-kpis.dash-kpis-3 > :first-child { grid-column: 1 / -1; }
    .period-field { flex: 1 1 0; min-width: 0; }
}

/* Fila en edición, botón de ícono para eliminar y contadores de una vista previa */
.data-table > tbody > tr.is-selected > td { background: rgba(var(--brand-rgb), 0.06) !important; }
.icon-btn-danger:hover { color: var(--accent-rose); background: rgba(var(--accent-rose-rgb), 0.08); border-color: rgba(var(--accent-rose-rgb), 0.2); }
.preview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.preview-stats .concept-card { padding: 0.55rem 0.65rem; }
@media (max-width: 575.98px) { .preview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Diálogo modal compartido (AppModal.vue) */
.app-modal-overlay {
    position: fixed; inset: 0; z-index: 1080;
    display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem;
    background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); overflow-y: auto;
}
.app-modal {
    display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: calc(100dvh - 3rem);
    background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); outline: none;
}
.app-modal-lg { max-width: 760px; }
.app-modal-xl { max-width: 1040px; }
.app-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color); }
.app-modal-title { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text-primary); }
.app-modal-sub { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.app-modal-body { padding: 1.1rem 1.25rem; overflow-y: auto; }
.app-modal-foot {
    display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color); background: var(--bg-surface-elevated); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.app-modal-enter-active { transition: opacity var(--dur-3) var(--ease-out); }
.app-modal-leave-active { transition: opacity var(--dur-2) var(--ease-out); }
.app-modal-enter-active .app-modal { transition: transform var(--dur-3) var(--ease-out); }
.app-modal-leave-active .app-modal { transition: transform var(--dur-2) var(--ease-out); }
.app-modal-enter-from, .app-modal-leave-to { opacity: 0; }
.app-modal-enter-from .app-modal, .app-modal-leave-to .app-modal { transform: translateY(6px) scale(0.96); }
@media (max-width: 575.98px) {
    .app-modal-overlay { padding: 0; align-items: flex-end; }
    .app-modal { max-width: none; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .app-modal-foot { border-radius: 0; flex-direction: column-reverse; }
    .app-modal-foot .btn { width: 100%; }
    .app-modal-enter-from .app-modal, .app-modal-leave-to .app-modal { transform: translateY(100%); }
}

/* Contenido de borde a borde dentro del diálogo (listas con su propio relleno) */
.app-modal-body > .app-modal-flush { margin: -1.1rem -1.25rem; }

/* Fila anulada: se ve, pero atenuada */
.data-table > tbody > tr.is-muted > td { opacity: 0.55; }

/* Utilidad que Bootstrap no trae (se usaba en muchas pantallas sin efecto): deja que un hijo flex se encoja y recorte su texto */
.min-w-0 { min-width: 0 !important; }

/* Firma escaneada en una lista */
.signature-box { display: inline-flex; align-items: center; padding: 2px 6px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.signature-box img { max-height: 32px; max-width: 120px; }

/* Avisos con tono (rojo / ámbar) sobre la base de .dash-notice */
.dash-notice.notice-danger { background: rgba(var(--accent-rose-rgb), 0.06); border-color: rgba(var(--accent-rose-rgb), 0.25); }
.dash-notice.notice-danger > i { color: var(--accent-rose); }
.dash-notice.notice-warning { background: rgba(var(--accent-amber-rgb), 0.07); border-color: rgba(var(--accent-amber-rgb), 0.28); }
.dash-notice.notice-warning > i { color: var(--accent-amber); }

/* Flujo de caja: concepto fijo a la izquierda, mes actual resaltado, subtotal y total marcados */
.flow-table .flow-concept { position: sticky; left: 0; z-index: 2; min-width: 220px; background: var(--bg-surface); }
.flow-table thead .flow-concept { background: var(--bg-surface-elevated); z-index: 3; }
.flow-table .is-current { background: rgba(var(--brand-rgb), 0.05); }
.flow-table thead .is-current { color: var(--brand); }
.flow-table tfoot td { font-weight: 700; background: var(--bg-surface-elevated); border-top: 1px solid var(--border-color); }
.flow-table tfoot .flow-concept { background: var(--bg-surface-elevated); }
.flow-grand { border-color: rgba(var(--brand-rgb), 0.35); }
.flow-grand td { font-weight: 700; padding-top: 0.9rem !important; padding-bottom: 0.9rem !important; }

/* Reportes: tarjetas con descripción y descarga */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.report-card { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem 1.1rem; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.report-card:hover { border-color: var(--border-color-light); box-shadow: var(--shadow-sm); }
.report-card-title { margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.report-card-text { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--text-muted); }

.data-table > tfoot > tr > td { padding: 0.7rem 1rem; }

/* =============================================================================
 * Armonización de componentes heredados (RR. HH., Asistencia, Comunicados,
 * Beneficios, Capacitación, Documentos, Configuración, pantallas Blade):
 * mismos tokens que las pantallas rediseñadas. Solo apariencia: no cambia
 * distribución, así que no rompe ninguna pantalla.
 * ============================================================================= */

/* Tarjetas KPI: sin saltar al pasar el mouse ni líneas neón arriba */
.kpi-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: border-color var(--dur-2) var(--ease-out); }
.kpi-card:hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border-color-light); }
.kpi-card.accent-emerald, .kpi-card.accent-amber, .kpi-card.accent-cyan, .kpi-card.accent-blue { border-top: 1px solid var(--border-color) !important; }
.kpi-title { text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 600; }

/* Botones de acción en filas: discretos hasta el hover, color de la marca, sin saltos */
.btn-table-action { border-color: transparent; background: transparent; border-radius: var(--radius-sm); transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.btn-table-action:hover, .btn-table-action.btn-action-edit:hover { transform: none; box-shadow: none; color: var(--text-primary); background: var(--bg-surface-elevated); border-color: var(--border-color); }
.btn-table-action:active { transform: scale(0.94); }
.btn-table-action:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-table-action.btn-action-view:hover { color: var(--accent-emerald); background: rgba(var(--accent-emerald-rgb), 0.08); border-color: rgba(var(--accent-emerald-rgb), 0.2); }
.btn-table-action.btn-action-danger:hover, .btn-table-action.btn-table-delete:hover { color: var(--accent-rose); background: rgba(var(--accent-rose-rgb), 0.08); border-color: rgba(var(--accent-rose-rgb), 0.2); }
[data-bs-theme="dark"] .btn-table-action { background: transparent; border-color: transparent; }

/* Campos con ícono y campos de formulario: anillo con el color de la marca */
.modern-input-wrapper { border-radius: var(--radius-sm); background: var(--bg-surface-elevated); transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out); }
.modern-input-wrapper:hover { border-color: var(--border-color-light); }
.modern-input-wrapper:focus-within, [data-bs-theme="dark"] .modern-input-wrapper:focus-within { border-color: var(--brand) !important; box-shadow: var(--ring) !important; background: var(--bg-surface); }
.modern-input-wrapper:focus-within .modern-input-icon { color: var(--brand); }
.modern-input-control { height: 38px; font-weight: 400; }
.modern-field-label, .emp-form-label, .legajo-form-label { text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.emp-form-input, .emp-form-select, .legajo-form-input { border-radius: var(--radius-sm); background-color: var(--bg-surface-elevated); transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.emp-form-input:focus, .emp-form-select:focus, .legajo-form-input:focus { border-color: var(--brand); box-shadow: var(--ring); background-color: var(--bg-surface); }

/* Secciones, tablas y diálogos heredados: mismo radio, borde y sombra */
.emp-section-card { border-radius: var(--radius-md); background: var(--bg-surface); }
.emp-section-title { text-transform: none; letter-spacing: -0.01em; font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.emp-section-title i { color: var(--brand); }
.emp-table-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.emp-table th { font-size: 0.68rem; }
.emp-table tbody tr > td { transition: background-color var(--dur-1) var(--ease-out); }
.emp-modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.emp-info-banner { border-radius: var(--radius-md); background: rgba(var(--brand-rgb), 0.06); border-color: rgba(var(--brand-rgb), 0.18); }

/* Barra segmentada heredada = pestañas segmentadas nuevas */
.training-segmented-bar { border-radius: var(--radius-md); gap: 2px; }
.training-segmented-item { height: 32px; padding: 0 0.75rem; transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.training-segmented-item:hover { background: transparent; }
.training-segmented-item.is-active, [data-bs-theme="dark"] .training-segmented-item.is-active { color: var(--text-primary); background: var(--bg-surface); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border-color); }
.training-segmented-item.is-active .training-segmented-pill { background: rgba(var(--brand-rgb), 0.12); color: var(--brand); }
.training-segmented-item:focus-visible { outline: none; box-shadow: var(--ring); }

/* Paginación de Bootstrap */
.page-link { border-radius: var(--radius-sm) !important; margin: 0 2px; border-color: var(--border-color); color: var(--text-secondary); font-size: 0.8rem; min-width: 32px; text-align: center; transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.page-link:hover { background: var(--bg-surface-elevated); color: var(--text-primary); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: var(--brand-text, #fff); }
.page-link:focus { box-shadow: var(--ring); }

/* Encabezados "hero" de cada módulo (announcements-header-card, benefits-header-card…):
   se leen como el encabezado de pantalla nuevo, sin tarjeta ni ícono en degradado */
[class*="-header-card"]:not(.modal *) { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; margin-bottom: 1.5rem; }
[class*="-header-card"]:not(.modal *) h1 { font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem) !important; font-weight: 700 !important; letter-spacing: -0.025em; }
[class*="-header-icon"]:not(.modal *):not(.cal-modal-header-icon):not(.evidence-header-icon) {
    width: 44px !important; height: 44px !important; border-radius: 12px !important;
    background: rgba(var(--brand-rgb), 0.1) !important; color: var(--brand) !important; box-shadow: none !important;
}
/* Tarjetas KPI de cada módulo: sin saltar al pasar el mouse */
[class*="-kpi-card"]:hover { transform: none !important; }
[class*="-kpi-card"] { border-radius: var(--radius-lg) !important; }

/* Barra de filtros compartida dentro de la tarjeta de la tabla (Colaboradores) */
.filter-bar.filter-bar-flush { border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; box-shadow: none; background: transparent; }
.emp-shell > .dash-kpis { margin-bottom: 0; }
.emp-shell > .page-head { margin-bottom: 0.25rem; }

/* Plantillas de documentos: texto cómodo de leer y campos para insertar */
.tpl-body { font-size: 0.82rem; line-height: 1.6; }
.tpl-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.6rem; }
.tpl-field { height: 26px; padding: 0 0.5rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-surface-elevated); color: var(--text-secondary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.72rem; transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.tpl-field:hover { border-color: var(--brand); color: var(--brand); }
.tpl-field:active { transform: scale(0.96); }
.tpl-field:focus-visible { outline: none; box-shadow: var(--ring); }

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

/* Liquidación: secciones del formulario y totales del cálculo */
.st-section { margin: 1.25rem 0 0.6rem; padding-top: 1rem; border-top: 1px solid var(--border-color); font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.st-table .st-subtotal > td { font-weight: 700; background: var(--bg-surface-elevated); }
.st-table tfoot .st-total > td { font-size: 0.95rem; font-weight: 800; color: var(--text-primary); border-top: 2px solid var(--border-color-light); }

/* Portal: resumen del mes en una fila compacta */
.portal-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.portal-stat { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.portal-stat .dash-dot { margin: 0 0 .15rem; }
.portal-stat-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); }
.portal-stat-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); line-height: 1.1; }
@media (max-width: 575.98px) { .portal-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Roles: lista lateral de roles y grupos de permisos */
.role-nav { display: flex; flex-direction: column; padding: 0.35rem; gap: 2px; }
.role-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%; padding: 0.6rem 0.7rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; text-align: left; transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.role-nav-item:hover { background: var(--bg-surface-elevated); color: var(--text-primary); }
.role-nav-item.is-active { background: rgba(var(--brand-rgb), 0.1); color: var(--brand); }
.role-nav-item:focus-visible { outline: none; box-shadow: var(--ring); }
.role-nav-sub { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }
.role-head { position: sticky; top: 0; z-index: 3; background: var(--bg-surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.perm-group { padding: 0.85rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.perm-group-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }

/* =============================================================================
 * El "primario" de Bootstrap es el color de la marca de la empresa
 * (antes los botones, enlaces y casillas usaban el azul de fábrica #0d6efd
 * mientras el menú y los íconos usaban la marca: dos azules en la misma pantalla)
 * ============================================================================= */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] {
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: color-mix(in srgb, var(--brand) 82%, #000);
    --bs-primary-text-emphasis: color-mix(in srgb, var(--brand) 78%, #000);
    --bs-primary-bg-subtle: rgba(var(--brand-rgb), 0.1);
    --bs-primary-border-subtle: rgba(var(--brand-rgb), 0.3);
}
[data-bs-theme="dark"] { --bs-primary-text-emphasis: color-mix(in srgb, var(--brand) 70%, #fff); --bs-link-hover-color: color-mix(in srgb, var(--brand) 75%, #fff); }
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 88%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 88%, #000);
    --bs-btn-active-bg: color-mix(in srgb, var(--brand) 80%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--brand) 80%, #000);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-hover-color: var(--brand-text, #fff);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
    --bs-btn-active-color: var(--brand-text, #fff);
    --bs-btn-disabled-color: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-link { --bs-btn-color: var(--brand); --bs-btn-hover-color: color-mix(in srgb, var(--brand) 82%, #000); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.form-switch .form-check-input:focus:not(:checked) { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%2894, 106, 125, 0.6%29'/%3e%3c/svg%3e"); }
.nav-pills .nav-link.active, .page-item.active .page-link { background-color: var(--brand); }
.progress-bar { background-color: var(--brand); }

/* =============================================================================
 * Modo oscuro: el color de la marca como TEXTO se aclara para leerse sobre fondo
 * oscuro (una marca oscura, p. ej. azul acero, quedaba con poco contraste).
 * Botones y rellenos siguen con la marca tal cual.
 * ============================================================================= */
:root { --brand-ink: var(--brand); }
[data-bs-theme="dark"] {
    --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
    --bs-link-color: var(--brand-ink);
    --bs-link-hover-color: color-mix(in srgb, var(--brand) 40%, #fff);
}
[data-bs-theme="dark"] :is(.cell-code, .cell-sub a, .sidebar-link.active, .sidebar-link.active .bi, .role-nav-item.is-active, .portal-tab.active, .text-primary, .btn-link, .topbar-avatar, .list-plain-icon, .modern-input-wrapper:focus-within .modern-input-icon, .emp-section-title i) { color: var(--brand-ink) !important; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--brand-ink); --bs-btn-border-color: color-mix(in srgb, var(--brand) 70%, #fff); }
/* Etiquetas y contadores con tono: el texto se aclara, el fondo sigue tenue */
[data-bs-theme="dark"] :is(.status-pill, .count-pill[class*="tone-"], .dash-kpi-icon[class*="tone-"]) { color: color-mix(in srgb, rgb(var(--tone, 148, 163, 184)) 60%, #fff); }

/* Indicadores de cinco (Reportes) y barra de filtros sobre la tabla */
.dash-kpis.dash-kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1399.98px) { .dash-kpis.dash-kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .dash-kpis.dash-kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-kpis.dash-kpis-5 > :first-child { grid-column: 1 / -1; }
}
.reports-filter-bar { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.reports-filter-bar .reports-filter-single-row { flex-wrap: wrap !important; overflow: visible; gap: 0.6rem 0.75rem; padding-bottom: 0; }
.reports-filter-bar .reports-filter-inline-controls { flex-wrap: wrap !important; flex-shrink: 1; min-width: 0; }
a.seg-tab { text-decoration: none; }

/* Tarjeta de indicador que filtra (enlace): marca la activa */
a.dash-kpi-card.is-link { color: inherit; text-decoration: none; transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
a.dash-kpi-card.is-link:hover { border-color: rgba(var(--brand-rgb), 0.4); }
a.dash-kpi-card.is-link:focus-visible { outline: none; box-shadow: var(--ring); }
a.dash-kpi-card.is-link.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* Diálogo que se abre encima de otro (p. ej. agregar documento sobre el expediente) */
.modal.modal-stacked { z-index: 1070; }
.modal-backdrop.is-stacked { z-index: 1065; }

/* =============================================================================
 * Dashboard ejecutivo (propuesta 2): cabecera en el color de la marca de cada
 * empresa con los 4 indicadores en una sola tarjeta apoyada encima. Todo va bajo
 * .dash-exec para no tocar las otras pantallas que usan las clases .dash-*.
 * ============================================================================= */
.dash-exec .dash-hero {
    position: relative;
    padding: 1.5rem 1.75rem 5.5rem;
    border-radius: 12px;
    color: #fff;
    background: #264a6b;
    background: color-mix(in srgb, rgb(var(--brand-rgb)) 62%, #0b1626);
}
.dash-exec .dash-hero .dash-head { margin-bottom: 1.1rem; }
.dash-exec .dash-hero .dash-eyebrow,
.dash-exec .dash-hero .dash-subtitle,
.dash-exec .dash-hero .dash-live-pill { color: rgba(255, 255, 255, 0.74); }
.dash-exec .dash-hero .dash-title { color: #fff; font-size: clamp(1.45rem, 1.15rem + 1vw, 1.95rem); }
.dash-exec .dash-hero .dash-status { margin: 0; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.dash-exec .dash-hero .dash-chip {
    height: 28px; border-radius: 6px;
    color: rgba(255, 255, 255, 0.86); background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16);
}
.dash-exec .dash-hero .dash-chip i,
.dash-exec .dash-hero .dash-chip .text-primary { color: inherit !important; }
.dash-exec .dash-hero .dash-chip.is-ok { color: #a7f3d0; background: rgba(16, 185, 129, 0.14); border-color: rgba(167, 243, 208, 0.32); }
.dash-exec .dash-hero .dash-icon-btn { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.dash-exec .dash-hero .dash-icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
.dash-exec .dash-hero .header-filter-btn,
.dash-exec .dash-hero .date-filter-pill { border-color: transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* Indicadores unidos, apoyados sobre la cabecera */
.dash-exec .dash-kpis-joined {
    position: relative; z-index: 1; gap: 0;
    margin: -4.25rem 1.25rem 1.25rem;
    background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px;
    box-shadow: 0 16px 36px -20px rgba(15, 23, 42, 0.45);
}
.dash-exec .dash-kpis-joined .dash-kpi-card {
    padding: 1.15rem 1.35rem; background: transparent; border: 0; border-radius: 0; box-shadow: none;
    border-right: 1px solid var(--border-color);
}
.dash-exec .dash-kpis-joined .dash-kpi-card:last-child { border-right: 0; }
.dash-exec .dash-kpis-joined .dash-kpi-icon { background: transparent; color: var(--text-muted); border: 1px solid var(--border-color); }
.dash-exec .dash-kpis-joined .dash-kpi-value { font-size: 2.15rem; font-variant-numeric: tabular-nums; }

/* Paneles: esquinas de 10 px y cabecera separada por una línea fina */
.dash-exec .dash-panel { border-radius: 10px; }
.dash-exec .dash-panel-head { margin: -1.1rem -1.15rem 1rem; padding: 0.9rem 1.15rem; border-bottom: 1px solid var(--border-color); }
.dash-exec .dash-panel-title { font-size: 0.95rem; }
.dash-exec .dash-panel-foot { border-radius: 0 0 10px 10px; }

@media (max-width: 1199.98px) {
    .dash-exec .dash-kpis-joined .dash-kpi-card:nth-child(2n) { border-right: 0; }
    .dash-exec .dash-kpis-joined .dash-kpi-card:nth-child(-n+2) { border-bottom: 1px solid var(--border-color); }
}
@media (max-width: 575.98px) {
    .dash-exec .dash-hero { padding: 1.15rem 1rem 4.75rem; border-radius: 10px; }
    .dash-exec .dash-kpis-joined { margin: -3.75rem 0.5rem 1rem; }
    .dash-exec .dash-kpis-joined .dash-kpi-card { padding: 0.9rem 0.85rem; }
    .dash-exec .dash-kpis-joined .dash-kpi-value { font-size: 1.6rem; }
}

/* Dashboard ejecutivo: igual al mockup (saludo y filtros en una línea, cifras con etiqueta de color, métricas en barras) */
.dash-exec .dash-hero .dash-head { margin-bottom: 0; align-items: center; }
.dash-exec .dash-hero .dash-eyebrow { gap: 0.6rem; font-weight: 500; }
.dash-exec .dash-hero .dash-eyebrow .dash-live-pill { color: #a7f3d0; font-weight: 600; }
.dash-exec .dash-hero .dash-subtitle { font-size: 0.78rem; }
.dash-exec .dash-kpis-joined .dash-kpi-card { gap: 0.35rem; align-items: flex-start; }
.dash-exec .dash-kpis-joined .dash-kpi-label { font-size: 0.82rem; font-weight: 500; }
.dash-badge {
    display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem;
    font-size: 0.74rem; font-weight: 500; line-height: 1.4; border-radius: 6px;
    color: rgb(var(--tone, var(--brand-rgb))); background: rgba(var(--tone, var(--brand-rgb)), 0.1);
}
.dash-badge b { font-weight: 700; color: inherit; }
.dash-exec .dash-metrics { display: flex; flex-direction: column; gap: 1.1rem; }
.dash-exec .dash-metric-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.45rem; font-size: 0.86rem; color: var(--text-primary); }
.dash-exec .dash-metric-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-exec .dash-metric-sub { margin-top: 0.35rem; font-size: 0.74rem; color: var(--text-muted); }
.dash-exec .dash-grid-3 .stream-list { max-height: 268px; overflow-y: auto; }
.dash-badge { display: inline-block; }
.dash-exec .dash-hero #telemetryRefreshBtn { flex: 0 0 38px; width: 38px !important; height: 38px; }

/* Cabecera: saludo a la izquierda y filtros a la derecha SIEMPRE en una sola fila, en todo ancho. Un nombre
   largo se parte en su columna; los filtros se compactan por etapas (texto con «…», luego solo ícono; el
   valor completo queda en el title del botón y en su menú). Nada se va abajo. */
.dash-exec .dash-hero .dash-head { flex-wrap: nowrap; }
.dash-exec .dash-hero .dash-head-text { flex: 1 1 auto; min-width: 0; }
.dash-exec .dash-hero .dash-title {
    overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.dash-exec .dash-hero .dash-controls { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; width: auto; }
.dash-exec .dash-hero .dash-controls > * { flex: 0 0 auto; }
/* Mediana: texto de los filtros recortado con «…» */
@media (max-width: 1440px) {
    .dash-exec .dash-hero .header-filter-btn { min-width: 8rem; max-width: 11rem; }
    .dash-exec .dash-hero .dash-title { font-size: 1.35rem; }
}
/* Tablet: empresa y sede solo con ícono; la fecha muestra solo su etiqueta («Hoy», «Ayer»…) */
@media (max-width: 1199.98px) {
    .dash-exec .dash-hero .header-filter-btn { width: 38px !important; min-width: 38px !important; max-width: 38px !important; padding: 0; justify-content: center; }
    .dash-exec .dash-hero .header-filter-btn :is(.header-filter-text, .header-filter-chevron) { display: none; }
    .dash-exec .dash-hero .date-filter-pill :is(.divider, #calTriggerFrom, #calTriggerTo) { display: none; }
    .dash-exec .dash-hero .date-filter-pill { width: auto !important; flex-wrap: nowrap; white-space: nowrap; }
}
/* Celular: el texto de arriba y la hora a todo el ancho; en la fila del medio, el saludo y los filtros (todo en
   íconos) lado a lado. Se anula el «ancho completo» de .dash-controls de las reglas generales de celular. */
@media (max-width: 575.98px) {
    .dash-exec .dash-hero .dash-head {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.6rem; align-items: center;
        grid-template-areas: "eyebrow eyebrow" "title controls" "subtitle subtitle";
    }
    .dash-exec .dash-hero .dash-head-text { display: contents; }
    .dash-exec .dash-hero .dash-eyebrow { grid-area: eyebrow; flex-wrap: wrap; }
    .dash-exec .dash-hero .dash-title { grid-area: title; font-size: 1.15rem; -webkit-line-clamp: 4; line-clamp: 4; }
    .dash-exec .dash-hero .dash-subtitle { grid-area: subtitle; }
    .dash-exec .dash-hero .dash-controls { grid-area: controls; gap: 0.35rem; }
    .dash-exec .dash-hero .dash-controls > * { width: auto !important; min-width: 0; }
    .dash-exec .dash-hero .date-filter-pill { width: 38px !important; height: 38px; padding: 0; justify-content: center; }
    .dash-exec .dash-hero .date-filter-pill > :not(.bi-calendar3) { display: none; }
    .dash-exec .dash-hero .date-filter-pill::after { display: none; }
}

/* Ficha del colaborador (crear y editar): secciones con un propósito, marcación a la derecha y fija al bajar */
.emp-edit { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.emp-edit-main, .emp-edit-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.emp-edit-side { position: sticky; top: calc(var(--topbar-h, 64px) + 1rem); }
.emp-edit-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; box-shadow: var(--shadow-xs); }
.emp-edit-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.95rem 1.15rem; border-bottom: 1px solid var(--border-color); }
.emp-edit-head h2 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.emp-edit-head p { margin: 0.1rem 0 0; font-size: 0.76rem; color: var(--text-muted); }
.emp-edit-icon { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--brand); background: rgba(var(--brand-rgb), 0.1); }
.emp-edit-body { padding: 1rem 1.15rem 1.15rem; margin: 0; }
.emp-edit-body.row { --bs-gutter-x: 1rem; padding-top: 0; }
.emp-edit-body .form-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--text-secondary); }
.emp-edit-divider { border-top: 1px solid var(--border-color); }
.emp-edit-note { font-size: 0.78rem; color: var(--text-secondary); background: var(--bg-surface-elevated); border: 1px solid var(--border-color); border-radius: 8px; padding: 0.6rem 0.75rem; }
.emp-edit-branches { max-height: 260px; overflow-y: auto; }
.emp-edit-branch { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 1.15rem; border-bottom: 1px solid var(--border-color); font-size: 0.86rem; }
.emp-edit-branch:last-child { border-bottom: 0; }
.emp-edit-actions { display: grid; gap: 0.5rem; }
@media (max-width: 1199.98px) {
    .emp-edit { grid-template-columns: minmax(0, 1fr); }
    .emp-edit-side { position: static; }
    .emp-edit-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575.98px) {
    .emp-edit-body { padding: 0.9rem; }
    .emp-edit-head { padding: 0.85rem 0.9rem; }
    .emp-edit-actions { grid-template-columns: 1fr; }
}

/* =============================================================================
 * Controles modernos de formulario (Panel.controls): ícono dentro del campo,
 * listas con buscador y calendario. Mismo alto y bordes que .form-control.
 * ============================================================================= */
.field-icon { position: relative; }
.field-icon > .bi, .field-icon > .field-prefix {
    position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.95rem; pointer-events: none; z-index: 2;
}
.field-icon > .field-prefix { font-size: 0.82rem; font-weight: 600; }
.field-icon > .form-control { padding-left: 2.45rem; }
.field-icon:focus-within > .bi, .field-icon:focus-within > .field-prefix { color: var(--brand); }

.mc { position: relative; }
.mc-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.mc-btn {
    display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; cursor: pointer;
    padding-left: 0.85rem; padding-right: 0.75rem;
}
.mc-btn .mc-icon { color: var(--text-muted); font-size: 0.95rem; flex: none; }
.mc-btn .mc-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-btn.is-placeholder .mc-label { color: var(--text-muted); }
.mc-btn .mc-caret { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.18s ease; }
.mc.is-open .mc-btn { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12); }
.mc.is-open .mc-btn .mc-icon { color: var(--brand); }
.mc.is-open .mc-caret { transform: rotate(180deg); }
.mc-clear { font-size: 0.7rem; color: var(--text-muted); padding: 0.25rem; border-radius: 4px; display: none; }
.mc-date.has-value .mc-clear { display: inline-block; }
.mc-clear:hover { color: var(--text-primary); background: var(--bg-surface-elevated); }

.mc-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1060;
    display: none; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.3); overflow: hidden;
}
.mc.drop-up .mc-panel { top: auto; bottom: calc(100% + 6px); }
.mc.is-open .mc-panel { display: block; animation: mcIn 0.14s ease; }
@keyframes mcIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mc-search { position: relative; padding: 0.5rem; border-bottom: 1px solid var(--border-color); }
.mc-search .bi { position: absolute; left: 1.15rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }
.mc-search input { width: 100%; height: 36px; padding: 0 0.75rem 0 2.1rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface-elevated); color: var(--text-primary); font-size: 0.85rem; outline: none; }
.mc-search input:focus { border-color: var(--brand); }
.mc-list { max-height: 264px; overflow-y: auto; padding: 0.3rem; }
.mc-group { padding: 0.55rem 0.65rem 0.25rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.mc-option {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%;
    padding: 0.5rem 0.65rem; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary);
    font-size: 0.86rem; text-align: left;
}
.mc-option:hover, .mc-option:focus-visible { background: rgba(var(--brand-rgb), 0.07); outline: none; }
.mc-option .bi { color: var(--brand); visibility: hidden; }
.mc-option.is-selected { background: rgba(var(--brand-rgb), 0.1); color: var(--brand); font-weight: 600; }
.mc-option.is-selected .bi { visibility: visible; }
.mc-option:disabled { opacity: 0.45; }
.mc-empty { padding: 0.9rem; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

.mc-cal { width: 296px; right: auto; padding: 0.75rem; }
.mc-cal-head { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; }
.mc-cal-head select { flex: 1; min-width: 0; height: 32px; padding: 0 0.4rem; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-surface); color: var(--text-primary); font-size: 0.84rem; font-weight: 600; }
.mc-nav { width: 32px; height: 32px; flex: none; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-surface); color: var(--text-secondary); }
.mc-nav:hover { color: var(--brand); border-color: var(--brand); }
.mc-cal-week, .mc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-cal-week span { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 0.25rem 0; }
.mc-day { height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.mc-day:hover:not(:disabled) { background: rgba(var(--brand-rgb), 0.08); }
.mc-day.is-today { box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.45); }
.mc-day.is-selected { background: var(--brand); color: #fff; font-weight: 700; }
.mc-day:disabled { opacity: 0.3; }
.mc-cal-foot { display: flex; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-color); }
.mc-link { border: 0; background: transparent; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); padding: 0.25rem 0.4rem; border-radius: 6px; }
.mc-link.is-primary { color: var(--brand); }
.mc-link:hover:not(:disabled) { background: var(--bg-surface-elevated); }
@media (max-width: 575.98px) { .mc-cal { width: auto; right: 0; } }
/* El mensaje de error sigue visible aunque el campo esté envuelto (ícono, lista o calendario) */
.field-icon:has(.is-invalid) ~ .invalid-feedback, .mc:has(.is-invalid) ~ .invalid-feedback { display: block; }
.mc-date .mc-btn { gap: 0.4rem; padding-left: 0.7rem; padding-right: 0.45rem; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .mc-date .mc-btn { font-size: 0.82rem; } .mc-date .mc-btn .mc-icon { font-size: 0.85rem; } }

/* Cabecera de la ficha del colaborador: avatar, nombre y estado; accesos a la derecha en la misma línea */
.emp-edit-header { align-items: center; margin-bottom: 1.25rem; }
.emp-edit-avatar { width: 52px; height: 52px; flex: none; border-radius: 12px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem; color: var(--brand); background: rgba(var(--brand-rgb), 0.1); border: 1px solid rgba(var(--brand-rgb), 0.18); }
.emp-edit-header .page-subtitle { max-width: none; }
@media (max-width: 575.98px) { .emp-edit-header .page-actions { width: 100%; } .emp-edit-header .page-actions .btn { flex: 1; } .emp-edit-avatar { width: 44px; height: 44px; } }

/* Legajo: misma línea visual que la ficha y el resto del panel (cabecera, pestañas segmentadas y resumen) */
.legajo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.legajo-meta > span + span::before { content: "·"; margin-right: 0.5rem; color: var(--text-muted); }
.legajo-meta .bi { margin-right: 0.3rem; color: var(--text-muted); }
.legajo-tabs {
    display: inline-flex; gap: 2px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
    background: var(--bg-surface-elevated); border: 1px solid var(--border-color); border-radius: var(--radius-md, 10px);
}
.legajo-tabs::-webkit-scrollbar { display: none; }
.legajo-tab-btn {
    height: 36px; padding: 0 0.9rem; margin: 0; border: 0; border-radius: 7px; flex-shrink: 0; white-space: nowrap;
    font-size: 0.84rem; color: var(--text-secondary);
}
.legajo-tab-btn.active {
    color: var(--text-primary); background: var(--bg-surface); border: 0; font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border-color);
}
.legajo-tab-btn.active .bi { color: var(--brand); }
.legajo-tabs + .tab-content { margin-top: 1.25rem; }
.legajo-stat-label { text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; }
.legajo-stat-value { font-size: 1.2rem; }
.legajo-stat-strip { border-radius: 10px; }
.field-icon > .emp-form-input { padding-left: 2.45rem; }

/* Mapas (Panel.tiles): botón de pantalla completa y etiqueta de dirección sobre el pin */
.leaflet-bar a.map-fullscreen-btn { display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: #333; }
.leaflet-container:fullscreen { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
.leaflet-tooltip.map-pin-label { padding: 6px 10px; border: 0; border-radius: 8px; background: #111827; color: #fff; font-size: 0.75rem; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.leaflet-tooltip.map-pin-label::before { border-top-color: #111827; }

/* Versión del panel web en el menú del usuario (web_version()) */
.user-profile-version { padding: 6px 16px 4px; font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Colaboradores: la columna Acciones queda fija a la derecha cuando la tabla es más ancha que la pantalla
   (antes el lápiz quedaba fuera de la vista, sobre todo en filas con menos botones, como RRHH) */
.emp-table th:last-child, .emp-table td:last-child { position: sticky; right: 0; z-index: 1; box-shadow: -8px 0 8px -8px rgba(15, 23, 42, 0.18); }

/* Sedes › supervisores: selección múltiple con casillas (branches/partials/supervisor-picker) */
.supervisor-picker-menu { min-width: 0; max-width: 92vw; border-radius: 10px; border: 1px solid var(--bs-border-color); }
.supervisor-picker-options { scrollbar-width: thin; }
.supervisor-picker-option { font-size: .875rem; padding: .45rem .5rem; }
.supervisor-picker-option .text-truncate { min-width: 0; }
.supervisor-picker-role { font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; background: var(--bs-secondary-bg); color: var(--bs-secondary-color); white-space: nowrap; }
.supervisor-picker-options { max-height: 240px; overflow-y: auto; }
.supervisor-picker-option { cursor: pointer; white-space: normal; }
.supervisor-picker-option:has(input:checked) { background: var(--bs-primary-bg-subtle); }
.supervisor-picker-toggle { overflow: hidden; }
