@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --text-light: #050505;
    --muted: #666663;
    --line: #e2e8f0;
    
    /* Typography / Font Sizes */
    --fs-2xs: 11px;
    --fs-xs: 11px;
    --fs-sm: 11px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 15px;
    --fs-xl: 17px;
    --fs-2xl: 20px;
    --fs-3xl: 24px;
    --fs-metric: 26px;

    /* Semantic Typography Aliases */
    --font-size-2xs: var(--fs-2xs);
    --font-size-xs: var(--fs-xs);
    --font-size-sm: var(--fs-sm);
    --font-size-base: var(--fs-base);
    --font-size-md: var(--fs-md);
    --font-size-lg: var(--fs-lg);
    --font-size-xl: var(--fs-xl);
    --font-size-2xl: var(--fs-2xl);
    --font-size-3xl: var(--fs-3xl);
    --font-size-table: var(--fs-2xs);
    --font-size-table-header: 11px;
    --report-situation-font-size: 9px;
    --line-height-table-header: 1.15;
    --table-header-text: #fac656;
    
    /* Brand Colors */
    --primary: #043664;
    --primary-dark: #06436d;
    --primary-light: #ccfbf1;
    
    /* Semantic Colors */
    --danger: #e11d48;
    --danger-light: #ffe4e6;
    --warn: #d97706;
    --warn-light: #fef3c7;
    --ok: #059669;
    --ok-light: #d1fae5;
    --info: #2563eb;
    --info-light: #dbeafe;
    --neutral-light: #082f53;
    --neutral-dark: #475569;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 8px -1px rgba(15, 23, 42, 0.02);
    --shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-hero: 0 24px 48px -12px rgba(13, 148, 136, 0.12), 0 0 0 1px rgba(13, 148, 136, 0.02);
    --shadow-btn: 0 8px 16px -4px rgba(13, 148, 136, 0.25);
    
    /* Border Radii */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Medidas compartidas de los botones con texto. */
    --button-height: 32px;
    --button-min-width: 72px;
    --button-padding-y: 5px;
    --button-padding-x: 12px;

    /* Modal overlay: oscurece el contexto sin ocultarlo ni desenfocarlo. */
    --modal-overlay-color: rgba(15, 23, 42, 0.28);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tamaño normalizado para los encabezados de todas las tablas del sistema. */
html body .main table:not(.anexo-table) thead th {
    color: var(--table-header-text) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: var(--line-height-table-header) !important;
}

/* Cuenta contable: impedir que descripciones extensas invadan las cifras vecinas. */
.report-results-card .responsive-table .consolidado-table.report-account-table td:nth-child(3) {
    width: 220px !important;
    min-width: 180px !important;
    max-width: 220px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word;
    text-overflow: clip;
    line-height: 1.35;
    vertical-align: middle;
}

.report-results-card .responsive-table .consolidado-table.report-account-table td:nth-child(n+4):nth-child(-n+7) {
    width: auto !important;
    min-width: 82px !important;
}

.report-results-card .responsive-table .consolidado-table.report-account-table td:nth-child(n+8) {
    width: auto !important;
    min-width: 115px !important;
}

.report-results-card .responsive-table .consolidado-table.report-account-table td:nth-child(11) {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    text-align: center;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 0% 0%, rgba(13, 148, 136, 0.05), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.05), transparent 40%),
        var(--bg);
    color: var(--text);
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    display: grid;
    grid-template-columns: 260px 1fr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: grid-template-columns 0.2s ease;
}

.sidebar {
    background: linear-gradient(180deg, #102a43 0%, #0f2438 100%);
    color: white;
    padding: 22px 16px;
    min-height: 100vh;
    overflow: hidden;
    transition: padding 0.2s ease, opacity 0.15s ease;
}

body.sidebar-collapsed {
    grid-template-columns: 0 1fr;
}

body.sidebar-collapsed .sidebar {
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2dd4bf, #0f766e);
    border-radius: 8px;
    font-weight: 800;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.35);
}

.brand small {
    display: block;
    color: #b8c7d9;
    margin-top: 3px;
}

nav {
    display: grid;
    gap: 6px;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a .nav-icon {
    color: #64748b;
    transition: var(--transition-fast);
    filter: drop-shadow(0 0 1px transparent);
}

nav a.active,
nav a:hover {
    background: rgba(45, 212, 191, 0.08);
    color: #2dd4bf;
    transform: translateX(4px);
    box-shadow: 
        inset 3px 0 0 #2dd4bf,
        0 0 15px rgba(45, 212, 191, 0.08);
    text-shadow: 0 0 8px rgba(45, 212, 191, 0.25);
}

nav a.active .nav-icon,
nav a:hover .nav-icon {
    color: #2dd4bf;
    filter: drop-shadow(0 0 4px #2dd4bf);
}

.sidebar-nav-group {
    margin: 0;
}

.sidebar nav {
    gap: 2px;
}

.sidebar nav .sidebar-nav-item,
.sidebar-nav-group .sidebar-nav-parent {
    min-height: 32px;
    padding: 4px 7px;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #7dd3fc;
    font-size: 12.5px;
    line-height: 1.1;
}

.sidebar nav .sidebar-nav-item.active,
.sidebar nav .sidebar-nav-item:hover {
    border-color: rgba(14, 165, 233, .65);
    background: rgba(14, 165, 233, .10);
    color: #22d3ee;
    box-shadow: none;
    text-shadow: none;
    transform: none;
}

.sidebar-nav-group .sidebar-nav-parent {
    width: 100%;
}

.sidebar-nav-group .sidebar-nav-parent.active,
.sidebar-nav-group .sidebar-nav-parent:hover {
    border-color: rgba(14, 165, 233, .65);
    background: rgba(14, 165, 233, .10);
    color: #22d3ee;
    box-shadow: none;
    transform: none;
}

.sidebar-parent-icon {
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    flex: 0 0 21px;
    border: 1px solid rgba(34, 211, 238, .45);
    border-radius: 5px;
    background: rgba(8, 47, 73, .65);
}

.sidebar-parent-icon .nav-icon {
    width: 12px;
    height: 12px;
    color: #22d3ee;
}

.sidebar-nav-chevron {
    margin-left: auto;
    flex: 0 0 auto;
    color: #38bdf8;
    transition: transform .18s ease;
}

.sidebar-nav-group.expanded .sidebar-nav-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    position: relative;
    margin: 0 0 3px 10px;
    padding: 1px 0 1px 11px;
    border-left: 1px solid rgba(56, 189, 248, .28);
}

.sidebar-nav-group.expanded .sidebar-submenu {
    display: grid;
    gap: 1px;
}

.sidebar-submenu a {
    min-height: 27px;
    padding: 2px 6px;
    gap: 6px;
    border-radius: 8px;
    color: #67e8f9;
    font-size: 11.5px;
    font-weight: 600;
}

.sidebar-submenu a::before {
    display: none;
}

.sidebar-submenu a.active,
.sidebar-submenu a:hover {
    background: rgba(15, 42, 64, .92);
    color: #22d3ee;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .08);
    transform: none;
    text-shadow: none;
}

.sidebar-submenu-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    border: 1px solid rgba(56, 189, 248, .28);
    border-radius: 6px;
    background: rgba(15, 42, 64, .75);
}

.sidebar-submenu-icon svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main {
    padding: 16px;
    min-width: 0;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin: 0 0 12px 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-light);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

.sidebar-toggle-mobile-icon {
    display: none;
}

.sidebar-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.sidebar-toggle-arrow {
    transform-origin: center;
    transition: transform 0.2s ease;
}

body.sidebar-collapsed .sidebar-toggle-arrow {
    transform: rotate(180deg);
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.muted,
.modal-body p.muted,
.report-results-note {
    color: var(--muted);
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

.page-head p {
    margin: 2px 0 0 0;
    font-size: var(--font-size-xs);
    color: var(--muted);
}

h1 {
    margin: 0;
    font-size: 22px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.metric strong {
    display: block;
    font-size: 28px;
    margin-top: 6px;
}

.report-metrics {
    gap: 5px;
}

.grid.report-metrics-main.report-metrics-count-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid.report-metrics-main.report-metrics-count-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-metrics-secondary {
    margin-top: 5px;
}

.report-metrics .card {
    min-height: 46px;
    padding: 6px 9px;
    border-radius: 6px;
}

.report-metrics .metric span {
    display: block;
    font-size: var(--fs-sm);
    line-height: 1.1;
}

.report-metrics .metric strong {
    margin-top: 2px;
    font-size: var(--fs-lg);
    line-height: 1;
}

.cuenta-contable-head {
    margin-bottom: 7px;
}

.cuenta-contable-head h1 {
    font-size: 18px;
}

.cuenta-contable-head p {
    font-size: var(--font-size-xs);
}

.cuenta-contable-tools {
    gap: 8px;
}

.cuenta-contable-tools .card {
    padding: 10px 12px;
}

.cuenta-contable-tools h2 {
    margin: 0 0 4px;
    font-size: var(--fs-md);
}

.cuenta-contable-tools p {
    margin: 0 0 6px;
    font-size: var(--font-size-xs);
}

.cuenta-contable-tools label {
    gap: 2px;
    margin-bottom: 5px;
    font-size: 10.5px;
}

.cuenta-contable-tools input {
    min-height: 28px;
    padding: 4px 7px;
    font-size: var(--fs-xs);
}


.standardized-import {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    margin-bottom: 6px;
}

.standardized-import h2 {
    margin: 0;
    font-size: var(--fs-base);
    font-weight: 700;
    line-height: 1.15;
}

.standardized-import p {
    margin: 1px 0 3px;
    font-size: var(--font-size-xs);
    line-height: 1.15;
}

.import-status {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.1;
}

.import-status.available {
    color: var(--ok);
    background: var(--ok-light);
}

.import-status.locked {
    color: var(--warn);
    background: var(--warn-light);
}

.standardized-import .actions {
    display: flex;
    gap: 6px;
    align-items: center;
}


.standardized-import .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.existencias-filter-panel {
    padding: 6px 12px;
    margin-bottom: 6px;
}

.existencias-filter-grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.8fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(140px, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.existencias-filter-grid label {
    display: grid;
    gap: 2px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-light);
}

.existencias-filter-grid input,
.existencias-filter-grid select {
    height: 28px;
    min-height: 28px;
    padding: 3px 7px;
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
}

.existencias-filter-grid .filter-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}


.existencias-results-panel {
    margin-top: 6px;
}

.inline-search-form {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 0;
}

.inline-search-form > label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.inline-search-form .filter-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.inline-search-form .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--button-height);
    min-height: var(--button-height);
    min-width: var(--button-min-width);
    max-width: 100%;
    justify-self: start;
    flex-shrink: 0;
    padding: var(--button-padding-y) var(--button-padding-x);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: white;
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-sm);
    line-height: 1.2;
    font-weight: 500;
    transition: var(--transition-fast);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
    border-color: var(--muted);
    color: var(--text);
}

.btn.primary {
    background: var(--primary);
    color: #f7cb06;
    border-color: var(--primary);
}

.btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-btn);
}

.btn.secondary {
    background: var(--neutral-light);
    color: #ffffff;
    border-color: var(--line);
}

.btn.secondary:hover {
    background: var(--line);
    color: var(--text);
}

.btn.elevated {
    box-shadow: var(--shadow-btn);
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--primary-dark);
}

.btn.ghost:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn.danger {
    color: white;
    background: var(--danger);
    border-color: var(--danger);
}

/* This block is intentionally blank - table styles are defined at line ~2130 alongside .responsive-table */

form {
    display: grid;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

label {
    display: grid;
    gap: 3px;
    font-size: 12.5px;
    color: #334155;
}

input, select, textarea {
    width: 100%;
    min-height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 8px;
    font: inherit;
    background: white;
}

textarea { min-height: 84px; resize: vertical; }

/* .badge base is defined at line ~2208 with modern pill styles */

.badge.conforme { background: #dcfce7; color: var(--ok); }
.badge.sobrante { background: #e0f2fe; color: var(--info); }
.badge.faltante { background: #fee2e2; color: var(--danger); }
.badge.no_registrado { background: #fef3c7; color: var(--warn); }

.notice {
    padding: 12px 14px;
    border: 1px solid #bae6fd;
    background: #04fa73;
    color: #06198a;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: var(--fs-base);
    line-height: 1.35;
}

.alert {
    font-size: var(--fs-base);
    line-height: 1.35;
}

.notice.error {
    border-color: #fecaca;
    background: #fee2e2;
    color: var(--danger);
    font-size: var(--fs-base);
    font-weight: 700;
}

.notice.inventory-readonly-notice {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e3a8a;
}

.filter-panel {
    border-color: rgba(15, 118, 110, .18);
    background:
        linear-gradient(135deg, rgba(240, 253, 250, .8), rgba(255, 255, 255, .96) 42%),
        var(--panel);
}

.compact-filter {
    padding: 12px;
}

.compact-title {
    margin-bottom: 8px;
    align-items: center;
}

.compact-title h2 {
    font-size: 16px;
    margin: 0;
}

.filter-form {
    gap: 8px;
}

.compact-filter-grid {
    display: grid;
    grid-template-columns: minmax(230px, 1.5fr) minmax(140px, .85fr) minmax(145px, .9fr) minmax(125px, .75fr) minmax(200px, 1.25fr) 100px;
    gap: 8px;
    align-items: end;
}

.inventory-filter-panel:not(.inventory-surplus-filter-panel) .compact-filter-grid {
    grid-template-columns: minmax(220px, 1.8fr) minmax(120px, .8fr) minmax(110px, .8fr) minmax(130px, .8fr) minmax(150px, auto) auto;
}

.inventory-filter-panel .inventory-observation-filter {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    align-self: end;
    gap: 7px;
    min-height: 27px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text-light);
    white-space: nowrap;
    cursor: pointer;
}

.inventory-filter-panel .inventory-observation-filter input[type="checkbox"] {
    width: 15px;
    height: 15px;
    min-height: 0;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.compact-filter-grid label {
    gap: 2px;
    font-size: var(--fs-sm);
}

.compact-filter-grid input,
.compact-filter-grid select {
    min-height: 30px;
    padding: 4px 8px;
}

.compact-filter-grid .filter-actions .btn {
    width: fit-content;
    
    
}

.module-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--neutral-light);
}

.module-tabs a {
    min-height: 32px;
    padding: 7px 14px;
    border-radius: 6px;
    color:#ffffff;
    font-size: var(--fs-base);
    font-weight: 700;
    text-decoration: none;
}

.module-tabs a.active {
    background: #145491;
    box-shadow: var(--shadow-btn);
}

/* Inventario: make the surplus workflow visually distinct from existencias. */
.inventory-tabs-sobrantes {
    border-color: #f0b45d;
    background: #fff7e8;
}

.inventory-tabs .inventory-tab-existencias:not(.active) {
    color: #145491;
    background: #eef5fb;
}

.inventory-tabs .inventory-tab-existencias.active {
    color: #fff;
    background: #145491;
}

.inventory-tabs .inventory-tab-sobrantes:not(.active) {
    color: #9a4d08;
    background: #fff3dc;
}

.inventory-tabs .inventory-tab-sobrantes.active {
    color: #fff;
    background: #c45d0a;
    box-shadow: 0 3px 8px rgba(154, 77, 8, .22);
}

.inventory-surplus-panel {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    box-shadow: inset 4px 0 0 #dc2626, 0 2px 5px rgba(153, 27, 27, .16);
}

.inventory-surplus-panel .section-title h2 {
    color: #991b1b;
}

.inventory-surplus-panel .responsive-table {
    background: #fff;
}

.sobrantes-filter-grid {
    display: grid;
    grid-template-columns: minmax(160px, .55fr) minmax(360px, 1.45fr) 110px;
    gap: 8px;
    align-items: end;
}

.sobrantes-filter-grid label {
    gap: 2px;
    font-size: var(--fs-sm);
}

.sobrantes-filter-grid input,
.sobrantes-filter-grid select {
    min-height: 30px;
    padding: 4px 8px;
}

.sobrantes-table th:nth-child(1),
.sobrantes-table td:nth-child(1) {
    min-width: 130px;
}

.sobrantes-table th:nth-child(2),
.sobrantes-table td:nth-child(2) {
    min-width: 320px;
}

.sobrantes-table th:nth-child(4),
.sobrantes-table td:nth-child(4) {
    width: 104px;
}

.sobrantes-table th:nth-child(7),
.sobrantes-table td:nth-child(7) {
    min-width: 260px;
}

.existencias-search-grid {
    grid-template-columns: minmax(280px, 1fr) 120px;
}

.filter-form .uppercase-fields label:has(input[name="q"]) {
    display: none;
}

.filter-form .uppercase-fields > label:nth-of-type(6) {
    display: none;
}

.inline-count-form {
    display: contents;
}

td input[type="number"] {
    min-width: 96px;
}

.count-input {
    width: 80px;
    min-width: 80px !important;
    text-align: right;
}

.observation-input {
    width: 100%;
    min-width: 260px;
}

.account-picker-cell {
    min-width: 165px !important;
}

.account-picker {
    position: relative;
    min-width: 145px;
}

.account-picker::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 9px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #475569;
    transform: translateY(-35%);
    pointer-events: none;
}

.account-picker-input {
    min-width: 145px;
    padding-right: 26px;
    text-transform: uppercase;
    cursor: text;
}

.account-picker-input:focus {
    border-color: var(--primary);
    outline: 2px solid rgba(7, 137, 141, 0.14);
    outline-offset: 0;
}

.account-picker-menu {
    position: fixed;
    z-index: 1500;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.2);
}

.account-picker-option {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.account-picker-option strong {
    color: var(--primary-dark);
    font-size: var(--fs-sm);
    line-height: 1.2;
}

.account-picker-option span {
    overflow: hidden;
    color: var(--text-light);
    font-size: var(--fs-xs);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-picker-option:hover,
.account-picker-option.active {
    background: var(--primary-light);
}

.account-picker-empty {
    padding: 9px 10px;
    color: var(--muted);
    font-size: var(--fs-xs);
}

.account-picker-hint {
    padding: 9px 10px;
    margin-top: 3px;
    color: var(--muted);
    font-size: var(--font-size-xs);
    border-top: 1px solid var(--line);
}

.consolidado-table {
    table-layout: auto;
}

.consolidado-table th,
.consolidado-table td {
    vertical-align: middle;
    padding: 5px 7px;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.25;
}

.consolidado-table th:nth-child(1),
.consolidado-table td:nth-child(1) {
    width: 140px;
    min-width: 140px;
}

.consolidado-table th:nth-child(2),
.consolidado-table td:nth-child(2) {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.consolidado-table th:nth-child(3),
.consolidado-table td:nth-child(3) {
    min-width: 220px;
}

.consolidado-table th:nth-child(4),
.consolidado-table td:nth-child(4) {
    min-width: 110px;
}

.consolidado-table th:nth-child(5),
.consolidado-table td:nth-child(5),
.consolidado-table th:nth-child(6),
.consolidado-table td:nth-child(6) {
    min-width: 90px;
}

.consolidado-table .price-column,
.consolidado-table .stock-column,
.consolidado-table .count-column {
    width: 82px;
    min-width: 82px;
    white-space: nowrap;
}

.consolidado-table .observation-column {
    min-width: 180px;
}

.consolidado-table.consolidado-numbered th:nth-child(1),
.consolidado-table.consolidado-numbered td:nth-child(1) {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
}

.consolidado-table.consolidado-numbered th:nth-child(2),
.consolidado-table.consolidado-numbered td:nth-child(2) {
    width: 140px;
    min-width: 140px;
}

.consolidado-table.consolidado-numbered th:nth-child(3),
.consolidado-table.consolidado-numbered td:nth-child(3) {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    white-space: nowrap;
}

.consolidado-table.consolidado-numbered th:nth-child(4),
.consolidado-table.consolidado-numbered td:nth-child(4) {
    min-width: 220px;
}

.consolidado-table.consolidado-numbered th:nth-child(5),
.consolidado-table.consolidado-numbered td:nth-child(5) {
    min-width: 110px;
}

.consolidado-table.consolidado-numbered th:nth-child(6),
.consolidado-table.consolidado-numbered td:nth-child(6),
.consolidado-table.consolidado-numbered th:nth-child(7),
.consolidado-table.consolidado-numbered td:nth-child(7) {
    min-width: 90px;
}

.report-account-table th:nth-child(2),
.report-account-table td:nth-child(2) {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
}

.report-account-table th:nth-child(3),
.report-account-table td:nth-child(3) {
    width: 220px;
    min-width: 180px;
    max-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
}

.report-account-table th:nth-child(n+4):nth-child(-n+7),
.report-account-table td:nth-child(n+4):nth-child(-n+7) {
    width: auto;
    min-width: 82px;
}

.consolidado-table.report-account-table th:nth-child(n+8),
.consolidado-table.report-account-table td:nth-child(n+8) {
    width: auto;
    min-width: 115px;
}

.consolidado-table.consolidado-numbered.report-brand-table th:nth-child(1),
.consolidado-table.consolidado-numbered.report-brand-table td:nth-child(1) {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    text-align: center;
}

.consolidado-table.consolidado-numbered.report-brand-table th:nth-child(2),
.consolidado-table.consolidado-numbered.report-brand-table td:nth-child(2) {
    width: auto;
    min-width: 0;
    max-width: none;
    text-align: left;
}

.consolidado-table.consolidado-numbered.report-brand-table th:nth-child(3),
.consolidado-table.consolidado-numbered.report-brand-table td:nth-child(3) {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    text-align: center;
}

.consolidado-table.consolidado-numbered.report-brand-table th:nth-child(4),
.consolidado-table.consolidado-numbered.report-brand-table td:nth-child(4) {
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    text-align: center;
}

.report-brand-detail-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0 auto;
    padding: 2px;
    color: var(--primary-dark);
}

.report-brand-detail-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.report-account-detail-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0 auto;
    padding: 2px;
    color: var(--primary-dark);
}

.report-account-detail-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.modal-content.report-account-detail-modal {
    width: min(94vw, 1000px);
    max-width: 1000px;
}

.report-account-detail-modal .modal-body {
    padding: 14px;
    max-height: 72vh;
    overflow: auto;
}

.report-results-card .report-account-detail-modal .responsive-table {
    scrollbar-gutter: auto;
}

.report-account-items-table th:nth-child(1),
.report-account-items-table td:nth-child(1) {
    width: 48px;
    text-align: center;
}

.report-account-items-table th:nth-child(2),
.report-account-items-table td:nth-child(2) {
    width: 1%;
    white-space: nowrap;
}

.report-account-items-table th:nth-child(3),
.report-account-items-table td:nth-child(3) {
    width: auto;
}

.report-account-items-table th:nth-child(4),
.report-account-items-table td:nth-child(4),
.report-account-items-table th:nth-child(5),
.report-account-items-table td:nth-child(5),
.report-account-items-table th:nth-child(6),
.report-account-items-table td:nth-child(6),
.report-account-items-table th:nth-child(7),
.report-account-items-table td:nth-child(7),
.report-account-items-table th:nth-child(8),
.report-account-items-table td:nth-child(8) {
    width: 1%;
    white-space: nowrap;
}

.report-account-items-table .inventory-status-cell,
.report-account-items-table th:nth-child(8) {
    text-align: center;
}

.report-account-items-table .inventory-status-cell {
    font-weight: 700;
}

.report-account-items-table .inventory-status-cell.is-yes {
    color: #2563eb;
}

.report-account-items-table .inventory-status-cell.is-no {
    color: #dc2626;
}

.inventory-image-view-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.modal-content.inventory-image-modal {
    width: min(96vw, 1040px);
    max-width: 1040px;
}

.inventory-image-modal-body {
    display: grid;
    grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr);
    gap: 10px;
    padding: 10px;
    max-height: 78vh;
}

.inventory-image-item-data {
    display: grid;
    align-content: start;
    gap: 4px;
    overflow-y: auto;
    padding-right: 2px;
}

.inventory-image-item-data p {
    display: grid;
    grid-template-columns: 102px minmax(0, 1fr);
    align-items: start;
    gap: 6px;
    margin: 0;
    padding: 3px 0;
    border-bottom: 1px solid var(--line);
}

.inventory-image-item-data span {
    color: var(--muted);
    font-size: var(--fs-xs);
}

.inventory-image-item-data strong {
    color: var(--text);
    font-size: var(--fs-base);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.inventory-image-preview {
    display: grid;
    place-items: center;
    min-height: 440px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fafc;
}

.inventory-image-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(78vh - 32px);
    object-fit: contain;
}

@media (max-width: 640px) {
    .inventory-image-modal-body {
        grid-template-columns: 1fr;
    }

    .inventory-image-preview {
        min-height: 220px;
    }

    .inventory-image-item-data p {
        grid-template-columns: 1fr;
        gap: 1px;
    }
}

.modal-content.report-brand-detail-modal {
    width: min(92vw, 900px);
    max-width: 900px;
}

.report-brand-detail-modal .modal-body {
    padding: 14px;
    max-height: 72vh;
    overflow: auto;
}

.report-results-card .report-brand-detail-modal .responsive-table {
    scrollbar-gutter: auto;
}

.report-brand-items-table th:nth-child(1),
.report-brand-items-table td:nth-child(1) {
    width: 48px;
    text-align: center;
}

.report-brand-items-table th:nth-child(4),
.report-brand-items-table td:nth-child(4),
.report-brand-items-table th:nth-child(5),
.report-brand-items-table td:nth-child(5) {
    width: 150px;
}

.report-brand-items-table th:nth-child(2),
.report-brand-items-table td:nth-child(2) {
    width: 130px;
}

.report-account-table tbody td:nth-child(3) {
    line-height: 1.4;
}

.report-account-table th:nth-child(n+4),
.report-account-table td:nth-child(n+4) {
    min-width: 105px;
}

.consolidado-table .badge {
    padding: 3px 7px;
    font-size: var(--report-situation-font-size);
    white-space: normal;
}

.inventory-date {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--fs-2xs);
    line-height: 1.2;
    white-space: nowrap;
}

