:root {
    --sistemas-blue: #284f9f;
    --sistemas-blue-2: #3c66b6;
    --sistemas-blue-3: #6e89c8;
    --sistemas-bg: #eef3fb;
    --sistemas-card: rgba(255, 255, 255, .92);
    --sistemas-border: rgba(66, 93, 151, .18);
    --sistemas-text: #1e2b47;
    --sistemas-muted: #6f7890;
    --sistemas-danger: #e44d35;
    --sistemas-warning: #f5bd3f;
    --sistemas-success: #4cae72;
    --sistemas-shadow: 0 18px 42px rgba(34, 65, 132, .16);
    --sistemas-soft-shadow: 0 8px 22px rgba(34, 65, 132, .10);
    --sistemas-radius: 18px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(40, 79, 159, .45) transparent;
}

body {
    min-height: 100vh;
    color: var(--sistemas-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, .96) 0 0, transparent 30%),
        radial-gradient(circle at 72% 46%, rgba(40, 79, 159, .26) 0 0, transparent 32%),
        linear-gradient(115deg, #f7f9fe 0%, #eef3fb 44%, #2e4f96 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(255,255,255,.72), rgba(255,255,255,.16)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'%3E%3Cg fill='none' stroke='%23284f9f' stroke-opacity='.13' stroke-width='28'%3E%3Cpath d='M70 585 C160 390 210 305 352 230 S612 94 865 16'/%3E%3Cpath d='M-18 468 C140 388 250 360 386 366 S660 414 920 292'/%3E%3Cpath d='M770 -30 C650 90 584 168 560 278 S536 468 408 630'/%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat;
    filter: blur(10px);
    transform: scale(1.04);
    opacity: .9;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(40,79,159,.18));
}

.app-shell {
    min-height: 100vh;
    display: flex;
    gap: 14px;
    padding: 18px;
}

.app-sidebar {
    width: 220px;
    flex: 0 0 220px;
    align-self: flex-start;
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    color: var(--sistemas-text);
    background: var(--sistemas-card);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: var(--sistemas-radius);
    box-shadow: var(--sistemas-shadow);
    backdrop-filter: blur(18px);
    padding: 12px;
}

.app-brand {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: .75rem .5rem 1rem;
    color: var(--sistemas-text);
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    border-bottom: 1px solid var(--sistemas-border);
}

.app-brand-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, var(--sistemas-blue), var(--sistemas-blue-2));
    border-radius: 50%;
    box-shadow: 0 10px 26px rgba(40,79,159,.28);
}

.app-menu {
    display: grid;
    gap: 7px;
    padding: 12px 0 0;
}

.app-menu a {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #293754;
    text-decoration: none;
    border: 1px solid rgba(40,79,159,.12);
    border-radius: 8px;
    padding: .48rem .62rem;
    background: rgba(255,255,255,.72);
    box-shadow: 0 5px 13px rgba(34,65,132,.05);
    font-size: .85rem;
    line-height: 1.15;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.app-menu a:hover,
.app-menu a.active {
    color: var(--sistemas-blue);
    background: #fff;
    box-shadow: 0 9px 18px rgba(34,65,132,.12);
    transform: translateY(-1px);
}

.app-menu a.active {
    border-color: rgba(40,79,159,.28);
}

.app-menu i {
    width: 19px;
    color: var(--sistemas-blue-2);
    text-align: center;
}

.app-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1rem;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(255,255,255,.72);
    border-radius: var(--sistemas-radius);
    box-shadow: var(--sistemas-soft-shadow);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 18px;
    z-index: 100;
}

.app-topbar strong {
    color: var(--sistemas-blue);
}

.app-main > main.container-fluid {
    padding: 0 !important;
}

.app-footer {
    margin-top: auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: rgba(255,255,255,.88);
    background: rgba(40,79,159,.65);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: var(--sistemas-radius);
    backdrop-filter: blur(16px);
}

.card,
.modal-content,
.dropdown-menu,
.toast {
    border: 1px solid rgba(255,255,255,.78);
    border-radius: var(--sistemas-radius);
    background-color: var(--sistemas-card);
    box-shadow: var(--sistemas-shadow);
    backdrop-filter: blur(18px);
}

.card-header,
.modal-header,
.modal-footer {
    border-color: var(--sistemas-border) !important;
    background: transparent !important;
}

.card-body {
    padding: 1rem;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--sistemas-blue);
    background: linear-gradient(135deg, var(--sistemas-blue), var(--sistemas-blue-2));
    box-shadow: 0 9px 18px rgba(40,79,159,.2);
}

