:root {
    /* ========================================
       COLOR BASE - Cambia este valor para personalizar todo el tema
       Ejemplos:
       - Azul (default): #2f4c79
       - Verde: #2d7a4f
       - Morado: #6b46c1
       - Rojo: #b91c1c
       - Naranja: #c2410c
       ======================================== */
    --color-primary: #00803d;
    --color-primary-dark: #18452c;
    --color-primary-light: #00c555;
    
    --bg-main: #dfe3eb;
    --bg-panel: #f5f5f8;
    --bg-header: var(--color-primary);
    --bg-header-dark: var(--color-primary-dark);
    --border-soft: #c3c7d1;
    --border-strong: #9ca2b1;
    --text-main: #1f1f1f;
    --tile-bg: #ffffff;
    --tile-border: #b8bcc6;
    --tile-hover: #e8efff;
    --tile-icon: var(--color-primary);
    
    /* Variables adicionales para tema completo */
    --menubar-bg: #ffffff;
    --menubar-text: #1f1f1f;
    --menubar-hover: #f0f2f8;
    --menubar-active: var(--color-primary);
    --menubar-active-text: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-text: #1f1f1f;
    --sidebar-hover: #f0f2f8;
    --sidebar-border: #e0e0e0;
    --statusbar-bg: var(--color-primary);
    --statusbar-text: #ffffff;
    --panel-bg: #ffffff;
    --panel-header-bg: #f8f9fa;
    --panel-border: #dee2e6;
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #1f1f1f;
    --table-bg: #ffffff;
    --table-border: #dee2e6;
    --table-header-bg: #f8f9fa;
    --table-row-hover: #f5f5f5;
    --alert-info-bg: #d1ecf1;
    --alert-success-bg: #d4edda;
    --alert-warning-bg: #fff3cd;
    --alert-error-bg: #f8d7da;
    --breadcrumb-bg: #e9ecef;
    --dropdown-bg: #ffffff;
    --dropdown-border: #dee2e6;
    --dropdown-hover: #f8f9fa;
}

/* Modo oscuro completo */
[data-theme="dark"] {
    --color-primary: #00803d;
    --color-primary-dark: #085028;
    --color-primary-light: #00c555;
    
    --bg-main: #1a1a1a;
    --bg-panel: #2d2d2d;
    --bg-header: var(--color-primary);
    --bg-header-dark: var(--color-primary-dark);
    --border-soft: #404040;
    --border-strong: #555555;
    --text-main: #e0e0e0;
    --tile-bg: #2d2d2d;
    --tile-border: #404040;
    --tile-hover: #3a3a3a;
    --tile-icon: var(--color-primary-light);
    
    /* Variables adicionales para tema oscuro */
    --menubar-bg: #252525;
    --menubar-text: #e0e0e0;
    --menubar-hover: #333333;
    --menubar-active: #1e3a5f;
    --menubar-active-text: #ffffff;
    --sidebar-bg: #252525;
    --sidebar-text: #e0e0e0;
    --sidebar-hover: #333333;
    --sidebar-border: #404040;
    --statusbar-bg: #1e3a5f;
    --statusbar-text: #e0e0e0;
    --panel-bg: #2d2d2d;
    --panel-header-bg: #333333;
    --panel-border: #404040;
    --card-bg: #2d2d2d;
    --card-border: #404040;
    --input-bg: #333333;
    --input-border: #555555;
    --input-text: #e0e0e0;
    --table-bg: #2d2d2d;
    --table-border: #404040;
    --table-header-bg: #333333;
    --table-row-hover: #3a3a3a;
    --alert-info-bg: #1a3a4a;
    --alert-success-bg: #1a3a2a;
    --alert-warning-bg: #4a3a1a;
    --alert-error-bg: #4a1a1a;
    --breadcrumb-bg: #333333;
    --dropdown-bg: #2d2d2d;
    --dropdown-border: #404040;
    --dropdown-hover: #3a3a3a;
}

/* Transición suave al cambiar tema */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    overflow: hidden; /* sensación de app de escritorio */
    height: 100%;
}

/* LAYOUT GENERAL */
.app-shell {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height para móviles */
    max-height: 100vh;
    max-height: 100dvh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    grid-template-columns: 260px 1fr;
    grid-template-areas:
        "topbar topbar"
        "menubar menubar"
        "sidebar main"
        "status status";
    overflow: hidden;
}

/* BARRA SUPERIOR (TITULO + AÑO + ICONOS) */
/* TOPBAR BASE */
.topbar {
    grid-area: topbar;
    background: linear-gradient(to bottom, var(--bg-header), var(--bg-header-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    font-size: 13px;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.15);
}

/* CONTENEDORES */
.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* LOGO */
.topbar-logo {
    height: 24px;
    margin-right: 6px;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
}

/* BOTONES DEL TOPBAR */
.topbar button {
    background: transparent;
    border: 0px solid rgba(255,255,255,0.15);
    color: white;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    transition: 0.2s;
}

.topbar button:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.35);
}

/* ICONOS */
.topbar button i {
    font-size: 14px;
    transition: transform .15s ease;
}

.topbar button:hover i {
    transform: scale(1.25);
}

/* USUARIO */
.topbar-user {
    font-size: 13px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.topbar-user:hover {
    background: rgba(255,255,255,0.2);
}

.topbar-user i {
    font-size: 14px;
    opacity: 0.9;
}

/* Evitar que los hijos intercepten clics */
.topbar-user > *,
.topbar-user-letter > * {
    pointer-events: none;
}

/* Ocultar versión móvil por defecto */
.topbar-user-letter {
    display: none;
    cursor: pointer;
}

/* Menú desplegable de usuario */
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 10px;
    margin-top: 8px;
    width: 280px;
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

/* ==========================
   SELECT · Classic Desktop
   ========================== */

.select-classic {
    position: relative;
    width: 100%;
}

/* Select base */
.select-classic select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 100%;
    padding-right: 26px !important;
    cursor: pointer;
}

/* Flecha */
.select-classic::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 8px;
    width: 0;
    height: 0;
    pointer-events: none;

    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--border-strong);

    transform: translateY(-40%);
}

/* Hover */
.select-classic:hover::after {
    border-top-color: var(--color-primary);
}