.uppercase-fields input {
    text-transform: uppercase;
}

.filter-actions {
    display: flex;
    align-items: end;
    gap: 6px;
}

.inventory-filter-clear { width:30px; height:30px; min-width:30px; min-height:30px; flex:0 0 30px; }
.inventory-filter-clear svg { display:block; width:15px; height:15px; fill:none; stroke:currentColor; }

.filter-actions .btn {
    width: auto;
    flex: 0 0 auto;
}

.report-filters {
    grid-template-columns: minmax(170px, 1.4fr) minmax(100px, .8fr) minmax(100px, .8fr) minmax(130px, .9fr) auto;
    align-items: end;
    gap: 6px;
    margin-bottom: 10px;
}

.report-filters.report-account-filters {
    grid-template-columns: minmax(170px, 1.4fr) repeat(2, minmax(130px, 1fr)) auto;
}

@media (max-width: 768px) {
    .report-filters.report-account-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .report-filters.report-account-filters { grid-template-columns: minmax(0, 1fr); }
}

.report-filters:has(.report-observation-filter) {
    grid-template-columns: minmax(150px, 1.4fr) minmax(90px, .7fr) minmax(100px, .8fr) minmax(125px, .9fr) auto auto;
}

/* Anexo 6: todos los filtros y acciones se mantienen en una sola fila. */
.report-filters:has(select[name="estado"]) {
    grid-template-columns: minmax(180px, 1.35fr) minmax(145px, 1fr) minmax(120px, .8fr) minmax(130px, .9fr) minmax(125px, .8fr) auto auto;
}

/* Sobrantes: Item, cuenta, situación, almacén, fecha y acciones en una sola fila. */
.report-filters:has(select[name="situacion"]):not(:has(.report-observation-filter)) {
    grid-template-columns: minmax(130px, 1.15fr) minmax(165px, 1.4fr) minmax(135px, 1fr) minmax(105px, .8fr) minmax(125px, .9fr) auto;
}

.report-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-filters label {
    min-width: 0;
    gap: 2px;
    font-size: var(--fs-xs);
}

.report-filters input {
    min-width: 0;
    min-height: 28px;
    padding: 3px 7px;
}

.report-filters .report-observation-filter {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    align-self: end;
    gap: 7px;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text-light);
    white-space: nowrap;
    cursor: pointer;
}