.btn-outline-secondary {
    border-color: rgba(40,79,159,.18);
    color: var(--sistemas-blue);
    background: rgba(255,255,255,.72);
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: rgba(40,79,159,.18);
    border-radius: 7px;
    background-color: rgba(255,255,255,.84);
    color: var(--sistemas-text);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(40,79,159,.55);
    box-shadow: 0 0 0 .22rem rgba(40,79,159,.14);
}

.table {
    color: var(--sistemas-text);
}

.table thead th {
    white-space: nowrap;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--sistemas-muted);
    background: rgba(255,255,255,.74);
    border-bottom: 1px solid var(--sistemas-border);
}

.table tbody td {
    border-color: rgba(40,79,159,.10);
}

.badge {
    border-radius: 7px;
}

.bg-white {
    background: transparent !important;
}

.text-muted {
    color: var(--sistemas-muted) !important;
}

.dashboard-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 14px;
}

.dashboard-main {
    min-width: 0;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.metric-card {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .7rem;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.74);
    background: rgba(255,255,255,.9);
    box-shadow: var(--sistemas-soft-shadow);
}

.metric-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 6px;
    background: var(--sistemas-blue-2);
    font-size: .75rem;
}

.metric-value {
    font-size: .95rem;
    font-weight: 800;
    line-height: 1;
}

.metric-label {
    color: var(--sistemas-muted);
    font-size: .66rem;
    line-height: 1.05;
}

.workspace-card {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    border-radius: var(--sistemas-radius);
    border: 1px solid rgba(255,255,255,.78);
    background: rgba(255,255,255,.88);
    box-shadow: var(--sistemas-shadow);
}

.workspace-card::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -120px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(40,79,159,.54);
    z-index: 0;
}

.workspace-inner {
    position: relative;
    z-index: 1;
    min-height: 360px;
    display: grid;
    grid-template-columns: 1fr minmax(280px, 48%);
    gap: 1rem;
    align-items: center;
    padding: 2rem;
}

.workspace-title {
    color: var(--sistemas-blue);
    font-size: clamp(1.9rem, 5vw, 3.7rem);
    font-weight: 900;
    letter-spacing: -.07em;
    line-height: .95;
}

.workspace-subtitle {
    max-width: 330px;
    color: #203155;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.22;
}

.workspace-panel {
    border: 1px solid rgba(40,79,159,.16);
    border-radius: 12px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 16px 40px rgba(34,65,132,.15);
    overflow: hidden;
}

.workspace-panel-header {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 .75rem;
    background: #fff;
    border-bottom: 1px solid rgba(40,79,159,.10);
}

.workspace-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sistemas-blue-3);
    opacity: .7;
}

.workspace-preview {
    display: grid;
    grid-template-columns: 86px 1fr 92px;
    gap: 10px;
    min-height: 216px;
    padding: 10px;
    background: linear-gradient(135deg, #f7f9ff, #eaf0fb);
}

.preview-nav,
.preview-right,
.preview-content {
    border-radius: 10px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(40,79,159,.10);
}

.preview-nav {
    background: linear-gradient(180deg, var(--sistemas-blue), #173a80);
}

.preview-line,
.preview-pill {
    height: 9px;
    margin: 9px;
    border-radius: 999px;
    background: rgba(40,79,159,.16);
}

.preview-pill {
    background: rgba(255,255,255,.32);
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 9px;
}

.preview-mini-card {
    min-height: 42px;
    border-radius: 9px;
    background: rgba(40,79,159,.11);
}

.dashboard-side {
    display: grid;
    gap: 10px;
    align-content: start;
}

.side-widget {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.72);
    background: rgba(255,255,255,.92);
    box-shadow: var(--sistemas-soft-shadow);
    padding: .75rem;
}

.side-widget-title {
    color: #1e2b47;
    font-size: .84rem;
    font-weight: 900;
    margin-bottom: .55rem;
}

.ring-chart {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--sistemas-blue-2) 0 72%, rgba(40,79,159,.14) 72% 100%);
    display: grid;
    place-items: center;
}

.ring-chart::after {
    content: "";
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 26px;
    margin-bottom: .35rem;
    font-size: .72rem;
}

.todo-badge {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #fff;
    background: var(--sistemas-warning);
    font-size: .62rem;
    font-weight: 800;
}

.action-circle {
    width: 150px;
    height: 150px;
    margin: 14px auto 0;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,.88);
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--sistemas-blue-2), var(--sistemas-blue));
    box-shadow: 0 22px 45px rgba(20,46,105,.25);
}