/* Focus */
.select-classic select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(0,128,61,0.25);
}

/* Disabled */
.select-classic select:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.select-classic select:disabled + * {
    opacity: .5;
}

[data-theme="dark"] .select-classic::after {
    border-top-color: #aaa;
}

[data-theme="dark"] .select-classic:hover::after {
    border-top-color: var(--color-primary-light);
}



.user-dropdown-menu.show {
    display: flex;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-header), var(--bg-header-dark));
    color: white;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

.user-menu-divider {
    height: 1px;
    background: var(--dropdown-border);
    margin: 0;
}

.user-menu-data {
    padding: 12px 16px;
    background: var(--panel-header-bg);
}

.user-data-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.user-data-item:last-child {
    margin-bottom: 0;
}

.user-data-item i {
    width: 16px;
    text-align: center;
    color: var(--tile-icon);
    font-size: 13px;
}

.user-menu-actions {
    padding: 8px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.user-menu-item:hover {
    background: var(--dropdown-hover);
}

.user-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--tile-icon);
}

.user-menu-item.logout {
    color: #dc3545;
}

.user-menu-item.logout i {
    color: #dc3545;
}

.user-menu-item.logout:hover {
    background: #fff5f5;
}

/* ============================
   RESPONSIVE MOBILE (<900px)
=============================== */
@media (max-width: 900px) {

    /* Esconder versión completa */
    .topbar-user {
        display: none !important;
    }

    /* Mostrar versión corta */
    .topbar-user-letter {
        display: flex;
        font-size: 13px;
        padding: 4px 10px;
        background: rgba(255,255,255,0.12);
        border-radius: 4px;
        border: 1px solid rgba(255,255,255,0.18);
        align-items: center;
        gap: 6px;
        cursor: default;
    }
}


/* SEPARADOR ENTRE BOTONES */
.topbar-separator {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.25);
    margin: 0 4px;
}


/* MENU PRINCIPAL (Inicio, Ventas, Compras, etc.) */
.menubar {
    grid-area: menubar;
    background: var(--menubar-bg);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 13px;
}

.menubar a {
    text-decoration: none;
    color: var(--menubar-text);
}

.menubar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2px;
}

.menubar-li {
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 3px 3px 0 0;
    border: 1px solid transparent;
    color: var(--menubar-text);
}

.menubar-li:hover {
    background: var(--menubar-hover);
}

.menubar-li.active {
    background: var(--panel-bg);
    border-color: var(--border-soft);
    border-bottom-color: var(--panel-bg);
    font-weight: 600;
}

/* SIDEBAR NAVEGADOR */
.sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 6px;
    font-size: 13px;
    height: 100%;
    min-height: 0;
}

.sidebar-header {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.sidebar-panel {
    border: 1px solid var(--border-soft);
    background: var(--panel-bg);
    border-radius: 3px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar-tree {
        padding-bottom: 10px;
    }
}


.sidebar-filter {
    border-bottom: 1px solid var(--border-soft);
    background: var(--panel-header-bg);
    padding: 4px 6px;
    font-weight: 600;
    color: var(--text-main);
}

.sidebar-tree {
    padding: 4px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    background: var(--panel-bg);
}

.sidebar-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 12px;
    font-size: 12px;
}

.sidebar-tree li {
    padding: 2px 0;
    margin: 2px 0;
    cursor: pointer;
    color: var(--sidebar-text);
}

.sidebar-tree li i {
    width: 14px;
    text-align: center;
    margin-right: 3px;
    color: var(--sidebar-text);
}

.sidebar-tree li:hover {
    background: var(--sidebar-hover);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu > li {
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    border-radius: 3px;
    padding: 4px 6px;
}

/* Elementos con has-submenu necesitan flex-direction column */
.sidebar-menu > li.has-submenu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

li a {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    width: 100%;
}

li a i {
    margin-right: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
}

.menu-item i {
    margin-right: 6px;
}


.sidebar-menu li:hover {
    background: var(--sidebar-hover);
}

/* ICONO ANIMADO */
.sidebar-menu li > i,
.menu-item > i {
    transition: transform 0.18s ease, color 0.18s ease;
}

.sidebar-menu li:hover > i,
.menu-item:hover > i {
    transform: scale(1.18);
    color: var(--tile-icon);
}


.has-submenu {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.submenu {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease-out, opacity 0.25s ease-out;
    display: block;
    width: 100%;
    position: static;
    clear: both;
}

.submenu li {
    padding: 4px 0;
    font-size: 12px;
    display: block;
    width: 100%;
    color: var(--sidebar-text);
    cursor: pointer;
}

.submenu li.active {
    font-weight: 700;
    color: var(--color-primary) !important;
}

.submenu li:hover {
    color: var(--color-primary-light);
}

.submenu li a {
    text-decoration: none;
    color: var(--sidebar-text);
}

.submenu li a.active {
    text-decoration: none;
    color: var(--color-primary);
}

.has-submenu.open > .submenu {
    max-height: 500px; /* suficiente para varios items */
    opacity: 1;
}

.arrow {
    transition: transform 0.25s ease;
    font-size: 11px;
}

.has-submenu.open .arrow {
    transform: rotate(90deg);
}


/* TREE LINES */
.tree li {
    position: relative;
    padding-left: 20px;
    margin: 0;
}

/* Elementos sin tree (directos) */
.sidebar-menu > li:not(.has-submenu) {
    padding: 4px 6px;
}

.sidebar-menu > li:not(.has-submenu) a {
    display: block;
    width: 100%;
}

/* Línea vertical ( │ ) */
.tree li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: -6px;
    width: 1px;
    height: 100%;
    background: var(--sidebar-border);
}

/* Línea horizontal ( ├─ ) */
.tree li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 12px;
    width: 10px;
    height: 1px;
    background: var(--sidebar-border);
}

/* El último elemento no tiene línea vertical continua */
.tree li.last::before {
    height: 18px;  /* corta la línea vertical */
}

/* ==========================
   LOADER / SPINNER
   ========================== */

.loader {
    border: 4px solid var(--border-soft);
    border-top: 4px solid var(--tile-icon);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page Loader - Pantalla de carga inicial */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-text {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

/* AREA PRINCIPAL */
.main {
    grid-area: main;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-main);
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}


.w-100 {
    width: 100%;
}


.main-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
        }