.report-filters .report-observation-filter input[type="checkbox"] {
    width: 15px;
    height: 15px;
    min-height: 0;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.report-filters .btn {
    
    
    white-space: nowrap;
}

@media (min-width: 769px) and (max-width: 1400px) {
    body:has(.report-page-head) {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    body.sidebar-collapsed:has(.report-page-head) {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    body:has(.report-page-head) .sidebar {
        padding-inline: 12px;
    }

    body:has(.report-page-head) .main {
        padding: 10px;
    }

    .report-page-head {
        margin-bottom: 5px;
    }

    .report-page-head h1 {
        font-size: 19px;
    }
.report-tabs a {
        min-height: 28px;
        padding: 4px 9px;
        font-size: var(--fs-sm);
    }

    .report-tabs {
        margin-top: 6px !important;
        padding: 2px;
    }

    .report-metrics-wrap {
        display: grid;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 4px;
    }

    .report-metrics-wrap .report-metrics {
        display: contents;
    }

    .report-metrics-wrap .report-metrics.report-metrics-main {
        display: grid;
        grid-column: 1 / -1;
    }

    .report-metrics-wrap .report-metrics-secondary {
        margin-top: 0;
    }

    .report-metrics-wrap .report-metrics .card {
        min-width: 0;
        min-height: 42px;
        padding: 4px 6px;
    }

    .report-metrics-wrap .report-metrics .metric span {
        overflow: hidden;
        font-size: 9.5px;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .report-metrics-wrap .report-metrics .metric strong {
        margin-top: 2px;
        overflow: hidden;
        font-size: var(--fs-base);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .report-results-card {
        margin-top: 6px;
        padding: 7px 8px;
    }

    .report-results-card .section-title {
        margin-bottom: 5px;
    }

    .report-results-card .section-title h2 {
        font-size: var(--fs-md);
    }

    .report-results-card .section-title p {
        font-size: var(--font-size-xs);
    }

    .report-results-card .section-title .badge {
        font-size: var(--fs-xs);
    }

    .report-results-card .responsive-table {
        scrollbar-gutter: auto;
    }

    .report-results-card .consolidado-table th,
    .report-results-card .consolidado-table td {
        padding: 3px 4px;
        font-size: 11px;
        line-height: 1;
    }

    .report-results-card .consolidado-table.consolidado-numbered th:nth-child(4),
    .report-results-card .consolidado-table.consolidado-numbered td:nth-child(4) {
        min-width: 165px;
    }

    .report-results-card .consolidado-table.consolidado-numbered th:nth-child(5),
    .report-results-card .consolidado-table.consolidado-numbered td:nth-child(5) {
        min-width: 72px;
    }

    .report-results-card .consolidado-table .price-column,
    .report-results-card .consolidado-table .stock-column,
    .report-results-card .consolidado-table .count-column {
        width: 58px;
        min-width: 58px;
    }

    .report-results-card .consolidado-table .observation-column {
        min-width: 105px;
    }

    .report-results-card .consolidado-table.consolidado-numbered th:nth-child(3),
    .report-results-card .consolidado-table.consolidado-numbered td:nth-child(3) {
        width: 86px;
        min-width: 86px;
        max-width: 86px;
    }

    .report-results-card .consolidado-table.consolidado-numbered th:nth-child(6),
    .report-results-card .consolidado-table.consolidado-numbered td:nth-child(6),
    .report-results-card .consolidado-table.consolidado-numbered th:nth-child(7),
    .report-results-card .consolidado-table.consolidado-numbered td:nth-child(7) {
        min-width: 68px;
    }

    .report-results-card .inventory-date {
        margin-top: 2px;
        font-size: 8px;
    }

    .report-results-card .consolidado-table .badge {
        padding: 2px 5px;
        font-size: var(--report-situation-font-size);
    }

    body:has(.inventory-page-head) {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    body.sidebar-collapsed:has(.inventory-page-head) {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    body:has(.inventory-page-head) .sidebar {
        padding-inline: 12px;
    }

    body:has(.inventory-page-head) .main {
        padding: 9px 10px;
    }

    .inventory-page-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 6px;
    }

    .inventory-head-title {
        flex: 0 0 auto;
    }

    .inventory-page-head h1 {
        font-size: 18px;
        line-height: 1.1;
        margin: 0;
    }

    .inventory-page-head p {
        font-size: var(--font-size-xs);
        margin: 2px 0 0;
    }

    .inventory-header-metrics {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin: 0;
        flex: 1 1 auto;
        max-width: 840px;
    }

    .inventory-header-metrics .metric-card {
        min-height: 38px;
        padding: 4px 8px;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .inventory-header-metrics .inventory-metric-value {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 6px;
        width: 100%;
        min-width: 0;
        white-space: nowrap;
    }

    .inventory-header-metrics .metric-card span {
        font-size: 10.5px;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .inventory-header-metrics .metric-card strong {
        margin: 0;
        font-size: var(--fs-md);
        line-height: 1;
        flex: 0 0 auto;
    }

    .inventory-tabs {
        padding: 3px;
    }

    .inventory-tabs a {
        min-height: 27px;
        padding: 4px 10px;
        font-size: 11.5px;
    }

    .inventory-filter-panel {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: end;
        gap: 10px;
        margin-top: 6px;
        padding: 7px 9px;
    }

    .inventory-filter-panel .compact-title {
        margin: 0 0 5px;
        white-space: nowrap;
    }

    .inventory-filter-panel .compact-title h2 {
        font-size: var(--fs-base);
    }

    .inventory-filter-panel .filter-form {
        min-width: 0;
    }

    .inventory-filter-panel .compact-filter-grid {
        grid-template-columns: minmax(155px, 1.4fr) minmax(90px, .75fr) minmax(105px, .85fr) minmax(95px, .75fr) auto;
        gap: 6px;
    }

    .inventory-filter-panel:not(.inventory-surplus-filter-panel) .compact-filter-grid {
        grid-template-columns: minmax(170px, 1.8fr) minmax(105px, .8fr) minmax(90px, .8fr) minmax(105px, .8fr) minmax(150px, auto) auto;
    }

    .inventory-filter-panel .compact-filter-grid label {
        min-width: 0;
        font-size: 10.5px;
    }
.inventory-filter-panel .compact-filter-grid input,
.inventory-filter-panel .compact-filter-grid select {
        min-height: 27px;
        padding: 3px 7px;
        font-size: var(--fs-xs);
    }

    .inventory-register-panel {
        margin-top: 7px;
        padding: 8px;
    }

    .inventory-register-panel .section-title {
        margin-bottom: 5px;
    }

    .inventory-register-panel .section-title h2 {
        font-size: var(--fs-lg);
    }

    .inventory-register-panel .section-title p {
        font-size: var(--font-size-xs);
    }

    .inventory-register-panel .section-title .badge {
        font-size: var(--fs-xs);
    }

    .inventory-register-panel .existencias-table th,
    .inventory-register-panel .existencias-table td {
        padding: 3px 5px;
        font-size: var(--fs-2xs);
        line-height: 1.12;
    }

    .inventory-register-panel .numbered-inventory-table th:nth-child(1),
    .inventory-register-panel .numbered-inventory-table td:nth-child(1) {
        width: 36px;
        min-width: 36px;
        max-width: 36px;
    }

    .inventory-register-panel .numbered-inventory-table th:nth-child(2),
    .inventory-register-panel .numbered-inventory-table td:nth-child(2) {
        width: 95px;
        min-width: 95px;
    }

    .inventory-register-panel .numbered-inventory-table th:nth-child(3),
    .inventory-register-panel .numbered-inventory-table td:nth-child(3) {
        width: auto;
        min-width: 190px;
    }

    .inventory-register-panel .numbered-inventory-table th:nth-child(4),
    .inventory-register-panel .numbered-inventory-table td:nth-child(4) {
        min-width: 88px;
    }

    .inventory-register-panel .numbered-inventory-table th:nth-child(5),
    .inventory-register-panel .numbered-inventory-table td:nth-child(5),
    .inventory-register-panel .numbered-inventory-table th:nth-child(6),
    .inventory-register-panel .numbered-inventory-table td:nth-child(6) {
        min-width: 76px;
    }
}

/* Configuration keys */
.config-wrapper h1 {
    font-size: var(--fs-xl);
}

.config-wrapper h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: var(--fs-md);
}

.config-wrapper,
.config-wrapper input,
.config-wrapper select,
.config-wrapper textarea,
.config-wrapper button {
    font-size: var(--fs-base);
}

.config-wrapper label,
.config-wrapper .muted,
.config-wrapper .btn {
    font-size: var(--fs-sm);
}

.config-wrapper table th,
.config-wrapper table td {
    font-size: var(--fs-base);
}

.config-wrapper table .btn,
.config-wrapper table button:not(.btn),
.config-wrapper table .badge,
.config-wrapper table small {
    font-size: var(--fs-base);
}

.config-logo-help {
    font-size: var(--font-size-xs);
}

.config-logo-initials {
    font-size: var(--fs-3xl);
}

.config-wrapper .card {
    padding: 12px;
}

.config-wrapper .form-grid {
    gap: 8px !important;
    margin-top: 7px !important;
}

.config-wrapper input:not([type="hidden"]):not([type="file"]),
.config-wrapper select {
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.config-wrapper input[type="file"] {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}


.config-wrapper form > .btn {
    margin-top: 10px !important;
}

.config-wrapper .responsive-table th,
.config-wrapper .responsive-table td {
    padding: 5px 8px;
    line-height: 1.2;
}

.config-wrapper > .card {
    margin-top: 12px !important;
}

.config-logo-preview {
    width: 120px !important;
    height: 120px !important;
}

.config-admin-keys {
    margin-top: 12px;
}

.config-admin-keys .responsive-table th,
.config-admin-keys .responsive-table td {
    padding-top: 3px;
    padding-bottom: 3px;
}

.config-admin-keys .config-key-action {
    width: 72px;
    text-align: center;
}

.config-wrapper .config-key-icon-btn {
    width: 27px;
    min-width: 27px;
    height: 27px;
    min-height: 27px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 7px;
}

.config-key-icon-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.config-keys-intro {
    margin-bottom: 16px;
    font-size: var(--fs-sm);
}

.admin-keys-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.config-key-help {
    margin-top: 2px;
    font-size: var(--font-size-xs);
}

.config-keys-submit {
    margin-top: 16px;
}

@media (max-width: 760px) {
    .admin-keys-grid {
        grid-template-columns: 1fr;
    }
}

/* Users module */
.users-page-head {
    margin-bottom: 10px;
}

.users-create-grid {
    display: grid;
}

.role-checkbox-fieldset {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.role-checkbox-fieldset legend {
    padding: 0 4px;
    font-size: var(--fs-xs);
    font-weight: 700;
}

.role-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
}

.role-checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    font-weight: 600;
}

.role-checkbox-grid input[type="checkbox"],
.role-checkbox-grid input[type="radio"] {
    width: 15px;
    height: 15px;
    min-height: 15px;
    margin: 0;
}

.users-table-panel {
    padding-top: 12px;
}

.users-table th,
.users-table td {
    padding: 5px 8px;
    vertical-align: middle;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.25;
}

.users-actions-column {
    width: 106px;
    min-width: 106px;
    white-space: nowrap;
    text-align: center;
}

.users-row-inactive {
    opacity: .68;
}
/* Audit module */
.audit-page-head {
    margin-bottom: 10px;
}

.audit-filter-panel {
    margin-bottom: 12px;
}

.audit-filter-panel h2 {
    margin-bottom: 8px;
}

.audit-filter-grid {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) minmax(140px, .9fr) minmax(135px, .8fr) minmax(190px, 1.25fr) minmax(125px, .75fr) minmax(125px, .75fr) minmax(105px, .65fr);
    gap: 8px;
    align-items: end;
}

.audit-filter-actions {
    gap: 6px;
}

.audit-table-panel {
    padding-top: 12px;
}

.audit-table th,
.audit-table td {
    padding: 5px 8px;
    vertical-align: middle;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.25;
}

.audit-table .badge {
    padding: 2px 6px;
    font-size: var(--fs-2xs);
    font-weight: 600;
}

.audit-date-column {
    width: 148px;
}

.audit-module-column {
    width: 145px;
}

.audit-record-column {
    width: 82px;
}

.audit-action-column {
    width: 145px;
}

.audit-user-column {
    width: 220px;
    min-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* El equipo puede incluir nombre e IP (p. ej. GP360 (::1)); no debe truncarse. */
.audit-table th:last-child,
.audit-table td:last-child {
    width: 280px;
    min-width: 280px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.audit-detail-cell {
    min-width: 240px;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .audit-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .audit-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .audit-filter-actions {
        grid-column: span 2;
    }
}

@media (max-width: 460px) {
    .audit-filter-grid {
        grid-template-columns: 1fr;
    }

    .audit-filter-actions {
        grid-column: auto;
    }
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.pagination-summary {
    color: var(--muted);
    font-size: var(--fs-base);
}

.btn.disabled {
    pointer-events: none;
    opacity: .48;
    box-shadow: none;
}

/* ==========================================================================
   DASHBOARD - HERO SECTION
   ========================================================================== */
.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: center;
    padding: 40px;
    margin-bottom: 32px;
    border: 1px solid rgba(13, 148, 136, 0.15);
    border-radius: var(--radius-lg);
    color: var(--text);
    background: 
        radial-gradient(circle at 100% 0%, rgba(13, 148, 136, 0.12), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.08), transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    box-shadow: var(--shadow-hero);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, rgba(13, 148, 136, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(13, 148, 136, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(circle at 30% 30%, black, transparent 80%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 16px;
    border-radius: 9999px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary-dark);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(13, 148, 136, 0.15);
}

.dashboard-hero h1 {
    font-size: 30px;
    font-weight: 500;
    line-height: 1.15;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #0f172a 30%, #0d9488 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-hero p {
    max-width: 600px;
    margin: 0 0 28px 0;
    color: var(--text-light);
    font-size: var(--font-size-xs);
    line-height: 1.6;
}

.hero-copy .actions {
    display: flex;
    gap: 12px;
}

.btn-icon {
    flex-shrink: 0;
    transition: var(--transition);
}

.btn:hover .btn-icon {
    transform: scale(1.1);
}

.hero-status {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    box-shadow: 
        0 10px 30px -10px rgba(15, 23, 42, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.hero-status:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 35px -10px rgba(15, 23, 42, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.hero-status strong {
    display: block;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text);
}

.hero-status small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.4;
}

/* Dynamic status ring using custom properties */
.status-ring {
    --size: 88px;
    width: var(--size);
    height: var(--size);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--primary-dark);
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.5px;
    background: 
        radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
        conic-gradient(var(--primary) 0 var(--progress-percentage, 0%), #e2e8f0 var(--progress-percentage, 0%) 100%);
    box-shadow: 
        0 8px 16px -4px rgba(13, 148, 136, 0.15),
        inset 0 0 0 1px rgba(13, 148, 136, 0.05);
    transition: var(--transition);
}

/* ==========================================================================
   DASHBOARD - METRICS
   ========================================================================== */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.existencias-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 7px;
    margin-bottom: 8px;
    gap: 5px;
}

.existencias-summary .metric-card {
    min-height: 42px;
    padding: 6px 10px;
    border-radius: 7px;
    justify-content: center;
}

.inventory-metric-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.existencias-summary .metric-card span {
    font-size: var(--fs-sm);
    line-height: 1.1;
}

.existencias-summary .metric-card strong {
    font-size: var(--fs-xl);
    line-height: 1;
    margin: 0;
    flex: 0 0 auto;
}

.existencias-summary .metric-card small {
    font-size: var(--fs-sm);
    line-height: 1.1;
    margin-top: 2px;
}

.metric-card {
    position: relative;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(13, 148, 136, 0.25);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.metric-card span {
    font-size: var(--fs-md);
    font-weight: 600;
}

.metric-icon-wrapper {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    transition: var(--transition);
}

.metric-card:hover .metric-icon-wrapper {
    transform: scale(1.1) rotate(3deg);
}

.metric-card strong {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.metric-card small {
    display: block;
    font-size: var(--fs-sm);
    line-height: 1.4;
}

/* Accent-specific metric designs */
.accent-teal .metric-icon-wrapper {
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary);
}
.accent-teal:hover {
    border-color: rgba(13, 148, 136, 0.3);
}

.accent-blue .metric-icon-wrapper {
    background: rgba(37, 99, 235, 0.1);
    color: var(--info);
}
.accent-blue:hover {
    border-color: rgba(37, 99, 235, 0.3);
}

.accent-amber .metric-icon-wrapper {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warn);
}
.accent-amber:hover {
    border-color: rgba(217, 119, 6, 0.3);
}

.accent-rose .metric-icon-wrapper {
    background: rgba(225, 29, 72, 0.1);
    color: var(--danger);
}
.accent-rose:hover {
    border-color: rgba(225, 29, 72, 0.3);
}

.accent-purple .metric-icon-wrapper {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}
.accent-purple:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

.accent-slate .metric-icon-wrapper {
    background: rgba(71, 85, 105, 0.1);
    color: var(--neutral-dark);
}
.accent-slate:hover {
    border-color: rgba(71, 85, 105, 0.3);
}

/* ==========================================================================
   DASHBOARD - GRID & CARDS
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 20px;
    margin-bottom: 32px;
}

.dashboard-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0 0 20px;
}

.dashboard-priority-card { padding: 20px; }
.dashboard-priority-card .section-title h2 { font-size: var(--fs-base); margin-bottom: 3px; }
.dashboard-priority-card .section-title p { font-size: var(--font-size-xs); }
.dashboard-priority-count { font-size: 32px; font-weight: 800; color: var(--danger, #dc2626); line-height: 1; }
.dashboard-priority-copy { color: var(--muted); font-size: var(--fs-sm); margin: 18px 0 14px; }
.dashboard-alert-list { display: grid; gap: 8px; margin-top: 14px; }
.dashboard-alert-list a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; color: var(--text); background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: var(--fs-sm); }
.dashboard-alert-list a:hover { border-color: var(--primary); color: var(--primary); }
.dashboard-alert-list strong { color: #d97706; font-size: var(--fs-base); }
.dashboard-activity-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 9px; }
.dashboard-activity-list li { border-left: 3px solid var(--primary); padding-left: 9px; display: grid; gap: 2px; min-width: 0; }
.dashboard-activity-list div { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); }
.dashboard-activity-list span, .dashboard-activity-list small { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-link { color: var(--primary); font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

@media (max-width: 980px) {
    .dashboard-priority-grid { grid-template-columns: 1fr; }
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.section-title h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.section-title p {
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin: 0;
}

.report-results-heading {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, auto) auto;
    align-items: center;
}

.report-results-heading h2 {
    margin-bottom: 0;
}

.report-results-heading .report-results-count {
    justify-self: center;
    white-space: nowrap;
}

.report-page-head .report-export-btn {
    width: auto;
    
    
    
    flex: 0 0 auto;
    white-space: nowrap;
    
}

@media (max-width: 760px) {
    .report-results-heading {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .report-results-heading .report-results-count {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        white-space: normal;
    }
}

/* Workflow step progress */
.progress-track {
    height: 8px;
    border-radius: 9999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--info));
    box-shadow: 0 0 12px rgba(13, 148, 136, 0.3);
    width: var(--progress, 0%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.workflow-steps div {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 18px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #f8fafc;
    transition: var(--transition);
    position: relative;
}

.workflow-steps div:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 148, 136, 0.2);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.step-num {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: var(--fs-base);
    transition: var(--transition);
}

.workflow-steps span:last-child {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text-light);
}

/* Workflow Step completed style */
.workflow-steps .done {
    border-color: rgba(5, 150, 105, 0.25);
    background: #f0fdf4;
}

.workflow-steps .done:hover {
    border-color: rgba(5, 150, 105, 0.4);
    background: #ffffff;
}

.workflow-steps .done .step-num {
    background: var(--ok);
    color: white;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2);
}

.workflow-steps .done span:last-child {
    color: var(--ok);
}

/* Latest Inventory Card */
.latest-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.latest-code {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    background: rgba(13, 148, 136, 0.05);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(13, 148, 136, 0.2);
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    font-family: Roboto;
}

.latest-card dl {
    display: grid;
    gap: 12px;
    margin: 0 0 24px 0;
}

.latest-card dl div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.latest-card dl div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.latest-card dt {
    color: var(--muted);
    font-size: var(--fs-base);
    font-weight: 600;
}

.latest-card dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--text);
}

.full-width {
    width: 100%;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
}

.empty-icon {
    color: var(--line);
    margin-bottom: 16px;
    animation: pulse 2s infinite ease-in-out;
}

.empty-state p {
    font-size: var(--fs-base);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   DASHBOARD - RECENT PANEL & TABLES
   ========================================================================== */
.recent-panel {
    margin-top: 32px;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--line);
}

.recent-panel .section-title {
    align-items: center;
}

.responsive-table {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
}

th, td {
    text-align: left;
    padding: 5px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.25;
}

th {
    background: #022d58;
    color: var(--table-header-text);
    font-weight: 700;
}

td {
    color: var(--text-light);
}

tr:last-child td { border-bottom: 0; }

tbody tr {
    transition: background .16s ease;
}

tbody tr:hover {
    background: #f1f5f9;
}

.number-cell {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.quantity-column {
    min-width: 120px;
}

.code-link {
    color: var(--primary-dark);
    font-weight: 700;
    font-family: Roboto, sans-serif;
    font-size: var(--fs-md);
}

.action-btn {
    width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--muted);
    border-color: var(--line);
    background: white;
    transition: var(--transition-fast);
}

.action-btn:hover {
    color: var(--primary-dark);
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.action-btn.danger-action:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.empty-table-row {
    text-align: center !important;
    padding: 40px !important;
    color: var(--muted);
    font-size: var(--fs-md);
}

.empty-icon-table {
    display: block;
    margin: 0 auto 12px;
    color: var(--line);
}

/* Translucent Modern Badges & Pills */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    background: #e2e8f0;
    color: #334155;
}

.badge.status-borrador {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.badge.status-en_conteo {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.badge.status-conciliado {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.badge.status-cerrado {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.result-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    min-height: 18px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.pill.ok {
    background: #ecfdf5;
    color: #065f46;
    border-color: #d1fae5;
}
.pill.ok .pill-dot {
    background: var(--ok);
}

.pill.warn {
    background: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}
.pill.warn .pill-dot {
    background: var(--warn);
}

.pill.neutral {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}
.pill.neutral .pill-dot {
    background: #94a3b8;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 30px;
    }
    .hero-status {
        max-width: 400px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
    .workflow-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .workflow-steps div {
        padding: 12px 8px;
    }
    .hero-copy .actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-copy .actions .btn {
        width: 100%;
    }
    .recent-panel .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .recent-panel .section-title .btn {
        width: 100%;
    }
    .compact-filter-grid {
        grid-template-columns: 1fr;
    }
    .inventory-filter-panel:not(.inventory-surplus-filter-panel) .compact-filter-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-overlay-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--panel, #ffffff);
    border: 1px solid #dbe5ed;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-hover, 0 10px 30px rgba(0,0,0,0.15));
    width: 90%;
    max-width: 440px;
    padding: 0;
    position: relative;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    margin: 0;
    padding: 11px 14px 11px 18px;
    color: #ffffff;
    border: 0;
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
    background: linear-gradient(135deg, #043664 0%, #075b73 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.15px;
}

.modal-header .muted {
    color: rgba(255, 255, 255, .72);
}

.modal-close-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .16);
}

.modal-body {
    padding: 18px 20px 0;
}
.modal-body p {
    margin: 0 0 14px 0;
    color: var(--text-light, #334155);
    font-size: var(--fs-md);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0 20px 18px;
}

/* ==========================================================================
   Inventory module
   ========================================================================== */
/* Module spacing */
.module-section-spacing {
    margin-top: 16px;
}

/* Inventory states and optional item data */
.state-column {
    min-width: 96px;
}

.state-select {
    min-width: 92px;
    padding: 5px 6px;
    font-size: var(--fs-xs);
}

.state-badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: var(--fs-2xs);
    font-weight: 700;
    white-space: nowrap;
}

.state-nuevo {
    background: #dbeafe;
    color: #1d4ed8;
}

.state-bueno {
    background: #dcfce7;
    color: #166534;
}

.state-regular {
    background: #fef3c7;
    color: #92400e;
}

.state-mixto {
    background: #e0e7ff;
    color: #4338ca;
}

.state-malo,
.state-defectuoso, .state-inmovilizado, .state-vencido {
    background: #fee2e2;
    color: #b91c1c;
}

.inventory-save-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.optional-data-button {
    padding: 5px 7px;
    font-size: var(--fs-xs);
    white-space: nowrap;
    border-color: #b91c1c !important;
    background: #dc2626 !important;
    color: #fff !important;
}

.optional-data-button:hover {
    border-color: #991b1b !important;
    background: #b91c1c !important;
}

.optional-data-button.has-optional-data {
    border-color: #991b1b !important;
    background: #b91c1c !important;
    color: #fff !important;
}

.optional-data-status {
    font-weight: 800;
}

.optional-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.optional-fields-grid label {
    display: grid;
    gap: 6px;
    font-size: var(--fs-base);
    font-weight: 600;
}

.optional-data-summary {
    color: #0f766e;
    font-size: var(--fs-xs);
    font-weight: 600;
}

@media (max-width: 640px) {
    .optional-fields-grid {
        grid-template-columns: 1fr;
    }
    .inventory-save-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Surplus row actions and deletion */
.surplus-action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.surplus-action-buttons .action-btn {
    width: 28px;
    height: 28px;
    min-height: 28px;
    border: 1px solid;
    border-radius: 6px;
    box-shadow: none;
}

.inventory-row-action {
    width: 26px;
    height: 26px;
    min-height: 26px;
    border: 1px solid;
    border-radius: 5px;
    box-shadow: none;
}

.inventory-row-action svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
}

.inventory-row-action.inventory-count-action {
    color: #047857;
    border-color: #10b981;
    background: #ecfdf5;
}

.inventory-row-action.inventory-edit-action {
    color: #075985;
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.inventory-row-action.inventory-view-action {
    color: #475569;
    border-color: #94a3b8;
    background: #f8fafc;
}

.inventory-row-action:hover {
    color: #ffffff;
    border-color: var(--primary);
    background: var(--primary);
    transform: none;
    box-shadow: none;
}

.compact-inventory-table .save-column,
.compact-surplus-table .save-column {
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.surplus-action-buttons .action-btn:hover {
    transform: none;
    box-shadow: none;
}

.surplus-action-buttons .surplus-edit-action {
    color: #075985;
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.surplus-action-buttons .surplus-edit-action:hover {
    color: #ffffff;
    border-color: #0284c7;
    background: #0284c7;
}

.surplus-action-buttons .danger-action {
    color: #b91c1c;
    border-color: #ef4444;
    background: #fff1f2;
}

.surplus-action-buttons .danger-action:hover {
    color: #ffffff;
    border-color: #dc2626;
    background: #dc2626;
}

.delete-surplus-modal {
    max-width: 480px;
}

.delete-surplus-warning {
    padding: 10px 12px;
    color: #9f1239 !important;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    background: #fff1f2;
    font-size: var(--fs-sm) !important;
}

.delete-surplus-item {
    margin-bottom: 14px !important;
    color: var(--text) !important;
    font-weight: 700;
}
/* Surplus editing modal */
.edit-surplus-modal {
    max-width: 780px;
}

.edit-surplus-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
}

.edit-surplus-grid label {
    display: grid;
    gap: 5px;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.edit-surplus-grid input, .edit-surplus-grid select, .edit-surplus-grid textarea {
    width: 100%;
}

.edit-surplus-grid textarea {
    min-height: 88px;
    resize: vertical;
}

#modal-editar-noncatalog .inventory-datetime-control {
    flex-wrap: wrap;
    gap: 5px;
}

#modal-editar-noncatalog .inventory-datetime-control > input {
    flex: 1 1 100%;
}

#modal-editar-noncatalog .inventory-datetime-control label {
    white-space: normal;
}

/* En el modal de sobrantes la casilla queda debajo del campo de fecha, dentro de su columna. */
#modal-editar-sobrante .inventory-datetime-control {
    flex-wrap: wrap;
    gap: 5px;
}

#modal-editar-sobrante .inventory-datetime-control > input {
    flex: 1 1 100%;
}

#modal-editar-sobrante .inventory-datetime-control label {
    white-space: normal;
}

#modal-conteo-existencia .inventory-datetime-control {
    flex-wrap: wrap;
    gap: 5px;
}

#modal-conteo-existencia .inventory-datetime-control > input {
    flex: 1 1 100%;
}

#modal-conteo-existencia .inventory-datetime-control label {
    white-space: normal;
}
#modal-editar-noncatalog .noncatalog-observation textarea {
    min-height: 52px;
    height: 52px;
}
.edit-surplus-observation {
    grid-column: span 3;
}

@media (max-width: 760px) {
    .edit-surplus-grid {
        grid-template-columns: 1fr 1fr;
    }
    .edit-surplus-observation {
        grid-column: span 2;
    }
}

@media (max-width: 520px) {
    .edit-surplus-grid {
        grid-template-columns: 1fr;
    }
    .edit-surplus-observation {
        grid-column: auto;
    }
}

/* Compact inventory table and registration modal */
.compact-inventory-table {
    width: 100%;
    table-layout: auto;
}

.compact-inventory-table th, .compact-inventory-table td {
    padding: 5px 7px;
    vertical-align: middle;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.2;
}

.compact-inventory-table th:nth-child(1),
.compact-inventory-table td:nth-child(1) {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    text-align: right;
}

.compact-inventory-table th:nth-child(2),
.compact-inventory-table td:nth-child(2) {
    width: 130px;
    min-width: 100px;
    white-space: nowrap;
}

.compact-inventory-table th:nth-child(3),
.compact-inventory-table td:nth-child(3) {
    width: 28%;
    min-width: 260px;
}

.compact-inventory-table th:nth-child(4),
.compact-inventory-table td:nth-child(4) {
    width: 145px;
    min-width: 130px;
}

.compact-inventory-table th:nth-child(5),
.compact-inventory-table td:nth-child(5) {
    width: 110px;
    min-width: 105px;
}

.compact-inventory-table th:nth-child(6),
.compact-inventory-table td:nth-child(6) {
    width: 125px;
    min-width: 115px;
}

.compact-inventory-table th:nth-child(7),
.compact-inventory-table td:nth-child(7) {
    width: 78px;
    min-width: 72px;
}

.compact-inventory-table th:nth-child(8),
.compact-inventory-table td:nth-child(8) {
    width: 220px;
    min-width: 200px;
}

.compact-inventory-table th:last-child,
.compact-inventory-table td:last-child {
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.inventory-item-name {
    display: block;
    line-height: 1.15;
}

.inventory-item-meta {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 9px;
}

.inventory-status {
    display: inline-flex;
    padding: 2px 5px;
    border-radius: 999px;
    font-size: var(--fs-2xs);
    font-weight: 500;
}

.inventory-status.counted {
    background: #dcfce7;
    color: #166534;
}

.inventory-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.inventory-count-summary {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-sm);
    color: #0541e9;
}

.inventory-row-counted,
.inventory-row-counted td,
.inventory-row-counted > td,
tr.inventory-row-counted,
tr.inventory-row-counted > td,
.main .responsive-table tr.inventory-row-counted,
.main .responsive-table tr.inventory-row-counted > td,
.numbered-inventory-table tr.inventory-row-counted,
.numbered-inventory-table tr.inventory-row-counted > td {
    background-color: rgba(35, 231, 104, 0.32) !important;
    background: rgba(35, 231, 104, 0.32) !important;
}

.inventory-row-counted:hover,
.inventory-row-counted:hover > td,
tr.inventory-row-counted:hover,
tr.inventory-row-counted:hover > td,
.main .responsive-table tr.inventory-row-counted:hover,
.main .responsive-table tr.inventory-row-counted:hover > td,
.numbered-inventory-table tr.inventory-row-counted:hover,
.numbered-inventory-table tr.inventory-row-counted:hover > td {
    background-color: rgba(35, 231, 104, 0.48) !important;
    background: rgba(35, 231, 104, 0.48) !important;
}

.inventory-count-modal {
    max-width: 760px;
}

.inventory-modal-name {
    margin: 0 0 12px;
    font-size: var(--fs-lg);
}

.inventory-detail-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.inventory-detail-grid div {
    min-width: 0;
}

.inventory-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
}

.inventory-detail-grid strong {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-sm);
    overflow-wrap: anywhere;
}

.inventory-count-fields {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
}

.inventory-count-fields label {
    display: grid;
    gap: 5px;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.inventory-count-fields input, .inventory-count-fields select, .inventory-count-fields textarea {
    width: 100%;
}

.inventory-modal-observation {
    grid-column: span 3;
}

.inventory-datetime-control {
    display: flex;
    align-items: center;
    gap: 9px;
}

.inventory-datetime-control > input {
    min-width: 0;
}

.inventory-datetime-control label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: var(--fs-xs);
    font-weight: 600;
}

.inventory-datetime-control label input {
    width: auto;
    min-height: auto;
    margin: 0;
}
/* Mantiene compacto el campo de observaciones del conteo. */
#modal-conteo-existencia .inventory-count-fields textarea {
    min-height: 52px;
    height: 52px;
}

@media (max-width: 800px) {
    .inventory-results-wrap {
        overflow: visible;
    }
    .compact-inventory-table, .compact-inventory-table tbody, .compact-inventory-table tr, .compact-inventory-table td {
        display: block;
        width: 100%;
    }
    .compact-inventory-table thead {
        display: none;
    }
    .compact-inventory-table tr {
        margin-bottom: 10px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(15,23,42,.05);
    }
    .compact-inventory-table td {
        display: grid;
        grid-template-columns: 88px minmax(0,1fr);
        gap: 8px;
        padding: 6px 4px;
        border: 0;
    }
    .compact-inventory-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: var(--fs-2xs);
        font-weight: 700;
        text-transform: uppercase;
    }
    .compact-inventory-table .save-column .btn {
        width: 100%;
    }
    .inventory-detail-grid, .inventory-count-fields {
        grid-template-columns: 1fr 1fr;
    }
    .inventory-modal-observation {
        grid-column: span 2;
    }
}

@media (max-width: 520px) {
    .inventory-detail-grid, .inventory-count-fields {
        grid-template-columns: 1fr;
    }
    .inventory-modal-observation {
        grid-column: auto;
    }
    .compact-inventory-table td {
        grid-template-columns: 76px minmax(0,1fr);
    }
}

/* Compact surplus table and registration modal */
.compact-surplus-table {
    width: 100%;
    table-layout: auto;
}

.compact-surplus-table th, .compact-surplus-table td {
    padding: 5px 7px;
    vertical-align: middle;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.2;
}

.compact-surplus-table th:first-child {
    width: 105px;
}

.compact-surplus-table th:nth-child(3) {
    width: 110px;
}

.compact-surplus-table th:last-child {
    width: 52px;
}

.compact-registered-surplus-table th,
.compact-registered-surplus-table td {
    padding: 3px 4px;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.15;
    vertical-align: middle;
}

.compact-registered-surplus-table .state-column {
    width: 72px;
    text-align: center;
}

.compact-registered-surplus-table .observation-column {
    min-width: 50px;
}

.compact-registered-surplus-table .save-column {
    width: 54px;
    min-width: 54px;
    text-align: center;
}

.surplus-register-modal {
    max-width: 780px;
}

.surplus-register-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
}

.surplus-register-grid label {
    display: grid;
    gap: 5px;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.surplus-register-grid input, .surplus-register-grid select, .surplus-register-grid textarea {
    width: 100%;
}

.surplus-modal-observation {
    grid-column: span 3;
}

@media (max-width: 800px) {
    .surplus-results-wrap {
        overflow: visible;
    }
    .compact-surplus-table, .compact-surplus-table tbody, .compact-surplus-table tr, .compact-surplus-table td {
        display: block;
        width: 100%;
    }
    .compact-surplus-table thead {
        display: none;
    }
    .compact-surplus-table tr {
        margin-bottom: 10px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(15,23,42,.05);
    }
    .compact-surplus-table td {
        display: grid;
        grid-template-columns: 88px minmax(0,1fr);
        gap: 8px;
        padding: 6px 4px;
        border: 0;
    }
    .compact-surplus-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: var(--fs-2xs);
        font-weight: 700;
        text-transform: uppercase;
    }
    .compact-surplus-table .save-column .btn {
        width: 100%;
    }
    .surplus-register-grid {
        grid-template-columns: 1fr 1fr;
    }
    .surplus-modal-observation {
        grid-column: span 2;
    }
}

@media (max-width: 520px) {
    .surplus-register-grid {
        grid-template-columns: 1fr;
    }
    .surplus-modal-observation {
        grid-column: auto;
    }
    .compact-surplus-table td {
        grid-template-columns: 76px minmax(0,1fr);
    }
}

/* Search fields and accounting account picker */
.filter-form input:not([type]), .filter-form input[type="text"], .modal-account-search {
    text-transform: uppercase;
}

.modal-account-picker {
    position: relative;
    min-width: 0;
}

.modal-account-search {
    width: 100%;
    padding-right: 28px;
    background-image: linear-gradient(45deg,transparent 50%,#64748b 50%),linear-gradient(135deg,#64748b 50%,transparent 50%);
    background-position: calc(100% - 15px) 50%,calc(100% - 10px) 50%;
    background-size: 5px 5px,5px 5px;
    background-repeat: no-repeat;
}

.modal-account-options {
    position: absolute;
    z-index: 10020;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15,23,42,.18);
}

.modal-account-picker[data-account-filter] .modal-account-options {
    width: max(100%, min(420px, 50vw));
    left: auto;
    right: 0;
}

.modal-account-picker[data-account-filter] .modal-account-option strong {
    color: var(--primary-dark);
}

