.users-cards-mobile {
    display: none;
    margin-top: 1.2rem;
    gap: 1rem;
}
.user-card {
    background: rgba(66, 34, 104, 0.13);
    border: 1px solid rgba(156, 2, 124, 0.18);
    border-radius: 12px;
    padding: 1.1rem 1rem 0.7rem 1rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 2px 8px rgba(30,24,63,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.user-card-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.2rem;
    font-size: 0.97rem;
}
.user-card-label {
    font-weight: 600;
    color: #d97fd0;
    min-width: 80px;
}
.user-card-actions {
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.user-card-row--meta {
    justify-content: space-between;
    align-items: baseline;
}

.user-card-row--meta .user-card-label {
    min-width: auto;
}

.user-card-row--role,
.user-card-row--password,
.user-card-row--permissions,
.user-card-row--status {
    align-items: flex-start;
}

.user-card-row--role .user-card-label,
.user-card-row--password .user-card-label,
.user-card-row--permissions .user-card-label,
.user-card-row--status .user-card-label {
    min-width: 92px;
}

.user-card-row--role select,
.user-card-row--password input {
    flex: 1;
    min-width: 0;
}

.user-card-row--permissions {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 0.5rem;
}

.user-card-permissions-list {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.user-card-permissions-list .inline-check.compact {
    margin-right: 0;
    font-size: 0.92rem;
}
@media (max-width: 768px) {
    .users-table-desktop {
        display: none !important;
    }
    .users-cards-mobile {
        display: flex !important;
        flex-direction: column;
    }

    .user-card {
        padding: 0.95rem 0.9rem 0.8rem;
        gap: 0.42rem;
    }

    .user-card-row {
        gap: 0.55rem;
        margin-bottom: 0.1rem;
    }

    .user-card-row--role {
        display: grid;
        grid-template-columns: 92px 1fr;
        align-items: center;
    }

    .user-card-row--status {
        display: grid;
        grid-template-columns: 92px 1fr;
        align-items: center;
    }

    .user-card-row--password {
        display: grid;
        grid-template-columns: 92px 1fr;
        align-items: center;
    }

    .user-card-row--permissions {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .user-card-row--permissions .user-card-label {
        min-width: auto;
    }

    .user-card-permissions-list {
        width: 100%;
    }

    .user-card-row--role select,
    .user-card-row--password input {
        width: 100%;
    }

    .user-card-actions .btn:not(.btn-icon) {
        min-width: 110px;
    }
}
.tunel-mobile-card,
.tunel-mobile-body,
.tunel-mobile-section {
    max-width: 100vw;
    box-sizing: border-box;
}

.tunel-mobile-body .field,
.tunel-mobile-section .field {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tunel-mobile-body .field input,
.tunel-mobile-body .field select,
.tunel-mobile-body .field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.tunel-mobile-body .entry-grid,
.tunel-mobile-section .entry-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.tunel-mobile-body .field input,
.tunel-mobile-body .field select,
.tunel-mobile-body .field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tunel-mobile-body .entry-grid {
    grid-template-columns: 1fr;
}
:root {
    --bg-start: #1a1a2e;
    --bg-end: #16213e;
    --card-bg: rgba(66, 34, 104, 0.15);
    --card-border: rgba(156, 2, 124, 0.2);
    --primary: #9C027C;
    --primary-hover: #422268;
    --secondary: #475b65;
    --text-main: #efefe5;
    --text-muted: rgba(239, 239, 229, 0.6);
    --input-bg: #1e1e3a;
    --input-border: #422268;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #9C027C;
    --scrollbar-track: rgba(255, 255, 255, 0.16);
    --scrollbar-thumb-start: #f25fd2;
    --scrollbar-thumb-end: #8b5cf6;
    --scrollbar-thumb-hover-start: #ff8be5;
    --scrollbar-thumb-hover-end: #a78bfa;
}

* {
    box-sizing: border-box;
}

html,
body,
.content-area,
.table-responsive,
.table-wrap,
.ris-top-tables-wrap,
.ris-oi-table-wrap,
#multiselect-options,
.info-content-box {
    scrollbar-width: auto;
    scrollbar-color: auto;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.content-area::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.ris-top-tables-wrap::-webkit-scrollbar,
.ris-oi-table-wrap::-webkit-scrollbar,
#multiselect-options::-webkit-scrollbar,
.info-content-box::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.ris-top-tables-wrap::-webkit-scrollbar-track,
.ris-oi-table-wrap::-webkit-scrollbar-track,
#multiselect-options::-webkit-scrollbar-track,
.info-content-box::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.12);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.ris-top-tables-wrap::-webkit-scrollbar-thumb,
.ris-oi-table-wrap::-webkit-scrollbar-thumb,
#multiselect-options::-webkit-scrollbar-thumb,
.info-content-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.45);
    border: 3px solid rgba(16, 16, 26, 0.85);
    border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.ris-top-tables-wrap::-webkit-scrollbar-thumb:hover,
.ris-oi-table-wrap::-webkit-scrollbar-thumb:hover,
#multiselect-options::-webkit-scrollbar-thumb:hover,
.info-content-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.62);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.content-area::-webkit-scrollbar-corner,
.table-responsive::-webkit-scrollbar-corner,
.table-wrap::-webkit-scrollbar-corner,
.ris-top-tables-wrap::-webkit-scrollbar-corner,
.ris-oi-table-wrap::-webkit-scrollbar-corner,
#multiselect-options::-webkit-scrollbar-corner,
.info-content-box::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.12);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Montserrat", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(140deg, var(--bg-start), var(--bg-end));
}

.week-picker-hidden {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.week-picker-hidden.week-picker-active {
    left: 12px;
    top: 12px;
    width: 220px;
    height: 36px;
    opacity: 0.01;
    pointer-events: auto;
    z-index: 99999;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.app-shell.guest {
    align-items: center;
    justify-content: center;
}

.app-shell.guest .main-wrap {
    margin-left: 0;
    width: 100%;
}

.app-shell.guest .content-area {
    padding: 0;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    border-right: 1px solid var(--card-border);
    background: rgba(10, 12, 28, 0.45);
    backdrop-filter: blur(12px);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-main);
    margin-bottom: 0.9rem;
    padding: 0.25rem 0.2rem 0.7rem;
    border-bottom: 1px solid var(--card-border);
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(156, 2, 124, 0.45);
    background: rgba(66, 34, 104, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

.brand-logo-f {
    color: #efefe5;
}

.brand-logo-r {
    color: #d97fd0;
}

.brand-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(239, 239, 229, 0.96);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-toggle-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-main);
    font: inherit;
    width: 100%;
    opacity: 0.92;
    margin-top: auto;
}

.sidebar-toggle-btn:hover {
    background: rgba(156, 2, 124, 0.14);
    border-left-color: var(--primary);
}

.sidebar.collapsed .sidebar-toggle-btn .icon-collapse {
    transform: rotate(180deg);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-item {
    color: var(--text-main);
    text-decoration: none;
    padding: 0.7rem 0.8rem;
    border-left: 3px solid transparent;
    border-radius: 8px;
    opacity: 0.92;
}

.nav-item.active {
    border-left-color: var(--primary);
    background: rgba(156, 2, 124, 0.14);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
    margin-top: auto;
}

.sidebar-footer span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-main);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-username {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed {
    width: 64px;
    padding: 1.2rem 0.6rem;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-footer-username {
    display: none;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .sidebar-toggle-btn {
    justify-content: center;
    padding: 0.7rem 0.4rem;
    gap: 0;
}

.sidebar.collapsed .nav-icon {
    width: 20px;
    height: 20px;
}

.sidebar.collapsed .sidebar-toggle-btn .nav-text {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-footer .logout-btn {
    margin-left: 0;
}

.main-wrap.sidebar-collapsed {
    margin-left: 64px;
}

.sidebar.collapsed + .sidebar-backdrop {
    display: none;
}

.main-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 240px;
}

.topbar {
    display: none;
    height: 68px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(10, 12, 28, 0.3);
    backdrop-filter: blur(12px);
    padding: 0 1rem;
    align-items: center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
}

.topbar-user.solo {
    margin-left: auto;
    margin-right: auto;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-actions form {
    margin: 0;
}

.panel-tunel {
    overflow: hidden;
    padding-bottom: 1.4rem;
    min-width: 0;
}

.panel-tunel > .panel.soft {
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
    max-width: 100%;
}

.panel-tunel .tunel-step {
    padding: 1rem;
}

.panel-tunel .entry-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel-tunel .table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.panel-tunel .entry-table {
    min-width: 1700px;
}

.panel-tunel .entry-table th,
.panel-tunel .entry-table td {
    min-width: 160px;
}

.panel-tunel .entry-table th {
    font-size: 0.76rem;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: normal;
    word-break: normal;
}

.panel-tunel .entry-table th:nth-last-child(-n+2),
.panel-tunel .entry-table td:nth-last-child(-n+2) {
    min-width: 120px;
}

/* PDF column: shrink to content */
.panel-tunel .entry-table th:nth-last-child(3),
.panel-tunel .entry-table td:nth-last-child(3) {
    min-width: 0;
    width: 1%;
    white-space: nowrap;
}

.panel-tunel .actions-cell {
    white-space: nowrap;
}

.panel-tunel .actions-cell .inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.tunel-entry-launcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.tunel-entry-launcher .btn {
    align-self: center;
    white-space: nowrap;
}

.tunel-modal {
    width: min(980px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background:
        radial-gradient(1200px 300px at 0% -20%, rgba(156, 2, 124, 0.2), transparent 55%),
        rgba(25, 22, 52, 0.95);
}

.tunel-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.45rem;
}

.tunel-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(239, 239, 229, 0.12);
    border: 1px solid rgba(156, 2, 124, 0.25);
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.tunel-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9c027c 0%, #d04db3 100%);
    box-shadow: 0 0 16px rgba(156, 2, 124, 0.45);
    transition: width 0.28s ease;
}

.tunel-progress-label {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    color: rgba(239, 239, 229, 0.72);
    font-variant-numeric: tabular-nums;
}

.tunel-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(156, 2, 124, 0.35);
    background: rgba(66, 34, 104, 0.2);
    color: rgba(239, 239, 229, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
}

.tunel-step-dot.active {
    background: rgba(156, 2, 124, 0.3);
    border-color: rgba(156, 2, 124, 0.68);
    color: #fff;
}

.tunel-step-pane {
    display: none;
}

.tunel-step-pane.active {
    display: block;
    animation: tunelStepInForward 0.26s ease;
}

.tunel-step-pane.active.is-back {
    animation-name: tunelStepInBack;
}

.tunel-step-pane h3 {
    margin: 0 0 0.65rem;
    font-size: 1.35rem;
}

.tunel-wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tunel-wizard-actions .btn {
    width: auto;
    min-width: 124px;
}

.tunel-mobile-list {
    display: none;
}

.tunel-mobile-card {
    border: 1px solid rgba(156, 2, 124, 0.2);
    border-radius: 12px;
    background: rgba(66, 34, 104, 0.12);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.tunel-mobile-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    cursor: pointer;
}

.tunel-mobile-summary::-webkit-details-marker {
    display: none;
}

.tunel-mobile-nro {
    font-weight: 700;
    font-size: 0.95rem;
    color: #efefe5;
}

.tunel-mobile-body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid rgba(156, 2, 124, 0.2);
}

.tunel-mobile-section {
    margin-top: 0.6rem;
    padding: 0.7rem;
}

.tunel-mobile-section h3 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.tunel-mobile-actions {
    margin-top: 0.6rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

/* PDF cell in table */
.tunel-pdf-actions {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.tunel-pdf-upload {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tunel-pdf-upload input[type="file"] {
    display: none;
}
.tunel-pdf-selected {
    font-size: 0.62rem;
    color: var(--primary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
    text-align: center;
    line-height: 1.2;
}
.tunel-pdf-selected.visible {
    display: block;
}
/* Grid 2 columnas para el último step del wizard (Inspector + Adjunto en la misma fila) */
.tunel-step-last-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Wizard PDF field */
.tunel-pdf-wizard-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}
.tunel-pdf-wizard-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    background: var(--secondary);
    color: #efefe5;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.15s;
    border: none;
    line-height: 1;
}
.tunel-pdf-wizard-label:hover {
    opacity: 0.85;
}
.tunel-pdf-wizard-label input[type="file"] {
    display: none;
}
.tunel-pdf-wizard-hint {
    font-size: 0.78rem;
    color: #8888aa;
}
.tunel-pdf-wizard-hint.has-file {
    color: var(--primary);
    font-weight: 500;
}
.tunel-pdf-wizard-label-icon {
    padding: 0.45rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    justify-content: center;
    background: var(--secondary);
    color: #efefe5;
}
.tunel-attach-icon-only {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-end;
    padding-bottom: 0.1rem;
}
.tunel-attach-icon-only > label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: row;
    width: 100%;
}

@keyframes tunelStepInForward {
    from {
        opacity: 0;
        transform: translateX(18px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes tunelStepInBack {
    from {
        opacity: 0;
        transform: translateX(-18px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tunel-step-pane.active,
    .tunel-step-pane.active.is-back {
        animation: none;
    }
}

.content-area {
    padding: 1.2rem;
    min-width: 0;
    overflow-x: hidden;
}

/* Styled info button for periods (circular icon + label) */
.btn-periodos-info {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(156, 2, 124, 0.25);
    background: linear-gradient(180deg, rgba(156,2,124,0.06), rgba(66,34,104,0.04));
    color: var(--info);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-periodos-info:hover {
    background: rgba(156,2,124,0.08);
}
.btn-periodos-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--info);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: serif;
    font-style: italic;
    flex-shrink: 0;
}
.btn-periodos-label {
    line-height: 1;
}

/* Evita doble scrollbar en RIS Art.36 y RIS OI: un solo scroll en el área de contenido. */
body.route-admin_art36_ris,
body.route-admin_ris {
    height: 100vh;
    overflow: hidden;
}

body.route-admin_art36_ris .app-shell,
body.route-admin_art36_ris .main-wrap,
body.route-admin_ris .app-shell,
body.route-admin_ris .main-wrap {
    height: 100vh;
}

body.route-admin_art36_ris .content-area,
body.route-admin_ris .content-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Global table layout and column width management */
.table.entry-table {
    table-layout: fixed;
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
}

.table.entry-table th,
.table.entry-table td {
    width: 160px; /* Equal fixed width */
    min-width: 160px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 12px 10px;
    border-bottom: 1px solid var(--card-border);
}

.table.entry-table th {
    padding: 14px 10px 18px;
    border-bottom: 2px solid rgba(156, 2, 124, 0.3);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.table.entry-table th.week-cell,
.table.entry-table td.week-cell {
    width: 200px;
    min-width: 200px;
}

.table.entry-table th.status-cell,
.table.entry-table td.status-cell {
    width: 120px;
    min-width: 120px;
}

/* Razon Social and Contribuyente usually need more space */
.table.entry-table th.col-razon_social,
.table.entry-table td.col-razon_social,
.table.entry-table th.col-contribuyente,
.table.entry-table td.col-contribuyente {
    width: 240px;
    min-width: 240px;
}

/* Money columns can be narrower */
.table.entry-table th.col-importe_capital,
.table.entry-table td.col-importe_capital {
    width: 140px;
    min-width: 140px;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
    border-radius: 12px;
    background: rgba(0,0,0,0.1);
}


.auth-panel {
    max-width: 440px;
    margin: 5vh auto;
}

.login-scene {
    position: relative;
    min-height: 100vh;
    border-radius: 18px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.login-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(40px);
    opacity: 0.35;
    z-index: 0;
}

.login-glow-a {
    width: 300px;
    height: 300px;
    background: rgba(156, 2, 124, 0.4);
    top: 8%;
    left: 16%;
}

.login-glow-b {
    width: 260px;
    height: 260px;
    background: rgba(66, 34, 104, 0.6);
    right: 14%;
    bottom: 10%;
}

.auth-panel-advanced {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 2rem));
    margin: 0;
    padding: 1.5rem;
    background: rgba(30, 24, 63, 0.78);
    border: 1px solid rgba(156, 2, 124, 0.28);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.auth-head {
    margin-bottom: 1rem;
}

.auth-kicker {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(239, 239, 229, 0.72);
}

.auth-system-title {
    margin: 0 0 0.55rem;
    font-size: 1.02rem;
    font-weight: 600;
    color: rgba(239, 239, 229, 0.9);
}

.auth-submit {
    margin-top: 0.4rem;
}

.auth-form {
    display: grid;
    gap: 0.9rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.password-field-wrap {
    position: relative;
    width: 100%;
}

.password-field-wrap input {
    padding-right: 2.45rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(239, 239, 229, 0.75);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
    background: rgba(156, 2, 124, 0.16);
    color: #efefe5;
    outline: none;
}

label {
    color: var(--text-muted);
    font-size: 0.92rem;
}

input,
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.68rem 0.74rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    accent-color: #c59f28;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(156, 2, 124, 0.2);
}

input[type="date"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.85) contrast(1.15);
    -webkit-filter: invert(1) brightness(1.85) contrast(1.15);
    opacity: 1;
    cursor: pointer;
}

.ris-date-input {
    border-color: rgba(255, 255, 255, 0.26) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.ris-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.85) contrast(1.15) !important;
    -webkit-filter: invert(1) brightness(1.85) contrast(1.15) !important;
    opacity: 1;
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 0.65rem 0.95rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: #e6f4ea;
    color: #166534;
    border: 1px solid rgba(22, 101, 52, 0.25);
}

.btn-success:hover {
    background: #d1edda;
    color: #0f3b27;
    border-color: rgba(22, 101, 52, 0.45);
}

.btn-success.btn-icon {
    color: #166534;
}

#btn-bulk-approve-weekly_int_masivas {
    color: #0f3b27;
}

#btn-bulk-approve-weekly_int_masivas svg path,
#btn-bulk-approve-weekly_int_masivas svg polyline,
#btn-bulk-approve-weekly_int_masivas svg line,
#btn-bulk-approve-weekly_int_masivas svg circle,
#btn-bulk-approve-weekly_int_masivas svg rect,
#btn-bulk-approve-weekly_int_masivas svg polygon {
    stroke: currentColor !important;
    fill: none !important;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.28);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.6);
}

.btn-secondary {
    background: var(--secondary);
}

.btn-light {
    background: #d9dde8;
    color: #1a1a2e;
    border: 1px solid #f3f5fb;
}

.btn-light:hover {
    background: #f0f3fb;
    color: #11152f;
}

.btn-draft-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    min-width: 0;
    white-space: nowrap;
}

.btn-actas {
    background: rgba(95, 117, 163, 0.92);
    border: 1px solid rgba(143, 160, 209, 0.32);
    color: #f4f6fb;
}

.btn-actas:hover {
    background: rgba(109, 131, 178, 0.98);
    color: #ffffff;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
}

.btn-small.btn-icon {
    width: 32px;
    height: 32px;
}

.logout-btn {
    background: rgba(239, 239, 229, 0.18);
    border: 1px solid rgba(239, 239, 229, 0.24);
    color: #efefe5;
}

.logout-btn:hover {
    background: rgba(239, 239, 229, 0.28);
    color: #ffffff;
}

.icon-logout {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2.1;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.muted {
    color: var(--text-muted);
}

.kpi-grid {
    margin-top: 1rem;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-grid-reports {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-grid-ris {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-grid-admin {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.kpi-grid-admin .kpi-card:nth-child(-n+3) {
    grid-column: span 4;
}

.kpi-grid-admin .kpi-card:nth-child(n+4):nth-child(-n+6) {
    grid-column: span 4;
}

.kpi-grid-admin .kpi-card:nth-child(n+7):nth-child(-n+10) {
    grid-column: span 3;
}

.kpi-grid-my-reports {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-grid-my-reports .kpi-card:nth-child(-n+3) {
    grid-column: auto;
}

.kpi-grid-my-reports .kpi-card:nth-child(n+4) {
    grid-column: auto;
}

.kpi-card {
    background: rgba(66, 34, 104, 0.15);
    border: 1px solid rgba(156, 2, 124, 0.2);
    border-radius: 14px;
    padding: 0.9rem;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(239,239,229,0.55);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #efefe5;
    line-height: 1;
}

.kpi-sub {
    font-size: 0.78rem;
    color: rgba(239,239,229,0.45);
}

.kpi-money {
    margin-top: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #d97fd0;
    font-variant-numeric: tabular-nums;
}

.kpi-money-label-inline {
    font-size: 0.82em;
    font-weight: 600;
    color: rgba(239, 239, 229, 0.76);
}

.users-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.panel.soft {
    background: rgba(66, 34, 104, 0.08);
}

.form-grid {
    display: grid;
    gap: 0.7rem;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-main);
    font-size: 0.92rem;
}

.inline-check.compact {
    font-size: 0.83rem;
    margin-right: 0.45rem;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 0.58rem;
    border-bottom: 1px solid rgba(156, 2, 124, 0.16);
    vertical-align: middle;
}

.table tbody tr:nth-child(odd) {
    background: rgba(66, 34, 104, 0.1);
}

.inline-form {
    display: inline;
}

.btn-small {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.84rem;
}

.mini-hint {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #f6c45a;
}

.permission-list {
    display: grid;
    gap: 0.5rem;
}

.permission-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 16, 0.72);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    width: min(560px, 95vw);
    background: rgba(25, 22, 52, 0.95);
    border: 1px solid rgba(156, 2, 124, 0.28);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    padding: 1rem;
}

.actas-modal-card {
    width: min(1040px, 96vw);
    padding: 0.85rem 0.95rem 0.95rem;
}

.int-masivas-modal-card {
    width: min(1180px, 96vw);
    max-height: 92vh;
    overflow: auto;
    padding: 0.95rem 1rem 1rem;
}

.entry-add-form-modal {
    margin-top: 0.35rem;
}

.int-masivas-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.actas-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.actas-form-grid .field {
    min-width: 0;
}

.actas-modal-card .modal-header {
    margin-bottom: 0.55rem;
}

.actas-modal-card .entry-table th,
.actas-modal-card .entry-table td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.actas-modal-card .field label {
    font-size: 0.9rem;
}

.actas-modal-card .field input,
.actas-modal-card .field textarea {
    min-height: 40px;
}

.actas-modal-card .modal-actions {
    margin-top: 0.35rem !important;
    justify-content: flex-end;
}

.actas-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.actas-span-full {
    grid-column: 1 / -1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.mt-12 {
    margin-top: 0.75rem;
}

.mt-16 {
    margin-top: 1rem;
}

.mt-24 {
    margin-top: 1.5rem;
}

.week-toolbar {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.week-toolbar .field {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.week-toolbar .field label {
    font-size: 0.9rem;
    margin-bottom: 0;
    white-space: nowrap;
}

.week-toolbar .field input[type="date"] {
    padding: 0.6rem;
    font-size: 0.9rem;
    flex: 1;
}

.week-toolbar .btn {
    margin-top: 0;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.week-label {
    color: var(--text-main);
    font-size: 0.95rem;
    white-space: nowrap;
}



.tab-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tab-btn {
    border: 1px solid var(--card-border);
    background: rgba(66, 34, 104, 0.12);
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.48rem 0.72rem;
    cursor: pointer;
}

.tab-btn.active {
    background: rgba(156, 2, 124, 0.2);
    border-color: rgba(156, 2, 124, 0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.entry-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.entry-grid.fields-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-add-form > .btn {
    margin-top: 0.55rem;
}

.money-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.money-wrap span {
    color: var(--text-muted);
    font-size: 0.86rem;
    min-width: 28px;
}

.entry-table input[readonly] {
    opacity: 0.7;
}

.status-chip {
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-chip.borrador {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f6c45a;
}

.status-chip.aprobado {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.4);
    color: #7de3a1;
}

.actions-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.actions-cell .inline-form {
    display: inline-flex;
}

.actions-edit-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.move-week-input {
    width: 140px;
    min-width: 140px;
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Resumen tab */
.resumen-block {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.resumen-block:first-child {
    border-top: none;
    padding-top: 0;
}
.resumen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.resumen-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #efefe5;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.resumen-count {
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(156, 2, 124, 0.25);
    color: #d97fd0;
    border-radius: 20px;
    padding: 2px 10px;
}
.money-ro {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Reports ──────────────────────────────────────────── */
.dashboard-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.3rem;
    border-radius: 12px;
    border: 1px solid rgba(156, 2, 124, 0.2);
    background: rgba(66, 34, 104, 0.12);
}

.dashboard-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 0.48rem 0.95rem;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
    color: rgba(239, 239, 229, 0.85);
    transition: all 0.2s ease;
}

.dashboard-tab:hover {
    color: #efefe5;
    background: rgba(156, 2, 124, 0.2);
}

.dashboard-tab.active {
    color: #efefe5;
    background: linear-gradient(135deg, rgba(156, 2, 124, 0.8), rgba(111, 0, 128, 0.8));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.report-filters {
    background: rgba(66, 34, 104, 0.1);
    border: 1px solid rgba(156, 2, 124, 0.15);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-row .field {
    flex: 1 1 160px;
}

.report-filters .filter-row .field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.6rem;
}

.report-filters .filter-row .field > label {
    margin: 0;
    white-space: nowrap;
}

.report-filters .filter-row .field > input,
.report-filters .filter-row .field > .user-picker {
    width: 100%;
}

.report-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.field-btn {
    flex: 0 0 auto !important;
}

.report-filters .field-btn {
    display: flex;
    align-items: center;
    min-width: 0;
}

.report-filters .field-btn > div {
    width: 100%;
    justify-content: flex-start;
}

.report-filters .field-btn > label {
    display: none;
}

@media (min-width: 1024px) {
    .report-filters .filter-row {
        flex-wrap: nowrap;
        align-items: flex-end;
    }

    .report-filters .field-week-from,
    .report-filters .field-week-to {
        flex: 0 0 24%;
        max-width: 260px;
    }


    .report-filters .field-week-from input,
    .report-filters .field-week-to input {
        max-width: 260px;
    }

    .report-filters .field-users-filter {
        flex: 1 1 auto;
        min-width: 280px;
    }

    .report-filters .field-btn {
        flex: 0 1 auto;
        margin-left: 0.25rem;
    }
}

.user-picker {
    position: relative;
}

.user-picker-trigger {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(156, 2, 124, 0.3);
    background: #1e1e3a;
    color: #efefe5;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-picker-trigger:hover,
.user-picker-trigger[aria-expanded="true"] {
    border-color: rgba(156, 2, 124, 0.65);
}

.user-picker-caret {
    color: rgba(239, 239, 229, 0.8);
    font-size: 0.9rem;
}

.user-picker-panel {
    position: absolute;
    z-index: 15;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid rgba(156, 2, 124, 0.3);
    background: #1e1e3a;
    border-radius: 10px;
    padding: 0.4rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.user-picker-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.4rem;
    border-radius: 8px;
    color: #efefe5;
}

.user-picker-option:hover {
    background: rgba(156, 2, 124, 0.15);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.chart-card {
    border: 1px solid rgba(156, 2, 124, 0.2);
    background: rgba(66, 34, 104, 0.1);
    border-radius: 12px;
    padding: 0.95rem;
    backdrop-filter: blur(12px);
}

.chart-card h2 {
    margin: 0 0 0.8rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: rgba(239, 239, 229, 0.92);
}

.chart-card-wide {
    grid-column: auto;
}

.chart-card-doughnut {
    max-width: none;
}

.chart-card canvas {
    width: 100% !important;
}

#doughnutChart {
    max-width: 760px;
    max-height: 240px;
    width: 100% !important;
    margin: 0;
    display: block;
}

.collapsible-section {
    border: 1px solid rgba(156, 2, 124, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.collapsible-toggle {
    width: 100%;
    background: rgba(66, 34, 104, 0.15);
    border: none;
    color: #efefe5;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-align: left;
    transition: background 0.2s;
}

.collapsible-toggle:hover {
    background: rgba(66, 34, 104, 0.28);
}

.collapsible-title {
    min-width: 0;
}

.collapsible-title-desktop {
    display: block;
}

.collapsible-title-mobile {
    display: none;
}

.collapsible-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.collapsible-count {
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(156, 2, 124, 0.25);
    color: #d97fd0;
    border-radius: 20px;
    padding: 2px 10px;
}

.collapse-icon {
    margin-left: 0;
    transition: transform 0.25s;
}

.collapsible-toggle[aria-expanded="false"] .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-body {
    padding: 0.75rem 1.1rem 1rem;
    background: rgba(66, 34, 104, 0.05);
}

.collapsible-body.collapsed {
    display: none;
}

/* Reportes admin: ajuste específico de columnas para la sección Actas */
#section-weekly_actas .entry-table th:nth-child(3),
#section-weekly_actas .entry-table td:nth-child(3),
#admin-section-weekly_actas .entry-table th:nth-child(3),
#admin-section-weekly_actas .entry-table td:nth-child(3) {
    min-width: 140px;
    white-space: nowrap;
}

#section-weekly_actas .entry-table th:nth-child(6),
#section-weekly_actas .entry-table td:nth-child(6),
#admin-section-weekly_actas .entry-table th:nth-child(6),
#admin-section-weekly_actas .entry-table td:nth-child(6) {
    min-width: 200px;
    white-space: nowrap;
}

#section-weekly_actas .entry-table th:nth-child(4),
#section-weekly_actas .entry-table td:nth-child(4),
#admin-section-weekly_actas .entry-table th:nth-child(4),
#admin-section-weekly_actas .entry-table td:nth-child(4) {
    min-width: 90px;
}

#section-weekly_actas .entry-table th:nth-child(5),
#section-weekly_actas .entry-table td:nth-child(5),
#admin-section-weekly_actas .entry-table th:nth-child(5),
#admin-section-weekly_actas .entry-table td:nth-child(5) {
    min-width: 220px;
}

#section-weekly_actas .entry-table th:nth-child(7),
#section-weekly_actas .entry-table td:nth-child(7),
#admin-section-weekly_actas .entry-table th:nth-child(7),
#admin-section-weekly_actas .entry-table td:nth-child(7) {
    min-width: 320px;
}

.week-cell {
    white-space: nowrap;
    font-size: 0.82rem;
    color: rgba(239,239,229,0.65);
}

.week-cell-summary {
    color: rgba(239,239,229,0.8);
    font-size: 0.92rem;
}

.weekly-summary-table {
    width: 100%;
    background: rgba(26, 26, 46, 0.4);
    border: 1px solid rgba(156, 2, 124, 0.2);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.85rem;
}

.weekly-summary-table thead {
    background: linear-gradient(135deg, rgba(66, 34, 104, 0.6), rgba(156, 2, 124, 0.3));
    border-bottom: 1px solid rgba(156, 2, 124, 0.3);
}

.weekly-summary-table th {
    padding: 0.38rem 0.28rem;
    text-align: center;
    color: rgba(239, 239, 229, 0.9);
    font-weight: 600;
    font-size: 0.68rem;
    line-height: 1.08;
    border-right: 1px solid rgba(156, 2, 124, 0.15);
    white-space: normal;
    min-width: 60px;
    max-width: 80px;
    word-break: break-word;
}

.weekly-summary-table th:first-child {
    text-align: left;
    min-width: 140px;
}

.weekly-summary-table th:last-child {
    border-right: none;
}

.weekly-summary-table tbody tr {
    border-bottom: 1px solid rgba(156, 2, 124, 0.1);
    transition: background 0.2s ease;
}

.weekly-summary-table tbody tr:hover {
    background: rgba(156, 2, 124, 0.1);
}

.weekly-summary-table td {
    padding: 0.6rem 0.4rem;
    color: rgba(239, 239, 229, 0.75);
    border-right: 1px solid rgba(156, 2, 124, 0.1);
    text-align: center;
}

.weekly-summary-table td:first-child {
    text-align: left;
    color: rgba(239, 239, 229, 0.8);
}

.weekly-summary-table td:last-child {
    border-right: none;
}

.weekly-summary-desktop {
    display: block;
}

.weekly-summary-mobile {
    display: none;
}

.weekly-summary-card {
    background: rgba(66, 34, 104, 0.14);
    border: 1px solid rgba(156, 2, 124, 0.2);
    border-radius: 12px;
    padding: 0.8rem;
}

.weekly-summary-card-title {
    margin: 0 0 0.6rem;
    font-size: 0.94rem;
    font-weight: 700;
    color: rgba(239, 239, 229, 0.9);
}

.weekly-summary-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.weekly-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.42);
    border: 1px solid rgba(156, 2, 124, 0.12);
}

.weekly-summary-item span {
    font-size: 0.72rem;
    color: rgba(239, 239, 229, 0.7);
}

.weekly-summary-item strong {
    font-size: 0.86rem;
    color: #efefe5;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 6px;
    margin: 0;
    padding: 0;
}

@media (min-width: 769px) {
    .table-tunel-report thead th {
        white-space: nowrap;
        line-height: 1.05;
        padding: 0.46rem 0.45rem;
        font-size: 0.84rem;
        vertical-align: middle;
    }

    .table-tunel-report thead tr:first-child th {
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.01em;
    }

    .table-tunel-report thead .tunel-group-title {
        text-align: center;
    }

    .table-tunel-report thead .tunel-group-start,
    .table-tunel-report tbody td.tunel-group-start {
        border-left: 1px solid rgba(156, 2, 124, 0.28);
    }

    .table-tunel-report thead .tunel-group-end,
    .table-tunel-report tbody td.tunel-group-end {
        border-right: 1px solid rgba(156, 2, 124, 0.22);
    }

    .table-tunel-report tbody td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 190px;
        line-height: 1.1;
        vertical-align: middle;
    }

    .table-tunel-report tbody td.week-cell {
        max-width: 160px;
    }
}

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: grid;
    gap: 0.6rem;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }

.hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    border-radius: 8px;
    width: 36px;
    height: 36px;
}

@media (max-width: 768px) {
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10,12,28,0.55);
        z-index: 59;
        transition: opacity 0.2s;
    }
    .sidebar.open ~ .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
    .sidebar-backdrop.open {
        display: block;
        opacity: 1;
    }
    .sidebar-close {
        display: block;
        position: absolute;
        top: 12px;
        right: 12px;
        background: none;
        border: none;
        color: #efefe5;
        font-size: 2.1rem;
        z-index: 61;
        cursor: pointer;
        padding: 0 8px;
        line-height: 1;
    }
}

@media (min-width: 769px) {
    .sidebar-backdrop { display: none !important; }
    .sidebar-close { display: none !important; }
}

@media (max-width: 768px) {
        .week-toolbar {
            grid-template-columns: 1fr !important;
            gap: 0.7rem !important;
        }
    .app-shell {
        grid-template-columns: 1fr;
    }

    .main-wrap {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        display: flex;
    }

    .kpi-grid,
    .kpi-grid-ris {
        grid-template-columns: 1fr;
    }

    .kpi-grid-admin .kpi-card:nth-child(-n+3),
    .kpi-grid-admin .kpi-card:nth-child(n+4) {
        grid-column: auto;
    }

    .kpi-grid-my-reports .kpi-card:nth-child(-n+3),
    .kpi-grid-my-reports .kpi-card:nth-child(n+4) {
        grid-column: auto;
    }

    .users-grid {
        grid-template-columns: 1fr;
    }


    /* Refuerzo: todos los contenedores y campos de TUNEL móvil no pueden exceder el ancho de la tarjeta */
    .tunel-mobile-card,
    .tunel-mobile-body,
    .tunel-mobile-section {
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .tunel-mobile-body .field,
    .tunel-mobile-section .field {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .tunel-mobile-body .field input,
    .tunel-mobile-body .field select,
    .tunel-mobile-body .field textarea,
    .tunel-mobile-section .field input,
    .tunel-mobile-section .field select,
    .tunel-mobile-section .field textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        display: block !important;
    }

    .tunel-mobile-body .entry-grid,
    .tunel-mobile-section .entry-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .entry-grid {
        grid-template-columns: 1fr !important;
    }

    .panel-tunel .tunel-desktop-table {
        display: none;
    }

    .panel-tunel .tunel-mobile-list {
        display: block;
    }

    .tunel-modal {
        width: min(96vw, 96vw);
        padding: 0.9rem;
    }

    .tunel-wizard-actions {
        justify-content: stretch;
    }

    .tunel-wizard-actions .btn {
        flex: 1 1 120px;
        min-width: 0;
    }

    .charts-grid {
        display: none;
    }

    #barChart {
        min-height: 150px;
    }

    #doughnutChart {
        min-height: 240px;
    }

    .weekly-summary-desktop {
        display: none;
    }

    .weekly-summary-mobile {
        display: grid;
        gap: 0.7rem;
    }

    .weekly-summary-card-grid {
        grid-template-columns: 1fr 1fr;
    }

    .report-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .report-actions .btn {
        width: 100%;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.58rem 0.5rem;
        white-space: nowrap;
    }

    .collapsible-toggle {
        padding: 0.8rem 0.95rem;
        gap: 0.55rem;
        align-items: center;
    }

    .collapsible-title-desktop {
        display: none;
    }

    .collapsible-title-mobile {
        display: block;
        font-size: 1.03rem;
        line-height: 1.15;
        font-weight: 700;
    }

    .collapsible-count {
        white-space: nowrap;
        font-size: 0.78rem;
        padding: 4px 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 30px;
    }

    .collapse-icon {
        width: 14px;
        height: 14px;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .login-scene {
        min-height: 100vh;
    }

    .auth-panel-advanced {
        padding: 1.1rem;
    }
}

@media (max-width: 420px) {
    .weekly-summary-card-grid {
        grid-template-columns: 1fr;
    }
}

/* SAT Import (OI + Art.36) / RIS: estilos globales para alineaciones */
.text-right,
.sat-import-page .text-right { text-align: right !important; }
.text-center,
.sat-import-page .text-center { text-align: center !important; }

.sat-import-page .sat-progress-wrap {
    min-width: 150px;
}

.sat-import-page .sat-progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.sat-import-page .sat-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--sat-fill, #16a34a);
    transition: width 0.2s ease;
}

.sat-import-page .sat-progress-meta {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
}

.sat-import-page .view-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.sat-import-page .modern-upload-group {
    display: flex;
    align-items: center;
    background: rgba(30, 24, 63, 0.4);
    border: 1px solid rgba(156, 2, 124, 0.3);
    border-radius: 14px;
    padding: 4px;
    transition: all 0.3s ease;
}

.sat-import-page .modern-upload-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(156, 2, 124, 0.2);
}

.sat-import-page .file-upload-custom {
    position: relative;
    padding: 0.5rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    min-width: 200px;
}

.sat-import-page .file-upload-custom input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.sat-import-page .file-upload-custom svg {
    width: 18px;
    height: 18px;
    color: #d97fd0;
}

.sat-import-page .file-upload-custom span {
    font-size: 0.85rem;
    color: rgba(239, 239, 229, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sat-import-page .file-upload-custom span.has-file {
    color: #efefe5;
    font-weight: 500;
}

.sat-import-page .btn-modern-primary {
    background: linear-gradient(135deg, #9C027C 0%, #422268 100%);
    border: none;
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(156, 2, 124, 0.3);
}

.sat-import-page .btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 2, 124, 0.5);
    filter: brightness(1.1);
}

.sat-import-page .btn-modern-primary svg,
.sat-import-page .btn-modern-danger svg {
    width: 18px;
    height: 18px;
}

.sat-import-page .btn-modern-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sat-import-page .btn-modern-danger:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-modern-info {
    background: rgba(156, 2, 124, 0.1);
    border: 1px solid rgba(156, 2, 124, 0.2);
    color: #d97fd0;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modern-info:hover {
    background: rgba(156, 2, 124, 0.3);
    border-color: #d97fd0;
    transform: scale(1.05);
}

.btn-modern-info svg {
    width: 14px;
    height: 14px;
}

.btn-modern-secondary {
    background: rgba(239, 239, 229, 0.1);
    border: 1px solid rgba(239, 239, 229, 0.2);
    color: #efefe5;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modern-secondary:hover {
    background: rgba(239, 239, 229, 0.2);
    color: #ffffff;
}

.sat-import-page .table-sat th {
    background: rgba(10, 12, 28, 0.96);
    white-space: nowrap;
    color: rgba(239, 239, 229, 0.8);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 1rem 0.8rem;
}

.sat-import-page .table-sat thead th {
    position: sticky;
    top: 0;
    z-index: 12;
}

.sat-import-page .sticky-col {
    position: sticky;
    left: 0;
    background: rgba(26, 26, 46, 0.98);
    z-index: 10;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
    border-right: 1px solid rgba(156, 2, 124, 0.3);
}

.sat-import-page th.sticky-col {
    background: rgba(15, 15, 35, 1);
    z-index: 13;
}

.sat-import-page tr:hover .sticky-col {
    background: rgba(45, 25, 75, 1) !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 28, 0.4);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    transition: all 0.3s ease;
}

.sat-detail-modal {
    background: linear-gradient(165deg, #1e183f 0%, #110e24 100%);
    border: 1px solid rgba(156, 2, 124, 0.4);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.active .sat-detail-modal {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 1.5rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(156, 2, 124, 0.05);
    border-bottom: 1px solid rgba(156, 2, 124, 0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #d97fd0;
    letter-spacing: 0.02em;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #efefe5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.8rem;
}

.info-content-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(156, 2, 124, 0.15);
    padding: 1.5rem;
    border-radius: 16px;
    line-height: 1.6;
    color: rgba(239, 239, 229, 0.9);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    max-height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.info-content-box::-webkit-scrollbar {
    width: 6px;
}

.info-content-box::-webkit-scrollbar-track {
    background: transparent;
}

.info-content-box::-webkit-scrollbar-thumb {
    background: rgba(156, 2, 124, 0.3);
    border-radius: 10px;
}

.modal-footer {
    padding: 1.2rem 1.8rem 1.8rem;
    text-align: right;
}

/* ===== Tabs manuales mejoradas: sticky headers + sticky columns ===== */
#tab-weekly_int_masivas .table-wrap,
#tab-weekly_expedientes .table-wrap,
#tab-weekly_operativos .table-wrap {
    overflow: auto;
    position: relative;
    border-bottom: 2px solid rgba(156, 2, 124, 0.2);
    border-radius: 0;
}
#tab-weekly_int_masivas .entry-table,
#tab-weekly_expedientes .entry-table,
#tab-weekly_operativos .entry-table {
    border-collapse: separate;
    border-spacing: 0;
}
#tab-weekly_int_masivas .entry-header,
#tab-weekly_expedientes .entry-header,
#tab-weekly_operativos .entry-header {
    margin-bottom: 8px;
}
#tab-weekly_int_masivas .entry-inline-search,
#tab-weekly_expedientes .entry-inline-search,
#tab-weekly_operativos .entry-inline-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 220px;
}
#tab-weekly_int_masivas .entry-inline-search-icon,
#tab-weekly_expedientes .entry-inline-search-icon,
#tab-weekly_operativos .entry-inline-search-icon {
    position: absolute;
    left: 10px;
    color: var(--muted);
    pointer-events: none;
}
#tab-weekly_int_masivas .entry-inline-search-input,
#tab-weekly_expedientes .entry-inline-search-input,
#tab-weekly_operativos .entry-inline-search-input {
    width: 100%;
    min-width: 220px;
    padding: 8px 38px 8px 32px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    color: #fff;
    -webkit-appearance: none;
    appearance: none;
}
#tab-weekly_int_masivas .entry-inline-search-input::-webkit-search-cancel-button,
#tab-weekly_int_masivas .entry-inline-search-input::-webkit-search-decoration,
#tab-weekly_int_masivas .entry-inline-search-input::-webkit-search-results-button,
#tab-weekly_int_masivas .entry-inline-search-input::-webkit-search-results-decoration,
#tab-weekly_expedientes .entry-inline-search-input::-webkit-search-cancel-button,
#tab-weekly_expedientes .entry-inline-search-input::-webkit-search-decoration,
#tab-weekly_expedientes .entry-inline-search-input::-webkit-search-results-button,
#tab-weekly_expedientes .entry-inline-search-input::-webkit-search-results-decoration,
#tab-weekly_operativos .entry-inline-search-input::-webkit-search-cancel-button,
#tab-weekly_operativos .entry-inline-search-input::-webkit-search-decoration,
#tab-weekly_operativos .entry-inline-search-input::-webkit-search-results-button,
#tab-weekly_operativos .entry-inline-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
#tab-weekly_int_masivas .entry-inline-search-input:focus,
#tab-weekly_expedientes .entry-inline-search-input:focus,
#tab-weekly_operativos .entry-inline-search-input:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(0,0,0,0.3);
}
#tab-weekly_int_masivas .entry-inline-search-clear,
#tab-weekly_expedientes .entry-inline-search-clear,
#tab-weekly_operativos .entry-inline-search-clear {
    position: absolute;
    right: 6px;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    padding: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#tab-weekly_int_masivas .entry-inline-search-clear svg,