/* GRID DE APPS */
.app-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 12px;
        }

.app-tile {
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
    border-radius: 4px;
    padding: 12px 14px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 1px 2px #0002;

    /* LO NUEVO */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}

.app-tile .tile-link {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.app-tile .tile-link:hover {
    text-decoration: none;
    color: inherit;
}


.tile-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tile-header {
    font-size: 14px;
    font-weight: 600;
}

.tile-subtitle {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
    margin-bottom: 4px;
}

.tile-icon {
    font-size: 28px;
    color: var(--tile-icon);
    margin-left: 8px; /* espacio para respirar */
}

.module-window {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.module-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-soft);
    background: #e3e7f0;
    font-size: 13px;
}

.module-tab {
    padding: 4px 10px;
    border-right: 1px solid var(--border-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-tab.active {
    background: #ffffff;
    font-weight: 600;
}

.module-content {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

/* TOOLBAR DENTRO DEL MODULO */
.module-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool-btn {
    width: 28px;
    height: 26px;
    border-radius: 3px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(to bottom, #ffffff, #dfe4f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
}

.tool-btn:hover {
    background: linear-gradient(to bottom, #ffffff, #cfd5e7);
}

/* FORM SUPERIOR */
.form-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 8px;
    font-size: 12px;
    margin-top: 4px;
}

.form-row label {
    font-weight: 600;
    margin-bottom: 1px;
}

.form-row input[type="text"],
.form-row input[type="date"],
.form-row select {
    width: 100%;
    padding: 1px 3px;
    font-size: 12px;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    background: #ffffff;
}

.form-radio-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.form-radio-group label {
    font-weight: normal;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 2px;
}

/* TABLA DE PRODUCTOS */
.table-wrapper {
    border: 1px solid var(--border-soft);
    background: #ffffff;
    border-radius: 2px;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* min-height: 180px; */
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table-wrapper thead {
    background: #e3e7f0;
    border-bottom: 1px solid var(--border-soft);
}

.table-wrapper th,
.table-wrapper td {
    padding: 2px 4px;
    border-right: 1px solid #d3d8e0;
    border-bottom: 1px solid #e3e7f0;
    white-space: nowrap;
}

.table-wrapper th:last-child,
.table-wrapper td:last-child {
    border-right: none;
}

.table-wrapper tbody tr:nth-child(even) {
    background: #f7f8fc;
}

.table-wrapper tbody tr:hover {
    background: #e8f0ff;
}

/* SECCION TOTALES Y LISTADO INFERIOR */
.totals-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
}

.observaciones-box {
    border: 1px solid var(--border-soft);
    background: #ffffff;
    padding: 4px;
    border-radius: 2px;
    min-height: 50px;
}

.totals-box {
    border: 1px solid var(--border-soft);
    background: #ffffff;
    border-radius: 2px;
    padding: 4px 6px;
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 2px;
    column-gap: 4px;
    align-items: center;
}

.totals-box label {
    text-align: right;
}

.totals-box input {
    width: 100%;
    padding: 1px 3px;
    font-size: 12px;
    border-radius: 2px;
    border: 1px solid var(--border-strong);
    text-align: right;
}

.sub-grid-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.sub-grid {
    border: 1px solid var(--border-soft);
    background: #ffffff;
    border-radius: 2px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.sub-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px;
    border-bottom: 1px solid var(--border-soft);
    background: #f0f2f8;
    font-size: 12px;
}

.sub-grid-search {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sub-grid-search input {
    font-size: 12px;
    padding: 1px 3px;
    border-radius: 2px;
    border: 1px solid var(--border-strong);
}

.sub-grid table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sub-grid th,
.sub-grid td {
    padding: 2px 4px;
    border-right: 1px solid #d3d8e0;
    border-bottom: 1px solid #e3e7f0;
    white-space: nowrap;
}

.sub-grid th:last-child,
.sub-grid td:last-child {
    border-right: none;
}

.sub-grid tfoot td {
    background: #f0f2f8;
    font-weight: 600;
}

/* BARRA DE ESTADO */
.statusbar {
    grid-area: status;
    height: 26px;
    background: #e3e7f0;
    border-top: 1px solid var(--border-soft);
    padding: 2px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

@media (max-width: 992px) {
    .main {
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
}


.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    border: 1px solid #1e8449;
}

/* === RESPONSIVE DESIGN === */

/* Variables para breakpoints */
@media (max-width: 1200px) {
    .app-shell {
        grid-template-columns: 200px 1fr;
    }
    
    .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 8px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    body {
        overflow: auto;
    }
    
    .app-shell {
        grid-template-columns: 180px 1fr;
    }
    
    .topbar {
        padding: 6px 10px;
    }
    
    .topbar-left span {
        display: none;
    }
    
    .menubar {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .menubar::-webkit-scrollbar {
        display: none;
    }
    
    .menubar ul {
        white-space: nowrap;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tablets (7-8 pulgadas: 768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .app-shell {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        grid-template-rows: auto auto 1fr auto;
        overflow: hidden;
    }
    
    .sidebar {
        display: flex !important;
    }
    
    .sidebar-panel {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .sidebar-tree {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .main {
        padding: 12px;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        max-height: 100%;
    }
    
    .statusbar {
        display: flex !important;
        height: 28px;
        padding: 4px 10px;
        font-size: 11px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        z-index: 100;
    }
    
    .status-left,
    .status-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .dataTables_info,
    .dataTables_paginate {
        display: flex !important;
    }
}

/* Mobile landscape */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        grid-template-areas:
            "topbar"
            "menubar"
            "main"
            "status";
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
    }
    
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        background: var(--bg-panel);
        border-right: 1px solid var(--border-soft);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow: hidden;
    }
    
    .sidebar.show {
        display: flex;
        transform: translateX(0);
    }
    
    .sidebar-panel {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100%;
    }
    
    .sidebar-tree {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .topbar {
        padding: 8px 10px;
        position: relative;
    }
    
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 28px;
        background: transparent;
        border: none;
        color: white;
        cursor: pointer;
        margin-right: 8px;
        border-radius: 3px;
    }
    
    .menu-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .topbar-left span {
        font-size: 12px;
    }
    
    .topbar-right span:first-child {
        display: none;
    }
    
    .menubar {
        padding: 0 4px;
        overflow-x: auto;
        scrollbar-width: thin;
    }
    
    .menubar ul {
        gap: 1px;
    }
    
    .menubar-li {
        padding: 6px 8px;
        white-space: nowrap;
        font-size: 12px;
    }
    
    .main {
        padding: 4px;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        max-height: 100%;
    }
    
    .module-toolbar {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .tool-btn {
        width: 36px;
        height: 32px;
        font-size: 14px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 8px 4px;
    }
    
    .form-radio-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .totals-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .table-wrapper,
    .sub-grid {
        overflow-x: auto;
    }
    
    .table-wrapper table,
    .sub-grid table {
        min-width: 800px;
    }
    
    .statusbar {
        display: flex !important;
        padding: 4px 8px;
        font-size: 10px;
        height: auto;
        min-height: 24px;
        flex-direction: row;
        gap: 4px;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        flex-wrap: wrap;
        position: sticky;
        bottom: 0;
        z-index: 100;
    }
    
    .status-left,
    .status-right {
        gap: 6px;
        flex-wrap: wrap;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .topbar {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .topbar-year {
        padding: 1px 6px;
        font-size: 10px;
    }
    
    .menubar {
        padding: 0 2px;
    }
    
    .menubar-li {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .main {
        padding: 10px;
    }
    
    .module-content {
        padding: 4px;
        gap: 4px;
    }
    
    .tool-btn {
        width: 32px;
        height: 28px;
        font-size: 12px;
    }
    
    .form-row {
        font-size: 11px;
        gap: 6px 2px;
    }
    
    .form-row input[type="text"],
    .form-row input[type="date"],
    .form-row select {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    .section-title {
        font-size: 11px;
    }
    
    .table-wrapper th,
    .table-wrapper td,
    .sub-grid th,
    .sub-grid td {
        padding: 3px 2px;
        font-size: 10px;
    }
    
    .totals-box {
        padding: 4px;
        font-size: 11px;
    }
    
    .totals-box input {
        font-size: 11px;
        padding: 2px 3px;
    }
    
    .sub-grid-header {
        padding: 3px;
        font-size: 11px;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .sub-grid-search {
        width: 100%;
        justify-content: space-between;
    }
    
    .sub-grid-search input {
        font-size: 11px;
        flex: 1;
        max-width: 120px;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .app-shell {
        grid-template-columns: 280px 1fr;
    }
    
    .form-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Hide menu toggle on larger screens */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .tool-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    .menubar-li {
        min-height: 40px;
        display: flex;
        align-items: center;
    }
    
    .sidebar-tree li {
        min-height: 32px;
        display: flex;
        align-items: center;
    }
}


/* ===========================
   STATUS BAR  · VSCode Style
   =========================== */

.statusbar {
    grid-area: status;
    height: 26px;
    background: linear-gradient(to bottom, #1e1e1e, #252526);
    color: #dcdcdc;
    border-top: 1px solid #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    padding: 0 10px;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Items estilo VSCode */
.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: default;
    transition: background .15s;
}

.status-item:hover {
    background: rgba(255,255,255,0.08);
}

/* Íconos VSCode */
.status-item i {
    font-size: 13px;
    opacity: .85;
}

/* ==========================
   DARK MODE · Professional
   ========================== */

body.dark-mode {
    --bg-main: #1f1f1f;
    --bg-panel: #2b2b2b;
    --bg-header: #2f2f2f;
    --bg-header-dark: #222;
    --border-soft: #3b3b3b;
    --border-strong: #555;
    --text-main: #e5e5e5;
    --tile-bg: #2b2b2b;
    --tile-border: #444;
    --tile-hover: #333;
    --tile-icon: #7ab0ff;
    background: #1f1f1f;
}

/* Topbar */
body.dark-mode .topbar {
    background: linear-gradient(to bottom, #3a3a3a, #1e1e1e);
    color: #fff;
}

/* Statusbar */
body.dark-mode .statusbar {
    background: #252526;
    border-top: 1px solid #3a3a3a;
}

/* Sidebar */
body.dark-mode .sidebar {
    background: #2a2a2a;
    border-right: 1px solid #3b3b3b;
}

body.dark-mode .sidebar-menu > li:hover,
body.dark-mode .sidebar-menu > li.open {
    background: #3a3a3a;
}

/* Arbol */
body.dark-mode .submenu li {
    color: #dcdcdc;
}

/* Main */
body.dark-mode .main {
    background: #232323;
}

/* Tiles */
body.dark-mode .app-tile {
    background: #2d2d2d;
    border: 1px solid #444;
    box-shadow: 0 1px 3px #0006;
}
body.dark-mode .app-tile:hover {
    background: #3b3b3b;
}

/* Inputs */
body.dark-mode input,
body.dark-mode .form-control {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

/* Buttons */
body.dark-mode button {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,.15);
}
body.dark-mode button:hover {
    background: rgba(255,255,255,0.18);
}

/* ==========================================
   RESPONSIVE TOPBAR – MODO MÓVIL
========================================== */
@media (max-width: 900px) {

    /* Mostrar botón menú */
    #menuToggle {
        display: block !important;
    }

    /* Ocultar botones de la derecha excepto usuario */
    .topbar-right button:not(.user-only) {
        display: none;
    }

    /* Mostrar solo el icono de usuario */
    .topbar-user {
        margin-left: auto;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Logo centrado */
    .topbar-left {
        width: 100%;
        justify-content: center;
        position: relative;
    }

    .topbar-left img {
        height: 28px;
        margin: 0 auto;
    }

    /* Reposicionar toggle */
    #menuToggle {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* ==========================
   ALERTS · Classic Desktop
   ========================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 2px #00000014;
}

.alert i {
    font-size: 15px;
    margin-top: 2px;
}

.alert-content {
    line-height: 1.3;
}

.alert-info {
    background: #eef4ff;
    border-color: #b5c7e6;
    color: #1f3a68;
}

.alert-info i {
    color: #2f4c79;
}

.alert-success {
    background: #edf8f0;
    border-color: #9dd6b5;
    color: #1e6b3a;
}

.alert-success i {
    color: #2ecc71;
}

.alert-warning {
    background: #fff7e6;
    border-color: #e6c97a;
    color: #7a5a12;
}

.alert-warning i {
    color: #f1c40f;
}

.alert-error {
    background: #fdecea;
    border-color: #e0a29c;
    color: #7b1e17;
}

.alert-error i {
    color: #e74c3c;
}

.alert-system {
    background: #f0f2f8;
    border-color: var(--border-soft);
    color: #333;
}

.alert-system i {
    color: #2f4c79;
}

/* Dark Mode Alerts */
body.dark-mode .alert {
    background: #2b2b2b;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .alert-info {
    background: #2a3446;
}

body.dark-mode .alert-success {
    background: #243a2e;
}

body.dark-mode .alert-warning {
    background: #3a321f;
}

body.dark-mode .alert-error {
    background: #3a2422;
}



/* ==========================
   BUTTONS · Classic Desktop
   ========================== */

.btn-classic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-family: "Segoe UI", Tahoma, sans-serif;
    border-radius: 3px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(to bottom, #ffffff, #dfe4f1);
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background .15s, border-color .15s;
}

.btn-classic i {
    font-size: 13px;
}

.btn-classic:hover {
    background: linear-gradient(to bottom, #ffffff, #cfd5e7);
    border-color: var(--border-strong);
}

.btn-classic:active {
    background: #cfd5e7;
}

.btn-primary {
    background: linear-gradient(to bottom, #3f6fb3, #2f4c79);
    border-color: #253b5b;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #4c7fd1, #2f4c79);
}

.btn-secondary {
    background: linear-gradient(to bottom, #ffffff, #e6e8ef);
    border-color: var(--border-soft);
    color: var(--text-main);
}

[data-theme="dark"] .btn-secondary {
    background: linear-gradient(to bottom, #4a4a4a, #3a3a3a);
    border-color: var(--border-soft);
    color: var(--text-main);
}

.btn-success {
    background: linear-gradient(to bottom, #4cd17c, #2ecc71);
    border-color: #27ae60;
    color: #fff;
}

.btn-warning {
    background: linear-gradient(to bottom, #f9d56e, #f1c40f);
    border-color: #d4ac0d;
    color: #5a4608;
}

.btn-danger {
    background: linear-gradient(to bottom, #f07b72, #e74c3c);
    border-color: #c0392b;
    color: #fff;
}

.btn-icon {
    width: 28px;
    height: 26px;
    padding: 0;
    justify-content: center;
}

.btn-sm {
    padding: 2px 8px;
    font-size: 12px;
}

.btn-lg {
    padding: 6px 14px;
    font-size: 14px;
}

.btn-classic:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-loading {
    pointer-events: none;
    opacity: .75;
}

body.dark-mode .btn-classic {
    background: linear-gradient(to bottom, #3a3a3a, #2a2a2a);
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .btn-primary {
    background: linear-gradient(to bottom, #4c7fd1, #2f4c79);
}


/* ==========================
   PANELS · Classic Desktop
   ========================== */

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    margin-bottom: 6px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--panel-header-bg);
    border-bottom: 1px solid var(--panel-border);
    font-size: 13px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-main);
}

.panel-title i {
    font-size: 14px;
    color: var(--tile-icon);
}

.panel-actions {
    display: flex;
    gap: 4px;
}

.panel-body {
    padding: 8px 10px;
    background: var(--panel-bg);
    flex: 1;
    overflow: auto;
    font-size: 13px;
    color: var(--text-main);
}

.panel-footer {
    padding: 6px 10px;
    background: var(--panel-header-bg);
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.panel.compact .panel-header {
    padding: 4px 8px;
    font-size: 12px;
}

.panel.compact .panel-body {
    padding: 6px 8px;
    font-size: 12px;
}

.panel.compact .panel-footer {
    padding: 4px 8px;
}

body.dark-mode .panel {
    background: #2a2a2a;
    border-color: #3b3b3b;
}

body.dark-mode .panel-header {
    background: linear-gradient(to bottom, #3a3a3a, #2e2e2e);
    border-bottom-color: #3b3b3b;
}

body.dark-mode .panel-body {
    background: #232323;
}

body.dark-mode .panel-footer {
    background: #2a2a2a;
    border-top-color: #3b3b3b;
}

/* ==========================
   FORMS · Classic Desktop
   ========================== */

.form-classic {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 3px 6px;
    font-size: 13px;
    border-radius: 2px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--input-text);
    margin-bottom: 6px;
}

.form-control:focus {
    outline: none;
    border-color: var(--tile-icon);
    box-shadow: 0 0 0 1px rgba(47, 76, 121, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

/* ==========================
   FORM HORIZONTAL
   ========================== */

.form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.horizontal {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 6px;
}

.form-group.horizontal label {
    margin: 0;
    font-size: 12px;
    text-align: left;
    padding-right: 6px;
}

@media (max-width: 768px) {

    .form-group.horizontal {
        grid-template-columns: 1fr;
    }

    .form-group.horizontal label {
        text-align: left;
        padding-right: 0;
    }
}



.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
}

.form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-row.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-options {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 12px;
}

.form-options label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group.error label {
    color: #7b1e17;
}

.form-group.error .form-control {
    border-color: #e74c3c;
    background: #fdecea;
}

.form-error {
    font-size: 11px;
    color: #7b1e17;
}

.form-group.warning .form-control {
    border-color: #f1c40f;
    background: #fff7e6;
}

.form-group.success .form-control {
    border-color: #2ecc71;
    background: #edf8f0;
}

.required::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}
.form-help {
    font-size: 11px;
    color: #555;
}

.form-compact .form-control {
    padding: 2px 4px;
    font-size: 12px;
}

body.dark-mode .form-control {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .form-group.error .form-control {
    background: #3a2422;
}

/* ==========================
   TABLES · Classic Desktop
   ========================== */

.table-wrapper {
    border: 1px solid var(--border-soft);
    background: #ffffff;
    border-radius: 2px;
    overflow: auto;
}




.table-classic {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table-classic thead {
    background: #e3e7f0;
    border-bottom: 1px solid var(--border-soft);
}

.table-classic th {
    text-align: left;
    padding: 4px 6px;
    font-weight: 600;
    white-space: nowrap;
}

.table-classic td {
    padding: 3px 6px;
    border-bottom: 1px solid #e3e7f0;
    white-space: nowrap;
}

.table-classic th,
.table-classic td {
    border-right: 1px solid #d3d8e0;
}

.table-classic th:last-child,
.table-classic td:last-child {
    border-right: none;
}

.table-classic tbody tr:nth-child(even) {
    background: #f7f8fc;
}

.table-classic tbody tr:hover {
    background: #e8f0ff;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.table-classic tr.selected {
    background: #dbe8ff !important;
}
.table-classic tr.disabled {
    opacity: 0.6;
}
.badge {
    padding: 1px 6px;
    font-size: 11px;
    border-radius: 10px;
    border: 1px solid transparent;
    display: inline-block;
    font-weight: 500;
}

.badge-primary {
    background: #e3ecf9;
    border-color: #2f4c79;
    color: #1f3a5b;
}

.badge-secondary {
    background: #e8e8e8;
    border-color: #6c757d;
    color: #3d4349;
}

.badge-success {
    background: #edf8f0;
    border-color: #2ecc71;
    color: #1e6b3a;
}

.badge-warning {
    background: #fff7e6;
    border-color: #f1c40f;
    color: #7a5a12;
}

.badge-danger {
    background: #fdecea;
    border-color: #e74c3c;
    color: #7b1e17;
}

.badge-info {
    background: #e6f7ff;
    border-color: #17a2b8;
    color: #0c5460;
}

.badge-light {
    background: #f8f9fa;
    border-color: #ddd;
    color: #555;
}

.badge-dark {
    background: #343a40;
    border-color: #23272b;
    color: #f8f9fa;
}

.badge-pill {
    border-radius: 50px;
    padding: 2px 10px;
}

.table-empty {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #666;
}

.table-loading {
    text-align: center;
    padding: 16px;
    font-size: 13px;
}

.sub-table {
    margin: 6px;
    border: 1px solid var(--border-soft);
}

/* Dark Mode - Tables */
body.dark-mode .table-wrapper {
    background: #2a2a2a !important;
    border-color: #444 !;
}

body.dark-mode .table-classic {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .table-classic thead {
    background: #333 !important;
    border-bottom-color: #444;
}

body.dark-mode .table-classic th {
    color: #e0e0e0;
    border-right-color: #3a3a3a;
}

body.dark-mode .table-classic td {
    color: #d1d5db;
    border-bottom-color: #3a3a3a;
    border-right-color: #3a3a3a;
}

body.dark-mode .table-classic tbody tr:nth-child(even) {
    background: #2e2e2e;
}

body.dark-mode .table-classic tbody tr:hover {
    background: #3a3a3a;
}

body.dark-mode .table-classic tr.selected {
    background: #2f4c79 !important;
}

body.dark-mode .table-empty,
body.dark-mode .table-loading {
    color: #9ca3af;
}

/* Dark Mode - Badges */
body.dark-mode .badge-primary {
    background: #2f4c79;
    border-color: #4c7fd1;
    color: #e3ecf9;
}

body.dark-mode .badge-success {
    background: #1e6b3a;
    border-color: #2ecc71;
    color: #d4edda;
}

body.dark-mode .badge-warning {
    background: #7a5a12;
    border-color: #f1c40f;
    color: #fff3cd;
}

body.dark-mode .badge-danger {
    background: #7b1e17;
    border-color: #e74c3c;
    color: #fdecea;
}

body.dark-mode .badge-info {
    background: #0c5460;
    border-color: #17a2b8;
    color: #d1ecf1;
}

body.dark-mode .badge-secondary {
    background: #3d4349;
    border-color: #6c757d;
    color: #e8e8e8;
}

body.dark-mode .badge-dark {
    background: #555;
    border-color: #777;
    color: #e0e0e0;
}

body.dark-mode .badge-light {
    background: #4a4a4a;
    border-color: #666;
    color: #e0e0e0;
}

/* ==========================
   MODALS · Classic Desktop
   ========================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-window {
    width: 420px;
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px #00000055;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: linear-gradient(to bottom, #e3e7f0, #d5dae6);
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.modal-title i {
    color: #2f4c79;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #444;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 12px;
    font-size: 13px;
    background: #ffffff;
    line-height: 1.4;
}

.modal-footer {
    padding: 8px 10px;
    border-top: 1px solid var(--border-soft);
    background: #f0f2f8;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.modal-sm  { width: 320px; }
.modal-md  { width: 480px; }
.modal-lg  { width: 680px; }

.modal-detail-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
}

.modal-detail-row label {
    font-weight: 600;
    color: #555;
}

body.dark-mode .modal-window {
    background: #2a2a2a;
    border-color: #3b3b3b;
}

body.dark-mode .modal-header {
    background: linear-gradient(to bottom, #3a3a3a, #2e2e2e);
}

body.dark-mode .modal-body {
    background: #232323;
}

body.dark-mode .modal-footer {
    background: #2a2a2a;
}

/* ==========================
   CARDS · Classic Admin
   ========================== */

.card-classic {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    transition: background .15s, box-shadow .15s;
}

.card-classic:hover {
    background: var(--tile-hover);
    box-shadow: 0 2px 6px #00000022;
}

.card-header {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    background: var(--panel-header-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

.card-header i {
    color: var(--tile-icon);
}

.card-body {
    padding: 12px 10px;
    text-align: center;
    color: var(--text-main);
}

.card-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--tile-icon);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-main);
    opacity: 0.7;
}

.card-footer {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--panel-header-bg);
    border-top: 1px solid var(--card-border);
    text-align: center;
    cursor: pointer;
    color: var(--text-main);
}

.card-footer:hover {
    background: var(--tile-hover);
}

.card-clickable {
    cursor: pointer;
}

.card-module {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-module .card-body {
    text-align: left;
}

.card-module i {
    font-size: 28px;
    color: var(--tile-icon);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.card-text {
    font-size: 13px;
    text-align: left;
}

body.dark-mode .card-classic {
    background: #2a2a2a;
    border-color: #3b3b3b;
}

body.dark-mode .card-header {
    background: #2e2e2e;
    border-bottom-color: #3b3b3b;
}

body.dark-mode .card-footer {
    background: #2a2a2a;
}

/* ==========================
   TABS · Classic Desktop
   ========================== */

.tabs-bar {
    display: flex;
    gap: 1px;
    background: var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
}
.tab-item {
    padding: 6px 12px;
    background: #e3e7f0;
    cursor: pointer;
    border: 1px solid var(--border-soft);
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
}

.tab-item i {
    font-size: 13px;
    color: #2f4c79;
}

.tab-item.active {
    background: #ffffff;
    font-weight: 600;
    position: relative;
    top: 1px;
}
.tab-item:not(.active):hover {
    background: #d5dae6;
}
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
.tabs-bar.compact .tab-item {
    padding: 4px 10px;
    font-size: 12px;
}

body.dark-mode .tabs-bar {
    background: #3b3b3b;
    border-bottom-color: #3b3b3b;
}

body.dark-mode .tab-item {
    background: #2e2e2e;
    border-color: #3b3b3b;
    color: #e0e0e0;
}

body.dark-mode .tab-item.active {
    background: #232323;
}


/* ==========================
   BREADCRUMBS · Classic ERP
   ========================== */

.breadcrumb-bar {
    padding: 6px 10px;
    background: var(--breadcrumb-bg);
    border-bottom: 1px solid var(--border-soft);
    font-size: 12px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    opacity: 0.7;
}

.breadcrumb li::after {
    content: ">";
    opacity: 0.5;
}

.breadcrumb li:last-child::after {
    content: "";
}

.breadcrumb a {
    color: var(--tile-icon);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb li.active {
    font-weight: 600;
    opacity: 1;
}

.breadcrumb.title {
    font-size: 14px;
    font-weight: 700;
}

.breadcrumb.compact {
    font-size: 11px;
}

.breadcrumb.compact li {
    gap: 4px;
}

body.dark-mode .breadcrumb-bar {
    background: #2a2a2a;
    border-bottom-color: #3b3b3b;
}

body.dark-mode .breadcrumb li {
    color: #ccc;
}

body.dark-mode .breadcrumb a {
    color: #7ab0ff;
}

body.dark-mode .breadcrumb li.active {
    color: #fff;
}

/* ==========================
   TOASTS · Classic Admin
   ========================== */

.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3000;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    box-shadow: 0 2px 8px #00000033;
    animation: toast-slide-in .2s ease-out;
}

.toast i {
    font-size: 14px;
    margin-top: 2px;
}

@keyframes toast-slide-in {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-info {
    background: #eef4ff;
    border-color: #b5c7e6;
    color: #1f3a68;
}

.toast-info i {
    color: #2f4c79;
}

.toast-success {
    background: #edf8f0;
    border-color: #9dd6b5;
    color: #1e6b3a;
}

.toast-success i {
    color: #2ecc71;
}

.toast-warning {
    background: #fff7e6;
    border-color: #e6c97a;
    color: #7a5a12;
}

.toast-warning i {
    color: #f1c40f;
}

.toast-error {
    background: #fdecea;
    border-color: #e0a29c;
    color: #7b1e17;
}

.toast-error i {
    color: #e74c3c;
}
body.dark-mode .toast {
    background: #2a2a2a;
    border-color: #3b3b3b;
    color: #e0e0e0;
}

body.dark-mode .toast-info {
    background: #2a3446;
}

body.dark-mode .toast-success {
    background: #243a2e;
}

body.dark-mode .toast-warning {
    background: #3a321f;
}

body.dark-mode .toast-error {
    background: #3a2422;
}

/* ==========================
   PRINT · REPORT LAYOUT
   ========================== */

@page {
    size: A4;
    margin: 20mm 15mm;
}

.report-page {
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 12px;
    color: #000;
}

.report-header {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.report-logo img {
    max-width: 80px;
}

.report-title h1 {
    margin: 0;
    font-size: 16px;
    text-transform: uppercase;
}

.report-meta {
    font-size: 11px;
    color: #333;
}

.report-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    font-size: 11px;
}

.report-content {
    margin-top: 10px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.report-table th,
.report-table td {
    border: 1px solid #000;
    padding: 4px 6px;
}

.report-table th {
    background: #eaeaea;
    text-align: left;
}

.report-summary {
    margin-top: 12px;
    width: 40%;
    font-size: 11px;
}

.report-summary div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #000;
    padding: 2px 0;
}

.report-signatures {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 40px;
    text-align: center;
}

.report-signatures .line {
    border-top: 1px solid #000;
    margin-top: 30px;
}

.report-footer {
    position: fixed;
    bottom: 10mm;
    left: 15mm;
    right: 15mm;
    font-size: 10px;
    text-align: center;
}

@media print {

    body * {
        visibility: hidden;
    }

    .report-page,
    .report-page * {
        visibility: visible;
    }

    .report-page {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

}


/* ==========================
   BUTTON DROPDOWN
   ========================== */

.btn-dropdown {
    position: relative;
    display: inline-block;
}

.btn-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    box-shadow: 0 2px 6px #00000022;
    display: none;
    z-index: 1000;
}

.btn-dropdown.show .btn-dropdown-menu {
    display: block;
}

.btn-dropdown-item {
    width: 100%;
    padding: 6px 10px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-dropdown-item:hover {
    background: #f0f2f8;
}

.btn-dropdown-item.danger {
    color: #b00020;
}

/* ==========================
   INPUT ICON
   ========================== */

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #666;
}

.input-icon .form-control {
    padding-left: 28px;
}

/* ==========================
   INPUT GROUP
   ========================== */

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    padding: 6px 10px;
    font-size: 12px;
    background: #e3e7f0;
    border: 1px solid var(--border-soft);
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    display: flex;
    line-height: 1;
}

.input-group .form-control {
    border-left: none;
    margin-bottom: 0;
}

.form-control-sm + .input-group-text,
.input-group-text + .form-control-sm {
    min-height: 28px;
}

.form-control-lg + .input-group-text,
.input-group-text + .form-control-lg {
    min-height: 40px;
}


/* ==========================
   INPUT STATES
   ========================== */

.form-control.is-error {
    border-color: #e74c3c;
}

.form-control.is-success {
    border-color: #2ecc71;
}

.form-error {
    font-size: 11px;
    color: #e74c3c;
    margin-top: 2px;
}

.form-help {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

/* ==========================
   CHECKBOX / RADIO
   ========================== */

.form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 4px;
}

/* ==========================
   SWITCH / TOGGLE
   ========================== */

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 18px;
    transition: .2s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: .2s;
}

.switch input:checked + .slider {
    background: #2f4c79;
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

.well {
  margin-top: 20px;
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.well blockquote {
  border-color: #ddd;
  border-color: rgba(0, 0, 0, 0.15);
}

.well-large {
  padding: 24px;
  -webkit-border-radius: 6px;
     -moz-border-radius: 6px;
          border-radius: 6px;
}

.well-small {
  padding: 9px;
  -webkit-border-radius: 3px;
     -moz-border-radius: 3px;
          border-radius: 3px;
}

.ui-section {
    margin-bottom: 24px;
}

.ui-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 4px;
    margin-bottom: 12px;
    margin-top: 12px;
}

.section-box {
            background: var(--bg-panel);
            border: 1px solid var(--border-soft);
            border-radius: 4px;
            padding: 15px;
            box-shadow: 0 0 10px #0002;
            margin-bottom: 20px;
        }

/* ================= IMAGES ================= */
        .thumb {
            width: 150px;
            border: 1px solid var(--border-soft);
            border-radius: 3px;
            padding: 4px;
            margin-right: 10px;
            display: inline-block;
            cursor: pointer;
            background: #fff;
        }
        .thumb:hover {
            background: #e8efff;
        }
        .thumb img {
            width: 100%;
            height: 100px;
            object-fit: cover;
            border-radius: 2px;
        }

/* ================= LIGHTBOX ================= */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
}

.lightbox-caption {
    color: #ccc;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    margin-top: 10px;
}

.img-zoomable {
    transition: transform 0.2s;
}

.img-zoomable:hover {
    transform: scale(1.05);
}

.window {
            background: var(--bg-panel);
            border: 1px solid var(--border-soft);
            border-radius: 3px;
            padding: 10px;
            height: 100%;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }

        .window-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
        }

/* ==========================
   LOGIN PAGE
   ========================== */

.login-page {
    background: 
        linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)),
        url('https://images.unsplash.com/photo-1558494949-ef010cbdcc31?q=80&w=2000') center/cover no-repeat fixed;
    height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(200, 200, 200, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 200, 200, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.login-box {
    width: 380px;
    background: var(--bg-panel);
    border: 1px solid rgba(180, 180, 180, 0.3);
    border-radius: 4px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(200, 200, 200, 0.2);
    padding-bottom: 15px;
    position: relative;
    z-index: 10;
}

.login-header {
    background: linear-gradient(to bottom, var(--bg-header), var(--bg-header-dark));
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.login-header i {
    font-size: 18px;
}

.login-body {
    padding: 18px;
}

.login-body label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.login-body .form-control {
    border: 1px solid var(--border-strong) !important;
    border-radius: 2px !important;
    font-size: 13px !important;
    padding: 4px 8px !important;
}

.login-btn {
    background: linear-gradient(to bottom, #ffffff, #dfe4f1);
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 13px;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
}

.login-btn:hover {
    background: linear-gradient(to bottom, #ffffff, #cfd5e7);
}

.login-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #444;
}

.login-statusbar {
    background: #e3e7f0;
    border-top: 1px solid var(--border-soft);
    border-radius: 0 0 4px 4px;
    padding: 4px 10px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
}

.login-status-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    border: 1px solid #1e8449;
}

.login-icon-top {
    text-align: center;
    margin-bottom: 10px;
}

.login-icon-top i {
    font-size: 50px;
    color: var(--bg-header);
    text-shadow: 1px 1px 2px #00000022;
}

/* Login Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .login-box {
        width: 420px;
    }
    .login-page::before {
        background-size: 30px 30px;
    }
}

@media (max-width: 768px) {
    .login-box {
        width: 90%;
        max-width: 400px;
        margin: 15px;
    }
    .login-header {
        font-size: 14px;
    }
    .login-body {
        padding: 15px;
    }
    .login-icon-top i {
        font-size: 45px;
    }
    .login-page::before {
        background-size: 25px 25px;
    }
    .login-statusbar {
        font-size: 10px;
        padding: 4px 8px;
    }
    .login-status-dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 10px;
        overflow-y: auto;
        align-items: flex-start;
        padding-top: 30px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    .login-box {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    .login-header {
        padding: 8px 12px;
        font-size: 13px;
    }
    .login-header i {
        font-size: 16px;
    }
    .login-body {
        padding: 12px;
    }
    .login-icon-top {
        margin-bottom: 8px;
    }
    .login-icon-top i {
        font-size: 40px;
    }
    .login-body label {
        font-size: 12px;
    }
    .login-body .form-control {
        font-size: 12px !important;
    }
    .login-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    .login-footer {
        font-size: 11px;
        margin-top: 8px;
    }
    .login-statusbar {
        font-size: 9px;
        padding: 3px 6px;
        flex-direction: column;
        gap: 3px;
        align-items: flex-start;
    }
    .login-status-left {
        gap: 4px;
    }
    .login-status-dot {
        width: 7px;
        height: 7px;
    }
    .login-page::before {
        background-size: 20px 20px;
    }
}

@media (max-width: 360px) {
    .login-box {
        border-radius: 3px;
    }
    .login-body {
        padding: 10px;
    }
    .login-icon-top i {
        font-size: 35px;
    }
    .login-footer {
        font-size: 10px;
    }
}

.forgot-password {
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: none;
}

.forgot-password:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}


        .form-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px 12px;
        }

        .form-grid label {
            font-weight: 600;
            font-size: 12px;
        }

        .form-grid input,
        .form-grid select {
            border: 1px solid var(--border-strong);
            border-radius: 2px;
            padding: 3px 5px;
            font-size: 12px;
        }


/* Imagen como ícono en enlaces */
.img-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    text-decoration: none;
    vertical-align: middle;
    margin: 0 4px 4px 4px;
}

.img-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}