.modal-account-option {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.modal-account-option:last-child {
    border-bottom: 0;
}

.modal-account-option:hover, .modal-account-option.active {
    background: #ecfeff;
}

.modal-account-option strong {
    color: #0f8b95;
    font-size: var(--fs-sm);
}

.modal-account-option span {
    font-size: var(--fs-2xs);
    line-height: 1.25;
    text-transform: uppercase;
}

.modal-account-empty {
    padding: 12px;
    color: #64748b;
    font-size: var(--fs-sm);
}
/* ==========================================================================
   DASHBOARD MOBILE REDESIGN
   ========================================================================== */
.notice-icon {
    margin-right: 8px;
    vertical-align: middle;
}

.inline-icon-leading {
    margin-right: 4px;
    vertical-align: middle;
}

.inline-icon-trailing {
    margin-left: 6px;
}

.status-ring {
    position: relative;
    background: #ffffff;
}

.status-ring svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.status-ring circle {
    fill: none;
    stroke-width: 4;
}

.status-ring-track {
    stroke: #e2e8f0;
}

.status-ring-value {
    stroke: var(--primary);
    stroke-linecap: round;
}

.status-ring > strong {
    position: relative;
    z-index: 1;
    color: var(--primary-dark);
    font-size: var(--fs-2xl);
    font-weight: 800;
}

progress.progress-track {
    display: block;
    width: 100%;
    border: 0;
    appearance: none;
}

progress.progress-track::-webkit-progress-bar {
    border-radius: inherit;
    background: #e2e8f0;
}

progress.progress-track::-webkit-progress-value,
progress.progress-track::-moz-progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--info));
}

@media (max-width: 768px) {
    body {
        display: block;
        min-width: 0;
    }

    body:not(.login-page):not(.central-page):not(.sidebar-collapsed)::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 900;
        background: rgba(15, 23, 42, 0.48);
        backdrop-filter: blur(2px);
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1000;
        width: min(84vw, 280px);
        min-height: 100dvh;
        overflow-y: auto;
        transform: translateX(0);
        box-shadow: 20px 0 40px rgba(15, 23, 42, 0.24);
        transition: transform 0.22s ease, opacity 0.18s ease;
    }

    body.sidebar-collapsed .sidebar {
        padding: 22px 16px;
        opacity: 0;
        pointer-events: none;
        transform: translateX(-105%);
    }

    .main {
        width: 100%;
        padding: 58px 12px 20px;
    }

    .sidebar-toggle {
        position: fixed;
        top: 10px;
        right: 12px;
        z-index: 1100;
        width: 40px;
        height: 40px;
        margin: 0;
        background: rgba(255, 255, 255, 0.96);
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 14px;
        padding: 18px;
        border-radius: 14px;
    }

    .eyebrow {
        margin-bottom: 10px;
        padding: 5px 9px;
        font-size: 9px;
    }

    .dashboard-hero h1 {
        margin-bottom: 8px;
        font-size: 25px;
        line-height: 1.15;
    }

    .dashboard-hero p {
        margin-bottom: 18px;
        font-size: var(--font-size-xs);
        line-height: 1.45;
    }

    .hero-copy .actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hero-copy .actions .btn {
        width: 100%;
        
    }

    .hero-status {
        width: 100%;
        max-width: none;
        gap: 12px;
        padding: 12px;
        border-radius: 10px;
    }

    .hero-status:hover,
    .metric-card:hover {
        transform: none;
    }

    .status-ring {
        --size: 62px;
    }

    .status-ring > strong {
        font-size: var(--fs-lg);
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 14px;
    }

    .metric-card {
        min-width: 0;
        min-height: 118px;
        padding: 13px;
        border-radius: 10px;
    }

    .metric-header {
        gap: 6px;
        margin-bottom: 8px;
    }

    .metric-card span {
        font-size: var(--fs-xs);
        line-height: 1.2;
    }

    .metric-icon-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .metric-icon-wrapper svg {
        width: 17px;
        height: 17px;
    }

    .metric-card strong {
        margin-bottom: 5px;
        overflow-wrap: anywhere;
        font-size: 23px;
        letter-spacing: -0.5px;
    }

    .metric-card small {
        font-size: var(--fs-2xs);
        line-height: 1.3;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 14px;
    }

    .workflow-card,
    .latest-card {
        padding: 16px;
    }

    .section-title {
        gap: 8px;
        margin-bottom: 16px;
    }

    .section-title h2 {
        font-size: var(--fs-md);
    }

    .section-title p {
        font-size: var(--font-size-xs);
        line-height: 1.35;
    }

    .progress-track {
        height: 6px;
        margin-bottom: 14px;
    }

    .workflow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .workflow-steps div {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        padding: 10px;
        text-align: left;
    }

    .step-num {
        width: 27px;
        height: 27px;
        flex: 0 0 auto;
    }

    .workflow-steps span:last-child {
        font-size: var(--fs-xs);
    }

    .latest-code {
        margin-bottom: 14px;
        padding: 10px 12px;
        overflow-wrap: anywhere;
        font-size: var(--fs-xl);
    }

    .latest-card dl {
        gap: 9px;
        margin-bottom: 16px;
    }

    .latest-card dl div {
        padding-bottom: 9px;
    }

    .latest-card dt,
    .latest-card dd {
        font-size: var(--fs-sm);
    }

    .recent-panel {
        margin-top: 14px;
        padding: 14px;
        border-radius: 12px;
    }

    .recent-panel .section-title {
        flex-direction: column;
        align-items: stretch;
    }

    .recent-panel .section-title .btn {
        width: 100%;
    }

    .recent-panel .responsive-table {
        overflow: visible;
        border: 0;
        box-shadow: none;
    }

    .recent-panel table,
    .recent-panel tbody,
    .recent-panel tr,
    .recent-panel td {
        display: block;
        width: 100%;
    }

    .recent-panel thead {
        display: none;
    }

    .recent-panel tbody {
        display: grid;
        gap: 10px;
    }

    .recent-panel tr {
        padding: 7px 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    }

    .recent-panel td {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 7px 0;
        border-bottom: 1px solid #eef2f7;
        overflow-wrap: anywhere;
        font-size: var(--fs-xs);
    }

    .recent-panel td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .recent-panel td:last-child {
        border-bottom: 0;
    }

    .recent-panel .result-pills {
        gap: 4px;
    }

    .recent-panel .pill {
        padding: 2px 6px;
        font-size: 9px;
    }

    .recent-panel .empty-table-row {
        display: block;
        padding: 24px 12px !important;
    }
}

@media (max-width: 380px) {
    .main {
        padding-inline: 9px;
    }

    .dashboard-hero {
        padding: 15px;
    }

    .dashboard-hero h1 {
        font-size: 22px;
    }

    .metric-card {
        min-height: 112px;
        padding: 11px;
    }

    .metric-card strong {
        font-size: var(--fs-2xl);
    }

    .recent-panel td {
        grid-template-columns: 68px minmax(0, 1fr);
    }
}
/* ==========================================================================
   MODULE HEADER COMPACT
   ========================================================================== */
.main {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 12px;
    align-content: start;
}

.main > .sidebar-toggle {
    grid-row: 1;
    grid-column: 1;
    margin: 0;
}

.main > .page-head {
    grid-row: 1;
    grid-column: 2;
    min-height: 36px;
    margin: 0 0 12px;
    align-items: center;
}

.main > .page-head h1 {
    font-size: 17px;
    line-height: 1.05;
}

.main > .page-head p {
    font-size: var(--font-size-xs);
    line-height: 1.25;
}

.main > :not(.sidebar-toggle):not(.page-head) {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 40px minmax(0, 1fr);
        column-gap: 10px;
        padding: 12px;
    }

    .main > .sidebar-toggle {
        position: static;
        width: 40px;
        height: 40px;
    }

    .main > .page-head {
        min-height: 40px;
        margin-bottom: 10px;
    }

    .main > .page-head h1 {
        font-size: 16px;
    }

    .main > .page-head p {
        margin-top: 3px;
        font-size: var(--font-size-xs);
    }

    body:not(.sidebar-collapsed) .main > .sidebar-toggle {
        position: fixed;
        top: 10px;
        right: 12px;
        z-index: 1100;
    }
}

@media (max-width: 380px) {
    .main {
        padding: 9px;
    }

    .main > .page-head h1 {
        font-size: 15px;
    }

    .main > .page-head p {
        font-size: var(--font-size-xs);
    }
}
/* ==========================================================================
   CATALOG MODULE
   ========================================================================== */
.catalog-import-panel {
    min-height: 0;
    margin-bottom: 8px;
}

.catalog-tools {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.catalog-search-panel {
    padding: 10px 12px;
}

.catalog-search-panel h2 {
    margin: 0 0 2px;
    font-size: var(--fs-md);
    line-height: 1.2;
}

.catalog-search-description {
    margin: 0 0 7px;
    font-size: var(--font-size-xs);
    line-height: 1.25;
}

.catalog-search-panel .inline-search-form {
    gap: 6px;
}

.catalog-search-panel .inline-search-form > label {
    gap: 2px;
    font-size: var(--fs-xs);
}

.catalog-search-panel input {
    min-height: 30px;
    padding: 4px 8px;
    font-size: var(--fs-xs);
}


.catalog-table-panel {
    padding: 10px 12px;
}

.catalog-table-panel .section-title {
    margin-bottom: 8px;
}

.catalog-table-panel .section-title h2 {
    margin-bottom: 3px;
    font-size: var(--fs-md);
}

.catalog-table-panel .section-title p {
    font-size: var(--font-size-xs);
}

.catalog-table th,
.catalog-table td {
    padding: 4px 8px;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.2;
}

.catalog-table .catalog-code-column,
.catalog-table .catalog-code-cell {
    width: 104px;
    min-width: 104px;
    max-width: 104px;
    white-space: nowrap;
    font-family: Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
}

.catalog-table .catalog-measure-column {
    width: 92px;
    min-width: 92px;
}

.catalog-table .badge {
    padding: 2px 6px;
    font-size: var(--fs-2xs);
}

.pagination {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .catalog-import-panel {
        align-items: flex-start;
    }

    .catalog-import-panel .actions {
        width: 100%;
    }

    .catalog-import-panel .actions .btn {
        flex: 1 1 auto;
    }

    .catalog-search-panel .inline-search-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .catalog-search-panel .inline-search-form > label {
        grid-column: 1 / -1;
    }

    .catalog-table-panel {
        padding: 9px;
    }
}
/* ==========================================================================
   ACCOUNT STATUS ACTIONS
   ========================================================================== */
.cuenta-contable-tools,
.account-table-panel {
    margin-top: 8px;
}

.account-table th {
    padding: 4px 8px;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.1;
}

.account-table td {
    padding: 2px 8px;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.1;
}

.account-table .account-code-column,
.account-table td:first-child {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    white-space: nowrap;
}

.account-table .account-status-column {
    width: 88px;
    min-width: 88px;
    text-align: center;
}

.account-table .account-actions-column {
    width: 72px;
    min-width: 72px;
    text-align: center;
}

.account-status {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}

.account-status.active {
    color: #166534;
    background: #dcfce7;
}

.account-status.inactive {
    color: #991b1b;
    background: #fee2e2;
}

.account-row-inactive {
    background: #f8fafc;
    color: var(--muted);
}

.account-row-inactive td:not(.account-actions-column) {
    opacity: 0.68;
}

.account-action-form {
    display: inline-flex;
    gap: 0;
    margin: 0;
}

.account-action-form .action-btn {
    width: 24px;
    height: 24px;
    min-height: 24px;
    border-width: 1px;
    border-style: solid;
    border-radius: 6px;
    box-shadow: none;
    transform: none;
}

.account-action-form .action-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    shape-rendering: geometricPrecision;
}

.account-action-form .action-btn:hover {
    box-shadow: none;
    transform: none;
}

.account-action-form .action-btn.danger-action {
    color: #b91c1c;
    border-color: #dc2626;
    background: #fff1f2;
}

.account-action-form .action-btn.danger-action:hover {
    color: #7f1d1d;
    border-color: #ef4444;
    background: #fecaca;
}

.action-btn.restore-action {
    color: #047857;
    border-color: #059669;
    background: #ecfdf5;
}

.action-btn.restore-action:hover {
    color: #ffffff;
    border-color: var(--ok);
    background: var(--ok);
}

