@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

.hidden {
    display: none !important;
}

.leftMenu.collapsed .textMenu {
    display: none !important;
}

/* Restricción de Roles / Acciones */
.disabled-action {
    opacity: 0.4 !important;
    pointer-events: none !important;
    filter: grayscale(0.7) !important;
    cursor: not-allowed !important;
}

:root {
    /* Base Palette (Software Moderno / Soft Dark) */
    --bg-deep: #0f1115;
    --bg-primary: #16181d;
    --bg-secondary: #21242c;
    --bg-tertiary: #2a2e39;
    
    /* Text */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-accent: #58a6ff;
    
    /* Accents */
    --accent: #2f81f7;
    --accent-hover: #4a92ff;
    --accent-glow: rgba(47, 129, 247, 0.15);
    --success: #238636;
    --success-hover: #2ea043;
    --danger: #da3633;
    --danger-hover: #f85149;
    --warning: #d29922;
    
    /* Borders & Glass */
    --border-color: #363b45;
    --border-hover: #484f58;
    --glass-bg: rgba(33, 36, 44, 0.7);
    --glass-border: rgba(54, 59, 69, 0.8);
    
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global focus reset - removes the default orange/blue rings */
*:focus,
button:focus,
input:focus,
a:focus,
textarea:focus,
select:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* ────────── GLOBAL CUSTOM CHECKBOX STYLING ────────── */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
}

input[type="checkbox"]:hover {
    border-color: var(--accent);
    background-color: rgba(47, 129, 247, 0.12);
}

input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(47, 129, 247, 0.35);
}

input[type="checkbox"]:checked::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    position: absolute;
    top: 1px;
}

input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.4);
}

input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
}

