/* Variables CSS para temas */
:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 8px 32px rgba(99, 102, 241, 0.1);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.3);
    
    /* Variables específicas para tablas */
    --table-bg: transparent;
    --table-header-bg: rgba(99, 102, 241, 0.15);
    --table-row-hover: rgba(255, 255, 255, 0.05);
    --table-row-alternate: rgba(255, 255, 255, 0.02);
    --table-text: var(--text-primary);
    --table-header-text: var(--primary-color);

    /* Variables RGB para uso con rgba() */
    --primary-rgb: 99, 102, 241;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 6, 182, 212;
    --secondary-rgb: 236, 72, 153;
}

/* Dropdown vendedor con texto más pequeño */
#filter-seller option {
    font-size: 0.85rem;
}

/* Alineación del checkbox Solo ClickUp */
.col-md-2 .form-check {
    margin-top: -0.2rem;
    margin-left: 0.5rem;
}

/* Campos con formato LPS */
.form-control[readonly] {
    font-weight: 600;
}

/* ===== ESTILOS PARA CLICKUP PRODUCTION ===== */

/* Secciones por estado */
.status-section {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.status-tasks {
    margin-left: 1rem;
}

/* Tarjetas de tareas con hover mejorado */
.task-card {
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
    border-color: var(--primary-color);
}

/* Tarjetas de listas ClickUp */
.clickup-list-card {
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.clickup-list-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-light);
    border-color: var(--primary-color);
}

/* Colores específicos para estados */
.status-section[data-status="open"] {
    border-left-color: var(--primary-color);
}

.status-section[data-status="in progress"] {
    border-left-color: var(--warning-color);
}

.status-section[data-status="review"] {
    border-left-color: var(--info-color);
}

.status-section[data-status="testing"] {
    border-left-color: var(--secondary-color);
}

.status-section[data-status="ready"] {
    border-left-color: var(--success-color);
}

/* Badges de estado mejorados con contraste optimizado */
.badge.bg-primary {
    background-color: #4f46e5 !important;  /* Índigo más oscuro para mejor contraste */
    color: #ffffff !important;
    font-weight: 600 !important;
}

.badge.bg-warning {
    background-color: #f59e0b !important;
    color: #000000 !important;
    font-weight: 600 !important;
}

.badge.bg-info {
    background-color: #0891b2 !important;  /* Cyan más oscuro para mejor contraste */
    color: #ffffff !important;
    font-weight: 600 !important;
}

.badge.bg-success {
    background-color: #059669 !important;  /* Verde más oscuro para mejor contraste */
    color: #ffffff !important;
    font-weight: 600 !important;
}

.badge.bg-secondary {
    background-color: #4b5563 !important;  /* Gris más oscuro para mejor contraste */
    color: #ffffff !important;
    font-weight: 600 !important;
}

.badge.bg-light {
    background-color: #e5e7eb !important;
    color: #374151 !important;  /* Gris oscuro para contraste en fondo claro */
    font-weight: 600 !important;
}

/* Indicador de estado en dropdown */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== VISTA BOARD/KANBAN COMO CLICKUP ===== */

/* Sección principal del board */
.clickup-board-section {
    margin-bottom: 8px;
}

/* Header colapsable del estado */
.board-status-header {
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.board-status-header:hover {
    transform: translateX(2px);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

/* Icono de colapso */
.collapse-icon {
    transition: transform 0.3s ease;
}

.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* Lista de tareas en el board */
.board-task-list {
    background: #f8f9fa;
    border-radius: 0 0 4px 4px;
}

/* Filas de tarea */
.task-row {
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    background: transparent !important;
}

/* Prevenir fondos alternados en tareas */
.task-row:nth-child(even),
.task-row:nth-child(odd) {
    background: transparent !important;
}

.task-row:hover {
    background-color: #f8f9fa !important;
    transform: translateX(2px);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
}

/* Header de tabla */
.task-table-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botón de estado en tabla */
.clickup-status-button {
    font-size: 9px !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    border: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    min-width: 60px !important;
}

.clickup-status-button:hover {
    opacity: 0.9 !important;
}

/* Dropdown items estilo ClickUp */
.dropdown-item.active {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
}

.status-dot {
    display: inline-block;
    border-radius: 50%;
}

/* Badges para asignados */
.badge {
    font-size: 9px;
    padding: 2px 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .task-table-header {
        display: none !important;
    }

    .task-row {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .task-row > div {
        width: 100% !important;
        margin-bottom: 4px;
    }
}

/* Eliminamos estilos anteriores que interfieren */
.status-button {
    display: none !important;
}

/* Status badges mejorados */
.status-badge {
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Dropdown de cambio de estado */
.dropdown-menu {
    z-index: 1050 !important;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-light);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
}

.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.dropdown-menu .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-menu .dropdown-item:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    transform: translateX(2px);
}

/* Forzar colores en elementos de estado */
.dropdown-item .status-indicator {
    background-color: inherit !important;
    border: 1px solid currentColor !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    margin-right: 8px !important;
}

/* Eliminar estilos que sobrescriben los colores inline */
/* Se quitaron las reglas que usaban inherit ya que cancelaban los estilos inline */

/* Asegurar que los btn-group tengan el z-index correcto */
.btn-group {
    position: relative;
    z-index: 1040;
}

.btn-group.show {
    z-index: 1055;
}

/* Animaciones para cambio de estado */
.task-card {
    transition: all 0.3s ease;
}

.task-card.moving {
    transform: scale(1.05);
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
}

/* Campos personalizados */
.custom-fields {
    border-top: 1px solid rgba(var(--border-color), 0.3);
    padding-top: 0.75rem;
    margin-top: 0.75rem !important;
}

.custom-field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(var(--border-color), 0.1);
}

.custom-field-item:last-child {
    border-bottom: none;
}

.custom-field-label {
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    flex: 0 0 auto;
}

.custom-field-label i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.custom-field-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    flex: 1;
    margin-left: 0.5rem;
}

.custom-field-link {
    color: var(--primary-color);
    text-decoration: none;
}