/* Login and session */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.login-page {
    display: block;
    min-width: 0;
    min-height: 100vh;
    background: linear-gradient(110deg, #0e2436, #1b3042);
    color: #122e50;
}

body.central-page { display: block; min-width: 0; }
.central-shell { width: min(1180px, 100%); margin: 0 auto; padding: 20px; }
.central-header, .central-heading, .central-account, .central-nav, .central-entity-options, .central-form-actions { display: flex; align-items: center; gap: 10px; }
.central-header { justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.central-brand { color: var(--primary); border-right: 1px solid var(--line); padding-right: 13px; font-size: var(--fs-xl); font-weight: 800; }
.central-heading h1 { margin: 0; font-size: var(--fs-xl); }
.central-heading p { margin: 4px 0 0; color: var(--neutral-dark); font-size: var(--fs-sm); }
.central-account { flex-wrap: wrap; font-size: var(--fs-xs); }
.central-account form { margin: 0; }
.central-page .btn { font-size: var(--fs-xs); }
.central-nav { gap: 20px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.central-nav a { display: inline-flex; padding: 9px 2px; border-bottom: 2px solid transparent; border-radius: 0; color: var(--neutral-dark); font-size: var(--fs-base); font-weight: 600; text-decoration: none; }
.central-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.central-nav a:hover, .central-edit-link:hover { text-decoration: underline; }
.card.central-panel { padding: 0; overflow: hidden; }
.central-section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.central-section-header h2 { margin: 0; color: var(--primary); font-size: var(--fs-base); font-weight: 700; }
.central-section-header span, .central-note { color: var(--neutral-dark); font-size: var(--fs-xs); line-height: 1.4; }
.central-panel-body { padding: 12px; }
.central-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.central-form label { font-size: var(--fs-xs); font-weight: 600; }
.central-form input { width: 100%; min-width: 0; border-color: #526a84; font-size: .8rem; font-weight: 400; }
.central-form input[readonly] { background: var(--bg); }
.central-form .central-note { font-weight: 400; }
.central-form-actions { flex-wrap: wrap; padding-top: 11px; margin: 11px 0 8px; border-top: 1px solid var(--line); }
.central-check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); }
.central-check input { width: auto; min-height: 0; }
.central-entity-options { justify-content: space-between; flex-wrap: wrap; margin: 8px 0 12px; }
.central-connection { margin: 0 0 11px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.central-connection legend { padding: 0 5px; color: var(--primary); font-size: var(--fs-xs); font-weight: 600; }
.central-identity-fields { grid-template-columns: 5fr 7fr; }
.central-connection-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.central-db-host { grid-column: span 8; }
.central-db-port { grid-column: span 4; }
.central-db-database, .central-db-username { grid-column: span 6; }
.central-db-password { grid-column: 1 / -1; }
.central-table { width: 100%; overflow-x: auto; }
.central-table table { min-width: 560px; margin: 0; }
.central-meta { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: var(--fs-xs); color: var(--neutral-dark); }
.central-table td { overflow-wrap: anywhere; }
.central-row-selected td { background: var(--bg); }
.central-status { display: inline-block; white-space: nowrap; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--primary); font-size: var(--fs-xs); }
.central-status--disabled { color: var(--neutral-dark); background: var(--panel); }
.central-edit-link { position: relative; display: inline-flex; align-items: center; min-height: 24px; color: var(--primary); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; white-space: nowrap; }
.central-list-note { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--neutral-dark); font-size: var(--fs-xs); }
.central-message { padding: 12px 16px; color: #065f46; background: var(--ok-light); border-radius: var(--radius-sm); }
.central-security { max-width: 900px; }
.central-editor { padding: 16px; }
.modal-content.central-editor-content { width: min(600px, 100%); max-width: 600px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 9px; }
.central-editor .modal-header { min-height: 34px; padding: 5px 12px; border-radius: 9px 9px 0 0; background: #071b3a; }
.central-editor .modal-header h2 { margin: 0; color: var(--table-header-text); font-size: var(--fs-md); }
.central-editor .modal-close-btn { width: 24px; height: 24px; border: 0; border-radius: 50%; font-size: 18px; background: var(--primary); }
.central-editor .modal-body { padding: 14px 16px; overflow-y: auto; min-height: 0; }
.central-editor .modal-body p.central-note { margin: 0 0 8px; color: var(--neutral-dark); font-size: var(--fs-xs); line-height: 1.4; }
.central-editor .modal-footer { justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
.central-page :is(a, button, input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    .central-editor-content { animation: none; }
}
@media (max-width: 575px) {
    .central-account { width: 100%; justify-content: space-between; }
    .central-heading { gap: 8px; }
    .central-shell { padding: 16px 12px; }
    .central-identity-fields { grid-template-columns: 1fr; }
    .central-db-database, .central-db-username { grid-column: 1 / -1; }
}
.central-login-form > label { gap: 5px; color: #122e50; font-size: .8rem; line-height: 19.2px; }
.central-login-card .login-footer a { margin-top: 0; font-size: .69rem; }

.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 28px 20px;
}

.login-card {
    position: relative;
    width: min(420px, 100%);
    padding: 28px 28px 24px;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(5, 18, 31, .12);
}

.login-brand-icon {
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    color: #0075ad;
    border: 0;
}

.login-brand-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-heading {
    margin: 0 0 28px;
    text-align: center;
}

.login-heading h1 {
    margin: 0 0 18px;
    color: #122e50;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.65px;
}

.login-heading p {
    margin: 0;
    color: #50709a;
    font-size: .92rem;
    line-height: 20px;
}

.login-error {
    margin: -10px 0 14px;
    padding: 9px 11px;
    color: #9f1239;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    background: #fff1f2;
    font-size: var(--fs-sm);
    line-height: 1.4;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    height: 44px;
    gap: 0;
    padding: 0;
    color: #006d8f;
    border: 1px solid #526a84;
    border-radius: 7px;
    background: #e8effc;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.login-field:focus-within {
    border-color: #0089c8;
    box-shadow: 0 0 0 3px rgba(0, 137, 200, .12);
}

.login-field > svg {
    flex: 0 0 auto;
    margin-left: 12px;
    margin-right: 13px;
}

.login-field input,
.login-field select,
.login-field input[type='password'],
.login-field input[type='text'] {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 12px 12px 12px 0;
    color: #111820;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
    font-size: .8rem;
    line-height: 18px;
    font-weight: 400;
    text-transform: none;
}

.login-field input::placeholder {
    color: #475569;
    opacity: 1;
}

.login-field select {
    padding-left: 12px;
}

.login-password-toggle {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #0088b0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.login-submit {
    width: 100%;
    height: 40px;
    margin-top: 12px;
    color: #ffd500;
    border: 1px solid #102f4f;
    border-radius: 7px;
    background: #102f4f;
    font-size: .8rem;
    line-height: 18px;
    font-weight: 800;
    letter-spacing: normal;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.login-submit:hover,
.login-submit:focus-visible {
    color: #ffd500;
    background: #19466f;
    box-shadow: 0 0 0 3px rgba(16, 47, 78, .15);
}

.login-footer {
    margin-top: 31px;
    padding-top: 24px;
    text-align: center;
    border-top: 1px solid #d8e2f0;
}

.login-footer p,
.login-footer a,
.login-footer .login-version {
    display: block;
    margin: 0;
    color: #50709a;
    font-size: .69rem;
    line-height: 18px;
}

.login-footer a {
    margin-top: 16px;
    color: #006d8f;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.login-footer a:hover,
.login-footer a:focus-visible {
    text-decoration: underline;
}

.login-footer .login-services {
    color: #122e50;
}

.login-footer .login-version {
    margin-top: 14px;
    color: #475569;
    line-height: 16px;
}

.sidebar-user {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 10px 12px;
    background: rgba(15, 36, 56, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #06243a;
    border-radius: 50%;
    background: linear-gradient(135deg, #2dd4bf, #0f766e);
    font-size: var(--fs-base);
    font-weight: 800;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-info strong,
.sidebar-user-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info strong {
    color: #f8fafc;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-user-info span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10.5px;
    line-height: 1.2;
}

.sidebar-logout-form {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logout {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-logout:hover {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.15);
    box-shadow: none;
    transform: none;
}

@media (max-width: 480px) {
    .login-shell {
        padding: 20px 16px;
    }

    .login-card {
        padding: 24px 22px 22px;
    }

    .login-brand-icon {
        width: 88px;
        height: 88px;
        margin-bottom: 18px;
    }

    .login-heading {
        margin-bottom: 24px;
    }

    .login-heading h1 {
        font-size: 1.12rem;
        margin-bottom: 14px;
    }

    .login-footer {
        margin-top: 24px;
        padding-top: 20px;
    }
}

@media (max-height: 620px) {
    .login-shell {
        align-items: start;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .login-brand-icon {
        width: 76px;
        height: 76px;
        margin-bottom: 14px;
    }

    .login-heading {
        margin-bottom: 20px;
    }

    .login-heading h1 {
        margin-bottom: 12px;
    }

    .login-footer {
        margin-top: 20px;
        padding-top: 16px;
    }
}
/* Dashboard minimal refresh */
.dashboard-hero-minimal {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
    gap: 24px;
    min-height: 220px;
    margin-bottom: 14px;
    padding: 26px 28px;
    color: #f8fafc;
    border: 0;
    border-radius: 15px;
    background:
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, .24), transparent 30%),
        linear-gradient(125deg, #062b4b 0%, #073c58 58%, #075769 100%);
    box-shadow: 0 18px 36px -24px rgba(3, 42, 70, .72);
    backdrop-filter: none;
}

.dashboard-hero-minimal::before {
    inset: auto -65px -95px auto;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    background: transparent;
    mask-image: none;
}

.dashboard-hero-minimal .eyebrow {
    margin-bottom: 11px;
    padding: 5px 9px;
    color: #99f6e4;
    border-color: rgba(153, 246, 228, .24);
    background: rgba(45, 212, 191, .1);
    font-size: 9px;
    letter-spacing: 1.3px;
}

.dashboard-hero-minimal h1 {
    max-width: 700px;
    margin-bottom: 9px;
    color: #fff;
    background: none;
    font-size: clamp(20px, 3vw, 30px);
    line-height: 1.08;
    letter-spacing: -.8px;
    -webkit-text-fill-color: currentColor;
}

.dashboard-hero-minimal p {
    max-width: 620px;
    margin-bottom: 20px;
    color: #bfd4df;
    font-size: var(--font-size-xs);
    line-height: 1.5;
}

.dashboard-hero-minimal .hero-copy .actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.dashboard-hero-minimal .btn {
    
    
    border-radius: 8px;
    
}

.dashboard-hero-minimal .btn.primary {
    color: #062b4b;
    border-color: #5eead4;
    background: #5eead4;
    box-shadow: 0 8px 18px -10px rgba(94, 234, 212, .75);
}

.dashboard-hero-minimal .btn.ghost {
    color: #e2f7f5;
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .07);
}

.dashboard-hero-minimal .hero-status {
    gap: 20px;
    min-height: 126px;
    padding: 20px 22px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    background: rgba(2, 28, 46, .32);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.dashboard-hero-minimal .hero-status:hover {
    transform: none;
    box-shadow: none;
}

.dashboard-hero-minimal .hero-status > div > strong {
    color: #fff;
    font-size: var(--fs-xl);
}

.dashboard-hero-minimal .hero-status small {
    color: #b9d2dc;
    font-size: var(--fs-base);
    line-height: 1.45;
}

.dashboard-hero-minimal .status-ring {
    --size: 96px;
    color: #fff;
    background: transparent;
    box-shadow: none;
}

.dashboard-hero-minimal .status-ring-track {
    stroke: rgba(255, 255, 255, .18);
}

.dashboard-hero-minimal .status-ring-value {
    stroke: #5eead4;
}

.dashboard-hero-minimal .status-ring > strong {
    color: #fff;
    font-size: 19px;
    letter-spacing: -.4px;
}

.dashboard-metrics-minimal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-metrics-minimal .metric-card {
    min-height: 116px;
    padding: 14px 15px;
    border-color: #e5edf3;
    border-radius: 10px;
    box-shadow: 0 8px 24px -22px rgba(15, 23, 42, .7);
}

.dashboard-metrics-minimal .metric-card:hover {
    border-color: #c9d9e5;
    transform: none;
    box-shadow: 0 10px 26px -22px rgba(15, 23, 42, .8);
}

.dashboard-metrics-minimal .metric-header {
    margin-bottom: 7px;
}

.dashboard-metrics-minimal .metric-card span {
    color: #526579;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.dashboard-metrics-minimal .metric-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.dashboard-metrics-minimal .metric-icon-wrapper svg {
    width: 17px;
    height: 17px;
}

.dashboard-metrics-minimal .metric-card:hover .metric-icon-wrapper {
    transform: none;
}

.dashboard-metrics-minimal .metric-card > strong {
    margin-bottom: 4px;
    color: #0b253c;
    font-size: 27px;
    line-height: 1;
    letter-spacing: -.7px;
}

.dashboard-metrics-minimal .metric-card small {
    color: #718096;
    font-size: 10.5px;
}

.dashboard-grid {
    gap: 12px;
    margin-bottom: 14px;
}

.workflow-card,
.latest-card,
.recent-panel {
    border-color: #e5edf3;
    box-shadow: 0 8px 26px -24px rgba(15, 23, 42, .72);
}

.workflow-card,
.latest-card {
    padding: 15px;
}

.workflow-card .section-title,
.latest-card .section-title,
.recent-panel .section-title {
    margin-bottom: 13px;
}

progress.progress-track {
    height: 6px;
    margin-bottom: 18px;
}

.recent-panel {
    padding: 15px;
}

.recent-panel th,
.recent-panel td {
    padding-top: 7px;
    padding-bottom: 7px;
}

@media (max-width: 960px) {
    .dashboard-hero-minimal {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .dashboard-metrics-minimal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .dashboard-hero-minimal {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 20px;
    }

    .dashboard-hero-minimal .hero-status {
        width: 100%;
    }

    .dashboard-hero-minimal .hero-copy .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .dashboard-hero-minimal .hero-copy .actions .btn {
        width: 100%;
        
        white-space: nowrap;
    }
}

@media (max-width: 430px) {
    .dashboard-hero-minimal {
        padding: 17px;
        border-radius: 12px;
    }

    .dashboard-hero-minimal h1 {
        font-size: 25px;
    }

    .dashboard-hero-minimal .hero-copy .actions {
        gap: 6px;
    }


    .dashboard-hero-minimal .hero-copy .actions .btn-icon {
        width: 15px;
        height: 15px;
    }

    .dashboard-metrics-minimal {
        gap: 7px;
    }

    .dashboard-metrics-minimal .metric-card {
        min-height: 108px;
        padding: 12px;
    }

    .dashboard-metrics-minimal .metric-card > strong {
        font-size: 23px;
    }
}
/* Mobile tables: preserve the tabular layout and allow horizontal scrolling. */
@media screen and (max-width: 800px) {
    .main .responsive-table,
    .main .inventory-results-wrap,
    .main .surplus-results-wrap {
        display: block !important;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        border: 1px solid var(--line);
        border-radius: 10px;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    .main .responsive-table table {
        display: table !important;
        width: max-content !important;
        min-width: 100%;
        table-layout: auto;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .main .responsive-table thead {
        display: table-header-group !important;
    }

    .main .responsive-table tbody {
        display: table-row-group !important;
    }

    .main .responsive-table tr {
        display: table-row !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent;
        box-shadow: none !important;
    }

    .main .responsive-table th,
    .main .responsive-table td {
        display: table-cell !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 200px !important;
        padding: 4px 6px;
        border-bottom: 1px solid var(--line) !important;
        vertical-align: middle;
        font-size: var(--fs-2xs) !important;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .main .responsive-table th {
        font-size: var(--font-size-table-header) !important;
    }

    .main .responsive-table td[colspan] {
        max-width: none !important;
    }

    .main .responsive-table input,
    .main .responsive-table select,
    .main .responsive-table textarea,
    .main .responsive-table button,
    .main .responsive-table .btn,
    .main .responsive-table .badge {
        font-size: var(--fs-2xs) !important;
    }

    .main .responsive-table input,
    .main .responsive-table select,
    .main .responsive-table textarea,
    .main .responsive-table .account-picker,
    .main .responsive-table .account-picker-input,
    .main .responsive-table .observation-input {
        min-width: 0 !important;
        max-width: 180px;
    }

    .main .responsive-table td::before {
        display: none !important;
        content: none !important;
    }

    .main .responsive-table .save-column .btn {
        width: auto !important;
    }
}

@media print {
    .anexo-table-scroll {
        overflow: visible !important;
        border: 0 !important;
    }
}
/* Mobile panels: use nearly the full viewport width. */
@media screen and (max-width: 768px) {
    .main {
        padding: 8px 4px 14px;
        column-gap: 6px;
    }

    .main .card {
        padding: 10px;
    }

    .main .responsive-table {
        margin-left: 0;
        margin-right: 0;
    }

    .grid.cols-2.config-top-panels {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* Mobile navigation: fixed hamburger button in the top-right corner. */
@media screen and (max-width: 768px) {
    .main {
        grid-template-columns: minmax(0, 1fr);
    }

    .main > .page-head {
        grid-column: 1 / -1;
        padding-right: 48px;
    }

    .main > .sidebar-toggle,
    body:not(.sidebar-collapsed) .main > .sidebar-toggle {
        position: fixed;
        top: 8px;
        right: 8px;
        z-index: 1100;
        width: 40px;
        height: 40px;
        margin: 0;
        border-radius: 9px;
        background: rgba(255, 255, 255, .96);
    }

    .sidebar-toggle-desktop-icon {
        display: none;
    }

    .sidebar-toggle-mobile-icon {
        display: block;
    }
}
/* Dashboard metrics: high-impact visual treatment. */
.dashboard-metrics-minimal .metric-card {
    --metric-color: #0d9488;
    --metric-rgb: 13, 148, 136;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 132px;
    padding: 17px 18px;
    border: 1px solid rgba(var(--metric-rgb), .22);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(var(--metric-rgb), .07)),
        #ffffff;
    box-shadow:
        0 14px 32px -24px rgba(15, 23, 42, .75),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}

.dashboard-metrics-minimal .metric-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--metric-color) 20%, var(--metric-color) 80%, transparent);
    box-shadow: 0 0 16px rgba(var(--metric-rgb), .45);
}

.dashboard-metrics-minimal .metric-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -58px;
    right: -48px;
    width: 138px;
    height: 138px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--metric-rgb), .2), rgba(var(--metric-rgb), 0) 68%);
    transition: transform .3s ease, opacity .3s ease;
}

.dashboard-metrics-minimal .metric-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--metric-rgb), .48);
    box-shadow:
        0 22px 42px -24px rgba(var(--metric-rgb), .5),
        0 12px 24px -20px rgba(15, 23, 42, .85),
        inset 0 1px 0 #ffffff;
}

.dashboard-metrics-minimal .metric-card:hover::after {
    opacity: .9;
    transform: scale(1.18);
}

.dashboard-metrics-minimal .metric-header {
    position: relative;
    z-index: 1;
    align-items: center;
    margin-bottom: 12px;
}

.dashboard-metrics-minimal .metric-card span {
    color: #34475b;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .65px;
}

.dashboard-metrics-minimal .metric-icon-wrapper {
    width: 38px;
    height: 38px;
    color: var(--metric-color);
    border: 1px solid rgba(var(--metric-rgb), .2);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(var(--metric-rgb), .18), rgba(var(--metric-rgb), .06));
    box-shadow: 0 8px 16px -10px rgba(var(--metric-rgb), .8);
    transition: transform .24s ease, box-shadow .24s ease;
}

.dashboard-metrics-minimal .metric-card:hover .metric-icon-wrapper {
    transform: translateY(-2px) scale(1.08) rotate(3deg);
    box-shadow: 0 12px 22px -10px rgba(var(--metric-rgb), .8);
}

.dashboard-metrics-minimal .metric-card > strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: 7px;
    color: var(--metric-color);
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 900;
    line-height: .95;
    letter-spacing: -1.2px;
    text-shadow: 0 8px 18px rgba(var(--metric-rgb), .16);
}

.dashboard-metrics-minimal .metric-card small {
    position: relative;
    z-index: 1;
    display: block;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.35;
}

.dashboard-metrics-minimal .accent-teal {
    --metric-color: #0d9488;
    --metric-rgb: 13, 148, 136;
}

.dashboard-metrics-minimal .accent-rose {
    --metric-color: #e11d48;
    --metric-rgb: 225, 29, 72;
}

.dashboard-metrics-minimal .accent-purple {
    --metric-color: #7c3aed;
    --metric-rgb: 124, 58, 237;
}

.dashboard-metrics-minimal .accent-blue {
    --metric-color: #2563eb;
    --metric-rgb: 37, 99, 235;
}

.dashboard-metrics-minimal .accent-amber {
    --metric-color: #d97706;
    --metric-rgb: 217, 119, 6;
}

.dashboard-metrics-minimal .accent-slate {
    --metric-color: #475569;
    --metric-rgb: 71, 85, 105;
}

@media screen and (max-width: 768px) {
    .dashboard-metrics-minimal .metric-card {
        min-height: 118px;
        padding: 13px 12px;
        border-radius: 12px;
    }

    .dashboard-metrics-minimal .metric-header {
        margin-bottom: 9px;
    }

    .dashboard-metrics-minimal .metric-icon-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .dashboard-metrics-minimal .metric-card > strong {
        margin-bottom: 5px;
        font-size: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-metrics-minimal .metric-card,
    .dashboard-metrics-minimal .metric-card::after,
    .dashboard-metrics-minimal .metric-icon-wrapper {
        transition: none;
    }
}
/* Mobile inventory rows: preserve the counted-state highlight. */
@media screen and (max-width: 800px) {
    .main .responsive-table tr.inventory-row-counted,
    .main .responsive-table tr.inventory-row-counted > td {
        background: rgba(35, 231, 104, .32) !important;
    }
}
/* Table row focus: light red hover on pointer devices. */
@media (hover: hover) and (pointer: fine) {
    .main .responsive-table tbody tr:not(.inventory-row-counted):hover,
    .main .responsive-table tbody tr:not(.inventory-row-counted):hover > td {
        background: #fecaca !important;
    }
}
/* Direct page selector for every paginated table. */
.pagination-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: var(--fs-sm);
    white-space: nowrap;
}

.pagination-jump select {
    width: auto;
    min-width: 58px;
    min-height: 32px;
    padding: 4px 24px 4px 9px;
    color: var(--text);
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background-color: #ffffff;
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
}

.pagination-jump select:focus {
    outline: 2px solid rgba(13, 148, 136, .18);
    border-color: var(--primary-dark);
}

@media screen and (max-width: 520px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 7px;
    }

    .pagination-jump {
        order: -1;
        width: 100%;
        justify-content: center;
    }
}
/* Apertura/Cierre: tarjetas para una lectura y operaciÃ³n cÃ³modas en celular. */
@media screen and (max-width: 800px) {
    .main .responsive-table.apertura-cierre-table {
        overflow: visible !important;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .main .responsive-table.apertura-cierre-table table,
    .main .responsive-table.apertura-cierre-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0;
    }

    .main .responsive-table.apertura-cierre-table thead {
        display: none !important;
    }

    .main .responsive-table.apertura-cierre-table tbody tr {
        display: block !important;
        width: 100% !important;
        margin: 0 0 12px !important;
        padding: 8px 14px !important;
        overflow: hidden;
        border: 1px solid var(--line) !important;
        border-radius: 12px !important;
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(15, 23, 42, .06) !important;
    }

    .main .responsive-table.apertura-cierre-table tbody td {
        display: grid !important;
        grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        width: 100% !important;
        max-width: none !important;
        padding: 9px 0;
        border-bottom: 1px solid var(--line) !important;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .main .responsive-table.apertura-cierre-table tbody td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: var(--fs-xs);
        font-weight: 800;
        letter-spacing: .04em;
        line-height: 1.4;
        text-align: left;
        text-transform: uppercase;
    }

    .main .responsive-table.apertura-cierre-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-actions form,
    .main .responsive-table.apertura-cierre-table .inventory-card-actions .btn {
        width: 100%;
    }


    .main .responsive-table.apertura-cierre-table .inventory-empty-row td {
        display: block !important;
        padding: 14px 0;
        border: 0 !important;
        text-align: center;
    }

    .main .responsive-table.apertura-cierre-table .inventory-empty-row td::before {
        content: none;
    }
}
/* Apertura/Cierre mÃ³vil v2: tarjeta compacta en dos columnas. */
@media screen and (max-width: 800px) {
    .main .responsive-table.apertura-cierre-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 0 !important;
        border-radius: 14px !important;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .08) !important;
    }

    .main .responsive-table.apertura-cierre-table tbody td {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 5px;
        min-height: 66px;
        padding: 11px 13px;
        color: var(--text);
        text-align: left;
    }

    .main .responsive-table.apertura-cierre-table tbody td::before {
        display: block;
        color: #64748b;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .08em;
        line-height: 1.2;
    }

    .main .responsive-table.apertura-cierre-table tbody td:nth-child(odd) {
        border-right: 1px solid var(--line) !important;
    }

    .main .responsive-table.apertura-cierre-table tbody td:first-child {
        color: var(--primary);
        font-weight: 800;
    }

    .main .responsive-table.apertura-cierre-table tbody td:nth-child(5) .badge {
        padding: 4px 10px;
        color: #075985;
        background: #e0f2fe;
        border: 1px solid #bae6fd;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary,
    .main .responsive-table.apertura-cierre-table .inventory-card-actions {
        grid-column: 1 / -1;
        width: 100% !important;
        border-right: 0 !important;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        padding: 12px 13px;
        background: #f8fafc;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary::before {
        grid-column: 1 / -1;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary span {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 3px;
        padding: 8px 4px;
        border: 1px solid #e2e8f0;
        border-radius: 9px;
        background: #ffffff;
        text-align: center;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary small {
        overflow: hidden;
        color: #64748b;
        font-size: 8px;
        font-weight: 700;
        text-overflow: ellipsis;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary strong {
        color: #0f172a;
        font-size: var(--fs-lg);
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-actions {
        min-height: auto;
        padding: 12px 13px;
        background: #f8fafc;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-actions::before {
        display: none;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-actions .btn {
        
        border-radius: 9px;
        font-weight: 800;
    }

    .main .responsive-table.apertura-cierre-table .inventory-empty-row {
        display: block !important;
    }
}
/* Apertura/Cierre mÃ³vil: mÃ¡s aire entre datos y registros. */
@media screen and (max-width: 800px) {
    .main .responsive-table.apertura-cierre-table tbody tr {
        margin-bottom: 20px !important;
    }

    .main .responsive-table.apertura-cierre-table tbody td {
        min-height: 84px;
        padding: 16px 15px;
        gap: 8px;
        font-size: var(--fs-base);
        line-height: 1.45;
    }

    .main .responsive-table.apertura-cierre-table tbody td::before {
        font-size: var(--fs-2xs);
        line-height: 1.3;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary {
        gap: 10px;
        padding: 16px 15px;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary span {
        gap: 6px;
        padding: 12px 6px;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-actions {
        padding: 15px;
    }
}
/* Apertura/Cierre mÃ³vil: altura compacta definitiva. */
@media screen and (max-width: 800px) {
    .main .responsive-table.apertura-cierre-table tbody tr {
        margin-bottom: 12px !important;
    }

    .main .responsive-table.apertura-cierre-table tbody td {
        min-height: 50px;
        padding: 8px 12px;
        gap: 3px;
        font-size: var(--fs-xs);
        line-height: 1.25;
    }

    .main .responsive-table.apertura-cierre-table tbody td::before {
        font-size: 8px;
        line-height: 1.1;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary {
        gap: 7px;
        padding: 9px 12px;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary::before {
        display: none;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary span {
        gap: 2px;
        padding: 6px 4px;
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-summary strong {
        font-size: var(--fs-base);
    }

    .main .responsive-table.apertura-cierre-table .inventory-card-actions {
        min-height: 0;
        padding: 9px 12px;
    }

}
/* Modal de registro de inventario: optimizaciÃ³n para mÃ³vil. */
@media screen and (max-width: 520px) {
    #modal-conteo-existencia {
        align-items: center;
        padding: 6px;
    }

    #modal-conteo-existencia .inventory-count-modal {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-height: calc(100dvh - 12px);
        border-radius: 12px;
        overflow: hidden;
    }

    #modal-conteo-existencia .modal-header {
        min-height: 44px;
        padding: 8px 10px 8px 13px;
    }

    #modal-conteo-existencia .modal-body {
        min-height: 0;
        padding: 10px 12px 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    #modal-conteo-existencia .inventory-modal-name {
        margin: 0 0 7px;
        font-size: var(--fs-sm);
        line-height: 1.25;
    }

    #modal-conteo-existencia .inventory-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        margin-bottom: 9px;
        padding: 0;
        overflow: hidden;
        border-radius: 8px;
    }

    #modal-conteo-existencia .inventory-detail-grid > div {
        min-height: 43px;
        padding: 7px 9px;
        border-bottom: 1px solid var(--line);
    }

    #modal-conteo-existencia .inventory-detail-grid > div:nth-child(odd) {
        border-right: 1px solid var(--line);
    }

    #modal-conteo-existencia .inventory-detail-grid > div:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    #modal-conteo-existencia .inventory-detail-grid span {
        font-size: 8px;
        line-height: 1.1;
    }

    #modal-conteo-existencia .inventory-detail-grid strong {
        margin-top: 3px;
        font-size: var(--fs-2xs);
        line-height: 1.2;
    }

    #modal-conteo-existencia .inventory-count-fields {
        gap: 8px;
    }

    #modal-conteo-existencia .inventory-count-fields label {
        gap: 3px;
        font-size: var(--fs-2xs);
    }

    #modal-conteo-existencia .inventory-count-fields input,
    #modal-conteo-existencia .inventory-count-fields select {
        min-height: 34px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    #modal-conteo-existencia .inventory-count-fields textarea {
        min-height: 54px;
        padding: 7px 9px;
    }

    #modal-conteo-existencia .modal-footer {
        flex: 0 0 auto;
        margin-top: 9px;
        padding: 9px 12px 11px;
        border-top: 1px solid var(--line);
        background: #fff;
    }

}
/* Modal de inventario mÃ³vil: versiÃ³n extra compacta. */
@media screen and (max-width: 520px) {
    #modal-conteo-existencia {
        padding: 3px;
    }

    #modal-conteo-existencia .inventory-count-modal {
        max-height: calc(100dvh - 6px);
    }

    #modal-conteo-existencia .modal-header {
        min-height: 38px;
        padding: 5px 8px 5px 11px;
    }

    #modal-conteo-existencia .modal-header h3 {
        font-size: var(--fs-base);
    }

    #modal-conteo-existencia .modal-close-btn {
        width: 27px;
        height: 27px;
    }

    #modal-conteo-existencia .modal-body {
        padding: 7px 9px 0;
    }

    #modal-conteo-existencia .inventory-modal-name {
        max-height: 28px;
        margin-bottom: 5px;
        overflow: hidden;
        font-size: var(--fs-2xs);
        line-height: 1.2;
    }

    #modal-conteo-existencia .inventory-detail-grid {
        margin-bottom: 6px;
    }

    #modal-conteo-existencia .inventory-detail-grid > div {
        min-height: 34px;
        padding: 5px 7px;
    }

    #modal-conteo-existencia .inventory-detail-grid span {
        font-size: 7px;
    }

    #modal-conteo-existencia .inventory-detail-grid strong {
        margin-top: 1px;
        font-size: 9px;
        line-height: 1.1;
    }

    #modal-conteo-existencia .inventory-count-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 7px;
    }

    #modal-conteo-existencia .inventory-count-fields label {
        min-width: 0;
        gap: 2px;
        font-size: 9px;
        line-height: 1.15;
    }

    #modal-conteo-existencia .inventory-count-fields label:nth-child(4),
    #modal-conteo-existencia .inventory-modal-observation {
        grid-column: span 2;
    }

    #modal-conteo-existencia .inventory-count-fields input,
    #modal-conteo-existencia .inventory-count-fields select {
        min-height: 30px;
        height: 30px;
        padding: 4px 7px;
        font-size: var(--fs-2xs);
    }

    #modal-conteo-existencia .inventory-count-fields textarea {
        min-height: 36px;
        height: 36px;
        padding: 5px 7px;
        font-size: var(--fs-2xs);
        line-height: 1.2;
        resize: none;
    }

    #modal-conteo-existencia .modal-footer {
        gap: 6px;
        margin-top: 6px;
        padding: 6px 9px 7px;
    }

}
/* Usuarios: creaciÃ³n mediante modal en escritorio y mÃ³vil. */
.users-create-modal {
    display: flex;
    flex-direction: column;
    width: min(92vw, 580px);
    max-width: 580px;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
}