.action-circle i {
    font-size: 3.4rem;
}

.quick-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.quick-module-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 70px;
    color: var(--sistemas-text);
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.78);
    background: rgba(255,255,255,.88);
    box-shadow: var(--sistemas-soft-shadow);
    padding: .8rem;
}

.quick-module-card i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 10px;
    background: var(--sistemas-blue-2);
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 430px;
}

.auth-icon {
    color: #fff;
    background: linear-gradient(145deg, var(--sistemas-blue), var(--sistemas-blue-2));
}

.org-chart-wrap {
    overflow-x: auto;
}
.org-tree,
.org-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 1.25rem;
    position: relative;
}
.org-tree > li {
    padding-left: 0;
}
.org-tree li {
    margin: .75rem 0;
    position: relative;
}
.org-tree li::before {
    content: "";
    position: absolute;
    top: 1.25rem;
    left: -.85rem;
    width: .75rem;
    border-top: 1px solid rgba(40,79,159,.25);
}
.org-tree ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: .35rem;
    bottom: 0;
    border-left: 1px solid rgba(40,79,159,.25);
}
.org-node {
    min-width: 220px;
    display: inline-block;
    padding: .75rem .9rem;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: .85rem;
    background: rgba(255,255,255,.88);
    box-shadow: var(--sistemas-soft-shadow);
}

@media (max-width: 1199.98px) {
    .metric-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .dashboard-page {
        grid-template-columns: 1fr;
    }
    .dashboard-side {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .action-circle {
        width: 112px;
        height: 112px;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        padding: 12px;
    }
    .app-sidebar {
        width: 100%;
        max-height: none;
        position: relative;
        top: 0;
        margin-bottom: 12px;
    }
    .app-brand {
        min-height: auto;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    .app-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-topbar {
        top: 0;
    }
    .workspace-inner {
        grid-template-columns: 1fr;
        padding: 1.2rem;
    }
    .quick-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .app-menu,
    .metric-strip,
    .quick-module-grid,
    .dashboard-side {
        grid-template-columns: 1fr;
    }
    .workspace-preview {
        grid-template-columns: 1fr;
    }
    .preview-nav,
    .preview-right {
        display: none;
    }
}

/* EPGRL v28 - Reportes anterior normalizados */
.app-card {
    border: 1px solid rgba(31, 60, 136, .10);
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(31, 60, 136, .08);
    background: rgba(255,255,255,.92);
}
.app-icon-circle {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 60, 136, .10);
    color: #254b9b;
    flex: 0 0 auto;
}
.report-table th {
    white-space: nowrap;
    font-size: .78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.report-table td {
    font-size: .86rem;
}
@media print {
    .app-sidebar,
    .app-topbar,
    .no-print,
    .btn,
    form,
    .app-menu {
        display: none !important;
    }
    .app-shell,
    .app-main,
    main.container-fluid {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    body.app-body {
        background: #fff !important;
    }
    .report-print-card,
    .card,
    .card-body {
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
    }
    .report-table {
        font-size: 9px;
    }
}

/* EPGRL v33: fotografías de empleados en listados */
.employee-avatar,
.employee-avatar-fallback {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.92);
}

.employee-avatar-fallback {
    font-weight: 800;
    color: #2563eb;
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(255, 255, 255, 0.95));
}

/* EPGRL v34: asignaciones por tipo y estados sin asignación */
.qeatzul-stat-card {
    border: 1px solid rgba(31, 60, 136, .10);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 18px 45px rgba(31, 60, 136, .08);
}

.qeatzul-tabs {
    gap: .5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: .25rem;
}

.qeatzul-tabs .nav-link {
    white-space: nowrap;
    border-radius: 999px;
    color: #334155;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(31, 60, 136, .10);
}

.qeatzul-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

.qeatzul-tabs .nav-link.active .badge {
    color: #1d4ed8;
}

.avatar-sm,
.avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, .10);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
    background: rgba(255,255,255,.92);
    flex: 0 0 38px;
}

.avatar-fallback {
    font-weight: 800;
    color: #2563eb;
    background: linear-gradient(135deg, rgba(219, 234, 254, .95), rgba(255,255,255,.95));
}

.device-photo-sm,
.device-photo-fallback {
    width: 54px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, .10);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
    background: rgba(255,255,255,.92);
    flex: 0 0 54px;
}

.device-photo-fallback {
    color: #2563eb;
    background: linear-gradient(135deg, rgba(219, 234, 254, .95), rgba(255,255,255,.95));
}