/* ────────── GLOBAL SELECT & OPTION STYLING ────────── */
select,
.input-select {
    background-color: var(--bg-primary, #16181d) !important;
    color: var(--text-primary, #e6edf3) !important;
    border: 1px solid var(--border-color, #363b45) !important;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}

select option {
    background-color: #1a1d24 !important;
    color: #e6edf3 !important;
    padding: 8px;
}

/* ─── Prevención de selección de texto Global ─── */
html, body {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* Inputs y áreas editables SÍ permiten selección */
input,
textarea,
select,
[contenteditable="true"],
.selectable-text {
    user-select: text !important;
    -webkit-user-select: text !important;
    -ms-user-select: text !important;
}

button, a, .sidebar__link, .btn-primary-premium, .btn-save-premium, .toggleButton {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active,
a:active,
.sidebar__link:active,
.btn-primary-premium:active,
.btn-save-premium:active {
    transform: scale(0.98);
}

/* Estilización de Inputs de Fecha (Ocultar icono nativo Chromium) */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-outer-spin-button {
    display: none;
    -webkit-appearance: none;
}

input[type="date"][readonly] {
    pointer-events: none;
    opacity: 0.8;
    cursor: default;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}


body {
    font-family: 'Segoe UI Variable Display', 'Segoe UI Variable Text', 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-size: 14px; /* Estándar Fluent 2 Body */
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* Typography Scale Fluent 2 */
h1, .title-view {
    font-size: 28px !important;
    font-weight: 600 !important;
    color: var(--text-primary);
    margin: 0;
}

h2, h3, .subtitle-view, .card-title, .chart-title {
    font-size: 20px !important;
    font-weight: 500 !important;
    color: var(--text-primary);
    margin: 0;
}

p, .body-text, .chart-subtitle, .card-subtitle {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--text-secondary);
    margin: 0;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* App Container */
.mainApp {
    display: flex;
    flex-direction: column;
    height: 100vh;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.topBar {
    height: 48px;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 18px; /* 18px + 5px padding del boton = 23px (Eje de centrado para 70px) */
    z-index: 10000;
    -webkit-app-region: drag;
}

.titleBar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1; /* Permite que el contenedor crezca */
}

.titleBar .title {
    display: flex;
    align-items: center;
    margin-left: auto; /* Empuja el título a la derecha de la barra superior */
    margin-right: 1.5rem; /* Separación de los botones de ventana */
}

.logoContainer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    transition: var(--transition);
}

.logoContainer:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.logoContainer img {
    height: 24px;
    width: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(88, 166, 255, 0.4));
}

.logoContainer p {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.version-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 500;
    vertical-align: middle;
    -webkit-text-fill-color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.sidebar-header-right {
    display: flex;
    gap: 8px;
}

.btn-subtle-edit, .btn-subtle-delete {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-subtle-edit:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-subtle-delete:hover {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    color: #f44336;
}


/* Custom Alert Modal Styles */
.modal-content-alert {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: 350px;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.modal-header-alert {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 2rem;
}

.modal-header-alert #confirmIcon {
    font-size: 44px;
    color: var(--accent);
}

.modal-header-alert h2 {
    font-size: 1.4rem;
    margin: 0;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.modal-body-alert {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1.05rem; /* Un poco más grande para mejor legibilidad */
    line-height: 1.6;
    overflow-wrap: break-word; /* Romper solo si es estrictamente necesario */
    word-break: normal;        /* Evita romper palabras cortas como "con" */
    text-align: center;        /* Centrado para acompañar al icono central */
    max-width: 100%;
}

.modal-footer-alert {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-footer-alert button {
    padding: 0.8rem 1.5rem;
    min-width: 100px;
}

.toggleButton {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 6px;
    transition: var(--transition);
    -webkit-app-region: no-drag;
}

.toggleButton:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.titleBarBtns {
    display: flex;
    gap: 10px;
    -webkit-app-region: no-drag;
}

.topBtn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.role-sysAdmin { background: rgba(88, 166, 255, 0.2); color: #58a6ff; border: 1px solid rgba(88, 166, 255, 0.4); }
.role-costo { background: rgba(126, 231, 135, 0.2); color: #7ee787; border: 1px solid rgba(126, 231, 135, 0.4); }
.role-bi { background: rgba(210, 153, 34, 0.2); color: #d29922; border: 1px solid rgba(210, 153, 34, 0.4); }
.role-director { background: rgba(218, 54, 51, 0.2); color: #da3633; border: 1px solid rgba(218, 54, 51, 0.4); }

.disabled-action {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

.closeBtn { background: #ff5f56; }
.maximizeBtn, .restoreBtn { background: #ffbd2e; }
.minimizeBtn { background: #27c93f; }

.topBtn:hover { opacity: 0.8; }

.contentArea {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Moderno */
.leftMenu {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #1a1d23 100%);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.leftMenu.collapsed {
    width: 70px;
}

.leftMenu.collapsed .sidebar__link {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
    gap: 0;
}

.leftMenu.collapsed .sidebar__main {
    padding: 10px;
}

.sidebar__container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible !important;
}

.sidebar__main {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

.sidebar__spacer {
    flex: 1;
}

.sidebar__list--admin {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.8rem 0; /* Padding simétrico igual al de los links */
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem 0.8rem 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px; /* Más cuadrado estilo Fluent */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-size: 13px; /* Más compacto para look Enterprise */
    font-weight: 500;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar__link.active,
.sidebar__link.active-link {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Indicador de Selección Fluent 2 (Pill vertical) */
.sidebar__link.active::before,
.sidebar__link.active-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    background: var(--text-accent);
    border-radius: 0 4px 4px 0;
    z-index: 2;
}

/* Reveal Highlight Effect */
.sidebar__link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        120px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.1),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.sidebar__link:hover::after {
    opacity: 1;
}

.sidebar__link iconify-icon, .sidebar__link span {
    position: relative;
    z-index: 3;
}

.sidebar__link i, 
.sidebar__link iconify-icon {
    font-size: 22px !important; /* Ligeramente menor para Fluent */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
}

.sidebar__link span.textMenu {
    font-size: 16px !important;
    line-height: 24px;
    flex: 1;
}

.textMenu {
    transition: opacity 0.2s ease-in-out;
    display: inline-block;
    line-height: 24px; /* Match icon height for perfect middle alignment */
    padding-top: 1px; /* Ajuste óptico para Segoe UI */
}

.textMenu.hidden {
    opacity: 0;
}

/* Page Wrapper */
.contentPages {
    flex: 1;
    background-color: var(--bg-primary);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tabcontent {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Insignias de Roles y Estados */
.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.role-sysAdmin { background: rgba(47, 129, 247, 0.15); color: #58a6ff; border: 1px solid rgba(47, 129, 247, 0.3); }
.role-costo { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.role-bi { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-director { background: rgba(110, 118, 129, 0.15); color: #8b949e; border: 1px solid rgba(110, 118, 129, 0.3); }
.role-sucursal { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.role-editor { background: rgba(35, 134, 54, 0.15); color: #3fb950; border: 1px solid rgba(35, 134, 54, 0.3); }
.role-viewer { background: rgba(110, 118, 129, 0.15); color: #8b949e; border: 1px solid rgba(110, 118, 129, 0.3); }

.status-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-badge.active { background: rgba(35, 134, 54, 0.2); color: #3fb950; }
.status-badge.active::before { content: ''; width: 6px; height: 6px; background: #3fb950; border-radius: 50%; }

.status-badge.inactive { background: rgba(248, 81, 73, 0.2); color: #f85149; }
.status-badge.inactive::before { content: ''; width: 6px; height: 6px; background: #f85149; border-radius: 50%; }

.code-badge {
    background: var(--bg-deep);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-accent);
    font-family: 'Consolas', monospace;
}

/* Perfil de Usuario Premium en Sidebar */
.sidebar__profile {
    height: 72px; 
    padding: 0 1rem 0 15px; /* Alineado para el ancho de 40px + border */
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
}

.sidebar__profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar__profile:hover .profile-avatar {
    color: var(--accent);
}

.sidebar__profile .profile-role {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.65rem;
    opacity: 0.6;
    color: var(--text-secondary);
}


.profile-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

img.profile-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Presence Indicator Wrapper */
.profile-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.presence-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #00ca4e; /* Verde Fluent */
    border: 2px solid var(--bg-deep);
    border-radius: 50%;
    z-index: 2;
}

.profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: opacity 0.2s;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.sidebar__profile:hover .profile-arrow {
    transform: translateX(3px);
}

/* Ajustes para Sidebar Colapsado */
.leftMenu.collapsed .profile-text,
.leftMenu.collapsed .profile-arrow {
    display: none;
}

.leftMenu.collapsed .sidebar__main {
    padding-left: 11px;
}

.leftMenu.collapsed .sidebar__profile {
    padding: 0 0 0 13px; /* Centro exacto para avatar de 44px (40+border) */
    justify-content: flex-start;
}


/* Skeletons & Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 12px;
    width: 80%;
    margin: 8px 0;
}

.skeleton-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Responsive Dashboard Charts Grid */
.dashboard-charts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

.dashboard-charts-grid > .chart-card {
    flex: 1 1 480px;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 1450px) {
    .dashboard-charts-grid > .chart-card:first-child {
        flex: 1.6 1 580px;
    }
    .dashboard-charts-grid > .chart-card:last-child {
        flex: 1 1 420px;
    }
}

/* Empty States */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-container .material-symbols-outlined {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-container h3 {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.empty-state-container p {
    font-size: 0.9rem;
    max-width: 300px;
}

/* Modal Sizing Standardization */
.modal-sm { width: 420px !important; }
.modal-md { width: 640px !important; }
.modal-lg { width: 940px !important; }

/* Modals Modernos */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content, .modal-content-newCliente {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Rim Light */
    border-radius: 20px;
    padding: 1.5rem;
    width: 600px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.4);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

/* Premium Modal Refinements */
.premium-modal {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(88, 166, 255, 0.1) !important;
}

.item-header-preview {
    margin-bottom: 2rem;
}

.header-info-pill {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.catalog-badge {
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-accent);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(88, 166, 255, 0.2);
    display: block;
    width: fit-content;
    margin: 0 auto;
}

.header-info-pill .label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.header-info-pill .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    width: 100%;
}

.modal-content h2 {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* Labels & Inputs Standard */
.field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.input, .select-custom {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4); /* Borde inferior base */
    border-radius: 6px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    width: 100%;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    display: block;
}

.input:focus, .select-custom:focus {
    outline: none;
    border-color: var(--border-hover);
    border-bottom: 2px solid var(--accent); /* Borde inferior Fluent 2 */
    background: rgba(255, 255, 255, 0.08);
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Validación Custom */
.input.is-invalid, .select-custom.is-invalid {
    border-color: var(--danger) !important;
    background: rgba(218, 54, 51, 0.05) !important;
    box-shadow: 0 0 0 4px rgba(218, 54, 51, 0.15) !important;
}

.field-error-msg {
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 5px;
    display: none;
    animation: slideDown 0.2s ease-out;
    padding-left: 2px;
}

.input.is-invalid + .field-error-msg,
.select-custom.is-invalid + .field-error-msg {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.select-custom {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

/* Form Grid System */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.group.full-width {
    grid-column: 1 / -1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.form-grid .group.full-width {
    grid-column: span 2;
}

/* Product Sub-Menu Tabs */
.tabs-sub-menu {
    display: flex;
    background: var(--bg-deep);
    padding: 4px;
    border-radius: 8px; /* Look Enterprise */
    gap: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tab-button-sub {
    background: none;
    border: none;
    color: #9ba3af; /* Aumento de contraste (+5% lum) */
    padding: 0.5rem 1.25rem;
    border-radius: 6px; /* Ajuste interno */
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab-button-sub.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px; /* Coherencia Enterprise */
    min-width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Ticket Modal Styles */
.modal-content-ticket {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 500px;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* El ticket (recibo) mantiene el estilo térmico blanco */
.ticket-receipt {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}

/* Forzar que el texto sea negro SOLO dentro del recibo */
.ticket-receipt, 
.ticket-receipt * {
    color: #1a1a1a !important;
}

.ticket-receipt {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 15px;
    /* Scrollbar style para que luzca limpio */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.ticket-receipt::-webkit-scrollbar {
    width: 6px;
}

.ticket-receipt::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
    border: 2px solid white;
}

.ticket-header {
    text-align: center;
}

.ticket-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #000;
}

.ticket-divider {
    font-size: 0.9rem;
    overflow: hidden;
    white-space: nowrap;
    margin: 0.5rem 0;
}

.ticket-header p {
    font-size: 0.85rem;
    margin: 2px 0;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ticket-table th {
    border-bottom: 2px solid #333;
    padding-bottom: 8px;
    font-weight: 800;
    color: #000;
}

.ticket-table td {
    padding: 6px 0;
    vertical-align: top;
}

/* Resaltar la descripción del producto */
.ticket-table td:nth-child(2) {
    font-weight: 800;
    color: #000 !important;
    padding-right: 10px;
}

.ticket-table td:nth-child(1), 
.ticket-table th:nth-child(1) { width: 40px; text-align: center; }
.ticket-table td:nth-child(3), 
.ticket-table th:nth-child(3) { width: 85px; text-align: right; }

.ticket-footer {
    text-align: right;
    font-size: 0.9rem;
}

.ticket-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1rem;
    margin-top: 0.5rem;
    color: #000;
}

/* Estilos de Botones de Acción en Tablas */
.actions-cell-wrapper {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.btn-pill-action-missing {
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-pill-action-missing:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-pill-action-missing.ticket:hover {
    background: var(--bg-tertiary);
    color: var(--text-accent);
    border-color: var(--text-accent);
}

/* Variación para Paquetes */
.modal.active.is-package-mode .modal-content-builder {
    width: 95vw;
    max-width: 1400px;
}

/* Modal Content Builder (Recipe) */
.modal-content-builder {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Rim Light */
    border-radius: 24px;
    padding: 2rem;
    width: 90vw;
    max-width: 1100px;
    transition: max-width 0.3s ease, width 0.3s ease;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.6rem;
}

.builder-title-group h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.builder-title-group p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.builder-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    min-height: 0;
}

.builder-workspace.is-package-mode {
    grid-template-columns: repeat(3, 1fr);
}

.builder-workspace.is-package-mode.has-ticket-panel {
    grid-template-columns: repeat(4, 1fr);
}

.builder-workspace.has-ticket-panel:not(.is-package-mode) {
    grid-template-columns: repeat(3, 1fr);
}

/* Panel de Vista Previa */
#itemPreviewPanel {
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-color);
}

.builder-workspace.is-package-mode #itemPreviewPanel {
    display: flex;
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
}

/* Centrado exclusivo para los placeholders de esta sección */
.preview-content .canvas-empty-state, 
.preview-content .loading-view-centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    pointer-events: none;
}

.recipe-preview-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left; /* Asegurar alineación a la izquierda */
}

.preview-recipe-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    gap: 12px;
}

.preview-recipe-item span:first-child {
    word-break: break-word;
}

.preview-recipe-item span:last-child {
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.preview-actions {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

/* Contenedor fijo al pie del panel */
.panel-footer-fixed {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.panel-footer-fixed .btn-corporate-action {
    font-size: 0.72rem;
    gap: 6px;
    padding: 11px 6px;
    white-space: nowrap;
}

/* Botón con Estilo Corporativo Sutil (Accento) */
.btn-corporate-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    background: transparent;
    color: var(--text-accent); /* Color acento corporativo */
    border: 1.5px solid var(--text-accent);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.25s ease;
    flex: 1;
}

.btn-corporate-action:hover {
    background: rgba(181, 150, 107, 0.1); /* Tinte del color acento sutil */
    border-color: #fff;
    color: #fff;
    transform: translateY(-1px);
}

.btn-corporate-action:active {
    transform: translateY(0);
}

.btn-corporate-action .material-symbols-outlined {
    font-size: 20px;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.draggable-ingredient.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.btn-add-subtle {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-add-subtle:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-add-subtle .material-symbols-outlined {
    font-size: 20px;
}

.builder-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-accent);
    margin-bottom: 0.75rem;
}

.market-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draggable-ingredient {
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    cursor: grab;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.draggable-ingredient:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
    cursor: pointer; /* Indicar que es clicable */
}

.draggable-ingredient:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.recipe-canvas {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-deep);
    position: relative;
    padding: 1rem;
}

.canvas-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    pointer-events: none;
    gap: 10px;
    width: 90%;
}

.canvas-empty-state span {
    font-size: 48px;
    opacity: 0.3;
}

.canvas-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.recipe-item {
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    animation: slideIn 0.3s ease-out;
    transition: var(--transition);
}

.recipe-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.recipe-item-header {
    width: 100%;
    line-height: 1.25;
}

.recipe-item-header .item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: white;
    word-break: break-word;
    display: block;
}

.recipe-item-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.recipe-item-body .item-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.02em;
}

.recipe-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-item-actions input[type="number"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.2rem 0.25rem;
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    width: 52px;
    height: 26px;
    box-sizing: border-box;
}

.recipe-item .input {
    height: auto;
    padding: 0.4rem;
    font-size: 0.82rem;
}
.item-unit-display {
    background: var(--bg-deep);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-accent);
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 600;
}

.item-code {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recipe-item input {
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem;
    color: white;
    width: 100%;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-remove-item:hover {
    color: var(--danger, #ef4444);
    background: rgba(239, 68, 68, 0.12);
}

.canvas-footer {
    padding: 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.recipe-summary {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}

.builder-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Quick Create Button */
.btn-quick-create {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.2);
}

.btn-quick-create:hover {
    background: #43A047;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.btn-quick-create span {
    font-size: 16px;
}


@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.formTitle h1 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

.group {
    position: relative;
    margin-bottom: 1.5rem;
}

.group .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.group .input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.group:has(.icon) .input {
    padding-left: 3rem;
}

.group select.input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 2.5rem; /* Space for a custom arrow if needed later */
}

.group .input:focus {
    border-color: var(--accent);
}

/* --- Input Wrapper with Icons (Modern UI Fix) --- */
.input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-wrapper .material-symbols-outlined {
    position: absolute;
    left: 14px;
    font-size: 1.2rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 5;
    transition: all 0.2s ease;
}

.input-wrapper .input {
    padding-left: 44px !important; /* Espacio para el icono */
}

/* Regla para que el icono desaparezca al escribir (Petición del Usuario) - Excluyendo inputs de fecha */
.input-wrapper .input:not([type="date"]):not(:placeholder-shown) ~ .material-symbols-outlined {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
}

/* Corrección de padding para los selects en wrappers */
.input-wrapper .select-custom {
    padding-left: 44px !important;
}

/* Si el select tiene foco, el icono se atenúa */
.input-wrapper .input:focus ~ .material-symbols-outlined {
    color: var(--accent);
}

/* Elements from reports views */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.2rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-save-edit {
    background: #2196F3;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.btn-save-edit:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}


.btn-desactivate {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-desactivate:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.modal-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.reports-view .title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-menu {
    display: flex;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
}

.tab-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.tab-button.active {
    background: var(--bg-tertiary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Tab especial: Rechazados — rojo cuando está activo */
#subTabTransfersRejected {
    color: var(--danger);
}
#subTabTransfersRejected.active {
    background: var(--danger) !important;
    color: #fff !important;
}
#subTabTransfersRejected:hover:not(.active) {
    background: rgba(218, 54, 51, 0.15);
    color: var(--danger);
}


/* View: Reports (Unified) */
.reports-view {
    padding: 1.5rem 3rem; /* Margen lateral unificado de 3 rem para mayor holgura */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    max-width: none;
}

/* Contenedor principal de contenido para alinear el footer */
.view-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.view-header {
    height: 60px; /* Reducido para un look más compacto */
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.view-header .title {
    font-size: 28px;
    font-weight: 600; /* Semibold */
    color: var(--text-primary);
}

.title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Filters Section */
.filters-section {
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.filters-section .subtitle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 20px;
    font-weight: 500; /* Medium */
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.filters-grid {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem; /* Aumentado para mejor legibilidad */
    flex-wrap: nowrap;
    width: 100%; 
    overflow-x: auto;
    padding: 0.5rem 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Checkbox Group Card - Clean & Sharp */
.toggle-group-card {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.toggle-group-inner {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.filter-label-tag {
    position: absolute;
    top: -18px;
    left: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
}

/* Disabled State for Filters */
.filter-checkbox.disabled,
.filter-checkbox:has(input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
    pointer-events: none;
}

.filter-checkbox.disabled .checkbox-custom,
.filter-checkbox:has(input:disabled) .checkbox-custom {
    border-color: var(--text-muted);
    background: transparent;
}

/* Responsive Filters - Ocultar texto de botones antes para evitar saltos */
@media (max-width: 1400px) {
    .filters-grid {
        gap: 0.75rem;
        padding-bottom: 5px;
    }

    .btn-text {
        display: none;
    }

    .btn-pill-action, 
    .btn-subtle-export {
        padding: 0.6rem;
        min-width: 42px;
        justify-content: center;
        gap: 0;
    }

    .search-pill-wrapper {
        width: 250px;
        flex-shrink: 1;
    }
}

.toggle-group {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.tabs-sub-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-field {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-field[type="date"] {
    width: 180px; /* Ancho fijo para las fechas */
    flex-grow: 0;
}

/* Icono de calendario navegable y visible en Dark Mode */
.input-field[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Pone el icono en blanco puro */
    opacity: 0.5;      /* Lo hace sutil por defecto */
    cursor: pointer;
    transition: var(--transition);
}

/* --- Global Sub-tabs Toggle Design --- */
.tabs-sub-menu {
    display: flex;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
    border: 1px solid var(--border-color);
}

.tab-button-sub {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab-button-sub:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.tab-button-sub.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(47, 129, 247, 0.3);
}

.tab-button-sub .badge {
    background: #f85149;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-field[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;        /* Se ilumina al pasar el mouse sin desaparecer */
}

.search-pill-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px; /* Look Enterprise */
    padding: 2px 4px;
    width: 480px; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-pill-wrapper:focus-within {
    border-bottom: 2px solid var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.search-pill-inner {
    flex: 1;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0 0.75rem;
    height: 32px;
}

.search-pill-inner input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 400;
    font-family: inherit;
}

.search-pill-inner input::placeholder {
    color: var(--text-muted);
}

.search-icon-btn {
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    transition: var(--transition);
}

.search-icon-btn:hover {
    color: var(--accent);
}

.search-icon-btn span {
    font-size: 22px;
}

.input, .select-custom {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.input:focus, .select-custom:focus {
    border-color: var(--accent);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Reports Content Layout */
.reports-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.view-header {
    flex-shrink: 0;
    padding: 0 0 1rem 0; /* Padding lateral 0 hermético */
    border-bottom: none;
    display: flex;
    align-items: center;
    background: transparent;
}

.view-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.view-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.filters-section {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.content-body {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin-right: 0;
    padding-right: 0;
    width: 100%;
}

.reports-section {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Rim Light */
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    min-height: 0; /* Asegura que flex-grow no rompa el scroll */
    overflow: hidden;
}

.tab-edit {
    width: 360px !important;
    min-width: 360px !important;
    max-width: 360px !important;
    flex: 0 0 360px !important;
    flex-shrink: 0;
    margin-left: auto;
    transition: var(--transition);
    display: none; /* Oculto por defecto, se activa con .active-sidebar */
}

.tab-edit.active-sidebar {
    display: flex !important;
}

.tab-edit.hidden {
    display: none !important;
}

.premium-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Rim Light on glass */
    border-radius: 16px;
    height: 100%;
    width: 100% !important; /* Asegura el ancho total del contenedor */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header span { color: var(--accent); }

.sidebar-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 2rem;
    line-height: 1.6;
}

/* Invoice / Incident Details */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row:hover {
    background: rgba(255, 255, 255, 0.02);
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 4px;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.summary-row .summary-value {
    color: var(--text-primary);
}

/* Special Highlighting */
.highlight-value {
    color: var(--text-accent);
    font-weight: 700;
    font-size: 1rem;
}

.summary-row[data-type="total"] {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.summary-row[data-type="total"] .summary-label {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
}

.summary-row[data-type="total"] .summary-value {
    color: var(--text-accent);
    font-size: 1.25rem;
}

/* Action Buttons in Details */
.review-button {
    width: 100%;
    margin-top: 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(47, 129, 247, 0.2);
}

.review-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(47, 129, 247, 0.3);
}

.review-button:active {
    transform: translateY(0);
}

.review-button .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Loading States */
.loadingView {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    gap: 1rem;
}

.loadingView::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.table-container {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.08); /* Sutil Rim Light */
    position: relative;
    box-shadow: var(--shadow-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.data-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.85rem 1rem; /* Padding un poco más denso */
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background 0.2s ease;
}

/* Zebra Striping (Entrelineado más visible) */
.data-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.data-table tr:hover {
    background: var(--bg-tertiary) !important;
}

/* Configuración de Columnas Específicas: Productos */
#productDataTable th:nth-child(1), 
#missingProductDataTable th:nth-child(1) { width: 100px; text-align: center; }

#productDataTable th:nth-child(2),
#missingProductDataTable th:nth-child(2),
#packageDataTable th:nth-child(2),
#missingPackageDataTable th:nth-child(2) { padding-left: 2rem; }

#productDataTable td:nth-child(2),
#missingProductDataTable td:nth-child(2),
#packageDataTable td:nth-child(2),
#missingPackageDataTable td:nth-child(2) { padding-left: 2rem; }

#productDataTable th:nth-child(3) { width: 120px; text-align: center; } 
#productDataTable th:nth-child(4) { width: 140px; text-align: right; } 
#productDataTable th:nth-child(5) { width: 160px; text-align: center; } 

/* Columnas para Faltantes */
#missingProductDataTable th:nth-child(3) { width: 150px; text-align: center; } 
#missingProductDataTable th:nth-child(4) { width: 120px; text-align: center; } 
#missingProductDataTable th:nth-child(5) { width: 100px; text-align: center; } 
#missingProductDataTable th:nth-child(6) { width: 120px; text-align: right; } 
#missingProductDataTable th:nth-child(7) { width: 100px; text-align: center; } 

#productDataTable td:nth-child(1),
#missingProductDataTable td:nth-child(1),
#productDataTable td:nth-child(3),
#productDataTable td:nth-child(5),
#missingProductDataTable td:nth-child(3),
#missingProductDataTable td:nth-child(4),
#missingProductDataTable td:nth-child(5),
#missingProductDataTable td:nth-child(7) {
    text-align: center;
}

#productDataTable td:nth-child(4),
#missingProductDataTable td:nth-child(6) {
    text-align: right;
    font-weight: 600;
    color: var(--text-accent);
}

/* Estado Seleccionado */
.data-table tr.selected, 
.data-table tr.active {
    background: var(--accent-glow) !important;
}

.data-table tr.selected td,
.data-table tr.active td {
    color: var(--text-accent);
    border-bottom-color: var(--accent);
}

/* Footer & Export */
.table-footer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem; /* Ajustado el padding para que sea más esbelto */
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end; /* Alineado a la derecha */
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.download-path {
    display: flex;
    align-items: center;
    gap: 0.85rem; /* Integramos mas el label con el grupo del input */
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px; /* Icono y texto mas juntos */
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    margin: 0;
    line-height: 1;
}

.input-label .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    line-height: 1;
}

/* Joined Input + Button */
.download-path-group {
    display: flex;
    align-items: stretch;
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    height: 42px; /* Altura controlada para el footer */
}

.download-path-group .input-ruta {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    width: 320px !important;
    color: var(--text-accent) !important;
    font-size: 0.85rem;
    padding: 0 1rem;
}

.btn-examinar {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: none;
    border-left: 1px solid var(--border-color);
    padding: 0 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-examinar:hover {
    background: var(--border-color) !important;
    color: white !important;
}

.btn-examinar .material-symbols-outlined {
    font-size: 1.1rem;
}

/* Cards Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    align-content: start;
    /* Se remueve flex: 1 y overflow-y: auto para que el scroll sea del contenedor principal */
    padding-top: 0.5rem;
}

.report-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.report-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    background: var(--bg-tertiary);
}

.report-card.selected {
    border-color: var(--accent);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--accent-glow), var(--shadow-md);
    transform: translateY(-2px);
}

.report-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.report-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.report-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Excel Export Button */
.btn-export-excel {
    background: #10864a; /* User specific green */
    color: white !important;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(16, 134, 74, 0.2);
}

/* Nuevo Botón Estilo Pill para Acción Principal */
.btn-pill-action {
    background: var(--accent);
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px var(--accent-glow);
}

.btn-pill-action:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--accent-glow);
}


.btn-table-icon {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-table-icon.edit { color: var(--accent); }
.btn-table-icon.delete { color: var(--danger); }
.btn-table-icon.ticket { color: #4CAF50; }
.btn-table-icon.view { color: var(--text-secondary); }

.btn-table-icon:hover {
    transform: scale(1.15);
}

.btn-table-icon.edit:hover { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.btn-table-icon.delete:hover { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.btn-table-icon.ticket:hover { background: rgba(76, 175, 80, 0.1); color: #66bb6a; }
.btn-table-icon.view:hover { background: rgba(148, 163, 184, 0.12); color: var(--text-primary); }

.btn-table-icon .material-symbols-outlined {
    font-size: 20px;
}

.btn-pill-action .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.4s ease;
}

.sync-action:hover .material-symbols-outlined {
    transform: rotate(180deg);
}

.btn-export-excel:hover {
    background: #14a058;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 134, 74, 0.3);
}

.btn-export-excel:active {
    transform: translateY(0);
}

.btn-export-excel img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Old buttons compatibility - deprecated */
.btn-modern, .btn-export-premium {
    background: linear-gradient(135deg, #238636, #2ea043);
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-modern:hover, .btn-export-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.4);
}

.btn-desactivate {
    width: 100%;
    background: var(--bg-tertiary);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-Save {
    background: var(--accent);
}

.btn-Save:hover {
    filter: brightness(1.2);
}

/* Sidebar Detail Panel */
.tab-edit {
    min-width: 380px;
    transition: var(--transition);
}

.premium-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    height: 100%;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Generic Modals */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-textB {
    text-align: center;
}

/* Accent Colors for Icons */
.bg-blue-soft { 
    background: rgba(88, 166, 255, 0.1); 
    color: #58a6ff; 
    border: 1px solid rgba(88, 166, 255, 0.2);
}
.bg-red-soft { 
    background: rgba(248, 81, 73, 0.1); 
    color: #f85149; 
    border: 1px solid rgba(248, 81, 73, 0.2);
}
.bg-amber-soft { 
    background: rgba(210, 153, 34, 0.1); 
    color: #d29922; 
    border: 1px solid rgba(210, 153, 34, 0.2);
}
.bg-green-soft { 
    background: rgba(63, 185, 80, 0.1); 
    color: #3fb950; 
    border: 1px solid rgba(63, 185, 80, 0.2);
}

/* Specific Modals & Loading */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loader-textB h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #8b949e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loader-textB p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Downloads specific */
.reports-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.input-ruta {
    width: 350px; /* Ancho fijo para mantener el footer compacto a la derecha */
    background: var(--bg-deep) !important;
    color: var(--text-accent) !important;
    border-style: dashed !important;
    cursor: default;
}

/* Tab Menu (Premium Style) */
.tab-menu {
    display: flex;
    gap: 6px;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab-button.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(47, 129, 247, 0.3);
}

.tab-button:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-button .material-symbols-outlined {
    font-size: 1.2rem;
}

/* Toast Notifications System - Soft Toned Minimalist */
.messages {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.message {
    pointer-events: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.7rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: toastFadeInRight 0.4s ease-out;
    position: relative;
    overflow: hidden;
    min-width: 280px;
}

/* Fondos y acentos por tipo (Fondo ligero del mismo color del icono) */
.message--success { background: rgba(63, 185, 80, 0.12); border-left: 4px solid #3fb950; }
.message--alert { background: rgba(248, 81, 73, 0.12); border-left: 4px solid #f85149; }
.message--info { background: rgba(88, 166, 255, 0.12); border-left: 4px solid #58a6ff; }
.message--warning { background: rgba(210, 153, 34, 0.12); border-left: 4px solid #d29922; }

.message::before {
    font-family: 'Material Symbols Outlined';
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.message--success::before { content: 'check_circle'; color: #3fb950; }
.message--alert::before { content: 'cancel'; color: #f85149; }
.message--info::before { content: 'info'; color: #58a6ff; }
.message--warning::before { content: 'warning'; color: #d29922; }

@keyframes toastFadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.message--removing {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.message .timestamp {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.message__status {
    display: none;
}
/* Status Badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.active {
    background: rgba(35, 134, 54, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.status-badge.inactive {
    background: rgba(218, 54, 51, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.status-badge.critical {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
}

/* Table Sorting */
.data-table th.sortable {
    cursor: pointer;
    position: sticky; /* Mantener sticky para que no se desplace */
    top: 0;
    z-index: 10;
    user-select: none;
    transition: background-color 0.2s;
}

.data-table th.sortable:hover {
    background-color: var(--bg-tertiary);
}

.data-table th.sortable::after {
    content: '\2195';
    font-size: 0.8rem;
    margin-left: 8px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.data-table th.sortable:hover::after {
    opacity: 0.7;
}

.data-table th.sorted-asc::after {
    content: '\2191';
    opacity: 1;
    color: var(--accent);
}

.data-table th.sorted-desc::after {
    content: '\2193';
    opacity: 1;
    color: var(--accent);
}

/* Filters Controls & Toggles */
.filters-grid {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.filters-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
}

.filter-checkbox input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.filter-checkbox input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-checkbox input:checked + .checkbox-custom::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.toggle-group {
    display: flex;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
    transition: var(--transition);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    transition: var(--transition);
}

.toggle-switch.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Narrower toggles for table */
.data-table .toggle-switch {
    transform: scale(0.85);
    justify-content: center;
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 36px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-switch input:checked + .slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(16px);
}

/* Edit Modal Styles */
.modal-toggles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    gap: 15px;
}

.modal-toggles .toggle-switch {
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
    flex: 1;
    justify-content: center;
}

.modal-toggles .toggle-switch:hover {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-save-premium {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-save-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
    filter: brightness(1.1);
}

.row-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#editModal .modal-content-newCliente {
    width: 500px;
}

#editModal .group .input {
    padding-left: 3rem;
}

/* Subtle Sidebar Header & Edit Button */
.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem;
    gap: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header-left .material-symbols-outlined {
    color: var(--accent);
    font-size: 1.4rem;
}

.btn-subtle-edit {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-subtle-edit:hover {
    background: var(--bg-tertiary);
    color: var(--text-accent);
    border-color: var(--border-color);
}

.btn-subtle-edit.hidden {
    display: none;
}

.filters-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto; /* Empuja todo a la derecha si el contenedor padre es flex */
}

.btn-subtle-export {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    margin-left: 1rem;
}

.btn-subtle-export:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

#btnCreate {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(47, 129, 247, 0.25);
}

#btnCreate:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 129, 247, 0.4);
}

#btnCreate .material-symbols-outlined {
    font-size: 20px;
    color: white;
}

.btn-subtle-export img {
    opacity: 0.8;
}

.btn-subtle-export:hover img {
    opacity: 1;
}

/* Custom Select & Readonly Styles */
.select-custom {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem !important;
    background-color: var(--bg-secondary);
}

.readonly-input {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: transparent !important;
}

.form-group-wrapper {
    margin-bottom: 1.2rem;
}

.field-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.modal-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-body-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Custom Validation Tooltips */
.group {
    position: relative;
}

.validation-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background: #f44336;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: fadeInScale 0.2s ease-out;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.validation-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 15px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #f44336;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: translateY(5px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Responsiveness */
@media (max-width: 650px) {
    .modal-content, .modal-content-newCliente {
        width: 95% !important;
        padding: 1.5rem !important;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-grid .group.full-width {
        grid-column: span 1 !important;
    }
    .modal-toggles {
        flex-direction: column;
        align-items: stretch;
    }
    .modal-actions {
        flex-direction: column;
    }
}

/* Botones del Modal de Ticket (Tema Premium) */
.modal-content-ticket .modal-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1.25rem;
    justify-content: center;
}

.modal-content-ticket .btn-subtle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.modal-content-ticket .btn-subtle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.modal-content-ticket .btn-save-premium {
    min-width: 160px;
    padding: 12px 28px;
    border-radius: 14px;
}

/* --- MÓDULO DE CATÁLOGO --- */
.catalog-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block;
}

.badge-product {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-package {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.status-indicator {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status-active::before {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status-pending::before {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

#catalogDataTable tr:hover {
    background: rgba(255, 255, 255, 0.03);
    cursor: default;
}

/* Catalog Modal Header Styles */
.item-header-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.header-info-pill {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-info-pill.full-width {
    grid-column: span 2;
}

.header-info-pill .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.header-info-pill .value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.header-info-pill .catalog-badge {
    align-self: flex-start;
    margin-top: 2px;
}

/* Custom Styled Global Tooltips (JS Driven) */
.app-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    z-index: 999999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translate(-50%, -100%) translateY(0px);
}

.app-tooltip.active {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-10px);
}

/* Tooltip Arrow */
.app-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

/* Modificadores para Tooltips de Sidebar (alineados a la derecha del botón) */
.app-tooltip.sidebar-tooltip {
    transform: translate(0, -50%) translateX(0px);
}
.app-tooltip.sidebar-tooltip.active {
    transform: translate(0, -50%) translateX(10px);
}
.app-tooltip.sidebar-tooltip::after {
    top: 50% !important;
    left: auto !important;
    right: 100% !important;
    transform: translateY(-50%) !important;
    border-color: transparent rgba(15, 23, 42, 0.95) transparent transparent !important;
}

/* ==========================================================================
   Segmented Control (Filter Bar Premium)
   ========================================================================== */
.segmented-control {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    width: fit-content;
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.segmented-control .segment {
    position: relative;
    cursor: pointer;
}

.segmented-control input[type="radio"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.segmented-control .segment-label {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    min-width: 130px;
    text-align: center;
}

.segmented-control .segment:hover .segment-label {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.segmented-control input[type="radio"]:checked + .segment-label {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.segmented-control input[type="radio"]:focus-visible + .segment-label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Filter Notification Badges */
.filter-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff4d4f;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    border: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-badge.active {
    transform: scale(1);
}

.segmented-control input[type="radio"]:checked + .segment-label + .filter-badge {
    border-color: var(--accent);
}

/* Catalog Filter Alignment */
.filters-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

/* Sortable Table Headers */
.th-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s;
}

.th-sortable:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
}

/* Alignments for sortable headers */
th[style*="text-align: left"] .th-content,
th.text-left .th-content {
    justify-content: flex-start;
}

th[style*="text-align: right"] .th-content,
th.text-right .th-content {
    justify-content: flex-end;
}

th[style*="text-align: center"] .th-content,
th.text-center .th-content {
    justify-content: center;
}

.sort-icon {
    font-size: 16px !important;
    opacity: 0.35;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    pointer-events: none;
    flex-shrink: 0;
}

.th-sortable:hover .sort-icon {
    opacity: 0.75;
}

.th-sortable.active .sort-icon {
    opacity: 1;
    color: var(--accent);
}
/* --- MODAL DE ACTUALIZACIÓN (PREMIUM) --- */
#appUpdateModal {
    z-index: 100000 !important;
}
.modal-content-update {
    width: 500px;
    background: rgba(22, 24, 29, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.update-header {
    margin-bottom: 2rem;
}

.update-icon {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

.update-body p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.update-progress-container {
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

#updatePercentText {
    color: var(--accent);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-deep);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-notes-container {
    text-align: left;
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 10px;
    border-left: 3px solid var(--accent);
}

.update-notes-container h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.notes-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-height: 100px;
    overflow-y: auto;
}

/* ==========================================================================
   SISTEMA DE LOGIN (PREMIUM)
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 48px;
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    background: radial-gradient(circle at center, rgba(14, 18, 27, 0.95) 0%, #080a0f 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto !important;
    padding: 24px 16px !important;
    box-sizing: border-box !important;
}

.login-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   PORTAL MODALS OVERRIDES & STACKING FIX
   ========================================================================== */
.portal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    overflow-y: auto !important;
    padding: 20px 10px !important;
    box-sizing: border-box !important;
}

.portal-modal.active,
.portal-modal[style*="display: flex"],
.portal-modal[style*="display:flex"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.login-card {
    background: rgba(25, 31, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto !important;
}

.active .login-card {
    transform: translateY(0);
}

.login-header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: auto;
    height: auto;
    background: none;
    margin: 0 auto 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
}

.logo-img-login {
    height: 160px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
}

.form-group-login {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group-login label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper span {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    transition: color 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s;
}



.remember-me {
    margin-top: -0.5rem;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.3s;
}

.checkbox-container:hover {
    color: #fff;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: rgba(255, 255, 255, 0.3);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.input-wrapper input:focus + span {
    color: var(--accent);
}

.btn-login-premium {
    width: 100%;
    margin-top: 1.5rem;
    padding: 14px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-login-premium:hover {
    filter: brightness(1.12);
}

.btn-login-premium:active {
    transform: translateY(0);
}

.login-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.login-footer {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
}

/* Ocultar contenido principal estrictamente cuando el login inicial está activo */
body:has(#loginModal.active) .main-wrapper,
body:has(#loginModal.active) .leftMenu,
body:has(#loginModal.active) #showHideMenus {
    display: none !important;
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

/* ─── Alineación Catálogo (Quick Actions) ─── */
.quick-actions-align {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-align {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-transform: none;
    white-space: nowrap;
    height: 28px;
}

.btn-align span {
    font-size: 16px;
}

.btn-align.btn-product {
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-accent);
    border-color: rgba(88, 166, 255, 0.2);
}

.btn-align.btn-product:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-align.btn-package {
    background: rgba(126, 231, 135, 0.1);
    color: #7ee787;
    border-color: rgba(126, 231, 135, 0.2);
}

.btn-align.btn-package:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-align.btn-condiments {
    background: rgba(210, 153, 34, 0.1);
    color: var(--warning);
    border-color: rgba(210, 153, 34, 0.2);
}

.btn-align.btn-condiments:hover {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* Row Animations */
.row-processing {
    opacity: 0.5;
    pointer-events: none;
    background: rgba(88, 166, 255, 0.05);
}

.row-fade-out {
    animation: rowExit 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes rowExit {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(30px);
        background: rgba(46, 160, 67, 0.1);
    }
}
/* ─── Standardized Premium Ticket Button ─── */
.btn-premium-ticket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 10px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-accent);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    white-space: nowrap;
    height: 28px;
}

.btn-premium-ticket:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-premium-ticket span.material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.btn-premium-ticket:hover span.material-symbols-outlined {
    transform: scale(1.1);
}

/* Responsividad de todos los botones de la App .btn-align, .btn-premium-ticket y .btn-pill-action-missing */
@media screen and (max-width: 1450px) {
    .btn-premium-ticket,
    .btn-align,
    .btn-pill-action-missing {
        padding: 0;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        justify-content: center;
        min-width: 32px; /* Asegurar forma circular */
    }
    .btn-premium-ticket .btn-text,
    .btn-align .btn-text,
    .btn-pill-action-missing .btn-text {
        display: none;
    }
    .btn-premium-ticket span.material-symbols-outlined,
    .btn-align span.material-symbols-outlined,
    .btn-pill-action-missing span.material-symbols-outlined {
        margin: 0;
        font-size: 18px;
    }
}

/* Estilos de Celda de Producto */
.product-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.product-name-cell .main-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.product-name-cell .sub-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.rbac-hidden {
    display: none !important;
}

/* --- Alerta de Información de Alineación --- */
.info-badge-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.15);
    padding: 10px 20px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: fit-content;
}

.info-badge-card span.material-symbols-outlined {
    color: var(--accent);
    font-size: 22px;
    flex-shrink: 0;
}

.toggle-group-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* --- Alineación: Sub-tabs y Tags --- */
.align-status-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 4px;
}

.align-status-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 4px;
}

.align-status-tag.product { background: rgba(33, 150, 243, 0.1); color: #2196F3; border: 1px solid rgba(33, 150, 243, 0.2); }
.align-status-tag.package { background: rgba(156, 39, 176, 0.1); color: #9c27b0; border: 1px solid rgba(156, 39, 176, 0.2); }
.align-status-tag.condiments { background: rgba(76, 175, 80, 0.1); color: #4CAF50; border: 1px solid rgba(76, 175, 80, 0.2); }


/* --- Modal de Alineación Rápida --- */
.select-type-modal {
    max-width: 500px;
    min-width: 350px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.item-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.type-selection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 25px 0;
}

.btn-type-select {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.btn-type-select span.material-symbols-outlined {
    font-size: 28px;
    transition: transform 0.2s ease;
}

.btn-type-select .selection-text {
    display: flex;
    flex-direction: column;
}

.btn-type-select .label {
    font-weight: 600;
    font-size: 1rem;
}

.btn-type-select .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-type-select:hover {
    transform: translateX(5px);
    background: var(--bg-tertiary);
}

.btn-type-select.btn-condiments:hover { border-color: #4CAF50; }
.btn-type-select.btn-condiments:hover span { color: #4CAF50; transform: scale(1.1); }
.btn-type-select.btn-product:hover { border-color: #2196F3; }
.btn-type-select.btn-product:hover span { color: #2196F3; transform: scale(1.1); }
.btn-type-select.btn-package:hover { border-color: #9c27b0; }
.btn-type-select.btn-package:hover span { color: #9c27b0; transform: scale(1.1); }

.modal-actions-centered {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-cancel:active {
    transform: translateY(0);
}

/* ==============================================================================
   PERSONALIZACIONES Y AJUSTES DE COSTOAPP (SOBREESCRITURAS)
   ============================================================================== */

/* Margen interno para que el contenido de las páginas no esté pegado al borde */
.contentPages {
    padding: 30px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
}

/* Redondeado uniforme de 12px, ancho del 100%, altura de 44px, padding y márgenes fijos para evitar desplazamientos horizontales/verticales */
.sidebar__link {
    width: 100% !important;
    height: 44px !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 12px !important;
    border-radius: 12px !important;
}

/* Forzar padding constante en el contenedor de la barra lateral y ocultar scrollbars */
.sidebar__main {
    padding: 10px !important;
    scrollbar-width: none !important; /* Firefox */
}
.sidebar__main::-webkit-scrollbar {
    display: none !important; /* Webkit/Chrome */
}

/* Evitar que el icono salte horizontalmente al colapsar/expandir el menú */
.leftMenu.collapsed .sidebar__link {
    width: 100% !important;
    height: 44px !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
    padding-right: 0 !important;
    justify-content: flex-start !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

/* Alinear la foto de perfil del sidebar verticalmente con los iconos del menú y evitar saltos (ajustado 2px a la izquierda) */
.sidebar__profile {
    padding: 12px 12px 12px 16px !important;
    justify-content: flex-start !important;
}

.leftMenu.collapsed .sidebar__profile {
    padding-left: 16px !important;
    padding-right: 0 !important;
    justify-content: flex-start !important;
}

.leftMenu.collapsed .profile-info {
    justify-content: flex-start !important;
    width: auto !important;
}

/* --- ESTILOS DE LA PESTAÑA PERFIL NATIVOS --- */
#tab-perfil,
#tab-perfil .view-main {
    overflow-y: auto !important;
    padding-bottom: 2rem;
}

.profile-layout {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
    overflow-y: auto;
}

.profile-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.profile-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
    justify-content: space-between;
}

.profile-avatar-large {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--border-color);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-large .material-symbols-outlined {
    font-size: 80px;
    color: var(--text-muted);
}

.profile-upload-zone {
    width: 100%;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.02);
}

.profile-upload-zone:hover, .profile-upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 247, 0.05);
}

.profile-upload-zone .material-symbols-outlined {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.profile-upload-zone p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-grid-profile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.section-header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header-action .section-title {
    margin-bottom: 0;
}

.input-wrapper.disabled {
    opacity: 0.7;
}

.btn-logout-profile {
    background: rgba(218, 54, 51, 0.1);
    border: 1px solid rgba(218, 54, 51, 0.2);
    color: var(--danger);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout-profile:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(218, 54, 51, 0.3);
}

.btn-subtle-password {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--accent-glow);
    font-size: 0.95rem;
}

.btn-subtle-password:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
    filter: brightness(1.1);
}

/* Evitar el salto de línea en el texto del menú y asegurar altura fija del botón */
.sidebar__link {
    height: 44px !important;
    overflow: visible !important;
}

.textMenu {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ⚙️ Estilos Premium para select y opciones desplegables (Solución a fondo blanco/texto blanco) */
select.input {
    background-color: #1a1d23 !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    outline: none !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease-in-out;
}

/* Force select.input inside input-wrapper to perfectly match input height and padding */
.input-wrapper select.input {
    padding: 10px 12px 10px 44px !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    height: 42px !important;
}

.input-wrapper input.input {
    height: 42px !important; /* Standarize absolute height */
}

select.input:focus {
    border-color: var(--accent) !important;
}

select.input option,
select option,
option {
    background-color: #21242c !important;
    color: #ffffff !important;
    padding: 10px !important;
    font-size: 0.9rem !important;
}

/* Expandir el indicador de calendario de manera transparente sobre todo el input para abrir el selector al hacer click */
.input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 6; /* Por encima del input y del icono para recibir el click */
}

/* --- Premium Custom Tooltips --- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translate(-50%, 4px);
    background: #161a22;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap !important;
    width: max-content !important;
    display: inline-block !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    z-index: 100000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --- Right Side Custom Tooltips (for Sidebar) --- */
.leftMenu.collapsed [data-tooltip-right] {
    position: relative;
}

.leftMenu.collapsed [data-tooltip-right]::after {
    content: attr(data-tooltip-right);
    position: absolute;
    top: 50%;
    left: 110%;
    transform: translate(-6px, -50%);
    background: #161a22;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap !important;
    width: max-content !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.7);
    z-index: 100000;
}

.leftMenu.collapsed [data-tooltip-right]:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
}

/* --- Sub-Tabs Menu Layout --- */
.tab-menu {
    display: flex;
    gap: 8px;
    background: rgba(22, 24, 29, 0.5);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab-button.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(47, 129, 247, 0.3);
}

.tab-button:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-button .material-symbols-outlined,
.tab-button .material-symbols-rounded {
    font-size: 1.2rem;
}

/* --- Modal Inventory Tables Polish --- */
#tblDailyCriticalItems tr,
#tblDailyToysItems tr,
#tblDailyBIBItems tr,
#tblInventoryItems tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#tbodyDailyCriticalItems tr:nth-child(even),
#tbodyDailyToysItems tr:nth-child(even),
#tbodyDailyBIBItems tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

#tbodyDailyCriticalItems input[type=number],
#tbodyDailyToysItems input[type=number],
#tbodyDailyBIBItems input[type=number],
#tbodyInventoryItems input[type=number] {
    padding-right: 12px !important;
}

#tbodyDailyCriticalItems input[type=number]::-webkit-inner-spin-button,
#tbodyDailyToysItems input[type=number]::-webkit-inner-spin-button,
#tbodyDailyBIBItems input[type=number]::-webkit-inner-spin-button,
#tbodyInventoryItems input[type=number]::-webkit-inner-spin-button {
    margin-left: 15px !important;
}


/* --- Global Utility Classes Added for Refactoring --- */

.btn-global-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-primary:hover {
    background: var(--accent-hover);
}

.btn-global-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.btn-global-warning {
    background: #eab308;
    color: #000000;
    border: 1px solid #eab308;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-warning:hover {
    background: #ca8a04;
    border-color: #ca8a04;
    color: #000000;
}

.btn-global-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-2 { gap: 8px; }
.gap-3 { gap: 10px; }

/* --- Global Modal Layout Classes Added by AI --- */

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 0 0 12px 12px;
}

.modal-footer-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 0 0 12px 12px;
}

.modal-total-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.modal-total-value {
    color: var(--success);
    font-size: 1.15rem;
    font-weight: 700;
}

.flex-row-gap {
    display: flex;
    gap: 10px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Global Table & Layout Classes (Refactored) --- */

.card-body-flex {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    min-height: 0;
}

.table-container-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
}

.table-global {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    text-align: left;
    min-width: 1250px;
    font-size: 0.9rem;
}

.table-header-row {
    position: sticky !important;
    top: 0 !important;
    z-index: 15 !important;
    background-color: var(--bg-tertiary) !important;
    border-bottom: 2px solid var(--border-color);
}

.th-global {
    color: var(--text-secondary);
    padding: 12px;
    font-size: 0.85rem;
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* --- Global Toolbar Classes --- */
.toolbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-shrink: 0;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-group {
    display: flex;
    align-items: center;
    gap: 15px;
}
.input-select {
    height: 34px;
}

/* --- Global Utility Classes Added for Refactoring --- */

.btn-global-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-primary:hover {
    background: var(--accent-hover);
}

.btn-global-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-danger:hover {
    background: var(--danger-hover);
}

.btn-global-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-global-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-2 { gap: 8px; }
.gap-3 { gap: 10px; }

/* --- Global Modal Layout Classes Added by AI --- */

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 0 0 12px 12px;
}

.modal-footer-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 0 0 12px 12px;
}

.modal-total-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.modal-total-value {
    color: var(--success);
    font-size: 1.15rem;
    font-weight: 700;
}

.flex-row-gap {
    display: flex;
    gap: 10px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Global Table & Layout Classes (Refactored) --- */

.card-body-flex {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

.table-container-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.table-global {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 950px;
}

.table-header-row {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1.5px solid var(--border-color);
}

.th-global,
.table-global th,
.table-global thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 15 !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.table-global td {
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    transition: background 0.2s ease !important;
    vertical-align: middle !important;
}

.table-global tr:nth-child(even),
.table-global tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05) !important;
}

.table-global tr:hover,
.table-global tbody tr:hover {
    background: var(--bg-tertiary) !important;
}

.table-global th .th-content,
.th-global .th-content {
    color: var(--text-secondary) !important;
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* --- Global Toolbar Classes --- */
.toolbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-shrink: 0;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-group {
    display: flex;
    align-items: center;
    gap: 15px;
}
.input-select {
    height: 34px;
    width: 180px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #1a1d23;
    color: var(--text-primary);
    cursor: pointer;
}

/* --- Tabla de Inventario Teórico (#tblTheoreticalInventory) --- */
#tblTheoreticalInventory {
    width: 100%;
    min-width: 1600px;
    table-layout: fixed;
}

#tblTheoreticalInventory th,
#tblTheoreticalInventory td {
    padding: 12px 14px;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
}

#tblTheoreticalInventory th:nth-child(1),
#tblTheoreticalInventory td:nth-child(1) { width: 90px; min-width: 90px; max-width: 90px; }

#tblTheoreticalInventory th:nth-child(2),
#tblTheoreticalInventory td:nth-child(2) { width: 240px; min-width: 240px; max-width: 240px; }

#tblTheoreticalInventory th:nth-child(3),
#tblTheoreticalInventory td:nth-child(3) { width: 150px; min-width: 150px; max-width: 150px; }

#tblTheoreticalInventory th:nth-child(4),
#tblTheoreticalInventory td:nth-child(4) { width: 65px; min-width: 65px; max-width: 65px; text-align: center; }

#tblTheoreticalInventory th:nth-child(5),
#tblTheoreticalInventory td:nth-child(5) { width: 100px; min-width: 100px; max-width: 100px; text-align: right; }

#tblTheoreticalInventory th:nth-child(6),
#tblTheoreticalInventory td:nth-child(6) { width: 95px; min-width: 95px; max-width: 95px; text-align: right; }

#tblTheoreticalInventory th:nth-child(7),
#tblTheoreticalInventory td:nth-child(7) { width: 100px; min-width: 100px; max-width: 100px; text-align: right; }

#tblTheoreticalInventory th:nth-child(8),
#tblTheoreticalInventory td:nth-child(8) { width: 95px; min-width: 95px; max-width: 95px; text-align: right; }

#tblTheoreticalInventory th:nth-child(9),
#tblTheoreticalInventory td:nth-child(9) { width: 105px; min-width: 105px; max-width: 105px; text-align: right; }

#tblTheoreticalInventory th:nth-child(10),
#tblTheoreticalInventory td:nth-child(10) { width: 115px; min-width: 115px; max-width: 115px; text-align: right; }

#tblTheoreticalInventory th:nth-child(11),
#tblTheoreticalInventory td:nth-child(11) { width: 105px; min-width: 105px; max-width: 105px; text-align: right; }

#tblTheoreticalInventory th:nth-child(12),
#tblTheoreticalInventory td:nth-child(12) { width: 100px; min-width: 100px; max-width: 100px; text-align: right; }

#tblTheoreticalInventory th:nth-child(13),
#tblTheoreticalInventory td:nth-child(13) { width: 110px; min-width: 110px; max-width: 110px; text-align: right; }

#tblTheoreticalInventory th:nth-child(14),
#tblTheoreticalInventory td:nth-child(14) { width: 130px; min-width: 130px; max-width: 130px; text-align: right; }

/* ==========================================================================
   ESTILOS DE IMPRESIÓN PROFESIONAL (HOJA DE CONTEO FÍSICO)
   ========================================================================== */
@media print {
  /* Ocultar la aplicación completa (sidebar, header, modales, pestañas, etc.) */
  body * {
    visibility: hidden !important;
  }

  /* Mostrar exclusivamente el documento de impresión */
  #printCountingSheetArea,
  #printCountingSheetArea * {
    visibility: visible !important;
  }

  #printCountingSheetArea {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 6mm 8mm !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  @page {
    size: letter portrait;
    margin: 8mm 8mm;
  }

  .print-page-break-avoid {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 12px !important;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #333333 !important;
    padding: 5px 6px !important;
    color: #000000 !important;
  }

  .print-table th {
    background-color: #f0f0f0 !important;
    font-weight: 700 !important;
    font-size: 9.5px !important;
    text-transform: uppercase !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-cat-header {
    background-color: #e5e5e5 !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    padding: 5px 8px !important;
    border: 1px solid #333333 !important;
    border-bottom: none !important;
    text-transform: uppercase !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-write-cell {
    background-color: #ffffff !important;
  }
}

/* ────────── EXTENSIÓN: BADGES VISTA REPORTES & AUDITORÍA ────────── */
.badge-audit-type {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
}

.badge-audit-type--combo {
    background: rgba(234, 179, 8, 0.18) !important;
    color: #facc15 !important;
    border: 1px solid rgba(234, 179, 8, 0.4) !important;
}

.badge-audit-type--producto {
    background: rgba(46, 160, 67, 0.18) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(46, 160, 67, 0.4) !important;
}

.badge-audit-type--ingrediente {
    background: rgba(56, 139, 253, 0.18) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(56, 139, 253, 0.4) !important;
}

/* ────────── EXTENSIÓN: ESTILO INPUT DATE CON ICONO CUSTOM ────────── */
input[type="date"].input-custom-date::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* ────────── EXTENSIÓN: HOMOLOGACIÓN 100% TABLA INVENTARIO EN MODAL (#tblInventoryItems) ────────── */
#tblInventoryItems {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

#tblInventoryItems th {
    background-color: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    padding: 12px 10px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    border-bottom: 1.5px solid var(--border-color) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

#tblInventoryItems td {
    padding: 10px 10px !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 0.85rem !important;
    vertical-align: middle !important;
}

#tblInventoryItems tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

#tblInventoryItems tbody tr:hover {
    background-color: var(--bg-tertiary) !important;
}



/* ==========================================================================
   ESTRUCTURA DE MODALES Y VISTA TRASPASOS (EXTENSION GLOBAL)
   ========================================================================== */
.modal-card-dialog {
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-header-standard {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}

.modal-title-standard {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.modal-close-btn-standard {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    outline: none;
}

.modal-close-icon {
    font-size: 24px;
}

.modal-body-scrollable {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    overflow: hidden;
}

.modal-form-vertical {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    overflow: hidden;
}

.transfer-grid-locations {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.transfer-col-date {
    text-align: left;
    width: 180px;
}

.transfer-col-dest {
    text-align: left;
    width: 300px;
    margin-left: auto;
}

.transfer-col-orig {
    text-align: left;
    width: 300px;
}

.transfer-field-label {
    margin-bottom: 6px;
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.transfer-input-transparent {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    padding-left: 10px;
    height: 38px;
}

.transfer-select-transparent {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    padding-left: 10px;
    height: 38px;
    font-family: inherit;
}

.transfer-capture-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.transfer-search-group {
    position: relative;
    flex: 2;
    min-width: 250px;
    text-align: left;
}

.transfer-search-box {
    display: flex;
    align-items: center;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    height: 42px;
    background: #1a1d23;
}

.transfer-search-box-icon {
    margin-right: 8px;
    color: var(--text-muted);
    font-size: 20px;
}

.transfer-search-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
    width: 100%;
}

.transfer-suggestions-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1d23;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10010;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.transfer-qty-group {
    width: 160px;
    text-align: left;
}

.transfer-qty-box {
    display: flex;
    align-items: center;
    padding-right: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    height: 42px;
    background: #1a1d23;
}

.transfer-qty-input {
    height: 100%;
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 8px;
}

.transfer-uom-suffix {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
}

.transfer-selected-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.transfer-selected-details {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
}

.transfer-item-text {
    color: var(--text-primary);
}

.transfer-item-code {
    color: var(--text-primary);
    font-family: monospace;
}

.transfer-item-cost {
    color: var(--success);
    font-weight: 600;
}

.transfer-btn-add {
    width: auto;
    padding: 0 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.transfer-btn-add-icon {
    font-size: 1.2rem;
}

.transfer-table-flex-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transfer-table-full {
    width: 100%;
}

.transfer-table-header-sticky {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.transfer-th {
    color: var(--text-secondary);
    padding: 12px;
    font-size: 0.85rem;
}

.transfer-th--w80 {
    width: 80px;
}

.transfer-th--right {
    text-align: right;
}

.transfer-th--center {
    text-align: center;
}

.transfer-modal-total {
    color: var(--primary);
}

.transfer-footer-actions {
    margin-left: auto;
}

.btn-global-primary--success {
    background: var(--success) !important;
    border-color: var(--success) !important;
}

.btn-global-primary--danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}


/* ==========================================================================
   EXTENSIÓN: PRESETS DE FECHA & PAGINACIÓN (UI/UX SAAS)
   ========================================================================== */
.preset-pills-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 8px;
}

.btn-preset-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-preset-pill:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-preset-pill.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pagination-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.pagination-info-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-controls-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 12px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-page-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 6px;
}

/* Badge de Sincronización Global en AppBar */
.top-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.top-sync-badge .pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--success);
    display: inline-block;
    box-shadow: 0 0 6px var(--success);
    animation: pulseDot 2s infinite alternate;
}

@keyframes pulseDot {
    0% { opacity: 0.5; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 8px var(--success); }
}