.users-create-modal form {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.users-create-modal .users-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    padding: 18px 20px 4px;
    overflow-y: auto;
}

.users-create-modal .users-create-grid label {
    display: grid;
    gap: 5px;
    min-width: 0;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.users-create-modal .users-create-grid label:first-child {
    grid-column: 1 / -1;
}

.users-create-modal .modal-footer {
    flex: 0 0 auto;
}

@media screen and (max-width: 520px) {
    .users-page-head {
        align-items: center;
    }

    .users-page-head .btn {
        flex: 0 0 auto;
        
        
    }

    #modal-crear-usuario {
        padding: 6px;
    }

    .users-create-modal {
        width: 100%;
        max-height: calc(100dvh - 12px);
    }

    .users-create-modal .modal-header {
        min-height: 44px;
        padding: 8px 10px 8px 13px;
    }

    .users-create-modal .users-create-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 13px 2px;
    }

    .users-create-modal .users-create-grid label:first-child {
        grid-column: auto;
    }

    .users-create-modal .users-create-grid input,
    .users-create-modal .users-create-grid select {
        min-height: 36px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .users-create-modal .modal-footer {
        margin-top: 10px;
        padding: 9px 13px 12px;
        border-top: 1px solid var(--line);
    }
}
/* Usuarios: tabla convertida en tarjetas Ãºnicamente en mÃ³vil. */
@media screen and (max-width: 720px) {
    .main .responsive-table.users-cards-table {
        overflow: visible !important;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .main .responsive-table.users-cards-table table,
    .main .responsive-table.users-cards-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0;
    }

    .main .responsive-table.users-cards-table thead {
        display: none !important;
    }

    .main .responsive-table.users-cards-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100% !important;
        margin: 0 0 12px !important;
        padding: 0 !important;
        overflow: hidden;
        border: 1px solid var(--line) !important;
        border-radius: 12px !important;
        background: #fff;
        box-shadow: 0 4px 12px rgba(15, 23, 42, .07) !important;
    }

    .main .responsive-table.users-cards-table tbody td {
        display: flex !important;
        min-width: 0 !important;
        min-height: 52px;
        width: 100% !important;
        max-width: none !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 4px;
        padding: 9px 11px;
        border-bottom: 1px solid var(--line) !important;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .main .responsive-table.users-cards-table tbody td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: .07em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    .main .responsive-table.users-cards-table tbody td:nth-child(even) {
        border-left: 1px solid var(--line) !important;
    }

    .main .responsive-table.users-cards-table .user-card-name {
        grid-column: 1 / -1;
        min-height: 56px;
        color: var(--primary);
        font-weight: 800;
        border-left: 0 !important;
        background: #f8fafc;
    }

    .main .responsive-table.users-cards-table .users-actions-column {
        width: 100%;
        align-items: stretch;
        border-bottom: 0 !important;
    }

    .main .responsive-table.users-cards-table .users-actions-column form {
        width: 100%;
    }

    .main .responsive-table.users-cards-table .users-actions-column .action-btn {
        width: 100%;
        min-height: 32px;
        border-radius: 8px;
    }

    .main .responsive-table.users-cards-table .users-empty-row {
        display: block !important;
    }

    .main .responsive-table.users-cards-table .users-empty-row td {
        display: block !important;
        padding: 16px;
        border: 0 !important;
        text-align: center;
    }

    .main .responsive-table.users-cards-table .users-empty-row td::before {
        content: none;
    }
}
/* Usuarios mÃ³vil: tarjetas de altura compacta. */
@media screen and (max-width: 720px) {
    .main .responsive-table.users-cards-table tbody tr {
        margin-bottom: 9px !important;
        border-radius: 10px !important;
    }

    .main .responsive-table.users-cards-table tbody td {
        min-height: 38px;
        gap: 2px;
        padding: 6px 10px;
        font-size: var(--fs-2xs);
        line-height: 1.15;
    }

    .main .responsive-table.users-cards-table tbody td::before {
        font-size: 7px;
        line-height: 1;
    }

    .main .responsive-table.users-cards-table .user-card-name {
        min-height: 42px;
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: var(--fs-2xs);
    }

    .main .responsive-table.users-cards-table .badge,
    .main .responsive-table.users-cards-table .account-status {
        padding: 3px 7px;
        font-size: 8px;
        line-height: 1;
    }

    .main .responsive-table.users-cards-table .users-actions-column {
        grid-column: 1 / -1;
        min-height: 40px;
        padding: 5px 10px;
        border-left: 0 !important;
    }

    .main .responsive-table.users-cards-table .users-actions-column::before {
        display: none;
    }

    .main .responsive-table.users-cards-table .users-actions-column .action-btn {
        min-height: 28px;
        height: 28px;
    }
}

/* Security: logout is a POST form without changing its visual treatment. */
.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-form .sidebar-logout {
    border: 0;
    background: transparent;
}
/* Backup and database restoration module. */
.backup-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.backup-page-head h1 {
    font-size: var(--fs-2xl);
    font-weight: 700;
    margin: 0;
}

.backup-page-head p {
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin: 2px 0 0;
}

.backup-page-head .badge {
    font-size: var(--fs-xs);
    padding: 4px 10px;
    font-weight: 600;
}

.backup-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.backup-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    min-height: auto;
    border-radius: var(--radius-sm);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

.backup-stat:hover {
    border-color: rgba(4, 54, 100, 0.25);
    box-shadow: var(--shadow-hover);
}

.backup-stat-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(4, 54, 100, 0.08);
    color: var(--primary);
}

.backup-stat-icon.tables-icon {
    background: rgba(7, 137, 141, 0.1);
    color: var(--primary-dark);
}

.backup-stat-icon.size-icon {
    background: rgba(37, 99, 235, 0.08);
    color: var(--info);
}

.backup-stat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.backup-stat-info span {
    color: var(--muted);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.1;
}

.backup-stat-info strong {
    font-size: var(--fs-lg);
    color: var(--text);
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.backup-action-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.backup-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.backup-action-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: grid;
    place-items: center;
    color: #0369a1;
    border-radius: var(--radius-sm);
    background: #e0f2fe;
}

.backup-action-icon.danger {
    color: #be123c;
    background: #ffe4e6;
}

.backup-card-header-text {
    min-width: 0;
    flex: 1;
}

.backup-card-header-text h2 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.2;
}

.backup-card-header-text p {
    margin: 2px 0 0;
    font-size: var(--font-size-xs);
    color: var(--muted);
    line-height: 1.35;
}

.backup-notes {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.backup-notes li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: var(--fs-xs);
    color: var(--text-light);
    line-height: 1.35;
}

.backup-notes li svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--ok);
}

.backup-action-form {
    margin-top: auto;
    padding-top: 2px;
}

.backup-action-form .btn,
.backup-restore-form .btn {
    width: 100%;
    
    
    
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.backup-warning {
    margin: 0;
    padding: 6px 9px;
    font-size: var(--fs-xs);
    line-height: 1.35;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.backup-restore-form {
    display: grid;
    gap: 7px;
}

.backup-restore-form label {
    display: grid;
    gap: 3px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text);
}

.backup-restore-form input[type="file"] {
    font-size: var(--fs-xs);
    padding: 3px 6px;
    min-height: 28px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.backup-restore-form input[type="file"]::file-selector-button {
    padding: 2px 7px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    margin-right: 8px;
    transition: var(--transition-fast);
}

.backup-restore-form input[type="file"]::file-selector-button:hover {
    background: #e2e8f0;
}

.backup-restore-form input[type="text"],
.backup-restore-form input[type="password"],
.backup-restore-form input:not([type]) {
    min-height: 28px;
    padding: 3px 8px;
    font-size: var(--fs-xs);
}

.backup-restore-form small {
    font-size: var(--fs-2xs);
    font-weight: 400;
    color: var(--muted);
    line-height: 1.2;
}

.backup-restore-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

@media screen and (max-width: 840px) {
    .backup-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 580px) {
    .backup-summary {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .backup-stat:first-child {
        grid-column: 1 / -1;
    }

    .backup-stat-info strong {
        font-size: var(--fs-md);
    }

    .backup-restore-inline-grid {
        grid-template-columns: 1fr;
    }

    .backup-action-card {
        padding: 11px 12px;
        gap: 8px;
    }
}
.catalog-heading{align-items:center}.catalog-version{display:grid;gap:2px;min-width:240px;padding:12px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}.catalog-version span,.catalog-version small{color:var(--muted);font-size:var(--font-size-xs)}.catalog-version strong{font-size:14px}.catalog-tabs{margin-bottom:16px}.catalog-tabs a{display:inline-flex;align-items:center;gap:8px}.catalog-tabs a span{padding:2px 7px;border-radius:999px;background:rgba(127,127,127,.12);font-size:11px}

.catalog-number-column,.catalog-number-cell{width:72px;text-align:center;white-space:nowrap}

/* Buscador compacto de catálogo en la pestaña Sobrantes. */
#form-busqueda-catalogo .sobrantes-filter-grid {
    grid-template-columns: minmax(280px, 1fr) auto;
}

#form-busqueda-catalogo .filter-actions .btn {
    width: auto;
    white-space: nowrap;
}

.inventory-noncatalog-search-action {
    color: #fff;
    border-color: #b91c1c;
    background: #dc2626;
}

.inventory-noncatalog-search-action:hover {
    color: #fff;
    border-color: #991b1b;
    background: #b91c1c;
}

@media (max-width: 640px) {
    #form-busqueda-catalogo .sobrantes-filter-grid {
        grid-template-columns: 1fr;
    }

    #form-busqueda-catalogo .filter-actions {
        flex-wrap: wrap;
    }
}

.inventory-status-notice,
.inventory-noncatalog-notice { font-size:var(--fs-base); line-height:1.35; }
.inventory-inline-status {
    flex: 1 1 320px;
    align-self: center;
    max-width: 580px;
    margin: 0;
    padding: 5px 10px;
}
.inventory-noncatalog-notice { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; }
@media (max-width: 640px) { .inventory-noncatalog-notice { align-items:stretch; flex-direction:column; } }

.inventory-surplus-filter-panel { padding:5px 8px; }
.inventory-surplus-filter-panel .compact-title { margin-bottom:2px; }
.inventory-surplus-filter-panel .sobrantes-filter-grid { gap:6px; }
.inventory-surplus-filter-panel .sobrantes-filter-grid input,
.inventory-surplus-filter-panel .inventory-filter-clear { min-height:28px; height:28px; }

.inventory-catalog-results-panel { margin-top:8px; padding:7px 8px; }
.inventory-catalog-results-panel .section-title { margin-bottom:3px; }
.inventory-catalog-results-panel .section-title h2 { margin-bottom:2px; font-size:14px; }
.inventory-catalog-results-panel .section-title p { font-size: var(--font-size-xs); }
.inventory-catalog-results-panel .section-title .badge { font-size:11px; }
.inventory-catalog-results-panel .inventory-noncatalog-notice { margin:5px 0 7px; padding:6px 10px; }


#form-busqueda-catalogo .filter-actions .btn {
    width: auto;
    
    
    
}
/* Numbered inventory tables */
.numbered-inventory-table th:nth-child(1),
.numbered-inventory-table td:nth-child(1),
.numbered-catalog-table th:nth-child(1),
.numbered-catalog-table td:nth-child(1) {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: right;
}

.numbered-inventory-table th:nth-child(2),
.numbered-inventory-table td:nth-child(2) {
    width: 130px;
    min-width: 100px;
    white-space: nowrap;
}

.numbered-inventory-table th:nth-child(3),
.numbered-inventory-table td:nth-child(3) {
    min-width: 260px;
}

.numbered-inventory-table th:nth-child(4),
.numbered-inventory-table td:nth-child(4),
.numbered-inventory-table th:nth-child(5),
.numbered-inventory-table td:nth-child(5),
.numbered-inventory-table th:nth-child(6),
.numbered-inventory-table td:nth-child(6) {
    min-width: 110px;
}

/* Sobrantes registrados adaptados al ancho disponible sin desbordar */
.registered-surplus-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.registered-surplus-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    flex: 1 1 760px;
    flex-wrap: wrap;
    min-width: 0;
}

.inventory-surplus-panel > .section-title {
    flex-wrap: wrap;
    gap: 8px;
}

.registered-surplus-search input[name="sobrante_item"],
.registered-surplus-search input[name="no_catalogado_item"] {
    width: 180px;
    min-width: 0;
    flex: 1.3 1 160px;
    min-height: 32px;
    height: 32px;
    padding: 5px 10px;
    font-size: 12.5px;
    line-height: 1.2;
    text-transform: uppercase;
}

.registered-surplus-search select {
    width: 150px;
    min-width: 0;
    flex: 1 1 130px;
    height: 32px;
    padding: 5px 7px;
}

.registered-surplus-search select[name="sobrante_cuenta"],
.registered-surplus-search select[name="sobrante_ubicacion"],
.registered-surplus-search select[name="no_catalogado_cuenta"],
.registered-surplus-search select[name="no_catalogado_almacen"] {
    flex-basis: 180px;
}

.registered-surplus-search .btn {
    
    
    
    
    
    white-space: nowrap;
}

.registered-surplus-observation-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text-light);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.registered-surplus-observation-filter input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

@media (max-width: 800px) {
    .registered-surplus-search {
        width: 100%;
        flex-wrap: wrap;
    }

    .registered-surplus-search input[name="sobrante_item"],
    .registered-surplus-search input[name="no_catalogado_item"] {
        flex: 1 1 180px;
        width: auto;
    }
}

/* Bienes no catalogados: conserva la densidad y proporciones del resto del inventario. */
.noncatalog-table-wrap {
    overflow-x: hidden;
    overflow-y: hidden;
}

.compact-noncatalog-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