/* EPGRL v36 - reportes, cuentas/licencias y revisión por baja */
.qe-tabs .nav-link {
    border-radius: 999px;
    margin-right: .35rem;
    margin-bottom: .35rem;
}
.report-table img,
.report-photo {
    width: 52px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
}
@media print {
    .report-table img,
    .report-photo {
        width: 44px;
        height: 36px;
    }
}

.qe-info-tile{border:1px solid rgba(15,23,42,.08);border-radius:18px;padding:1rem;background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(248,250,252,.78));box-shadow:0 12px 30px rgba(15,23,42,.06)}
.qe-info-tile span{display:block;font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:700}
.qe-info-tile strong{display:block;font-size:1.05rem;color:#0f172a;margin-top:.2rem}
.qe-info-tile small{color:#64748b}
.qe-avatar-sm{width:36px;height:36px;border-radius:12px;object-fit:cover;border:1px solid rgba(15,23,42,.1);background:#eef6ff;display:inline-flex;align-items:center;justify-content:center;color:#2563eb}


.app-user-session {
    min-width: 0;
}

.topbar-user-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .92);
    background: linear-gradient(135deg, rgba(40, 79, 159, .92), rgba(60, 102, 182, .88));
    box-shadow: 0 10px 24px rgba(34, 65, 132, .18);
}

.topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.topbar-user-avatar-fallback {
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .03em;
    line-height: 1;
}

/* EPGRL v40 - captura directa de fotografías */
.camera-capture-open {
    overflow: hidden;
}
.camera-capture-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.camera-capture-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(4px);
}
.camera-capture-panel {
    position: relative;
    width: min(720px, 100%);
    background: #fff;
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .35);
}
.camera-capture-header,
.camera-capture-actions {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
}
.camera-capture-video {
    width: 100%;
    max-height: 62vh;
    object-fit: contain;
    background: #020617;
    border-radius: 18px;
    margin: .85rem 0;
}
@media print {
    .camera-capture-modal {
        display: none !important;
    }
}