#tab-weekly_expedientes .entry-inline-search-clear svg,
#tab-weekly_operativos .entry-inline-search-clear svg {
    width: 12px;
    height: 12px;
}
#tab-weekly_int_masivas .entry-add-form,
#tab-weekly_expedientes .entry-add-form,
#tab-weekly_operativos .entry-add-form {
    margin-top: 8px !important;
}
#tab-weekly_int_masivas .entry-add-form .field,
#tab-weekly_expedientes .entry-add-form .field,
#tab-weekly_operativos .entry-add-form .field {
    margin-bottom: 6px;
}
#tab-weekly_int_masivas .entry-add-form label,
#tab-weekly_expedientes .entry-add-form label,
#tab-weekly_operativos .entry-add-form label {
    margin-bottom: 2px;
    font-size: 0.82rem;
}
#tab-weekly_int_masivas .entry-add-form input,
#tab-weekly_int_masivas .entry-add-form select,
#tab-weekly_int_masivas .entry-add-form textarea,
#tab-weekly_expedientes .entry-add-form input,
#tab-weekly_expedientes .entry-add-form select,
#tab-weekly_expedientes .entry-add-form textarea,
#tab-weekly_operativos .entry-add-form input,
#tab-weekly_operativos .entry-add-form select,
#tab-weekly_operativos .entry-add-form textarea {
    padding: 6px 8px;
    min-height: 32px;
}
#tab-weekly_int_masivas .entry-table thead th,
#tab-weekly_int_masivas .entry-table tbody td,
#tab-weekly_expedientes .entry-table thead th,
#tab-weekly_expedientes .entry-table tbody td,
#tab-weekly_operativos .entry-table thead th,
#tab-weekly_operativos .entry-table tbody td {
    padding: 6px 8px;
}
#tab-weekly_int_masivas .entry-table tbody td input,
#tab-weekly_int_masivas .entry-table tbody td select,
#tab-weekly_int_masivas .entry-table tbody td textarea,
#tab-weekly_expedientes .entry-table tbody td input,
#tab-weekly_expedientes .entry-table tbody td select,
#tab-weekly_expedientes .entry-table tbody td textarea,
#tab-weekly_operativos .entry-table tbody td input,
#tab-weekly_operativos .entry-table tbody td select,
#tab-weekly_operativos .entry-table tbody td textarea {
    padding: 4px 6px;
    min-height: 28px;
}
/* Sticky vertical via CSS */
#tab-weekly_int_masivas .entry-table thead th,
#tab-weekly_expedientes .entry-table thead th,
#tab-weekly_operativos .entry-table thead th {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10;
    background: #1a1a2e !important;
    overflow: visible !important;
}
/* Sticky horizontal via JS (transform: translateX) */
#tab-weekly_int_masivas .entry-table th:first-child,
#tab-weekly_int_masivas .entry-table td:first-child,
#tab-weekly_expedientes .entry-table th:first-child,
#tab-weekly_expedientes .entry-table td:first-child,
#tab-weekly_operativos .entry-table th:first-child,
#tab-weekly_operativos .entry-table td:first-child {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    z-index: 20;
    background: #1a1a2e !important;
}
#tab-weekly_int_masivas .entry-table td[data-sticky],
#tab-weekly_int_masivas .entry-table th[data-sticky],
#tab-weekly_expedientes .entry-table td[data-sticky],
#tab-weekly_expedientes .entry-table th[data-sticky],
#tab-weekly_operativos .entry-table td[data-sticky],
#tab-weekly_operativos .entry-table th[data-sticky] {
    z-index: 15;
    background: #1a1a2e !important;
}
#tab-weekly_int_masivas .entry-table thead th:first-child,
#tab-weekly_expedientes .entry-table thead th:first-child,
#tab-weekly_operativos .entry-table thead th:first-child {
    z-index: 30 !important;
}
#tab-weekly_int_masivas .entry-table thead th[data-sticky],
#tab-weekly_expedientes .entry-table thead th[data-sticky],
#tab-weekly_operativos .entry-table thead th[data-sticky] {
    z-index: 25 !important;
}
#tab-weekly_int_masivas .entry-table tbody td:first-child,
#tab-weekly_int_masivas .entry-table tbody td[data-sticky],
#tab-weekly_expedientes .entry-table tbody td:first-child,
#tab-weekly_expedientes .entry-table tbody td[data-sticky],
#tab-weekly_operativos .entry-table tbody td:first-child,
#tab-weekly_operativos .entry-table tbody td[data-sticky] {
    background: rgba(26, 26, 46, 0.97) !important;
}
#tab-weekly_int_masivas .entry-table tbody tr:nth-child(odd) td:first-child,
#tab-weekly_int_masivas .entry-table tbody tr:nth-child(odd) td[data-sticky],
#tab-weekly_expedientes .entry-table tbody tr:nth-child(odd) td:first-child,
#tab-weekly_expedientes .entry-table tbody tr:nth-child(odd) td[data-sticky],
#tab-weekly_operativos .entry-table tbody tr:nth-child(odd) td:first-child,
#tab-weekly_operativos .entry-table tbody tr:nth-child(odd) td[data-sticky] {
    background: rgba(35, 34, 60, 0.97) !important;
}
#tab-weekly_int_masivas .entry-table td:first-child,
#tab-weekly_int_masivas .entry-table td[data-sticky],
#tab-weekly_expedientes .entry-table td:first-child,
#tab-weekly_expedientes .entry-table td[data-sticky],
#tab-weekly_operativos .entry-table td:first-child,
#tab-weekly_operativos .entry-table td[data-sticky] {
    border-right: 1px solid rgba(156, 2, 124, 0.25);
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
}
/* Tbody necesita position: relative para que z-index funcione con transform */
#tab-weekly_int_masivas .entry-table tbody td:first-child,
#tab-weekly_int_masivas .entry-table tbody td[data-sticky],
#tab-weekly_expedientes .entry-table tbody td:first-child,
#tab-weekly_expedientes .entry-table tbody td[data-sticky],
#tab-weekly_operativos .entry-table tbody td:first-child,
#tab-weekly_operativos .entry-table tbody td[data-sticky] {
    position: relative;
}
/* Thead ya tiene position: sticky (inline), no hace falta relative */