.compact-noncatalog-table th,
.compact-noncatalog-table td {
    min-width: 0;
    padding: 4px 6px;
    vertical-align: middle;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.compact-noncatalog-table th:nth-child(1),
.compact-noncatalog-table td:nth-child(1) { width: 9% !important; white-space: normal; }
.compact-noncatalog-table th:nth-child(2),
.compact-noncatalog-table td:nth-child(2) {
    width: 27% !important;
    line-height: 1.25;
}
.compact-noncatalog-table th:nth-child(3),
.compact-noncatalog-table td:nth-child(3) { width: 6% !important; }
.compact-noncatalog-table th:nth-child(4),
.compact-noncatalog-table td:nth-child(4) { width: 7% !important; }
.compact-noncatalog-table th:nth-child(5),
.compact-noncatalog-table td:nth-child(5) { width: 8% !important; }
.compact-noncatalog-table th:nth-child(6),
.compact-noncatalog-table td:nth-child(6) { width: 7% !important; }
.compact-noncatalog-table th:nth-child(7),
.compact-noncatalog-table td:nth-child(7) { width: 5% !important; }
.compact-noncatalog-table th:nth-child(8),
.compact-noncatalog-table td:nth-child(8) { width: 6% !important; }
.compact-noncatalog-table th:nth-child(9),
.compact-noncatalog-table td:nth-child(9) { width: 5% !important; }
.compact-noncatalog-table th:nth-child(10),
.compact-noncatalog-table td:nth-child(10) { width: 7% !important; }
.compact-noncatalog-table th:nth-child(11),
.compact-noncatalog-table td:nth-child(11) {
    width: 5% !important;
}

.compact-noncatalog-table th:nth-child(12),
.compact-noncatalog-table td:nth-child(12) {
    width: 8% !important;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
}

.compact-noncatalog-table .surplus-action-buttons {
    gap: 3px;
    flex-wrap: nowrap;
}

.compact-noncatalog-table .surplus-action-buttons .action-btn {
    width: 24px;
    height: 24px;
    min-height: 24px;
    flex: 0 0 24px;
}

@media screen and (max-width: 800px) {
    .main .noncatalog-table-wrap {
        overflow-x: hidden !important;
    }

    .main .noncatalog-table-wrap .compact-noncatalog-table {
        width: 100% !important;
        min-width: 100% !important;
        table-layout: fixed !important;
    }

    .main .noncatalog-table-wrap .compact-noncatalog-table th,
    .main .noncatalog-table-wrap .compact-noncatalog-table td {
        min-width: 0 !important;
        max-width: none !important;
        padding: 3px 2px;
        font-size: 8px !important;
        overflow-wrap: anywhere;
    }

    .main .noncatalog-table-wrap .compact-noncatalog-table th {
        font-size: var(--font-size-table-header) !important;
    }

    .main .noncatalog-table-wrap .inventory-date {
        white-space: normal;
        font-size: 7px;
    }
}

.registered-surplus-table-wrap .save-column {
    position: sticky;
    right: 0;
    z-index: 3;
    width: 72px;
    min-width: 72px;
    background: var(--surface, #fff);
    box-shadow: -7px 0 10px -9px rgba(15, 23, 42, .75);
}

/* Keep the edit/delete controls visible when the surplus table is wider than
   its card. The generic .responsive-table rule clips overflow on desktop. */
.registered-surplus-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.registered-surplus-table-wrap .surplus-action-buttons {
    min-width: 62px;
    flex-wrap: nowrap;
}

.registered-surplus-table-wrap thead .save-column {
    z-index: 4;
    background: #022d58;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table th,
.registered-surplus-table-wrap .numbered-registered-surplus-table td {
    min-width: 0;
    padding: 3px 4px;
    overflow-wrap: normal;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table th:nth-child(1),
.registered-surplus-table-wrap .numbered-registered-surplus-table td:nth-child(1) {
    width: 28px;
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table th:nth-child(2),
.registered-surplus-table-wrap .numbered-registered-surplus-table td:nth-child(2) {
    width: 90px;
    white-space: nowrap;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table th:nth-child(3),
.registered-surplus-table-wrap .numbered-registered-surplus-table td:nth-child(3) {
    width: auto;
    line-height: 1.2;
}

.registered-surplus-table-wrap .numbered-registered-surplus-table th:nth-child(4),
.registered-surplus-table-wrap .numbered-registered-surplus-table td:nth-child(4) { width: 65px; }
.registered-surplus-table-wrap .numbered-registered-surplus-table th:nth-child(5),
.registered-surplus-table-wrap .numbered-registered-surplus-table td:nth-child(5) { width: 68px; }
.registered-surplus-table-wrap .numbered-registered-surplus-table th:nth-child(6),
.registered-surplus-table-wrap .numbered-registered-surplus-table td:nth-child(6) { width: 65px; }
.registered-surplus-table-wrap .price-column { width: 56px; text-align: right; }
.registered-surplus-table-wrap .count-column { width: 48px; text-align: right; }
.registered-surplus-table-wrap .state-column { width: 72px; text-align: center; }
.registered-surplus-table-wrap .observation-column { width: auto; }
.registered-surplus-table-wrap .save-column { width: 54px; min-width: 54px; text-align: center; }

@media screen and (max-width: 800px) {
    .main .registered-surplus-table-wrap .save-column {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
    }
}

.numbered-catalog-table th:nth-child(2),
.numbered-catalog-table td:nth-child(2) {
    width: 120px;
    min-width: 110px;
    white-space: nowrap;
}

.numbered-catalog-table th:nth-child(3),
.numbered-catalog-table td:nth-child(3) {
    min-width: 260px;
}

.numbered-catalog-table th:nth-child(4),
.numbered-catalog-table td:nth-child(4) {
    width: 110px;
    min-width: 100px;
}
/* Fixed layout for numbered catalog results */
@media (min-width: 769px) {
.numbered-catalog-table {
    width: 100%;
    table-layout: fixed;
}

.numbered-catalog-table th:nth-child(1),
.numbered-catalog-table td:nth-child(1) {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    text-align: center;
}

.numbered-catalog-table th:nth-child(2),
.numbered-catalog-table td:nth-child(2) {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    white-space: nowrap;
}

.numbered-catalog-table th:nth-child(3),
.numbered-catalog-table td:nth-child(3) {
    width: auto;
    min-width: 0;
}

.numbered-catalog-table th:nth-child(4),
.numbered-catalog-table td:nth-child(4) {
    width: 155px;
    min-width: 155px;
    max-width: 155px;
    white-space: nowrap;
}

.numbered-catalog-table th:nth-child(5),
.numbered-catalog-table td:nth-child(5) {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    text-align: center;
}
}

/* Compact height for the inventory catalog results only. */
.inventory-catalog-results-panel .numbered-catalog-table th,
.inventory-catalog-results-panel .numbered-catalog-table td {
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: var(--font-size-table, var(--fs-2xs));
    line-height: 1.1;
}

.inventory-catalog-results-panel .numbered-catalog-table .inventory-row-action {
    width: 20px;
    height: 20px;
    min-height: 20px;
    border-radius: 4px;
}

.inventory-catalog-results-panel .numbered-catalog-table .inventory-row-action svg {
    width: 12px;
    height: 12px;
}

/* Tabs and search share one compact row in the inventory module. */
.inventory-search-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    margin-top: 0;
    padding: 5px 8px;
}

.inventory-search-toolbar .inventory-tabs {
    align-self: end;
    margin: 0;
    padding: 2px;
    white-space: nowrap;
}

.inventory-search-toolbar .inventory-tabs a {
    min-height: 27px;
    padding: 4px 10px;
    font-size: 11.5px;
}

.inventory-search-toolbar .filter-form {
    min-width: 0;
    margin: 0;
}

.inventory-search-toolbar .compact-filter-grid,
.inventory-search-toolbar .sobrantes-filter-grid {
    gap: 6px;
}

.inventory-search-toolbar .compact-filter-grid label,
.inventory-search-toolbar .sobrantes-filter-grid label {
    font-size: 10.5px;
}
.inventory-search-toolbar .compact-filter-grid input,
.inventory-search-toolbar .compact-filter-grid select,
.inventory-search-toolbar .sobrantes-filter-grid input,
.inventory-search-toolbar .inventory-filter-clear {
    min-height: 27px;
    height: 27px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: var(--fs-xs);
}

@media (min-width: 641px) and (max-width: 1100px) {
    .inventory-filter-panel:not(.inventory-surplus-filter-panel) .compact-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .inventory-search-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .inventory-search-toolbar .inventory-tabs {
        justify-self: start;
    }
}

/* Unified typography for every inventory search control. */
.inventory-search-toolbar input,
.inventory-search-toolbar select,
.inventory-search-toolbar button,
.inventory-search-toolbar select option,
.registered-surplus-search input,
.registered-surplus-search select,
.registered-surplus-search button,
.registered-surplus-search .btn {
    font-family: inherit;
    font-size: var(--fs-xs);
}

.inventory-search-toolbar input::placeholder,
.registered-surplus-search input::placeholder {
    font-size: var(--fs-xs);
}

.table-scroll-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 850;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: var(--primary, #0f4c81);
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .24);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.table-scroll-top[hidden] {
    display: none;
}

.table-scroll-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 28px rgba(15, 23, 42, .3);
}

.table-scroll-top:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .4);
    outline-offset: 3px;
}

.table-scroll-top svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

@media (max-width: 640px) {
    .table-scroll-top {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 0;
    }

}

/* Dashboard compacto para monitores HD (por ejemplo, 1366 x 768). */
@media screen and (min-width: 1100px) and (max-height: 800px) {
    body.page-dashboard .main {
        padding: 10px 14px 14px;
    }

    body.page-dashboard .main > .sidebar-toggle {
        width: 30px;
        height: 30px;
        margin-bottom: 7px;
    }

    body.page-dashboard .dashboard-hero-minimal {
        grid-template-columns: minmax(0, 1fr) minmax(285px, 330px);
        gap: 18px;
        min-height: 138px;
        margin-bottom: 8px;
        padding: 14px 20px;
    }

    body.page-dashboard .dashboard-hero-minimal .eyebrow {
        margin-bottom: 5px;
        padding: 3px 8px;
    }

    body.page-dashboard .dashboard-hero-minimal h1 {
        margin-bottom: 4px;
        font-size: 23px;
    }

    body.page-dashboard .dashboard-hero-minimal p {
        margin-bottom: 9px;
        font-size: var(--font-size-xs);
        line-height: 1.3;
    }


    body.page-dashboard .dashboard-hero-minimal .hero-status {
        gap: 13px;
        min-height: 92px;
        padding: 10px 14px;
    }

    body.page-dashboard .dashboard-hero-minimal .status-ring {
        --size: 68px;
    }

    body.page-dashboard .dashboard-hero-minimal .status-ring > strong,
    body.page-dashboard .dashboard-hero-minimal .hero-status > div > strong {
        font-size: var(--fs-md);
    }

    body.page-dashboard .dashboard-hero-minimal .hero-status small {
        font-size: var(--fs-2xs);
    }

    body.page-dashboard .dashboard-metrics-minimal {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 8px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card {
        min-height: 94px;
        padding: 10px 11px;
        border-radius: 9px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card::before {
        height: 3px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-header {
        gap: 5px;
        margin-bottom: 5px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card span {
        font-size: 8px;
        line-height: 1.15;
        letter-spacing: .35px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-icon-wrapper {
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        border-radius: 8px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-icon-wrapper svg {
        width: 14px;
        height: 14px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card > strong {
        margin-bottom: 3px;
        font-size: 22px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card small {
        font-size: 8.5px;
        line-height: 1.2;
    }

    body.page-dashboard .dashboard-grid {
        grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr);
        gap: 8px;
        margin-bottom: 8px;
    }

    body.page-dashboard .workflow-card,
    body.page-dashboard .latest-card,
    body.page-dashboard .recent-panel {
        padding: 10px 12px;
    }

    body.page-dashboard .workflow-card .section-title,
    body.page-dashboard .latest-card .section-title,
    body.page-dashboard .recent-panel .section-title {
        margin-bottom: 7px;
    }

    body.page-dashboard progress.progress-track {
        margin-bottom: 9px;
    }

    body.page-dashboard .workflow-steps {
        gap: 6px;
    }

    body.page-dashboard .workflow-steps div {
        min-height: 38px;
        padding: 6px 8px;
    }

    body.page-dashboard .latest-card dl {
        margin: 6px 0;
    }

    body.page-dashboard .latest-card dl div {
        padding: 4px 0;
    }


    body.page-dashboard .recent-panel {
        margin-top: 0;
    }

    body.page-dashboard .recent-panel .section-title p {
        display: none;
    }

    body.page-dashboard .recent-panel th,
    body.page-dashboard .recent-panel td {
        padding-top: 4px;
        padding-bottom: 4px;
        font-size: var(--font-size-table, var(--fs-2xs));
    }
}

/* Ventanas modales compactas en escritorio. */
@media screen and (min-width: 521px) {
    .modal-overlay {
        padding: 14px;
    }

    .modal-content {
        width: min(84vw, 320px);
        max-height: calc(100dvh - 28px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 10px;
    }

    .modal-content > form {
        min-height: 0;
        overflow-y: auto;
    }

    .inventory-count-modal,
    .surplus-register-modal,
    .edit-surplus-modal {
        width: min(84vw, 520px);
        max-width: 520px;
    }

    .delete-surplus-modal {
        max-width: 390px;
    }

    .users-create-modal {
        width: min(84vw, 400px);
        max-width: 400px;
    }

    .modal-header {
        width: 100%;
        flex: 0 0 auto;
        box-sizing: border-box;
        min-height: 42px;
        padding: 7px 10px 7px 14px;
        border-radius: 9px 9px 0 0;
    }

    .modal-header h3 {
        font-size: 14px;
    }

    .modal-close-btn {
        width: 27px;
        height: 27px;
        font-size: 19px;
    }

    .modal-body {
        min-height: 0;
        overflow-y: auto;
        padding: 12px 16px 0;
    }

    .modal-body p {
        margin-bottom: 9px;
        font-size: var(--fs-sm);
        line-height: 1.35;
    }

    .modal-footer {
        gap: 7px;
        margin-top: 11px;
        padding: 0 16px 12px;
    }

    .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
    .modal-content select {
        min-height: 32px;
        height: 32px;
        padding: 5px 8px;
        font-size: var(--fs-xs);
    }

    .modal-content textarea {
        min-height: 52px;
        padding: 6px 8px;
        font-size: var(--fs-xs);
        line-height: 1.3;
    }


    .edit-surplus-grid,
    .inventory-count-fields,
    .surplus-register-grid {
        grid-template-columns: repeat(3, minmax(0, 154px));
        justify-content: start;
        gap: 8px 10px;
    }

    .edit-surplus-grid > label:not(.edit-surplus-observation),
    .inventory-count-fields > label:not(.inventory-modal-observation),
    .surplus-register-grid > label:not(.surplus-modal-observation) {
        min-width: 0;
        width: 100%;
        max-width: 154px;
    }

    .edit-surplus-grid label,
    .inventory-count-fields label,
    .surplus-register-grid label {
        gap: 3px;
        font-size: var(--fs-xs);
    }

    .inventory-modal-name {
        margin-bottom: 8px;
        font-size: var(--fs-base);
    }

    .inventory-detail-grid {
        gap: 6px;
        margin-bottom: 10px;
        padding: 8px 10px;
    }

    .inventory-detail-grid strong {
        font-size: var(--fs-xs);
    }

    .surplus-modal-observation textarea,
    .edit-surplus-observation textarea,
    #modal-conteo-existencia .inventory-count-fields textarea {
        min-height: 48px;
        height: 48px;
    }
}

/* ==========================================================================
   COMPONENTE NORMALIZADO: TARJETAS DE MÉTRICAS
   ========================================================================== */


.metrics-grid .metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(var(--metric-rgb), .16);
}

.metrics-grid .metric-card::after {
    content: none;
}

.metrics-grid .metric-card.accent-teal { --metric-color: #059669; --metric-rgb: 5, 150, 105; }
.metrics-grid .metric-card.accent-blue { --metric-color: #0284c7; --metric-rgb: 2, 132, 199; }
.metrics-grid .metric-card.accent-amber { --metric-color: #c58b14; --metric-rgb: 197, 139, 20; }
.metrics-grid .metric-card.accent-rose { --metric-color: #dc2626; --metric-rgb: 220, 38, 38; }
.metrics-grid .metric-card.accent-purple { --metric-color: #9333ea; --metric-rgb: 147, 51, 234; }
.metrics-grid .metric-card.accent-slate { --metric-color: #1e3a5f; --metric-rgb: 30, 58, 95; }



.metrics-grid .metric-card--simple:nth-child(6n + 1) { --metric-color: #1e3a5f; --metric-rgb: 30, 58, 95; }
.metrics-grid .metric-card--simple:nth-child(6n + 2) { --metric-color: #059669; --metric-rgb: 5, 150, 105; }
.metrics-grid .metric-card--simple:nth-child(6n + 3) { --metric-color: #c58b14; --metric-rgb: 197, 139, 20; }
.metrics-grid .metric-card--simple:nth-child(6n + 4) { --metric-color: #dc2626; --metric-rgb: 220, 38, 38; }
.metrics-grid .metric-card--simple:nth-child(6n + 5) { --metric-color: #9333ea; --metric-rgb: 147, 51, 234; }
.metrics-grid .metric-card--simple:nth-child(6n) { --metric-color: #0284c7; --metric-rgb: 2, 132, 199; }


.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    margin: 0 0 10px;
    gap: 6px;
}

.metrics-grid .metric-card {
    --metric-color: #0f766e;
    --metric-rgb: 15, 118, 110;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(var(--metric-rgb), .35);
    border-left: 4px solid var(--metric-color);
    background: linear-gradient(135deg, #ffffff 0%, rgba(var(--metric-rgb), .055) 100%);
    box-shadow: 0 5px 15px rgba(15, 23, 42, .08);
    color: #0f172a;
    transition: transform .18s ease, box-shadow .18s ease;
    min-height: 74px;
    padding: 7px 8px 9px;
    border-radius: 9px;
}

.metrics-grid .metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 3px;
}

.metrics-grid .metric-card span {
    color: #475569;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    font-size: 10px;
}

.metrics-grid .metric-icon-wrapper {
    display: grid;
    flex: 0 0 23px;
    place-items: center;
    background: rgba(var(--metric-rgb), .11);
    color: var(--metric-color);
    width: 23px;
    height: 23px;
    border-radius: 7px;
}

.metrics-grid .metric-icon-wrapper svg {
    width: 13px;
    height: 13px;
}

.metrics-grid .metric-card > strong {
    display: block;
    margin: 0 0 2px;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.05;
    font-size: 18px;
}

.metrics-grid .metric-card small {
    display: block;
    color: #475569;
    line-height: 1.25;
    font-size: 9px;
}

.metrics-grid .metric-card--simple {
    padding-top: 9px;
}

.metrics-grid .metric-card--simple::before {
    position: absolute;
    display: grid;
    place-items: center;
    background: rgba(var(--metric-rgb), .11);
    color: var(--metric-color);
    content: '+';
    font-weight: 800;
    line-height: 1;
    border-radius: 7px;
    top: 7px;
    right: 8px;
    width: 21px;
    height: 21px;
    font-size: 14px;
}

.metrics-grid .metric-card--simple > span {
    display: block;
    max-width: calc(100% - 40px);
    margin: 0 0 6px;
}

@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
}

/* Reportes: tablas compactas, ajustadas al contenido. */
.report-results-card .consolidado-table th,
.report-results-card .consolidado-table td,
.report-results-card .report-account-items-table th,
.report-results-card .report-account-items-table td,
.report-results-card .report-brand-items-table th,
.report-results-card .report-brand-items-table td {
    padding: 2px 6px;
    line-height: 1.12;
}

.report-results-card .consolidado-table td,
.report-results-card .report-account-items-table td,
.report-results-card .report-brand-items-table td {
    vertical-align: middle;
}

.report-results-card .consolidado-table td:nth-child(3) {
    line-height: 1.12;
}

.report-results-card .consolidado-table .inventory-date {
    margin-top: 1px;
    line-height: 1.05;
}

/* Acciones semánticas y visibles para tablas. */
.report-results-card .btn-icon.report-action-view,
.report-results-card .btn-icon.report-action-edit,
.report-results-card .btn-icon.report-action-confirm,
.report-results-card .btn-icon.report-action-delete {
    display: inline-grid;
    width: 24px;
    height: 24px;
    padding: 4px;
    place-items: center;
    border-width: 1px;
    border-style: solid;
    border-radius: 6px;
}

.report-results-card .btn-icon.report-action-view {
    color: #073b68;
    border-color: #93c5fd;
    background: #eff6ff;
}

/* Icono de vista único para todas las acciones de reportes. */
.report-results-card .btn-icon.report-action-view svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.report-results-card .btn-icon.report-action-edit {
    color: #9a6700;
    border-color: #fcd34d;
    background: #fffbeb;
}

.report-results-card .btn-icon.report-action-confirm {
    color: #047857;
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.report-results-card .btn-icon.report-action-delete {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

.report-results-card .btn-icon.report-action-view:hover { color: #ffffff; border-color: #073b68; background: #073b68; }
.report-results-card .btn-icon.report-action-edit:hover { color: #ffffff; border-color: #9a6700; background: #9a6700; }
.report-results-card .btn-icon.report-action-confirm:hover { color: #ffffff; border-color: #047857; background: #047857; }
.report-results-card .btn-icon.report-action-delete:hover { color: #ffffff; border-color: #b91c1c; background: #b91c1c; }
/* Anexo 6: situación del inventario con colores semánticos. */
.report-results-card .badge.report-status-inventariado {
    color: #047857;
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.report-results-card .badge.report-status-parcial {
    color: #9a6700;
    border-color: #fcd34d;
    background: #fffbeb;
}

.report-results-card .badge.report-status-faltante {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

.report-results-card .badge.report-status-sobrante {
    color: #6d28d9;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.report-results-card .badge.report-status-no-catalogado {
    color: #075985;
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.report-results-card .badge.report-status-neutral {
    color: #475569;
    border-color: #cbd5e1;
    background: #f8fafc;
}
.report-results-card .badge.report-status-sobrante-existencia {
    color: #0f766e;
    border-color: #5eead4;
    background: #f0fdfa;
}

.report-results-card .badge.report-status-faltante-parcial {
    color: #9a3412;
    border-color: #fdba74;
    background: #fff7ed;
}

.report-situation-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: var(--fs-2xs);
}

.report-situation-legend .badge {
    letter-spacing: 0;
}

.report-situation-code {
    min-width: 24px;
    text-align: center;
    text-decoration: none;
    cursor: help;
}

/* Variante reutilizable de métricas para encabezados en una sola fila. */
.page-head > .metrics-grid--inline {
    flex: 1 1 0;
    min-width: 0;
    max-width: 840px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 0 auto;
}

@media (max-width: 768px) {
    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .page-head > .metrics-grid--inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
        margin-left: 0;
    }
}
/* Modal por cuenta: columnas de inventario. */
.report-account-items-table th:nth-child(8),
.report-account-items-table td:nth-child(8),
.report-account-items-table th:nth-child(9),
.report-account-items-table td:nth-child(9),
.report-account-items-table th:nth-child(10),
.report-account-items-table td:nth-child(10) {
    width: 1%;
    white-space: nowrap;
}

.report-account-items-table th:nth-child(10),
.report-account-items-table .inventory-status-cell {
    text-align: center;
}
/* Comparativo por cuenta: prioriza el nombre y compacta los importes. */
.report-results-card .report-account-table th:nth-child(3),
.report-results-card .report-account-table td:nth-child(3) {
    width: 42% !important;
    min-width: 320px !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.report-results-card .report-account-table th:nth-child(5),
.report-results-card .report-account-table td:nth-child(5),
.report-results-card .report-account-table th:nth-child(6),
.report-results-card .report-account-table td:nth-child(6),
.report-results-card .report-account-table th:nth-child(7),
.report-results-card .report-account-table td:nth-child(7),
.report-results-card .report-account-table th:nth-child(8),
.report-results-card .report-account-table td:nth-child(8),
.report-results-card .report-account-table th:nth-child(9),
.report-results-card .report-account-table td:nth-child(9) {
    width: 1% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}

.report-results-card .report-account-table th:nth-child(1),
.report-results-card .report-account-table td:nth-child(1),
.report-results-card .report-account-table th:nth-child(4),
.report-results-card .report-account-table td:nth-child(4),
.report-results-card .report-account-table th:nth-child(10),
.report-results-card .report-account-table td:nth-child(10) {
    width: 1% !important;
    white-space: nowrap !important;
}
/* Comparativo por cuenta: el código conserva solo el ancho necesario. */
.report-results-card .report-account-table th:nth-child(2),
.report-results-card .report-account-table td:nth-child(2) {
    width: 116px !important;
    min-width: 116px !important;
    max-width: 116px !important;
    white-space: nowrap !important;
}
/* Distribución explícita del comparativo por cuenta contable. */
.report-results-card .report-account-table {
    table-layout: fixed;
}

.report-account-table .report-account-col-number { width: 3%; }
.report-account-table .report-account-col-code { width: 10%; }
.report-account-table .report-account-col-name { width: 20%; }
.report-account-table .report-account-col-items { width: 5%; }
.report-account-table .report-account-col-money { width: 10%; }
.report-account-table .report-account-col-action { width: 3%; }

.report-results-card .report-account-table th,
.report-results-card .report-account-table td {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.report-results-card .report-account-table th:nth-child(3),
.report-results-card .report-account-table td:nth-child(3) {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.report-results-card .report-account-table th:nth-child(2),
.report-results-card .report-account-table td:nth-child(2),
.report-results-card .report-account-table th:nth-child(n+4),
.report-results-card .report-account-table td:nth-child(n+4) {
    white-space: nowrap !important;
}
/* Anexo 1: la acción permanece visible al desplazar la tabla. */
.report-results-card .responsive-table:has(.report-anexo-similar-btn) {
    overflow-x: auto;
    overflow-y: hidden;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) {
    min-width: 1460px;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:last-child,
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:last-child {
    position: sticky;
    right: 0;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    text-align: center;
    background: #ffffff;
    box-shadow: -5px 0 8px -8px rgba(15, 23, 42, .65);
    z-index: 1;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:last-child {
    z-index: 2;
    background: #064b75;
}

.report-results-card .btn-icon.report-anexo-similar-btn {
    display: inline-grid;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 5px;
    place-items: center;
}

.report-results-card .report-anexo-similar-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
/* Anexo 1: distribución compacta para evitar desplazamiento horizontal. */
.report-results-card .responsive-table:has(.report-anexo-similar-btn) {
    overflow: hidden;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th,
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td {
    min-width: 0;
    max-width: none;
    padding: 3px 4px;
    font-size: 10px;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(1),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(1) { width: 3%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(3),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(3) { width: 7%; white-space: normal; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(4),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(4) { width: 16%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(5),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(5) { width: 8%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(6),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(6) { width: 7%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(7),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(7) { width: 7%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(8),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(8) { width: 5%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(9),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(9),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(10),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(10),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(11),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(11),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(12),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(12) { width: 5%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(13),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(13) { width: 6%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(14),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(14) { width: 6%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:last-child,
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:last-child {
    position: static;
    width: 3%;
    min-width: 38px;
    padding: 2px;
    box-shadow: none;
}

.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:last-child {
    background: #064b75;
}
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(4),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(4) {
    width: 25%;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(5),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(5) { width: 7%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(6),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(6) { width: 6%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(8),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(8) { width: 4%; }
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(9),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(9),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(10),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(10),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(11),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(11),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(12),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(12) {
    width: 4%;
    white-space: nowrap;
}
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) th:nth-child(13),
.report-results-card .consolidado-table:has(.report-anexo-similar-btn) td:nth-child(13) { width: 5%; }
/* Anexo 1: anchos explícitos, sin depender de selectores :has(). */
.report-results-card .consolidado-table.report-anexo1-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.report-results-card .responsive-table:has(.report-anexo1-table) {
    overflow: hidden !important;
}

.report-results-card .consolidado-table.report-anexo1-table th,
.report-results-card .consolidado-table.report-anexo1-table td {
    min-width: 0 !important;
    max-width: none !important;
    padding: 3px 4px !important;
    font-size: var(--font-size-table, var(--fs-2xs)) !important;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.report-results-card .consolidado-table.report-anexo1-table thead th {
    font-size: var(--font-size-table-header) !important;
}

.report-results-card .consolidado-table.report-anexo1-table th:nth-child(1), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(1) { width: 3% !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(3), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(3) { width: 7% !important; white-space: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(4), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(4) { width: 20% !important; white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(5), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(5) { width: 8% !important; white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(6), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(6) { width: 7% !important; white-space: nowrap !important; }
.report-results-card .consolidado-table.report-anexo1-table td:nth-child(2) .badge { white-space: nowrap !important; overflow-wrap: normal !important; word-break: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(7), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(7) { width: 6% !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(8), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(8) { width: 4% !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(9), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(9), .report-results-card .consolidado-table.report-anexo1-table th:nth-child(10), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(10), .report-results-card .consolidado-table.report-anexo1-table th:nth-child(11), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(11), .report-results-card .consolidado-table.report-anexo1-table th:nth-child(13), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(13) { width: 4% !important; white-space: nowrap !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(12), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(12) { width: 5% !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(14), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(14) { width: 5% !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(15), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(15) { width: 7% !important; }
.report-results-card .consolidado-table.report-anexo1-table th:last-child, .report-results-card .consolidado-table.report-anexo1-table td:last-child {
    position: static !important;
    width: 3% !important;
    min-width: 38px !important;
    padding: 2px !important;
    box-shadow: none !important;
}
.report-results-card .consolidado-table.report-anexo1-table th:last-child { background: #064b75 !important; }

/* Anexo 6: distribución estable para las columnas de condición física. */
.report-results-card .responsive-table:has(.report-anexo1-table) { overflow-x: auto !important; }
.report-results-card .consolidado-table.report-anexo1-table {
    min-width: 1510px !important;
    table-layout: fixed !important;
}
.report-results-card .consolidado-table.report-anexo1-table th,
.report-results-card .consolidado-table.report-anexo1-table td { white-space: nowrap !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(1), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(1) { width: 40px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(3), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(3) { width: 95px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(4), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(4) { width: 269px !important; white-space: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(5), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(5) { width: 90px !important; white-space: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(6), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(6) { width: 78px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(7), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(7) { width: 82px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(8), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(8) { width: 72px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(n+9):nth-child(-n+13), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(n+9):nth-child(-n+13) { width: 58px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(14), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(14) { width: 72px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(15), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(15) { width: 65px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(16), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(16) { width: 82px !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(17), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(17) { width: 150px !important; white-space: normal !important; }
.report-results-card .consolidado-table.report-anexo1-table th:nth-child(18), .report-results-card .consolidado-table.report-anexo1-table td:nth-child(18) { width: 52px !important; min-width: 52px !important; }
.report-results-card .btn-icon.report-anexo-similar-btn:disabled {
    color: #94a3b8;
    border-color: #cbd5e1;
    background: #f8fafc;
    cursor: not-allowed;
    opacity: .7;
}
/* Navegación lateral: estado seleccionado y foco accesible. */
.sidebar nav .sidebar-nav-item.active,
.sidebar-nav-group .sidebar-nav-parent.active {
    border-color: #38bdf8;
    background: linear-gradient(90deg, rgba(14, 165, 233, .30), rgba(14, 165, 233, .10));
    color: #ecfeff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #22d3ee;
}

.sidebar-submenu a.active {
    border: 1px solid rgba(34, 211, 238, .72);
    background: rgba(14, 165, 233, .24);
    color: #ecfeff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #22d3ee;
}

.sidebar nav .sidebar-nav-item:focus-visible,
.sidebar-nav-group .sidebar-nav-parent:focus-visible,
.sidebar-submenu a:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    border-color: #fbbf24;
}
/* Reportes detallados: los títulos se parten dentro de su propia columna y
   Acción conserva el mismo color que el resto del encabezado. */
.report-results-card .consolidado-table.report-anexo1-table thead th {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: var(--line-height-table-header) !important;
}

.report-results-card .consolidado-table.report-anexo1-table thead th:last-child {
    background: var(--primary) !important;
}

/* Prioridad final: los encabezados de cantidades pueden ocupar dos líneas. */
.report-results-card .consolidado-table.report-anexo1-table thead th:nth-child(n+8):nth-child(-n+12) {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* La última columna no debe heredar el azul especial de la regla :has(). */
.report-results-card .consolidado-table.report-anexo1-table:has(.report-anexo-similar-btn) thead th:last-child {
    background: var(--primary) !important;
}

/* Móvil: todas las tablas conservan su estructura; se desplazan horizontalmente
   cuando su contenido necesita más ancho, sin convertirse en tarjetas. */
@media screen and (max-width: 800px) {
    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) table {
        display: table !important;
        width: max-content !important;
        min-width: 100% !important;
        border: 0 !important;
    }

    .main .responsive-table.apertura-cierre-table table { min-width: 900px !important; }
    .main .responsive-table.users-cards-table table { min-width: 680px !important; }

    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) thead {
        display: table-header-group !important;
    }

    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody {
        display: table-row-group !important;
    }

    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody tr,
    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody tr.inventory-empty-row,
    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody tr.users-empty-row {
        display: table-row !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody td,
    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody tr.inventory-empty-row td,
    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody tr.users-empty-row td {
        display: table-cell !important;
        width: auto !important;
        padding: 4px 6px !important;
        border-bottom: 1px solid var(--line) !important;
        text-align: left !important;
        vertical-align: middle !important;
    }

    .main .responsive-table:is(.apertura-cierre-table, .users-cards-table) tbody td::before {
        display: none !important;
        content: none !important;
    }

    .report-results-card .consolidado-table {
        min-width: 980px !important;
    }
}

/* Corrección móvil de reportes: no comprimir ni recortar columnas. */
@media screen and (max-width: 800px) {
    .report-results-card .responsive-table {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    .report-results-card .consolidado-table.report-anexo1-table {
        width: 980px !important;
        min-width: 980px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    .report-results-card .consolidado-table.report-anexo1-table th,
    .report-results-card .consolidado-table.report-anexo1-table td {
        min-width: 0 !important;
        max-width: none !important;
    }
}

/* El desplazamiento queda contenido dentro de la tabla, nunca en el panel ni
   en toda la página. */
@media screen and (max-width: 800px) {
    .main .report-results-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    .main .report-results-card .responsive-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        touch-action: pan-x pan-y;
    }

    .main .report-results-card .consolidado-table.report-anexo1-table {
        width: 980px !important;
        min-width: 980px !important;
    }
}

/* Resumen por almacén: columnas comparativas proporcionadas y estables. */
.report-results-card .resumen-almacenes-table {
    width: 100%;
    min-width: 1180px;
    table-layout: fixed;
}
.report-results-card .resumen-almacenes-table th,
.report-results-card .resumen-almacenes-table td {
    white-space: nowrap;
}
.report-results-card .resumen-almacenes-table th:first-child,
.report-results-card .resumen-almacenes-table td:first-child {
    white-space: normal;
}
.resumen-almacenes-table .summary-col-warehouse { width: 17%; }
.resumen-almacenes-table .summary-col-kardex,
.resumen-almacenes-table .summary-col-physical { width: 8%; }
.resumen-almacenes-table .summary-col-surplus,
.resumen-almacenes-table .summary-col-missing { width: 8%; }
.resumen-almacenes-table .summary-col-items { width: 5%; }
.resumen-almacenes-table .summary-col-kardex-amount,
.resumen-almacenes-table .summary-col-physical-amount { width: 11%; }
.resumen-almacenes-table .summary-col-surplus-amount,
.resumen-almacenes-table .summary-col-missing-amount { width: 10.5%; }
.resumen-almacenes-table .summary-col-action { width: 3%; }
.report-results-card .resumen-almacenes-table th:nth-child(n+2),
.report-results-card .resumen-almacenes-table td:nth-child(n+2) {
    white-space: nowrap;
}
.report-results-card .report-action-column {
    width: 52px !important;
    min-width: 52px !important;
    padding: 2px !important;
    text-align: center !important;
    vertical-align: middle !important;
}
.report-results-card .report-action-column .btn-icon {
    margin: 0 auto;
}
.report-results-card .resumen-almacenes-table .summary-total-row td {
    background: #e5f2dc;
    border-top: 2px solid #8dad79;
}
.report-warehouse-detail-modal {
    width: min(1180px, 96vw);
    max-width: 1180px;
}
.warehouse-detail-cards {
    margin: 0 0 22px;
}
.report-warehouse-detail-modal h4 {
    margin: 18px 0 9px;
    color: #123d5c;
}
.report-warehouse-detail-modal .responsive-table {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}
.report-warehouse-sobrantes-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.report-warehouse-sobrantes-table th,
.report-warehouse-sobrantes-table td {
    box-sizing: border-box;
    overflow-wrap: break-word;
}
.report-warehouse-sobrantes-table .warehouse-col-number { width: 4%; }
.report-warehouse-sobrantes-table .warehouse-col-type { width: 13%; }
.report-warehouse-sobrantes-table .warehouse-col-code { width: 13%; }
.report-warehouse-sobrantes-table .warehouse-col-name { width: 34%; }
.report-warehouse-sobrantes-table .warehouse-col-brand { width: 11%; }
.report-warehouse-sobrantes-table .warehouse-col-unit { width: 9%; }
.report-warehouse-sobrantes-table .warehouse-col-quantity { width: 7%; }
.report-warehouse-sobrantes-table .warehouse-col-amount { width: 9%; }
.report-warehouse-sobrantes-table th:nth-child(1),
.report-warehouse-sobrantes-table td:nth-child(1),
.report-warehouse-sobrantes-table th:nth-child(7),
.report-warehouse-sobrantes-table td:nth-child(7),
.report-warehouse-sobrantes-table th:nth-child(8),
.report-warehouse-sobrantes-table td:nth-child(8) {
    white-space: nowrap !important;
}
.report-warehouse-sobrantes-table th:nth-child(4),
.report-warehouse-sobrantes-table td:nth-child(4) {
    white-space: normal !important;
}
@media screen and (max-width: 700px) {
    .warehouse-detail-cards { margin-bottom: 18px; }
}
@media screen and (max-width: 800px) {
    .main .report-results-card .consolidado-table.report-anexo1-table {
        width: 1600px !important;
        min-width: 1600px !important;
    }

    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(1),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(1) { width: 36px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(3),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(3) { width: 120px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(4),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(4) { width: 364px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(5),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(5) { width: 120px !important; white-space: normal !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(6),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(6),
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(7),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(7) { width: 100px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(n+8):nth-child(-n+13),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(n+8):nth-child(-n+13) { width: 75px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(13),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(13) { width: 75px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(14),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(14) { width: 90px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:nth-child(15),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(15) { width: 160px !important; }
    .main .report-results-card .consolidado-table.report-anexo1-table th:last-child,
    .main .report-results-card .consolidado-table.report-anexo1-table td:last-child { width: 52px !important; }

    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(2),
    .main .report-results-card .consolidado-table.report-anexo1-table td:nth-child(3) {
        white-space: nowrap !important;
    }
}

/* Login: evita el fondo claro aplicado por el autocompletado del navegador. */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:active {
    -webkit-text-fill-color: #111820 !important;
    -webkit-box-shadow: 0 0 0 1000px #e8effc inset !important;
    box-shadow: 0 0 0 1000px #e8effc inset !important;
    caret-color: #111820;
    transition: background-color 9999s ease-out 0s;
}

.login-field input:autofill {
    color: #111820 !important;
    background: #e8effc !important;
}

/* Reportes: superficie compacta y fluida para pantallas HD.
   El wrapper histórico usa una cuadrícula de ocho columnas; las métricas
   actuales son una sola sección y deben ocuparla completa. */
body.page-reportes .report-metrics-wrap {
    display: block;
    width: 100%;
    margin: 0 0 8px;
}

body.page-reportes .report-metrics-wrap > .metrics-grid {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    width: 100%;
    gap: 6px;
    margin: 0;
}

body.page-reportes .metrics-grid .metric-card {
    min-height: 74px;
    padding: 8px 9px 10px;
}

body.page-reportes .metrics-grid .metric-card > strong {
    font-size: 19px;
}

body.page-reportes .metrics-grid .metric-card small {
    font-size: 10px;
}

body.page-reportes .report-page-head {
    gap: 10px;
    margin-bottom: 7px;
}

body.page-reportes .report-page-head h1 {
    font-size: 20px;
    line-height: 1.1;
}

body.page-reportes .report-page-head .muted {
    margin-top: 2px;
    font-size: var(--font-size-xs);
}

body.page-reportes .report-page-head .actions,
body.page-reportes .report-filter-actions {
    gap: 5px;
}


body.page-reportes .report-results-card {
    margin-top: 0;
    padding: 9px;
}

body.page-reportes .report-filters {
    gap: 5px;
    margin-bottom: 7px;
}

body.page-reportes .report-filters label {
    font-size: 11px;
}

body.page-reportes .report-filters input,
body.page-reportes .report-filters select {
    min-height: 28px;
    padding-block: 3px;
    font-size: 12px;
}

/* Anexo 1: seis campos compactos, observación y acciones en una sola fila. */
body.page-reportes .report-filters.report-anexo1-filters {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr) 118px auto auto;
}

body.page-reportes .report-anexo1-filters :is(input, select) {
    padding-inline: 5px;
    font-size: 11px;
}

body.page-reportes .report-anexo1-filters .report-observation-filter {
    gap: 4px;
    padding-inline: 5px;
}


@media screen and (max-width: 768px) {
    body.page-reportes .report-filters.report-anexo1-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 480px) {
    body.page-reportes .report-filters.report-anexo1-filters {
        grid-template-columns: minmax(0, 1fr);
    }
}

body.page-reportes .report-results-card .consolidado-table th,
body.page-reportes .report-results-card .consolidado-table td {
    padding: 3px 5px;
}

/* Anexo 6: solo la cuenta se divide de forma intencional; los demás títulos
   conservan cada palabra completa y reciben el ancho necesario. */
body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table thead th {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table :is(th, td):nth-child(6) {
    width: 82px !important;
}

body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table thead th:nth-child(6) {
    white-space: normal !important;
    line-height: 1.05 !important;
}

body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table :is(th, td):nth-child(7) { width: 96px !important; }
body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table :is(th, td):nth-child(8) { width: 84px !important; }
body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table :is(th, td):nth-child(9) { width: 84px !important; }
body.page-reportes .main .report-results-card .consolidado-table.report-anexo1-table :is(th, td):nth-child(10) { width: 88px !important; }

/* Submenú de Reportes: conserva los seis accesos visibles sin añadir altura. */
body.page-reportes .sidebar-nav-group:has(#reportes-submenu) .sidebar-submenu {
    gap: 1px;
    margin-bottom: 2px;
}

body.page-reportes .sidebar-nav-group:has(#reportes-submenu) .sidebar-submenu a {
    min-height: 25px;
    padding-block: 2px;
    font-size: 11px;
}

@media screen and (min-width: 1100px) and (max-height: 800px) {
    body.page-reportes .main {
        padding: 9px 12px 12px;
    }

    body.page-reportes .report-metrics-wrap > .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    body.page-reportes .metrics-grid .metric-card {
        min-height: 68px;
        padding: 7px 8px 8px;
    }

    body.page-reportes .metrics-grid .metric-card > strong {
        font-size: 18px;
    }
}

@media screen and (max-width: 768px) {
    body.page-reportes .report-metrics-wrap > .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    }

    body.page-reportes .report-page-head {
        align-items: flex-start;
    }

    body.page-reportes .report-results-card {
        padding: 8px;
    }
}

/* Tablas anchas: la barra auxiliar ubicada sobre la tabla controla el
   desplazamiento; la nativa inferior queda oculta para no duplicarla. */
@media screen {
    .main .responsive-table,
    .responsive-table.anexo-table-scroll {
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Barra auxiliar al inicio de tablas extensas. Permanece visible antes de
   recorrer sus filas y controla el mismo desplazamiento horizontal. */
.table-horizontal-scrollbar {
    height: 12px;
    margin: 0 0 4px;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-color: #64748b #e2e8f0;
    scrollbar-width: auto;
}

.table-horizontal-scrollbar > div {
    height: 1px;
}

.table-horizontal-scrollbar::-webkit-scrollbar {
    height: 10px;
}

.table-horizontal-scrollbar::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.table-horizontal-scrollbar::-webkit-scrollbar-thumb {
    background: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
}

.table-horizontal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

@media print {
    .table-horizontal-scrollbar {
        display: none !important;
    }
}

/* Resumen por almacén: proporciones para que la comparación completa se lea
   en una pantalla HD sin comprimir cifras ni desperdiciar el ancho disponible. */
@media screen and (min-width: 1100px) {
    body.page-reportes .report-results-card .resumen-almacenes-table {
        min-width: 1050px;
        font-size: 11px;
    }

    body.page-reportes .report-results-card .resumen-almacenes-table th,
    body.page-reportes .report-results-card .resumen-almacenes-table td {
        padding: 5px 7px;
    }

    body.page-reportes .report-results-card .resumen-almacenes-table thead th {
        white-space: normal;
        line-height: 1.12;
        font-size: var(--font-size-table-header);
    }

    body.page-reportes .resumen-almacenes-table .summary-col-warehouse { width: 19%; }
    body.page-reportes .resumen-almacenes-table .summary-col-kardex,
    body.page-reportes .resumen-almacenes-table .summary-col-physical,
    body.page-reportes .resumen-almacenes-table .summary-col-surplus,
    body.page-reportes .resumen-almacenes-table .summary-col-missing { width: 7.4%; }
    body.page-reportes .resumen-almacenes-table .summary-col-items { width: 5%; }
    body.page-reportes .resumen-almacenes-table .summary-col-kardex-amount,
    body.page-reportes .resumen-almacenes-table .summary-col-physical-amount,
    body.page-reportes .resumen-almacenes-table .summary-col-surplus-amount,
    body.page-reportes .resumen-almacenes-table .summary-col-missing-amount { width: 10.5%; }
    body.page-reportes .resumen-almacenes-table .summary-col-action { width: 4%; }
}

/* Una sola medida para las situaciones de Anexo 6, sobrantes y faltantes. */
body.page-reportes .report-results-card .consolidado-table td:nth-child(2) .badge {
    padding: 2px 4px;
    font-size: var(--report-situation-font-size) !important;
    line-height: 1.15;
    letter-spacing: -.1px;
    white-space: nowrap !important;
}

body.page-reportes .report-results-card .consolidado-table:is(.report-anexo1-table, .report-sobrantes-table, .report-faltantes-table) :is(th, td):nth-child(2) {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    text-align: center;
    white-space: nowrap;
}

/* Comparativo por cuenta: distribución de escritorio para lectura financiera
   completa en monitores HD. */
@media screen and (min-width: 1100px) {
    body.page-reportes .report-results-card .report-account-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        font-size: 11px;
    }

    body.page-reportes .report-results-card .report-account-table th,
    body.page-reportes .report-results-card .report-account-table td {
        padding: 5px 7px;
    }

    body.page-reportes .report-results-card .report-account-table thead th {
        font-size: var(--font-size-table-header);
        line-height: 1.12;
        white-space: normal !important;
    }

    body.page-reportes .report-account-table .report-account-col-number { width: 3%; }
    body.page-reportes .report-account-table .report-account-col-code { width: 11%; }
    body.page-reportes .report-account-table .report-account-col-name { width: 25%; }
    body.page-reportes .report-account-table .report-account-col-items { width: 5%; }
    body.page-reportes .report-account-table .report-account-col-money { width: 10.5%; }
    body.page-reportes .report-account-table .report-account-col-action { width: 3.5%; }

    body.page-reportes .report-account-table th:nth-child(3),
    body.page-reportes .report-account-table td:nth-child(3) {
        min-width: 0 !important;
        overflow-wrap: normal !important;
    }

    body.page-reportes .report-account-table th:last-child,
    body.page-reportes .report-account-table td:last-child {
        width: 38px !important;
        min-width: 38px !important;
    }
}

/* Sobrantes: anchos estables para las 15 columnas; el excedente se desplaza
   dentro del contenedor en lugar de comprimir los encabezados. */
@media screen {
    body.page-reportes .report-results-card .responsive-table:has(.report-sobrantes-table) {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }
    body.page-reportes .report-results-card .responsive-table:has(.report-sobrantes-table):focus-visible {
        outline: 2px solid var(--info);
        outline-offset: 2px;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table {
        width: 100% !important;
        min-width: 1450px !important;
        table-layout: fixed !important;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table :is(th, td) {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 5px 7px !important;
        font-size: var(--font-size-table) !important;
        line-height: 1.25;
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: normal;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table thead th {
        font-size: var(--font-size-table-header) !important;
        line-height: var(--line-height-table-header) !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table td.number-cell {
        font-variant-numeric: tabular-nums;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table td:is(:nth-child(2), :nth-child(3), :nth-child(6)) {
        white-space: nowrap !important;
        font-variant-numeric: tabular-nums;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table :is(th, td):last-child {
        text-align: center;
    }
    body.page-reportes .report-results-card .consolidado-table.report-sobrantes-table thead th:last-child {
        background: var(--primary) !important;
    }
    .report-sobrantes-table .surplus-col-number { width: 36px; }
    .report-sobrantes-table .surplus-col-situation { width: 76px; }
    .report-sobrantes-table .surplus-col-code { width: 104px; }
    .report-sobrantes-table .surplus-col-brand { width: 84px; }
    .report-sobrantes-table .surplus-col-account { width: 86px; }
    .report-sobrantes-table .surplus-col-location { width: 94px; }
    .report-sobrantes-table .surplus-col-price { width: 80px; }
    .report-sobrantes-table .surplus-col-stock { width: 86px; }
    .report-sobrantes-table .surplus-col-found { width: 96px; }
    .report-sobrantes-table .surplus-col-good { width: 60px; }
    .report-sobrantes-table .surplus-col-difference { width: 76px; }
    .report-sobrantes-table .surplus-col-value { width: 90px; }
    .report-sobrantes-table .surplus-col-observation { width: 140px; }
    .report-sobrantes-table .surplus-col-action { width: 56px; }
}

/* Dashboard: las seis métricas principales comparten una fila en HD. */
@media screen and (min-width: 1100px) {
    body.page-dashboard .metrics-grid.dashboard-metrics-minimal {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card {
        min-height: 82px;
        padding: 9px 10px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card span {
        font-size: 10px;
        line-height: 1.12;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-icon-wrapper {
        width: 27px;
        height: 27px;
        flex-basis: 27px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-icon-wrapper svg {
        width: 14px;
        height: 14px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card > strong {
        font-size: 20px;
    }

    body.page-dashboard .dashboard-metrics-minimal .metric-card small {
        font-size: 9.5px;
        line-height: 1.16;
    }
}

/* Todos los encabezados de tablas usan el tamaño del Anexo 6. Esta regla
   final prevalece sobre los tamaños de celda definidos por cada módulo. */
html body .main table:not(.anexo-table) thead th,
html body .main .responsive-table table:not(.anexo-table) thead th {
    font-size: var(--font-size-table-header) !important;
}