.custom-field-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Progress bars para campos de progreso */
.custom-field-progress {
    width: 60px;
    height: 8px;
    background-color: rgba(var(--border-color), 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 0.5rem;
}

.custom-field-progress-bar {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Campos personalizados en modal de detalles */
.custom-fields-detail {
    background: rgba(var(--glass-bg), 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.custom-field-detail-item {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(var(--border-color), 0.2);
}

.custom-field-detail-item:last-child {
    border-bottom: none;
}

.custom-field-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-field-detail-label i {
    font-size: 1rem;
    opacity: 0.8;
}

.custom-field-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.custom-field-detail-value .custom-field-progress {
    width: 120px;
    height: 12px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .status-section {
        padding-left: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .status-tasks {
        margin-left: 0;
    }

    .task-card {
        margin-bottom: 1rem !important;
    }

    .btn-group .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .custom-field-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .custom-field-value {
        text-align: left;
        margin-left: 0;
    }

    .custom-field-label {
        font-size: 0.75rem;
    }
}

/* General */
body {
    transition: background-color 0.5s ease, color 0.5s ease;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1a3a 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Sidebar con efecto auto-hide */
.sidebar {
    width: 80px;
    color: var(--text-primary);
    position: fixed;
    height: 100vh;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 15px;
    backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border-radius: 0 20px 20px 0;
    box-shadow: var(--shadow-light);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
}

.sidebar:hover {
    width: 280px;
}

.sidebar h3 {
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    text-align: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    white-space: nowrap;
}

.sidebar:hover h3 {
    opacity: 1;
}

/* Sidebar logo cuando está colapsado */
.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    margin: 0 auto 2rem;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.sidebar:hover .sidebar-icon {
    margin-bottom: 0;
    opacity: 0;
    transform: scale(0.8);
}

/* Temas dinámicos */
body.light-theme {
    --dark-bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --primary-rgb: 99, 102, 241;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 6, 182, 212;
    --secondary-rgb: 236, 72, 153;
    
    /* Variables para tablas - tema claro */
    --table-bg: rgba(255, 255, 255, 0.7);
    --table-header-bg: rgba(99, 102, 241, 0.1);
    --table-row-hover: rgba(99, 102, 241, 0.05);
    --table-row-alternate: rgba(241, 245, 249, 0.8);
    --table-text: #1e293b;
    --table-header-text: #4c1d95;
    
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

body.light-theme .sidebar {
    background: rgba(248, 249, 250, 0.95);
    color: var(--text-primary);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    --dark-bg: #121212;
    --card-bg: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-rgb: 99, 102, 241;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 6, 182, 212;
    --secondary-rgb: 236, 72, 153;
    
    /* Variables para tablas - tema oscuro */
    --table-bg: rgba(255, 255, 255, 0.03);
    --table-header-bg: rgba(99, 102, 241, 0.2);
    --table-row-hover: rgba(255, 255, 255, 0.08);
    --table-row-alternate: rgba(255, 255, 255, 0.02);
    --table-text: #e0e0e0;
    --table-header-text: #a5b4fc;
    
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
}

body.dark-theme .sidebar {
    background: rgba(18, 18, 18, 0.95);
    color: var(--text-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

body.dim-theme {
    --dark-bg: #2c2c2c;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --text-primary: #b0b0b0;
    --text-secondary: #888888;
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Variables para tablas - tema dim */
    --table-bg: rgba(255, 255, 255, 0.02);
    --table-header-bg: rgba(99, 102, 241, 0.15);
    --table-row-hover: rgba(255, 255, 255, 0.06);
    --table-row-alternate: rgba(255, 255, 255, 0.01);
    --table-text: #b0b0b0;
    --table-header-text: #9ca3af;
    
    background: linear-gradient(135deg, #2c2c2c 0%, #3a3a3a 100%);
}

body.high-contrast-theme {
    --primary-color: #ffff00;
    --dark-bg: #000000;
    --card-bg: rgba(255, 255, 0, 0.1);
    --glass-bg: rgba(255, 255, 0, 0.15);
    --text-primary: #ffff00;
    --text-secondary: #ffffff;
    --border-color: rgba(255, 255, 0, 0.3);
    
    /* Variables para tablas - tema alto contraste */
    --table-bg: rgba(255, 255, 0, 0.05);
    --table-header-bg: rgba(255, 255, 0, 0.2);
    --table-row-hover: rgba(255, 255, 0, 0.1);
    --table-row-alternate: rgba(255, 255, 0, 0.03);
    --table-text: #ffffff;
    --table-header-text: #ffff00;
    
    background: #000000;
}

body.pastelBlue-theme {
    --primary-color: #64748B; /* Muted Slate Blue */
    --dark-bg: #F1F5F9; /* Light Slate */
    --card-bg: rgba(100, 116, 139, 0.08);
    --glass-bg: rgba(100, 116, 139, 0.12);
    --text-primary: #1E293B; /* Dark Slate */
    --text-secondary: #475569; /* Medium Slate */
    --border-color: rgba(100, 116, 139, 0.15);
    --primary-rgb: 100, 116, 139;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 6, 182, 212;
    --secondary-rgb: 236, 72, 153;
    
    /* Variables para tablas - tema azul pastel */
    --table-bg: rgba(248, 250, 252, 0.8);
    --table-header-bg: rgba(100, 116, 139, 0.1);
    --table-row-hover: rgba(100, 116, 139, 0.05);
    --table-row-alternate: rgba(241, 245, 249, 0.6);
    --table-text: #1E293B;
    --table-header-text: #475569;
    
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
}

body.pastelGreen-theme {
    --primary-color: #527853; /* Muted Sage Green */
    --dark-bg: #F0F5F0; /* Light Sage */
    --card-bg: rgba(82, 120, 83, 0.08);
    --glass-bg: rgba(82, 120, 83, 0.12);
    --text-primary: #344E41; /* Dark Sage */
    --text-secondary: #A3B18A; /* Light Olive */
    --border-color: rgba(82, 120, 83, 0.15);
    
    /* Variables para tablas - tema verde pastel */
    --table-bg: rgba(247, 250, 247, 0.8);
    --table-header-bg: rgba(82, 120, 83, 0.1);
    --table-row-hover: rgba(82, 120, 83, 0.05);
    --table-row-alternate: rgba(240, 245, 240, 0.6);
    --table-text: #344E41;
    --table-header-text: #527853;
    
    background: linear-gradient(135deg, #F7FAF7 0%, #F0F5F0 100%);
}

body.pastelLavender-theme {
    --primary-color: #9370DB; /* Muted Medium Purple */
    --dark-bg: #F3F1F7; /* Light Lavender */
    --card-bg: rgba(147, 112, 219, 0.08);
    --glass-bg: rgba(147, 112, 219, 0.12);
    --text-primary: #4A235A; /* Dark Purple */
    --text-secondary: #884EA0; /* Medium Purple */
    --border-color: rgba(147, 112, 219, 0.15);
    
    /* Variables para tablas - tema lavanda pastel */
    --table-bg: rgba(248, 247, 250, 0.8);
    --table-header-bg: rgba(147, 112, 219, 0.1);
    --table-row-hover: rgba(147, 112, 219, 0.05);
    --table-row-alternate: rgba(243, 241, 247, 0.6);
    --table-text: #4A235A;
    --table-header-text: #7B68EE;
    
    background: linear-gradient(135deg, #F8F7FA 0%, #F3F1F7 100%);
}

body.pastelPink-theme {
    --primary-color: #C08497; /* Dusty Rose */
    --dark-bg: #F5E6E8; /* Light Rose */
    --card-bg: rgba(192, 132, 151, 0.08);
    --glass-bg: rgba(192, 132, 151, 0.12);
    --text-primary: #723D46; /* Dark Rose */
    --text-secondary: #9A6A6A; /* Muted Brownish Pink */
    --border-color: rgba(192, 132, 151, 0.15);
    
    /* Variables para tablas - tema rosa pastel */
    --table-bg: rgba(249, 242, 243, 0.8);
    --table-header-bg: rgba(192, 132, 151, 0.1);
    --table-row-hover: rgba(192, 132, 151, 0.05);
    --table-row-alternate: rgba(245, 230, 232, 0.6);
    --table-text: #723D46;
    --table-header-text: #9A6A6A;
    
    background: linear-gradient(135deg, #F9F2F3 0%, #F5E6E8 100%);
}

body.pastelYellow-theme {
    --primary-color: #D4A276; /* Soft Ochre */
    --dark-bg: #F7F3ED; /* Off-white/Sand */
    --card-bg: rgba(212, 162, 118, 0.08);
    --glass-bg: rgba(212, 162, 118, 0.12);
    --text-primary: #6F4518; /* Brown */
    --text-secondary: #A87C56; /* Muted Brown */
    --border-color: rgba(212, 162, 118, 0.15);
    
    /* Variables para tablas - tema amarillo pastel */
    --table-bg: rgba(250, 248, 245, 0.8);
    --table-header-bg: rgba(212, 162, 118, 0.1);
    --table-row-hover: rgba(212, 162, 118, 0.05);
    --table-row-alternate: rgba(247, 243, 237, 0.6);
    --table-text: #6F4518;
    --table-header-text: #A87C56;
    
    background: linear-gradient(135deg, #FAF8F5 0%, #F7F3ED 100%);
}

/* Estilo de los enlaces del sidebar */
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.menu a i {
    min-width: 24px;
    margin-right: 12px;
    font-size: 1.2rem;
    text-align: center;
}

.menu a span {
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.sidebar:hover .menu a span {
    opacity: 1;
}

.menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    z-index: -1;
}

.menu a:hover::before {
    width: 100%;
}

.menu a:hover {
    color: white;
    transform: translateX(8px);
}

/* ===== Sub-menú colapsable (Inventario) ===== */
.has-submenu > .submenu-toggle {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.has-submenu > .submenu-toggle i:first-child {
    min-width: 24px;
    margin-right: 12px;
    font-size: 1.2rem;
}

.has-submenu > .submenu-toggle span {
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.sidebar:hover .has-submenu > .submenu-toggle span {
    opacity: 1;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0;
}

.sidebar:hover .submenu-arrow {
    opacity: 1;
}

.has-submenu.open > .submenu-toggle .submenu-arrow {
    transform: rotate(180deg);
}

.has-submenu > .submenu-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    z-index: -1;
}

.has-submenu > .submenu-toggle:hover::before {
    width: 100%;
}

.has-submenu > .submenu-toggle:hover {
    color: white;
    transform: translateX(8px);
}

/* Sub-menú items */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.open .submenu {
    max-height: 200px;
}

.submenu li a {
    display: flex;
    align-items: center;
    padding: 8px 8px 8px 20px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.submenu li a i {
    min-width: 20px;
    margin-right: 10px;
    font-size: 1rem;
}

.submenu li a span {
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.sidebar:hover .submenu li a span {
    opacity: 1;
}

.submenu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    z-index: -1;
    opacity: 0.7;
}

.submenu li a:hover::before {
    width: 100%;
}

.submenu li a:hover {
    color: white;
    transform: translateX(6px);
}

/* Cuando sidebar está colapsado, ocultar sub-menú */
.sidebar:not(:hover) .submenu {
    max-height: 0 !important;
}

/* ===== Fin sub-menú ===== */

/* Contenido principal - aprovechando más espacio */
.content {
    margin-left: 100px;
    padding: 20px;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 95%;
    /* Usar 95% del ancho disponible */
    margin-left: auto;
    margin-right: auto;
    padding-left: 140px;
    /* Más espacio para el sidebar */
    padding-right: 40px;
    /* Padding derecho para balance */
    width: 100%;
}

/* Cuando el sidebar se expande */
.sidebar:hover+.content {
    padding-left: 320px;
    /* Más espacio cuando sidebar está expandido */
    max-width: 90%;
    /* Ajustar ancho máximo */
}

/* Dropdown de selección de tema - solo mejorar legibilidad */
.theme-dropdown {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.theme-dropdown select {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    min-width: 180px;
    height: 45px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
}

.theme-dropdown select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: var(--glass-bg);
}

.theme-dropdown select:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.theme-dropdown select option {
    background: var(--dark-bg);
    color: var(--text-primary);
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* User info styling */
.user-info {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-info i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.user-info:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Cards más anchas para aprovechar el espacio */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    /* Usar todo el ancho disponible */
    min-width: auto;
    /* Remover restricción de ancho mínimo */
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

/* Responsive para cards */
@media (max-width: 992px) {
    .glass-card {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .glass-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
}

/* Page title mejorado con mejor contraste */
.page-title {
    font-size: 2.8rem;
    /* Más grande */
    font-weight: 800;
    /* Más grueso */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Sombra sutil */
}

/* Títulos de sección más compactos */
.glass-card h3 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    /* Tamaño más pequeño */
    margin-bottom: 1.25rem;
    /* Margen reducido */
    border-bottom: 1px solid var(--border-color);
    /* Borde más delgado */
    padding-bottom: 0.5rem;
    /* Padding reducido */
}

/* Form elements más compactos en altura */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    /* Padding reducido significativamente */
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    height: 38px;
    /* Altura fija más pequeña */
    width: 100%;
    font-size: 0.875rem;
    /* Tamaño de fuente más pequeño */
    line-height: 1.2;
    /* Line height compacto */
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
    font-size: 0.875rem;
    /* Placeholder más pequeño */
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.375rem;
    /* Margen reducido */
    font-size: 0.8rem;
    /* Label más pequeño */
    line-height: 1.1;
}

.form-select option {
    background: var(--dark-bg);
    color: var(--text-primary);
    padding: 0.375rem;
    font-size: 0.875rem;
}

/* Mejor distribución en las columnas */
.item-row .col-12,
.item-row .col-6,
.item-row .col-md-2,
.item-row .col-md-3,
.item-row .col-md-4,
.item-row .col-md-5,
.item-row .col-md-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Ajustes para aprovechar mejor el espacio en desktop */
@media (min-width: 1200px) {
    .item-row .col-md-2 {
        flex: 0 0 auto;
        width: 15%;
        /* Columnas más compactas para cantidad/porcentaje */
    }

    .item-row .col-md-3 {
        flex: 0 0 auto;
        width: 30%;
        /* Columnas para material/precio */
    }

    .item-row .col-md-4 {
        flex: 0 0 auto;
        width: 35%;
        /* Columnas para artículos */
    }
}

/* Botones más compactos y estéticos */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-outline-primary {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-outline-success {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    color: var(--success-color);
    font-weight: 600;
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-outline-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--warning-color);
    color: var(--warning-color);
    font-weight: 600;
}

.btn-outline-warning:hover {
    background: var(--warning-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

/* Botón outline-danger mejorado */
.btn-outline-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    font-weight: 600;
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white !important;
    border-color: var(--danger-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-outline-danger:focus {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
    font-weight: 600;
    border: 2px solid transparent;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    font-weight: 600;
    border: 2px solid transparent;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #22d3ee);
    color: white;
    font-weight: 600;
    border: 2px solid transparent;
}

.btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

.btn-outline-info {
    background: rgba(6, 182, 212, 0.1);
    border: 2px solid var(--info-color);
    color: var(--info-color);
    font-weight: 600;
}

.btn-outline-info:hover {
    background: var(--info-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

/* Item rows más compactos en altura */
.item-row {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    /* Padding vertical reducido */
    margin-bottom: 0.75rem;
    /* Margen entre filas reducido */
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
}

.item-row:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.item-row .row {
    align-items: end;
    gap: 0.5rem;
    /* Gap reducido entre columnas */
    margin: 0;
    /* Remover margen de Bootstrap */
}

/* Columnas con padding reducido */
.item-row .col-md-1,
.item-row .col-md-2,
.item-row .col-md-3,
.item-row .col-md-4,
.item-row .col-md-5,
.item-row .col-md-8 {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

/* Botones de eliminar con mejor contraste y alineación */
.remove-material-btn,
.remove-article-btn,
.remove-additional-btn {
    width: 32px;
    height: 32px;
    /* Misma altura que los campos de input */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.15) !important;
    /* Fondo más visible */
    border: 2px solid rgba(239, 68, 68, 0.6) !important;
    /* Borde más contrastante */
    color: #ef4444 !important;
    /* Color más intenso */
    transition: all 0.2s ease;
}

.remove-material-btn:hover,
.remove-article-btn:hover,
.remove-additional-btn:hover {
    background: #ef4444 !important;
    /* Fondo rojo sólido en hover */
    border-color: #ef4444 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.remove-material-btn:focus,
.remove-article-btn:focus,
.remove-additional-btn:focus {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
    outline: none;
}

/* Alineación forzada en la misma línea */
.item-row .row {
    align-items: center;
    /* Centrar verticalmente todos los elementos */
    gap: 0.5rem;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    /* Evitar que se envuelvan a nueva línea */
}

/* Asegurar que todas las columnas estén en la misma línea */
.item-row .col-md-1,
.item-row .col-md-2,
.item-row .col-md-3,
.item-row .col-md-4,
.item-row .col-md-5,
.item-row .col-md-8 {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
    flex-shrink: 0;
    /* No permitir que se encojan */
    display: flex;
    flex-direction: column;
}

/* Columna del botón de eliminar siempre alineada */
.item-row .row .col-md-1 {
    display: flex;
    align-items: center;
    /* Centrar el botón verticalmente */
    justify-content: center;
    min-height: auto;
    /* Remover altura mínima */
    margin-top: 0;
    align-self: center;
    /* Forzar alineación central */
}

/* Botones de eliminar alineados horizontalmente */
.remove-material-btn,
.remove-article-btn,
.remove-additional-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    /* Remover todos los márgenes */
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.15) !important;
    border: 2px solid rgba(239, 68, 68, 0.6) !important;
    color: #ef4444 !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* No permitir que se encoja */
}

/* Remover estilos del botón flotante anterior */
.remove-row {
    display: none;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Vistas de inventario: usar ancho completo */
#inventario-view.active,
#inventario-historial-view.active {
    width: 100%;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ===== ESTILOS PARA GESTIÓN DE ARTÍCULOS ===== */

/* Tabla de artículos */
.table {
    color: var(--table-text);
    background: var(--table-bg);
    border-radius: 8px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.table thead th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    font-weight: 600;
    border-bottom: 2px solid var(--table-header-text);
    padding: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    vertical-align: middle;
    background: inherit;
    color: var(--table-text);
}

.table tbody tr {
    transition: all 0.2s ease;
    background: var(--table-bg);
}

.table tbody tr:nth-child(even) {
    background: var(--table-row-alternate);
}

.table tbody tr:hover {
    background: var(--table-row-hover) !important;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    background: var(--table-bg);
    margin-bottom: 1rem;
}

.table-responsive .table {
    margin-bottom: 0;
    border: none;
    background: transparent;
}

/* Botones en tablas */
.table .btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.table .btn-outline-primary {
    border-color: var(--table-header-text);
    color: var(--table-header-text);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.table .btn-outline-primary:hover {
    background: var(--table-header-text);
    color: var(--table-bg);
    border-color: var(--table-header-text);
    transform: translateY(-1px);
}

.table .btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.table .btn-outline-success:hover {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    transform: translateY(-1px);
}

.table .btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.table .btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
    transform: translateY(-1px);
}

.table .btn-outline-secondary {
    border-color: var(--table-text);
    color: var(--table-text);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.table .btn-outline-secondary:hover {
    background: var(--table-text);
    color: var(--table-bg);
    border-color: var(--table-text);
    transform: translateY(-1px);
}

/* Enlaces en tablas */
.table a {
    color: var(--table-header-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.table a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Texto fuerte en tablas */
.table strong, .table b {
    color: var(--table-header-text);
}

/* Badges y spans en tablas */
.table .badge {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    border: 1px solid var(--table-header-text);
}

/* Badges personalizados adaptativos para ClickUp */
.badge-clickup-active {
    background: rgba(var(--success-rgb), 0.15) !important;
    color: var(--success-color) !important;
    border: 1px solid var(--success-color) !important;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.badge-clickup-inactive {
    background: rgba(var(--table-text), 0.1) !important;
    color: var(--table-text) !important;
    border: 1px solid var(--table-text) !important;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: inline-block;
}

/* Estados hover para los badges */
.badge-clickup-active:hover {
    background: rgba(var(--success-rgb), 0.25) !important;
    transform: scale(1.05);
}

.badge-clickup-inactive:hover {
    background: rgba(var(--table-text), 0.2) !important;
    transform: scale(1.05);
}

/* Badges de ClickUp en párrafos y contextos no-tabla */
p .badge-clickup-active,
div .badge-clickup-active {
    vertical-align: middle;
    margin-left: 0.5rem;
}

p .badge-clickup-inactive,
div .badge-clickup-inactive {
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Formato para montos monetarios en tablas */
.table td[style*="white-space: nowrap"], 
.table .currency-amount {
    white-space: nowrap !important;
    font-weight: 500;
    text-align: right;
}

/* Mejoras generales para números en tablas */
.table .number, 
.table .amount {
    white-space: nowrap;
    text-align: right;
    font-weight: 500;
}

/* Modal personalizado */
.modal-content {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    animation: slide-down 0.5s ease-out;
}

@keyframes slide-down {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-title {
    color: var(--primary-color);
    font-weight: 600;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Sección de configuración de fórmula */
#editArticleModal .glass-card {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid var(--primary-color) !important;
    padding: 1.25rem;
    margin-top: 1rem;
}

#editArticleModal .glass-card h5 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

#formula-result {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Ajustes específicos para el modal de edición */
.modal-xl {
    max-width: 90%;
}

@media (min-width: 1200px) {
    .modal-xl {
        max-width: 1140px;
    }
}

/* ===== RESPONSIVE STYLES ===== */

/* Para pantallas muy pequeñas (móviles) */
@media (max-width: 576px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        border-radius: 0;
    }

    .sidebar:hover {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        margin-right: 0;
        padding: 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        width: 100%;
        max-width: none;
    }

    .theme-dropdown {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .theme-dropdown select {
        width: 100%;
        max-width: 280px;
        min-width: auto;
        font-size: 1rem;
        height: 48px;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .glass-card {
        padding: 1rem;
        margin-bottom: 1rem;
        width: 100%;
    }

    .item-row {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .item-row .row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        /* Estirar en móvil para mejor uso del espacio */
        min-height: auto;
    }

    .item-row .col-md-3,
    .item-row .col-md-4,
    .item-row .col-md-6,
    .item-row .col-md-5,
    .item-row .col-md-2,
    .item-row .col-md-8 {
        margin-bottom: 0.5rem;
        padding-left: 0;
        padding-right: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Mantener el botón en línea con el último campo en móvil */
    .item-row .col-md-1 {
        width: 100%;
        max-width: 100%;
        padding-top: 0;
        justify-content: center;
        margin-bottom: 0;
    }

    .remove-material-btn,
    .remove-article-btn,
    .remove-additional-btn {
        width: 40px;
        height: 40px;
        margin: 0 auto;
        background: rgba(239, 68, 68, 0.2) !important;
        border: 2px solid rgba(239, 68, 68, 0.8) !important;
        font-size: 1rem;
    }

    /* Ajustar botones en móvil */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        width: 100%;
        margin-bottom: 0.5rem;
        height: 40px;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }

    /* Ajustar campos de formulario en móvil */
    .form-control,
    .form-select {
        font-size: 16px;
        /* Evita zoom en iOS */
        height: 42px;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    /* Modal en móvil */
    .modal-xl {
        max-width: 100%;
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Tabla responsive */
    .table-responsive {
        overflow-x: auto;
    }
}

/* Para tablets */
@media (min-width: 577px) and (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar:hover {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        max-width: none;
    }

    .theme-dropdown {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        width: 200px;
    }

    .page-title {
        font-size: 2rem;
    }

    .glass-card {
        padding: 1.5rem;
        width: 100%;
    }

    .item-row .col-md-3,
    .item-row .col-md-4,
    .item-row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .item-row .col-md-2,
    .item-row .col-md-5 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 1rem;
    }

    .remove-row {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* Para pantallas medianas */
@media (min-width: 769px) and (max-width: 992px) {
    .content {
        padding: 1.5rem;
        padding-left: 140px;
        padding-right: 30px;
        width: 100%;
        max-width: 95%;
    }

    .sidebar:hover+.content {
        padding-left: 320px;
        max-width: 90%;
    }

    .glass-card {
        padding: 1.5rem;
        width: 100%;
    }

    .item-row {
        padding: 1.25rem 1.75rem;
        /* Padding ajustado para tablets */
    }

    .item-row .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .item-row .col-md-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }

    .item-row .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .item-row .col-md-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }

    .item-row .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Para pantallas grandes */
@media (min-width: 993px) and (max-width: 1200px) {
    .content {
        padding: 2rem;
        padding-left: 140px;
        padding-right: 40px;
        max-width: 95%;
        width: 100%;
    }

    .sidebar:hover+.content {
        padding-left: 320px;
        max-width: 90%;
    }

    .item-row {
        padding: 1.5rem 2.25rem;
        /* Más padding horizontal en pantallas grandes */
    }
}

/* Para pantallas extra grandes */
@media (min-width: 1201px) {
    .content {
        padding: 2rem;
        padding-left: 140px;
        padding-right: 40px;
        max-width: 96%;
        /* Usar casi todo el ancho en pantallas muy grandes */
        width: 100%;
    }

    .sidebar:hover+.content {
        padding-left: 320px;
        max-width: 92%;
    }

    .item-row {
        padding: 1.5rem 3rem;
        /* Aún más padding horizontal en pantallas extra grandes */
    }

    .glass-card {
        padding: 1.75rem 2.5rem;
        /* Más padding horizontal en cards también */
    }
}

/* Para pantallas ultra anchas */
@media (min-width: 1600px) {
    .content {
        max-width: 98%;
        /* Usar casi todo el ancho disponible */
    }

    .sidebar:hover+.content {
        max-width: 94%;
    }

    .item-row {
        padding: 1.5rem 4rem;
        /* Padding generoso en pantallas ultra anchas */
    }

    .glass-card {
        padding: 1.75rem 3rem;
    }
}

/* Mejoras específicas para elementos */
@media (max-width: 768px) {

    /* Hacer que las tarjetas de resumen sean más compactas */
    .text-center.p-3 {
        padding: 1rem !important;
    }

    /* Ajustar el grid de información del cliente */
    #quotation-view .row .col-md-4 {
        margin-bottom: 1rem;
    }

    /* Mejorar la tabla de cálculos */
    #quotation-view .glass-card .row .col-md-4,
    #quotation-view .glass-card .row .col-md-6 {
        margin-bottom: 1rem;
    }

    /* Centrar botones de acción */
    .text-center .btn {
        display: block;
        margin: 0.5rem auto;
        width: 100%;
        max-width: 300px;
    }

    /* Hacer scroll horizontal en tablas si es necesario */
    .table-responsive {
        overflow-x: auto;
    }
}

/* Ajustes para mejorar la usabilidad en touch */
@media (max-width: 768px) {
    .menu a {
        padding: 15px 12px;
        font-size: 1.1rem;
    }

    .menu a i {
        font-size: 1.4rem;
        margin-right: 15px;
    }

    .remove-row {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .btn {
        min-height: 44px;
        /* Tamaño mínimo para touch */
    }
}

/* Ajustes para el modo landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .glass-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }

    .item-row {
        padding: 0.8rem;
    }
}

/* Estilos adicionales para dispositivos táctiles */
.touch-device .btn {
    min-height: 44px;
    min-width: 44px;
}

.touch-device .form-control,
.touch-device .form-select {
    min-height: 44px;
}

.touch-device .remove-row {
    min-width: 44px;
    min-height: 44px;
}

/* Botón hamburguesa para móvil */
.mobile-menu-btn {
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
    background: var(--glass-bg) !important;
    border: 1px solid var(--border-color) !important;
}

/* Overlay para cerrar sidebar en móvil */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mejoras para el scroll en móvil */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    .glass-card {
        border-radius: 16px;
    }

    .item-row {
        border-radius: 12px;
    }
}

/* Animaciones suaves para cambios de layout */
.content,
.sidebar,
.item-row,
.glass-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ajustes específicos para iOS */
@supports (-webkit-touch-callout: none) {

    .form-control,
    .form-select {
        font-size: 16px !important;
        /* Previene zoom automático */
        border-radius: 12px;
    }
}

/* Mejora la visibilidad de elementos activos en touch */
.touch-device .btn:active,
.touch-device .menu a:active {
    transform: scale(0.98);
}

/* Estilos para orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 250px;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .glass-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .item-row {
        padding: 0.8rem;
    }
}

/* Grid helpers para mobile */
@media (max-width: 576px) {
    .mobile-grid-1 {
        width: 100%;
    }

    .mobile-grid-2 {
        width: 50%;
    }

    .mobile-grid-3 {
        width: 33.333%;
    }

    .mobile-stack>* {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .mobile-stack>*:last-child {
        margin-bottom: 0;
    }
}

/* Mejoras para accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible mejorado */
.form-control:focus-visible,
.form-select:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Prevenir zoom en inputs en iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {

    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"] {
        font-size: 16px !important;
    }
}

/* Spinner de carga para interacciones */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mejoras para tablas en móvil */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }

    .table-mobile-stack {
        display: block;
    }

    .table-mobile-stack tr {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
        background: var(--card-bg);
    }

    .table-mobile-stack td {
        display: block;
        text-align: left !important;
        border: none;
        padding: 0.25rem 0;
    }

    .table-mobile-stack td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: var(--text-secondary);
    }
}

/* Sticky headers para scroll largo */
.sticky-header {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

/* Contraste específico para selector de temas - colores opuestos */

/* Tema claro - texto oscuro sobre fondo claro */
body.light-theme .theme-dropdown select {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #1e293b;
}

body.light-theme .theme-dropdown select option {
    background: #ffffff;
    color: #1e293b;
}

body.light-theme .user-info {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #1e293b;
}

body.light-theme .user-info span {
    color: #64748b !important;
}

/* Tema oscuro - texto blanco sobre fondo oscuro */
body.dark-theme .theme-dropdown select {
    background: #1a1a1a;
    border: 2px solid #374151;
    color: #ffffff;
}

body.dark-theme .theme-dropdown select option {
    background: #1a1a1a;
    color: #ffffff;
}

body.dark-theme .user-info {
    background: #1a1a1a;
    border: 2px solid #374151;
    color: #ffffff;
}

body.dark-theme .user-info span {
    color: #d1d5db !important;
}

/* Modo oscuro - Texto muted (etiquetas del dashboard) */
body.dark-theme .text-muted {
    color: #9ca3af !important;
}

/* Modo oscuro - Títulos del dashboard */
body.dark-theme h3,
body.dark-theme h4 {
    color: #ffffff !important;
}

/* Modo oscuro - Asegurar que los contadores mantengan sus colores */
body.dark-theme .text-primary {
    color: #60a5fa !important;
}

body.dark-theme .text-success {
    color: #34d399 !important;
}

body.dark-theme .text-warning {
    color: #fbbf24 !important;
}

body.dark-theme .text-info {
    color: #06b6d4 !important;
}

/* Tema tenue - texto claro sobre fondo tenue */
body.dim-theme .theme-dropdown select {
    background: #3a3a3a;
    border: 2px solid #525252;
    color: #f5f5f5;
}

body.dim-theme .theme-dropdown select option {
    background: #3a3a3a;
    color: #f5f5f5;
}

body.dim-theme .user-info {
    background: #3a3a3a;
    border: 2px solid #525252;
    color: #f5f5f5;
}

body.dim-theme .user-info span {
    color: #d4d4d8 !important;
}

/* Alto contraste - amarillo sobre negro */
body.high-contrast-theme .theme-dropdown select {
    background: #000000;
    border: 2px solid #ffff00;
    color: #ffff00;
    font-weight: 700;
}

body.high-contrast-theme .theme-dropdown select option {
    background: #000000;
    color: #ffff00;
}

body.high-contrast-theme .user-info {
    background: #000000;
    border: 2px solid #ffff00;
    color: #ffff00;
    font-weight: 700;
}

body.high-contrast-theme .user-info span {
    color: #ffff00 !important;
}

/* Pastel Azul - azul oscuro sobre fondo azul claro */
body.pastelBlue-theme .theme-dropdown select {
    background: #dbeafe;
    border: 2px solid #93c5fd;
    color: #1e40af;
}

body.pastelBlue-theme .theme-dropdown select option {
    background: #dbeafe;
    color: #1e40af;
}

body.pastelBlue-theme .user-info {
    background: #dbeafe;
    border: 2px solid #93c5fd;
    color: #1e40af;
}

body.pastelBlue-theme .user-info span {
    color: #3b82f6 !important;
}

/* Pastel Verde - verde oscuro sobre fondo verde claro */
body.pastelGreen-theme .theme-dropdown select {
    background: #dcfce7;
    border: 2px solid #86efac;
    color: #166534;
}

body.pastelGreen-theme .theme-dropdown select option {
    background: #dcfce7;
    color: #166534;
}

body.pastelGreen-theme .user-info {
    background: #dcfce7;
    border: 2px solid #86efac;
    color: #166534;
}

body.pastelGreen-theme .user-info span {
    color: #16a34a !important;
}

/* Pastel Lavanda - morado oscuro sobre fondo lavanda claro */
body.pastelLavender-theme .theme-dropdown select {
    background: #f3e8ff;
    border: 2px solid #c4b5fd;
    color: #6b21a8;
}

body.pastelLavender-theme .theme-dropdown select option {
    background: #f3e8ff;
    color: #6b21a8;
}

body.pastelLavender-theme .user-info {
    background: #f3e8ff;
    border: 2px solid #c4b5fd;
    color: #6b21a8;
}

body.pastelLavender-theme .user-info span {
    color: #7c3aed !important;
}

/* Pastel Rosa - rosa oscuro sobre fondo rosa claro */
body.pastelPink-theme .theme-dropdown select {
    background: #fce7f3;
    border: 2px solid #f9a8d4;
    color: #be185d;
}

body.pastelPink-theme .theme-dropdown select option {
    background: #fce7f3;
    color: #be185d;
}

body.pastelPink-theme .user-info {
    background: #fce7f3;
    border: 2px solid #f9a8d4;
    color: #be185d;
}

body.pastelPink-theme .user-info span {
    color: #ec4899 !important;
}

/* Pastel Amarillo - amarillo oscuro sobre fondo amarillo claro */
body.pastelYellow-theme .theme-dropdown select {
    background: #fefce8;
    border: 2px solid #fde047;
    color: #a16207;
}

body.pastelYellow-theme .theme-dropdown select option {
    background: #fefce8;
    color: #a16207;
}

body.pastelYellow-theme .user-info {
    background: #fefce8;
    border: 2px solid #fde047;
    color: #a16207;
}

body.pastelYellow-theme .user-info span {
    color: #ca8a04 !important;
}

/* Notificaciones toast para feedback */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    min-width: 300px;
}

@media (max-width: 576px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .custom-toast {
        min-width: auto;
        width: 100%;
    }
}

/* Estilos para las secciones de clientes */
.client-form-section {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.client-form-section h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.selected-client-section {
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    background: rgba(16, 185, 129, 0.05);
    transition: all 0.3s ease;
}

.selected-client-section h5 {
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.selected-client-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color) !important;
}

/* Estilos para los resultados de búsqueda de clientes */
.client-results-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.client-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: between;
    align-items: center;
}

.client-result-item:last-child {
    border-bottom: none;
}

.client-result-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.client-result-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
}

.client-info {
    flex-grow: 1;
}

.client-info h6 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.client-info small {
    color: var(--text-secondary);
}

.select-client-btn {
    margin-left: auto;
}

/* Animaciones para mostrar/ocultar secciones */
.client-form-section,
.selected-client-section {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive para secciones de clientes */
@media (max-width: 768px) {

    .client-form-section,
    .selected-client-section {
        padding: 1rem;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .d-flex.gap-3 .btn {
        width: 100%;
    }

    .client-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .select-client-btn {
        margin-left: 0;
        width: 100%;
    }
}

/* ===== ESTILOS PARA PANEL DE CONTROL DE GESTIÓN DE ARTÍCULOS ===== */

/* Tarjetas de acción del panel de control */
.action-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

/* Estilo para resaltar filas con error de validación */
.item-row.input-error {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid red;
    border-radius: 8px;
    transition: background-color 0.3s, border 0.3s;
}

/* Estilos para el contenedor de búsqueda de materiales */
.search-results-list {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    max-height: 350px;
    overflow-y: auto;
    z-index: 1050; /* Asegurar que esté por encima de otros elementos */
}

.search-result-item {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========================================
   MEJORAS DE RESPONSIVIDAD MOBILE
======================================== */

/* Prevenir overflow horizontal en toda la aplicación */
body {
    overflow-x: hidden;
}

.content {
    overflow-x: hidden;
}

/* Media Queries para mejorar responsividad */
@media (max-width: 768px) {
    /* Sidebar móvil */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1060;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }

    /* Sub-menú visible en sidebar móvil abierto */
    .sidebar.show .has-submenu > .submenu-toggle span,
    .sidebar.show .submenu-arrow,
    .sidebar.show .submenu li a span {
        opacity: 1;
    }

    /* Overlay para cerrar sidebar en móvil */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1055;
        display: none;
    }
    
    .mobile-overlay.show {
        display: block;
    }
    
    /* Contenido principal en móvil */
    .content {
        margin-left: 0;
        padding: 10px;
        min-height: 100vh;
    }
    
    /* Botón hamburguesa para mostrar menú */
    .mobile-menu-toggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1070;
        background: var(--primary-color);
        border: none;
        color: white;
        padding: 10px;
        border-radius: 5px;
        font-size: 1.2rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Ajustar theme dropdown en móvil */
    .theme-dropdown {
        flex-direction: column;
        gap: 10px !important;
        margin-bottom: 15px;
    }
    
    .theme-dropdown select {
        width: 100%;
    }
    
    /* Glass cards más compactas en móvil */
    .glass-card {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    /* Formularios más compactos */
    .row.mb-3, .row.mt-3 {
        margin-bottom: 10px !important;
        margin-top: 10px !important;
    }
    
    /* Botones de acción en móvil */
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 8px !important;
    }
    
    /* Tablas responsivas */
    .table-responsive {
        border: none;
        margin-bottom: 0;
    }
    
    .table th, .table td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }
    
    /* Modal en móvil */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .modal-xl {
        max-width: calc(100vw - 20px);
    }
    
    /* Action cards en gestión de artículos */
    .action-card {
        margin-bottom: 15px;
    }
    
    /* Ajustar navegación de páginas */
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    /* Smartphones pequeños */
    .content {
        padding: 5px;
    }
    
    .glass-card {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .sidebar {
        width: 100vw;
    }
    
    /* Botones más grandes para touch */
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    /* Campos de formulario más grandes */
    .form-control, .form-select {
        padding: 12px;
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    /* Page title más pequeño */
    .page-title {
        font-size: 1.25rem;
    }
    
    /* User info más compacto */
    .user-info {
        font-size: 0.8rem;
    }
}

/* Media query para tablets en orientación horizontal */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .content {
        margin-left: 200px;
        padding: 15px;
    }
    
    .glass-card {
        padding: 20px;
    }
}

/* ========================================
   MINI-COTIZADOR DE REPORTE DE MATERIALES
======================================== */

.materials-report-form {
    animation: fadeIn 0.3s ease-in-out;
}

.materials-report-form .card {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.materials-report-form .card-header {
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #28a745;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    position: relative;
}

.search-result-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-left-color: #fff;
    transform: translateX(2px);
}

.search-result-item:hover .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.materials-list .table {
    margin-bottom: 0;
}

.materials-list .table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-top: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.materials-list .table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Animación para cuando se ocultan los valores */
[class*="values-column-"] {
    transition: all 0.3s ease;
}

/* Estilos específicos para el total */
.materials-report-form .card.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    border: none;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Responsive para el mini-cotizador */
@media (max-width: 768px) {
    .materials-report-form .row .col-md-6 {
        margin-bottom: 1rem;
    }

    .materials-report-form .table-responsive {
        font-size: 0.8rem;
    }

    .materials-report-form .d-flex.gap-2 {
        flex-direction: column;
    }

    .materials-report-form .d-flex.gap-2 button {
        margin-bottom: 0.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MEJORAS DE UX PARA GESTIÓN DE PRODUCCIÓN ===== */

/* Mejor hover para headers colapsables */
.board-status-header {
    transition: all 0.3s ease !important;
    position: relative;
}

.board-status-header:hover {
    transform: translateX(5px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}


.board-status-header .collapse-icon {
    transition: transform 0.3s ease;
}

.board-status-header[aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

/* Mejorar hover en filas de tareas */
.task-row {
    transition: all 0.2s ease;
    position: relative;
}

.task-row:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.08) !important;
}


@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Indicador de clickeable en elementos interactivos */
.task-row,
.board-status-header,
[data-bs-toggle="collapse"] {
    cursor: pointer !important;
}

/* Efecto de carga más bonito */
.spinner-border {
    border-width: 0.15em;
}

/* Estilos para búsqueda y filtros */
#production-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.task-row.hidden-by-filter {
    display: none !important;
}

.task-row.highlight-search {
    background: rgba(99, 102, 241, 0.2) !important;
    border-left-width: 5px !important;
    border-left-color: var(--primary-color) !important;
}

/* Mejorar botón de ayuda */
.btn-link:hover i {
    transform: scale(1.2) rotate(15deg);
    transition: transform 0.3s ease;
}

/* Animación para el switch de modos */
#production-mode-switch-container {
    transition: all 0.3s ease;
}

#production-mode-switch-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ===== MEJORAS DE CONTRASTE PARA MODO OSCURO - PRODUCCIÓN ===== */

/* Mejorar contraste de glass-card en modo oscuro */
body.dark-theme .glass-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.dark-theme .glass-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
}

/* Headers de estados más visibles en modo oscuro */
body.dark-theme .board-status-header {
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .board-status-header:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Filas de tareas con mejor contraste */
body.dark-theme .task-row {
    border-left: 4px solid transparent;
    background: rgba(255, 255, 255, 0.03) !important;
}

body.dark-theme .task-row:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-left-color: var(--primary-color) !important;
}

/* Texto más legible en modo oscuro */
body.dark-theme .task-row,
body.dark-theme .board-task-list {
    color: #e5e7eb !important;
}

/* Badges más visibles en modo oscuro */
body.dark-theme .badge {
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Switch de modo producción más visible en modo oscuro */
body.dark-theme #production-mode-switch-container {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme #production-mode-switch-container:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Input de búsqueda en modo oscuro */
body.dark-theme #production-search-input,
body.dark-theme .form-control,
body.dark-theme .form-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}

body.dark-theme #production-search-input:focus,
body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.3);
    color: #f3f4f6;
}

body.dark-theme .form-control::placeholder,
body.dark-theme .form-select option {
    color: #9ca3af;
}

/* Botones en modo oscuro */
body.dark-theme .btn-outline-secondary {
    color: #d1d5db;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #f3f4f6;
}

/* Iconos del input-group en modo oscuro */
body.dark-theme .input-group-text {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Texto de ayuda y contadores en modo oscuro */
body.dark-theme #production-search-results {
    color: #d1d5db;
}

/* Modal de ayuda en modo oscuro */
body.dark-theme .modal-content {
    background: rgba(18, 18, 18, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-theme .accordion-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .accordion-button {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e5e7eb !important;
}

body.dark-theme .accordion-button:not(.collapsed) {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #f3f4f6 !important;
}

body.dark-theme .accordion-body {
    color: #d1d5db;
}

/* Alert en modal de ayuda */
body.dark-theme .alert-info {
    background: rgba(13, 110, 253, 0.15) !important;
    border-color: rgba(13, 110, 253, 0.3) !important;
    color: #93c5fd;
}

/* Mejorar legibilidad de listas en modal */
body.dark-theme .accordion-body ul li,
body.dark-theme .accordion-body ol li {
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

body.dark-theme .accordion-body strong {
    color: #f3f4f6;
}

/* Hover hint más visible en modo oscuro */
body.dark-theme .task-row:hover::before,
body.dark-theme .board-status-header:hover::before {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-weight: 700;
}

/* Tareas resaltadas por búsqueda en modo oscuro */
body.dark-theme .task-row.highlight-search {
    background: rgba(99, 102, 241, 0.25) !important;
    border-left-color: #6366f1 !important;
    border-left-width: 5px !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ===================================================================
   OPTIMIZACIONES PARA LAPTOPS PEQUEÑAS (720p y similares)
   Pantallas entre 900px y 1366px de ancho
   =================================================================== */

@media (min-width: 769px) and (max-width: 1366px) {

    /* ----- LAYOUT GENERAL ----- */

    /* Reducir padding del contenedor principal */
    .content {
        padding: 1rem 1rem !important;
        padding-left: 120px !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }

    /* Optimizar cuando sidebar está expandido */
    .sidebar:hover + .content {
        padding-left: 280px !important;
        max-width: 100% !important;
    }

    /* Optimizar glass-cards */
    .glass-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Reducir tamaños de título */
    .page-title {
        font-size: 2rem;
        margin-bottom: 1.25rem;
    }

    h1 {
        font-size: 1.9rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    /* ----- SIDEBAR NAVIGATION ----- */

    .sidebar {
        width: 240px;
    }

    .sidebar h3 {
        font-size: 1.2rem;
    }

    .menu li a {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    /* Ajustar contenido principal considerando sidebar más pequeño */
    .content {
        margin-left: 240px;
    }

    /* ----- DASHBOARD ----- */

    /* Hacer que las tarjetas de dashboard usen menos espacio vertical */
    #dashboard-view .col-md-3 {
        padding: 0.5rem;
    }

    #dashboard-view .text-center.p-3 {
        padding: 1rem !important;
    }

    #dashboard-view h4 {
        font-size: 1.5rem;
    }

    #dashboard-view .text-muted {
        font-size: 0.85rem;
    }

    /* ----- TABLAS ----- */

    /* Reducir padding en celdas de tabla */
    table td,
    table th {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem;
        vertical-align: middle;
    }

    /* Optimizar anchos de columnas en tablas */
    .table-responsive {
        font-size: 0.8rem;
        width: 100%;
        overflow-x: auto;
    }

    /* Asegurar que las tablas usen todo el ancho */
    .table {
        width: 100%;
        margin-bottom: 0;
    }

    /* Optimizar columnas específicas de la tabla de cotizaciones */
    /* KommoID */
    #quotations-list table th:nth-child(1),
    #quotations-list table td:nth-child(1) {
        width: 70px;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    /* Fecha */
    #quotations-list table th:nth-child(2),
    #quotations-list table td:nth-child(2) {
        width: 75px;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    /* Nombre del Proyecto */
    #quotations-list table th:nth-child(3),
    #quotations-list table td:nth-child(3) {
        min-width: 100px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Cliente */
    #quotations-list table th:nth-child(4),
    #quotations-list table td:nth-child(4) {
        min-width: 90px;
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Vendedor */
    #quotations-list table th:nth-child(5),
    #quotations-list table td:nth-child(5) {
        min-width: 90px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Total */
    #quotations-list table th:nth-child(6),
    #quotations-list table td:nth-child(6) {
        width: 75px;
        white-space: nowrap;
        text-align: right;
        font-size: 0.75rem;
    }

    /* ClickUp Task */
    #quotations-list table th:nth-child(7),
    #quotations-list table td:nth-child(7) {
        width: 90px;
        text-align: center;
    }

    /* Acciones */
    #quotations-list table th:nth-child(8),
    #quotations-list table td:nth-child(8) {
        width: 145px;
        text-align: center;
    }

    /* Hacer botones más compactos en tablas */
    #quotations-list .btn-group-sm > .btn,
    #quotations-list .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }

    #quotations-list .btn-group {
        gap: 2px;
    }

    /* Aplicar los mismos estilos a la tabla de cotizaciones recientes */
    #recent-quotations-list table th:nth-child(1),
    #recent-quotations-list table td:nth-child(1) {
        width: 80px;
        white-space: nowrap;
    }

    #recent-quotations-list table th:nth-child(2),
    #recent-quotations-list table td:nth-child(2) {
        width: 85px;
        white-space: nowrap;
    }

    #recent-quotations-list table th:nth-child(3),
    #recent-quotations-list table td:nth-child(3) {
        min-width: 120px;
        max-width: 200px;
    }

    #recent-quotations-list table th:nth-child(4),
    #recent-quotations-list table td:nth-child(4) {
        min-width: 100px;
        max-width: 150px;
    }

    #recent-quotations-list table th:nth-child(5),
    #recent-quotations-list table td:nth-child(5) {
        min-width: 100px;
        max-width: 140px;
    }

    #recent-quotations-list table th:nth-child(6),
    #recent-quotations-list table td:nth-child(6) {
        width: 90px;
        white-space: nowrap;
        text-align: right;
    }

    #recent-quotations-list table th:nth-child(7),
    #recent-quotations-list table td:nth-child(7) {
        width: 100px;
        text-align: center;
    }

    #recent-quotations-list table th:nth-child(8),
    #recent-quotations-list table td:nth-child(8) {
        width: 160px;
        text-align: center;
    }

    /* Badges más compactos en tablas */
    #quotations-list .badge,
    #recent-quotations-list .badge {
        font-size: 0.7rem;
        padding: 0.2em 0.4em;
    }

    /* Optimizar tabla del cotizador */
    #quotation-view .table-responsive {
        overflow-x: auto;
    }

    /* ----- FORMULARIOS ----- */

    /* Reducir altura de inputs */
    .form-control,
    .form-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Reducir espacio entre campos de formulario */
    .mb-3,
    .my-3 {
        margin-bottom: 0.75rem !important;
    }

    .mt-3 {
        margin-top: 0.75rem !important;
    }

    /* Labels más compactos */
    .form-label {
        margin-bottom: 0.35rem;
        font-size: 0.9rem;
    }

    /* ----- BOTONES ----- */

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }

    .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
    }

    /* ----- GRIDS DE BOOTSTRAP ----- */

    /* Hacer que columnas md ocupen más espacio en pantallas pequeñas */
    .col-md-2 {
        flex: 0 0 20%;
        max-width: 20%;
    }

    .col-md-3 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* ----- CARDS ----- */

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* ----- MODALES ----- */

    .modal-dialog {
        max-width: 650px;
        margin: 1rem auto;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-footer {
        padding: 0.75rem 1.25rem;
    }

    /* ----- COTIZADOR ----- */

    /* Optimizar tabla de artículos en cotizador */
    #quotation-view table {
        font-size: 0.8rem;
    }

    #quotation-view td,
    #quotation-view th {
        padding: 0.4rem !important;
    }

    /* Reducir ancho de columnas numéricas */
    #quotation-view td:nth-child(3),
    #quotation-view td:nth-child(4),
    #quotation-view td:nth-child(5) {
        width: 80px;
    }

    /* ----- CLIENTES ----- */

    /* Hacer grid de clientes más compacto */
    #clients-view .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* ----- PRODUCCIÓN ----- */

    /* Optimizar vista de producción */
    #production-view .clickup-list-card {
        margin-bottom: 1rem;
    }

    #production-view .card-body {
        padding: 0.9rem;
    }

    /* Tareas más compactas */
    .task-card,
    .task-card-compact {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    .task-name,
    .task-card h6 {
        font-size: 0.95rem !important;
    }

    /* Headers de estado más pequeños */
    .board-status-header {
        padding: 0.75rem !important;
    }

    .board-status-header h5 {
        font-size: 1rem;
    }

    /* ----- BÚSQUEDA Y GESTIÓN DE ARTÍCULOS ----- */

    #search-view .glass-card {
        padding: 1.25rem;
    }

    /* ----- THEME SELECTOR Y USER INFO ----- */

    .theme-dropdown {
        padding: 0.5rem 1rem;
        gap: 0.75rem !important;
    }

    #theme-selector {
        max-width: 140px;
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .user-info {
        font-size: 0.85rem;
    }

    /* ----- BADGES Y PILLS ----- */

    .badge {
        padding: 0.3em 0.55em;
        font-size: 0.8rem;
    }

    /* ----- ACORDEONES ----- */

    .accordion-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .accordion-body {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    /* ----- ALERTAS ----- */

    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    /* ----- LISTAS ----- */

    .list-group-item {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    /* ----- BREADCRUMBS ----- */

    .breadcrumb {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* ----- PAGINATION ----- */

    .pagination {
        font-size: 0.85rem;
    }

    .page-link {
        padding: 0.4rem 0.65rem;
    }

    /* ----- SCROLLBARS ----- */

    /* Hacer scrollbars más delgados en pantallas pequeñas */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    /* ----- TOOLTIPS Y POPOVERS ----- */

    .tooltip-inner {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    /* ----- INPUT GROUPS ----- */

    .input-group-text {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* ----- OPTIMIZACIONES ESPECÍFICAS PARA TABLAS DE MATERIALES ----- */

    .materials-list table td,
    .materials-list table th {
        padding: 0.4rem !important;
        font-size: 0.8rem;
    }

    .materials-list .form-control,
    .materials-list .form-select {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    /* ----- AJUSTES PARA MEJORAR USO DE ESPACIO HORIZONTAL ----- */

    /* Reducir márgenes laterales de rows */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Contenedores más eficientes */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Optimizaciones adicionales para pantallas muy pequeñas de laptop (900px-1100px) */
@media (min-width: 769px) and (max-width: 1100px) {

    /* Hacer sidebar colapsable o más pequeño */
    .sidebar {
        width: 180px;
    }

    .content {
        padding-left: 100px !important;
        padding-right: 0.75rem !important;
    }

    .sidebar:hover + .content {
        padding-left: 260px !important;
    }

    .sidebar h3 {
        font-size: 1.1rem;
        padding: 0.5rem;
    }

    .menu li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .menu li a i {
        font-size: 1rem;
    }

    /* Hacer columnas de 3 elementos convertirse en 2 */
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Títulos aún más pequeños */
    .page-title {
        font-size: 1.75rem;
    }

    /* Glass cards más compactos */
    .glass-card {
        padding: 1rem;
    }

    /* Reducir spacing general */
    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .mt-4 {
        margin-top: 1rem !important;
    }

    .my-4 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    /* Tablas extra compactas */
    table td,
    table th {
        padding: 0.35rem !important;
        font-size: 0.8rem;
    }

    /* Inputs más pequeños */
    .form-control,
    .form-select {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    /* Tablas aún más compactas */
    #quotations-list table th,
    #quotations-list table td,
    #recent-quotations-list table th,
    #recent-quotations-list table td {
        padding: 0.3rem 0.4rem !important;
        font-size: 0.75rem;
    }

    /* Reducir aún más el ancho de columnas fijas y hacer iconos más pequeños */
    #quotations-list table th:nth-child(1),
    #quotations-list table td:nth-child(1),
    #recent-quotations-list table th:nth-child(1),
    #recent-quotations-list table td:nth-child(1) {
        width: 65px;
        font-size: 0.7rem;
    }

    #quotations-list table th:nth-child(2),
    #quotations-list table td:nth-child(2),
    #recent-quotations-list table th:nth-child(2),
    #recent-quotations-list table td:nth-child(2) {
        width: 70px;
        font-size: 0.7rem;
    }

    #quotations-list table th:nth-child(6),
    #quotations-list table td:nth-child(6),
    #recent-quotations-list table th:nth-child(6),
    #recent-quotations-list table td:nth-child(6) {
        width: 80px;
    }

    #quotations-list table th:nth-child(7),
    #quotations-list table td:nth-child(7),
    #recent-quotations-list table th:nth-child(7),
    #recent-quotations-list table td:nth-child(7) {
        width: 85px;
    }

    #quotations-list table th:nth-child(8),
    #quotations-list table td:nth-child(8),
    #recent-quotations-list table th:nth-child(8),
    #recent-quotations-list table td:nth-child(8) {
        width: 130px;
    }

    /* Hacer que nombres largos se corten con ellipsis */
    #quotations-list table td:nth-child(3),
    #quotations-list table td:nth-child(4),
    #quotations-list table td:nth-child(5),
    #recent-quotations-list table td:nth-child(3),
    #recent-quotations-list table td:nth-child(4),
    #recent-quotations-list table td:nth-child(5) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
    }

    /* Botones de acción más pequeños - solo iconos */
    #quotations-list .btn,
    #recent-quotations-list .btn {
        padding: 0.15rem 0.25rem !important;
        font-size: 0.65rem !important;
    }

    #quotations-list .btn i,
    #recent-quotations-list .btn i {
        font-size: 0.8rem;
    }

    /* Theme dropdown más compacto */
    .theme-dropdown {
        padding: 0.35rem 0.75rem;
        gap: 0.5rem !important;
    }

    #theme-selector {
        max-width: 120px;
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .user-info {
        font-size: 0.75rem;
    }
}

/* ============================================================================
   ESTILOS RESPONSIVE PARA CUSTOM IDs DE CLICKUP
   ============================================================================ */

/* Por defecto (pantallas grandes): sin salto de línea */
.clickup-id-cell {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Media query para laptops y tablets (máx 1366px) */
@media (max-width: 1366px) {
    .clickup-id-cell {
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.3;
        max-width: 90px;
    }
}

/* Media query para pantallas pequeñas (máx 768px) */
@media (max-width: 768px) {
    .clickup-id-cell {
        font-size: 0.75rem;
        max-width: 70px;
    }
}

/* Modal de revisión - responsive */
#review-clickup-id {
    white-space: nowrap;
}

@media (max-width: 1366px) {
    #review-clickup-id {
        white-space: normal !important;
        word-break: break-word;
    }
}

/* Badge de Custom ID en vista de cotización - responsive */
.badge.bg-primary {
    white-space: nowrap;
}

@media (max-width: 1366px) {
    p .badge.bg-primary {
        white-space: normal !important;
        word-break: break-word;
        display: inline-block;
        line-height: 1.4;
    }
}

/* ===== ESTILOS PARA VISTA PREVIA DE COTIZACIÓN ===== */
/* Badges más grandes en la vista previa */
#quotation-preview-modal .badge.bg-primary,
#quotation-preview-modal .badge.bg-info,
#quotation-preview-modal .badge-clickup-active,
#quotation-preview-modal .badge-clickup-inactive {
    font-size: 0.9rem !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

/* Asegurar que los badges tengan buen contraste */
#quotation-preview-modal .badge.bg-primary {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}

#quotation-preview-modal .badge.bg-info {
    background-color: #0891b2 !important;
    color: #ffffff !important;
}

/* Espaciado en la vista previa */
#quotation-preview-modal p {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

#quotation-preview-modal p strong {
    font-weight: 600;
    margin-right: 0.5rem;
}