.mobile-bottom-nav {
    display: none;
}

.ris-top-toolbar {
    margin-bottom: 1rem;
}

.ris-view-header {
    margin-bottom: 1rem;
}

.ris-export-actions {
    display: flex;
    gap: .45rem;
    align-items: center;
    margin-left: auto;
}

.route-admin_ris .ris-view-header {
    justify-content: flex-start;
}

.route-admin_ris .ris-view-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.route-admin_ris .ris-export-actions {
    margin-left: auto;
    margin-right: 2rem;
    flex: 0 0 auto;
}

.ris-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.ris-filter-fields {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

@media (min-width: 769px) {
    .route-admin_ris .ris-filter-form {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.45rem;
    }

    .route-admin_ris .ris-period-chip {
        flex: 0 0 auto;
        white-space: nowrap;
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .route-admin_ris .ris-filter-fields {
        flex: 1 1 auto;
        min-width: 0;
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center !important;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .route-admin_ris .ris-filter-fields label {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .route-admin_ris .ris-date-input {
        flex: 1 1 150px;
        min-width: 120px;
        max-width: 150px;
    }

    .route-admin_ris .custom-multiselect {
        flex: 0 0 150px;
        min-width: 150px;
        max-width: 150px;
    }

    .route-admin_ris #multiselect-label {
        min-width: 150px !important;
        width: 100% !important;
        height: 34px !important;
    }

    .route-admin_ris .ris-filter-fields button,
    .route-admin_ris .ris-filter-fields .btn,
    .route-admin_ris .ris-filter-fields input[type="submit"] {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

.ris-top-tables-wrap,
.ris-oi-table-wrap,
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .sidebar,
    .sidebar-backdrop,
    .topbar {
        display: none !important;
    }

    .main-wrap,
    .main-wrap.sidebar-collapsed {
        margin-left: 0 !important;
    }

    .content-area {
        padding: 1rem 1rem 6.75rem;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0;
        padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
        background: rgba(10, 12, 28, 0.92);
        backdrop-filter: blur(16px);
        border-top: 1px solid rgba(156, 2, 124, 0.24);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
    }

    .mobile-bottom-nav-item {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.22rem;
        color: rgba(239, 239, 229, 0.72);
        text-decoration: none;
        padding: 0.42rem 0.15rem;
        border-radius: 12px;
        font-size: 0.66rem;
        font-weight: 600;
        text-align: center;
        line-height: 1.05;
    }

    .mobile-bottom-nav-item .nav-icon {
        width: 17px;
        height: 17px;
    }

    .mobile-bottom-nav-item.active {
        color: #fff;
        background: linear-gradient(180deg, rgba(156,2,124,0.34), rgba(66,34,104,0.22));
        box-shadow: inset 0 0 0 1px rgba(156, 2, 124, 0.24);
    }

    .route-admin_ris .panel {
        padding: 1rem 0.95rem 1.1rem;
    }

    .route-admin_ris .ris-top-toolbar {
        margin-bottom: 0.9rem;
    }

    .route-admin_ris .dashboard-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.35rem;
        border-radius: 16px;
    }

    .route-admin_ris .dashboard-tabs .dashboard-tab {
        flex: 1 1 0;
        text-align: center;
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        font-size: 1rem;
    }

    .route-admin_ris .ris-view-header {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 0.9rem !important;
        margin-bottom: 0.8rem;
    }

    .route-admin_ris .ris-view-header > div:first-child {
        width: 100%;
    }

    .route-admin_ris .view-title {
        font-size: clamp(2.05rem, 7.6vw, 2.55rem);
        line-height: 0.98;
        letter-spacing: -0.04em;
    }

    .route-admin_ris .view-subtitle {
        margin-top: 0.85rem;
        margin-bottom: 0;
        max-width: 18ch;
        font-size: 0.96rem;
        line-height: 1.14;
    }

    .route-admin_ris .ris-view-header > div:first-child > div:first-child {
        align-items: center !important;
        gap: 0.55rem !important;
    }

    .route-admin_ris .ris-view-header > div:first-child > div:first-child > a {
        min-height: 38px;
        padding: 0.36rem 0.9rem !important;
        border-radius: 10px !important;
        font-size: 0.82rem !important;
    }

    .route-admin_ris .ris-export-actions {
        margin-left: 0;
        margin-top: 0;
        gap: 0.38rem;
    }

    .route-admin_ris .ris-export-actions button {
        width: 32px !important;
        height: 32px !important;
        border-radius: 9px !important;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    }

    .route-admin_ris .ris-export-actions svg {
        width: 15px !important;
        height: 15px !important;
    }

    .route-admin_ris .ris-filter-form {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem !important;
        align-items: stretch !important;
    }

    .route-admin_ris .ris-period-chip {
        width: 100%;
        text-align: center;
        min-height: 40px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 12px !important;
    }

    .route-admin_ris .ris-filter-fields {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: auto 1fr;
        gap: 0.6rem 0.65rem !important;
        align-items: center !important;
        padding-top: 0.15rem;
    }

    .route-admin_ris .ris-date-input,
    .route-admin_ris .custom-multiselect,
    .route-admin_ris #multiselect-label {
        width: 100% !important;
        min-width: 0 !important;
    }

    .route-admin_ris #multiselect-options {
        width: 100% !important;
    }

    .route-admin_ris .ris-top-tables-wrap,
    .route-admin_ris .ris-oi-table-wrap,
    .route-admin_ris .table-responsive {
        overflow: auto !important;
        max-width: 100%;
        border-radius: 14px;
    }

    .route-admin_ris .ris-top-table,
    .route-admin_ris .ris-oi-table {
        min-width: 880px;
    }

    .route-admin_ris .ris-pager {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 420px) {
    .mobile-bottom-nav {
        grid-template-columns: repeat(6, minmax(56px, 1fr));
        overflow-x: auto;
    }

    .route-admin_ris .ris-filter-form {
        grid-template-columns: 1fr;
    }

    .route-admin_ris .ris-view-header {
        flex-direction: column;
    }

    .route-admin_ris .ris-export-actions {
        width: auto;
        justify-content: flex-start;
        margin-top: 0.1rem;
    }

    .route-admin_ris .view-title {
        font-size: clamp(1.9rem, 9vw, 2.3rem);
    }

    .route-admin_ris .view-subtitle {
        max-width: none;
        font-size: 0.93rem;
    }
}


body.route-admin_ris .content-area,
body.route-admin_art36_ris .content-area,
.ris-top-tables-wrap,
.ris-oi-table-wrap,
.table-responsive,
.table-wrap,
#multiselect-options {
    scrollbar-width: auto;
    scrollbar-color: auto;
    scrollbar-gutter: stable;
}

body.route-admin_ris .content-area,
body.route-admin_art36_ris .content-area {
    overflow-y: scroll !important;
}

.ris-top-tables-wrap,
.ris-oi-table-wrap,
.table-responsive,
.table-wrap {
    scrollbar-gutter: stable both-edges;
}

body.route-admin_ris .content-area::-webkit-scrollbar,
body.route-admin_art36_ris .content-area::-webkit-scrollbar,
.ris-top-tables-wrap::-webkit-scrollbar,
.ris-oi-table-wrap::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
#multiselect-options::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

body.route-admin_ris .content-area::-webkit-scrollbar-track,
body.route-admin_art36_ris .content-area::-webkit-scrollbar-track,
.ris-top-tables-wrap::-webkit-scrollbar-track,
.ris-oi-table-wrap::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
#multiselect-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

body.route-admin_ris .content-area::-webkit-scrollbar-thumb,
body.route-admin_art36_ris .content-area::-webkit-scrollbar-thumb,
.ris-top-tables-wrap::-webkit-scrollbar-thumb,
.ris-oi-table-wrap::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
#multiselect-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    border: 3px solid rgba(16, 16, 26, 0.85);
    box-shadow: none;
}