/* EPGRL v41 - modales operativos y fotos en organización/kardex */
.app-modal-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.25rem;
    background: rgba(37, 99, 235, .10);
    color: #2563eb;
}
.app-modal-icon-success { background: rgba(22, 163, 74, .12); color: #15803d; }
.app-modal-icon-danger { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.app-modal-icon-warning { background: rgba(245, 158, 11, .16); color: #b45309; }
.app-modal-icon-info { background: rgba(37, 99, 235, .10); color: #2563eb; }
.app-modal-message { white-space: pre-wrap; color: var(--sistemas-text); }
.org-node .avatar-sm { width: 42px; height: 42px; flex-basis: 42px; }

/* EPGRL v48 - búsquedas inteligentes en selects */
.smart-select-wrap {
    position: relative;
}
.smart-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.smart-select-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1080;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .55);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    padding: .35rem;
}
.smart-select-result {
    width: 100%;
    display: block;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .55rem .7rem;
    border-radius: 10px;
    color: var(--sistemas-text);
    font-size: .92rem;
}
.smart-select-result:hover,
.smart-select-result:focus {
    background: rgba(37, 99, 235, .10);
    outline: none;
}
.smart-select-result:disabled {
    cursor: default;
    background: transparent;
}
@media print {
    .smart-select-results { display: none !important; }
}

/* EPGRL v50 - filas con modal de acciones */
.table-row-clickable {
    cursor: pointer;
}
.table-row-clickable:focus {
    outline: 2px solid rgba(37, 99, 235, .45);
    outline-offset: -2px;
}
.table-row-clickable:hover > * {
    background-color: rgba(37, 99, 235, .045) !important;
}
.table-action-modal-btn {
    display: flex;
    align-items: center;
    gap: .55rem;
    justify-content: flex-start;
    border-radius: 12px;
}
.table-action-modal-btn i {
    width: 1.1rem;
    text-align: center;
}
@media print {
    #appTableActionModal { display: none !important; }
}

/* EPGRL v55: reportes ejecutivos y exportación PDF */
.report-table thead th {
    font-size: .72rem;
    letter-spacing: .045em;
    text-transform: uppercase;
    color: #536582;
    background: rgba(244, 247, 252, .95);
}
.report-print-card {
    border: 1px solid rgba(36, 78, 166, .10);
}
@media print {
    .no-print,
    .app-sidebar,
    .app-topbar,
    .app-flash-alert,
    .btn,
    form {
        display: none !important;
    }
    .app-shell,
    .app-main,
    main.container-fluid {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    body {
        background: #fff !important;
    }
    .card,
    .app-card {
        box-shadow: none !important;
        border: 1px solid #dbe3ef !important;
        break-inside: avoid;
    }
    .report-table {
        font-size: 10.5px;
    }
    .report-table th,
    .report-table td {
        padding: 5px 6px !important;
    }
}


/* EPGRL v56: reportes ejecutivos */
.executive-report-card {
    background: linear-gradient(135deg, #ffffff 0%, #f6f8fc 62%, #edf3ff 100%);
    border: 1px solid rgba(36, 78, 166, .12);
}
.executive-eyebrow {
    color: #244ea6;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .45rem;
}
.license-chart-box {
    width: 240px;
    height: 240px;
    max-width: min(240px, 100%);
    position: relative;
}
.license-chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}
.report-table th,
.report-table td {
    white-space: nowrap;
}
@media (max-width: 991.98px) {
    .license-chart-box { width: 190px; height: 190px; }
}
@media print {
    .executive-report-card { display: none !important; }
    .report-table th,
    .report-table td { white-space: normal; }
}

/* EPGRL v57 · Reporte Office Familia jerárquico */
.office-family-report {
    display: grid;
    gap: 1rem;
}
.office-family-group {
    border: 1px solid var(--app-border, #dbe3ef);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}
.office-family-main {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e6edf7;
    background: rgba(36, 78, 166, .045);
}
.office-associated-table thead th {
    font-size: .72rem;
    letter-spacing: .055em;
    text-transform: uppercase;
    color: #5f6f89;
    background: #f4f7fb;
}
.office-associated-table td,
.office-associated-table th {
    padding: .72rem .85rem;
}
@media print {
    .office-family-group {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* EPGRL v58 - búsquedas inteligentes generales y visor seguro de secretos */
.smart-search-wrap {
    position: relative;
}
.smart-search-wrap > input[type="search"],
.smart-search-wrap > input[data-smart-search-input] {
    width: 100%;
}
.smart-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1082;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .55);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    padding: .35rem;
}
.smart-search-result {
    width: 100%;
    display: block;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .55rem .7rem;
    border-radius: 10px;
    color: var(--sistemas-text);
    font-size: .92rem;
}
.smart-search-result:hover,
.smart-search-result:focus {
    background: rgba(37, 99, 235, .10);
    outline: none;
}
.secret-inline .secret-mask {
    letter-spacing: .08em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
#appSecretModal [data-secret-value] {
    letter-spacing: .04em;
}
@media print {
    .smart-search-results,
    #appSecretModal { display: none !important; }
}

/* EPGRL v61 - Gestión de usuarios */
.user-view-dl dt { color: var(--bs-secondary-color); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.user-view-dl dd { font-weight: 600; }
#usuariosTable .table-row-action { white-space: nowrap; }

/* EPGRL v65 - Cuentas/licencias en cards con búsqueda en resultados */
.cuentas-licencias-page .license-kpi-card {
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}
.cuentas-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}
.cuenta-license-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    border: 1px solid rgba(148, 163, 184, .38);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .075);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cuenta-license-card:hover,
.cuenta-license-card:focus {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .38);
    box-shadow: 0 22px 46px rgba(15, 23, 42, .12);
    outline: none;
}
.record-card-main {
    padding: 1rem;
}
.record-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .85rem 1rem 1rem;
    border-top: 1px solid rgba(226, 232, 240, .95);
    background: #f8fafc;
}
.license-icon-badge {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(37, 99, 235, .10);
    color: #1d4ed8;
    flex: 0 0 auto;
}
.license-icon-badge.office_familia {
    background: rgba(34, 197, 94, .12);
    color: #15803d;
}
.license-icon-badge.adobe_cc {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}
.license-icon-badge.otras_licencias {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}
.license-card-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}
.license-card-data > div {
    min-width: 0;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    padding: .75rem;
    background: #fbfdff;
}
.license-card-label {
    display: block;
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    margin-bottom: .2rem;
}
.license-card-data strong,
.license-card-data small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.license-card-data small {
    color: #64748b;
}
.cuenta-card-empty {
    margin-top: 1rem;
}
@media (max-width: 575.98px) {
    .cuentas-card-grid { grid-template-columns: 1fr; }
    .license-card-data { grid-template-columns: 1fr; }
    .record-card-actions .btn { flex: 1 1 100%; }
}
@media print {
    .record-card-actions,
    .cuentas-licencias-page form,
    .cuentas-licencias-page .qe-tabs { display: none !important; }
    .cuentas-card-grid { grid-template-columns: 1fr; }
    .cuenta-license-card { box-shadow: none; break-inside: avoid; }
}
