:root {
    --bg-primary: #0a0f1c;
    --bg-secondary: #0f172a;
    --accent: #00adef; /* Ingenia Cyan */
    --accent-glow: rgba(0, 173, 239, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

:root.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #eff6ff;
    --accent: #2563eb; /* Royal Blue */
    --accent-glow: rgba(37, 99, 235, 0.15);
    --text-primary: #000000;
    --text-secondary: #1e3a8a; /* Dark Blue instead of grey */
    --border: #bfdbfe; /* Light Blue instead of grey */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: #bfdbfe;
    --success: #3b82f6; /* Blue instead of Green */
    --warning: #1d4ed8; /* Blue instead of Yellow */
    --danger: #1e3a8a;  /* Blue instead of Red */
}

/* Forzar que las insignias (badges) y chips de fallos en modo claro usen solo azul, blanco y negro */
.light-mode .badge,
.light-mode .badge.reparada,
.light-mode .badge.pendiente,
.light-mode .badge.sin-reparar,
.light-mode .badge.taller-en-proceso,
.light-mode .badge.revisar-falla,
.light-mode .badge.test,
.light-mode .badge.software,
.light-mode .badge.materiales,
.light-mode .badge.espera-recogida {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

.light-mode .fault-chip {
    background: #ffffff !important;
    color: #1e3a8a !important;
    border-color: #bfdbfe !important;
}

.light-mode .fault-chip.active {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #2563eb !important;
    border-color: #2563eb !important;
}

.light-mode .fault-chip.locked {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

.light-mode button[onclick*="deleteEmpresa"],
.light-mode button[onclick*="delete"] {
    background: #eff6ff !important;
    color: #1e3a8a !important;
    border: 1px solid #bfdbfe !important;
}
.light-mode button[onclick*="deleteEmpresa"]:hover,
.light-mode button[onclick*="delete"]:hover {
    background: #dbeafe !important;
}

.light-mode .low-stock, 
.light-mode .sin-stock,
.light-mode [style*="color:#ef4444"],
.light-mode [style*="color: #ef4444"],
.light-mode [style*="color: rgb(239, 68, 68)"],
.light-mode [style*="color:rgb(239, 68, 68)"],
.light-mode [style*="color:#f59e0b"],
.light-mode [style*="color:#eab308"],
.light-mode [style*="color: #eab308"] {
    color: #1e3a8a !important;
}

.light-mode [style*="background:rgba(239, 68, 68"],
.light-mode [style*="background:rgba(239,68,68"],
.light-mode [style*="background:rgba(245, 158, 11"],
.light-mode [style*="background-color: rgba(239, 68, 68"],
.light-mode [style*="background-color: rgba(245, 158, 11"],
.light-mode [style*="background-color:rgba(239,68,68"] {
    background-color: #eff6ff !important;
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
}

.light-mode body {
    background-color: #f0f7ff;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(0, 173, 239, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 173, 239, 0.08) 0%, transparent 50%);
}

.light-mode input, .light-mode select, .light-mode textarea {
    background: #ffffff !important;
    border: 2px solid #d1e2f3 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.light-mode input:focus, .light-mode select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px var(--accent-glow) !important;
}

.light-mode .glass-card, .light-mode .glass-table {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 173, 239, 0.12), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 173, 239, 0.1), transparent 25%);
}

.app-container {
    display: flex;
    height: 100vh;
}

.user-avatar-small {
    background: var(--accent);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    transition: all 0.3s;
    box-shadow: 0 2px 6px var(--accent-glow);
}



/* User Profile & Dropdown */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    position: relative;
    padding: 8px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-mode .user-profile {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.user-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: var(--accent);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    padding: 0.8rem;
    z-index: 1000;
    backdrop-filter: blur(20px);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.light-mode .profile-dropdown {
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-dropdown.active {
    display: flex;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 173, 239, 0.1);
    color: var(--accent);
    transform: translateX(4px);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    color: var(--accent);
}

.logo i {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    filter: drop-shadow(0 4px 10px var(--accent-glow));
    font-weight: 700;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar, .search-box {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--glass-bg); /* Use glass background for all */
    padding: 1rem 1.6rem;
    border-radius: 16px;
    border: 2px solid var(--accent); /* Consistent accent border */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
    max-width: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.light-mode .search-bar, .light-mode .search-box {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: 0 4px 15px rgba(0, 173, 239, 0.05);
}

.light-mode .search-bar:focus-within, .light-mode .search-box:focus-within {
    border-color: var(--accent);
}

.search-bar::after, .search-box::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: 0.3s;
    border-radius: 2px;
}

.search-bar:focus-within::after, .search-box:focus-within::after {
    opacity: 1;
    left: 20px;
    right: 20px;
}

.light-mode .search-bar, .light-mode .search-box {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 173, 239, 0.05);
}

.search-bar:hover, .search-box:hover {
    border-color: rgba(0, 173, 239, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-bar:focus-within, .search-box:focus-within {
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 8px 30px -10px var(--accent-glow);
    transform: translateY(-1px);
}

.search-bar i, .search-box i {
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.search-bar:focus-within i, .search-box:focus-within i {
    opacity: 1;
    transform: scale(1.1);
}

.search-bar input, .search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 500;
}

.search-bar input::placeholder, .search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 400;
}

.user-profile img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
}

/* Page Sections */
.content-area {
    padding: 2.5rem 3rem;
}

.page-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page-section.active {
    display: block;
}

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

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

/* Buttons */
.btn {
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* Sub-tabs (dentro de sección Salidas) */
.subtab-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.subtab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.subtab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Badge clickable (cambio de estatus) */
.badge-clickable:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
    transition: all 0.15s ease;
}


.w-100 {
    width: 100%;
    justify-content: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 1.8rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

.icon-bg {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.1);
}

.stat-info h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-info p {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tables */
.table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
}

.glass-table th,
.glass-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.glass-table th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.light-mode .glass-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 700;
}

.glass-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.glass-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.light-mode .glass-table th.sortable:hover {
    background: rgba(0, 173, 239, 0.05);
}

.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    white-space: nowrap;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.reparada, .badge.reparada { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge.pendiente { background: rgba(139, 92, 246, 0.1); color: var(--accent); }
.badge.sin-reparar { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.fault-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    box-sizing: border-box;
    width: auto;
}

.fault-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border-color: rgba(0,173,239,0.3);
    background: rgba(0,173,239,0.06);
}

.fault-chip.active {
    background: var(--accent-glow) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 10px var(--accent-glow);
}

.fault-chip.locked {
    background: rgba(0, 173, 239, 0.15) !important;
    color: white !important;
    border-color: var(--accent) !important;
    box-shadow: none !important;
    cursor: default !important;
}
.badge.taller-en-proceso { background: rgba(0, 173, 239, 0.2); color: #00adef; }
.badge.revisar-falla { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.badge.suspendido { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge.test { background: rgba(167, 139, 250, 0.2); color: #a78bfa; }
.badge.software { background: rgba(99, 102, 241, 0.2); color: #6366f1; }
.badge.materiales { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.badge.espera-recogida { background: rgba(14, 165, 233, 0.2); color: #0ea5e9; }
.badge.tasacion-presupuesto { background: rgba(100, 116, 139, 0.2); color: #64748b; }
.badge.enviada { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge.success { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Device type badges */
.badge.maquina    { background: rgba(0, 173, 239, 0.12); color: var(--accent); border: 1px solid rgba(0, 173, 239, 0.25); font-weight: 700; }
.badge.base       { background: rgba(245, 158, 11, 0.12); color: #f59e0b;      border: 1px solid rgba(245, 158, 11, 0.25); font-weight: 700; }
.badge.baserouter { background: rgba(16, 185, 129, 0.12); color: #10b981;      border: 1px solid rgba(16, 185, 129, 0.25); font-weight: 700; }


/* Custom Table Header Filters */
.header-filters td {
    padding: 0.5rem 1.2rem !important;
    background: rgba(0, 0, 0, 0.03) !important;
    border-bottom: 2px solid var(--border) !important;
}

.header-filters input, .header-filters select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-size: 0.75rem !important;
    padding: 5px 10px !important;
    font-weight: 500;
    transition: all 0.2s;
}

.light-mode .header-filters input, .light-mode .header-filters select {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

.header-filters input:focus, .header-filters select:focus {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    outline: none;
}

.rotate {
    transform: rotate(90deg);
}

.toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Test Sections */
.test-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.test-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
}

.light-mode .test-card {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 173, 239, 0.05);
}

.test-card-title {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.light-mode .test-card-title {
    color: var(--text-primary);
    font-weight: 800;
}

.test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 1rem;
}

.test-item label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: help;
}

.test-item input, .test-item select {
    width: 60%;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.form-group-test {
    margin-bottom: 1rem;
}

.form-group-test label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.info-icon:hover {
    opacity: 1;
}

/* Premium Button Option Groups */
.btn-option-group {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border);
    width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.btn-option {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 55px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.btn-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-option.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.04);
    z-index: 1;
}

.btn-option-danger.active {
    background: var(--danger) !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

.btn-option-warn.active {
    background: var(--warning) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
    color: #1e293b;
}

.btn-option-neutral.active {
    background: #64748b !important;
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4) !important;
}

.light-mode .btn-option-group {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.light-mode .btn-option:hover {
    background: #e2e8f0;
}

.light-mode .btn-option.active {
    color: white;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none; /* Cambiado de flex a none para mayor compatibilidad */
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1 !important;
    pointer-events: all !important;
    display: flex !important;
    z-index: 99999999; 
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.2rem 1.5rem;
}

/* Forms */
.glass-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.form-group.half-width {
    width: calc(50% - 0.5rem);
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

input,
select,
textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateY(-1px);
}

.form-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.form-section:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    font-size: 1rem;
    opacity: 0.8;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s;
}

.input-with-icon input {
    padding-left: 38px !important;
    width: 100%;
}

.input-with-icon input:focus + i {
    color: var(--accent);
    opacity: 1;
}

option {
    background: var(--bg-secondary);
}

/* Login Screen */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    z-index: 1000;
}

.login-wrapper.active {
    display: flex;
}

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 3.5rem 2.8rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-box h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-box label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 6px;
}

/* Timeline Historial */
.timeline-item {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1;
}

.timeline-content {
    background: var(--glass-bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    flex: 1;
}

.timeline-content h4 {
    margin-bottom: 0.2rem;
    color: var(--accent);
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-small:hover {
    background: var(--accent);
}

/* Empresas Grid & Cards */
.empresas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.empresa-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.empresa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: 0.3s;
}

.empresa-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 15px 30px -10px var(--accent-glow);
}

.empresa-card:hover::before {
    opacity: 1;
}

.empresa-icon {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent);
}

.empresa-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.empresa-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.empresa-id {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.5;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}.password-wrapper { position: relative; width: 100%; display: block; } 
.password-wrapper input { width: 100% !important; padding-right: 45px !important; }

/* Past items in timeline */
.timeline-item.past .timeline-icon {
    background: rgba(148, 163, 184, 0.1) !important;
    color: var(--text-secondary) !important;
}

.timeline-item.past .timeline-content {
    background: rgba(15, 23, 42, 0.4);
    opacity: 0.8;
}

.timeline-item.past .timeline-content h4 {
    color: var(--text-secondary);
}

.visit-divider {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.8rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.visit-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.visit-divider.current {
    color: var(--accent);
    background: rgba(0, 173, 239, 0.1);
}

/* Modal Improvements */
.glass-form .form-group label {
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

#lista-maquinas-envio .glass-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#lista-maquinas-envio .glass-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(5px);
}

#lista-maquinas-envio button:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    transform: scale(1.1);
}

.empresa-card p {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* --- Shipment Group Header Styles --- */
.shipment-header-row {
    background: linear-gradient(90deg, rgba(0, 173, 239, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    border-bottom: 2px solid var(--border);
    user-select: none;
    cursor: pointer;
}
.shipment-header-row:hover {
    background: linear-gradient(90deg, rgba(0, 173, 239, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
}
.shipment-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
.shipment-main-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    color: var(--accent);
}
.toggle-icon.rotate {
    transform: rotate(90deg);
}
.shipment-date {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
}
.shipment-company {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(0, 173, 239, 0.1);
    padding: 4px 12px;
    border-radius: 8px;
}
.shipment-meta-tags {
    display: flex;
    gap: 15px;
    align-items: center;
}
.meta-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.meta-tag strong {
    color: var(--text-primary);
    margin-left: 4px;
}
.bultos-count {
    background: var(--accent);
    color: #000;
    font-weight: 900;
    font-size: 0.7rem;
    padding: 4px 14px;
    border-radius: 20px;
    box-shadow: 0 0 15px var(--accent-glow);
}
.shipment-item-row {
    background: rgba(255,255,255,0.01) !important;
    transition: all 0.2s ease;
}
.shipment-item-row:hover {
    background: rgba(255,255,255,0.03) !important;
}
.shipment-item-row td {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-secondary);
}

/* --- Tab Styling (Unified) --- */
.subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding: 0 0.5rem;
}

.subtab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1.8rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    position: relative;
    opacity: 0.7;
}

.subtab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
    opacity: 1;
}

.subtab-btn.active {
    color: var(--accent);
    background: rgba(0, 173, 239, 0.05);
    opacity: 1;
}

.subtab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--accent-glow);
}

.subtab-btn i {
    font-size: 1.1rem;
}

/* Modal Polish */
.modal-header h2 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Timeline & History Polish */
.timeline-item {
    display: flex;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.timeline-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.timeline-content {
    flex: 1;
}

.timeline-content h4 {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.modal-lg {
    max-width: 1000px !important;
}

#historial-summary > div {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#historial-summary > div:hover {
    background: rgba(255,255,255,0.04);
    transform: translateY(-3px);
}

.test-card-hover:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 173, 239, 0.15) !important;
    border-color: var(--accent) !important;
    background: rgba(0, 173, 239, 0.05) !important;
}

/* --- Custom Select Arrows & Badge Chevrons --- */
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.1em !important;
    padding-right: 2.8rem !important;
}

.light-mode select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b6584'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
}

.badge-clickable {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.badge-clickable:hover {
    transform: translateY(-1px) scale(1.02) !important;
    filter: brightness(1.1) !important;
}

.badge-clickable::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 1px;
}
/* --- CATEGORY TILES & FAULT CHIPS (Synchronized with Portal) --- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.2rem;
    margin: 1.5rem 0;
}

.cat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.cat-item i {
    font-size: 1.8rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.cat-item span {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cat-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: rgba(0, 173, 239, 0.05);
}

.cat-item.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.cat-item.active i, .cat-item.active span {
    color: white;
}

/* Chips Container */
.fault-chips-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1.5px dashed var(--border);
    border-radius: 20px;
    margin-top: 1rem;
    min-height: 80px;
}

/* Duplicate block kept intentionally minimal to avoid overriding */
.fault-chip.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.light-mode .cat-item {
    background: #ffffff;
    border-color: var(--border);
}

.light-mode .fault-chips-container {
    background: var(--bg-tertiary);
}

/* --- INVENTORY CHECK CARDS --- */
.inventory-check-card {
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
}

.light-mode .inventory-check-card {
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 173, 239, 0.08);
}

.inventory-check-card.disabled-card {
    filter: grayscale(0.3);
    opacity: 0.7;
}

.inventory-check-card .card-footer {
    background: rgba(0,0,0,0.3);
    padding: 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.03);
    position:relative;
    z-index:1;
    margin-top:auto;
}

.light-mode .inventory-check-card .card-footer {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: #000000;
}

.inventory-check-card .stat-badge {
    background:rgba(255,255,255,0.03);
    padding:8px 12px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,0.05);
    text-align:right;
    flex-shrink:0;
}

.light-mode .inventory-check-card .stat-badge {
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

.light-mode .stat-badge p {
    color: #000000 !important;
    opacity: 1 !important;
}

.light-mode .stat-badge p span {
    color: #000000 !important;
    opacity: 0.6 !important;
}

/* --- DECISION CARDS --- */
.decision-selector-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 1rem 0;
}

.decision-card {
    flex: 1;
    max-width: 300px;
    cursor: pointer;
    position: relative;
}

.decision-card input {
    position: absolute;
    opacity: 0;
}

.decision-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
    text-align: center;
}

.decision-card.approved .decision-content i { color: var(--success); font-size: 2.5rem; }
.decision-card.suspended .decision-content i { color: var(--danger); font-size: 2.5rem; }

.decision-content span {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.decision-content small {
    font-size: 0.75rem;
    opacity: 0.5;
}

.decision-card:hover .decision-content {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.02);
}

.decision-card.approved input:checked + .decision-content {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.decision-card.suspended input:checked + .decision-content {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

/* --- PART SELECTION IN TEST --- */
.part-item-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-primary);
}

.part-item-btn:hover {
    background: rgba(0, 173, 239, 0.08);
    border-color: rgba(0, 173, 239, 0.3);
}

.part-item-btn.active {
    background: var(--accent);
    color: white;
    border-color: white;
}

.part-item-btn .part-name { font-weight: 700; font-size: 0.8rem; line-height: 1.2; }
.part-item-btn .part-stock { font-size: 0.7rem; opacity: 0.6; }
.part-item-btn.active .part-stock { opacity: 0.9; }

.part-item-btn.low-stock:not(.active) {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.part-item-btn i {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 0.8rem;
    opacity: 0.4;
}

.part-item-btn.active i { opacity: 1; }

/* Media Query for Mobile Devices */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    .sidebar {
        width: 100% !important;
        height: 65px !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        border-right: none !important;
        border-top: 1px solid var(--border) !important;
        flex-direction: row !important;
        padding: 0 !important;
        gap: 0 !important;
        z-index: 1000 !important;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2) !important;
        border-radius: 0 !important;
        backdrop-filter: blur(16px) !important;
    }

    .sidebar .logo, 
    .sidebar > div:last-child {
        display: none !important;
    }

    .sidebar nav {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        height: 100% !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0.5rem !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 0.8rem !important;
    }

    .sidebar nav::-webkit-scrollbar {
        display: none !important;
    }

    .sidebar .nav-item {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        gap: 2px !important;
        padding: 6px 10px !important;
        font-size: 0.65rem !important;
        border-radius: 8px !important;
        align-items: center !important;
        justify-content: center !important;
        color: var(--text-secondary) !important;
        height: auto !important;
    }

    .sidebar .nav-item i {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    .sidebar .nav-item span {
        font-size: 0.6rem !important;
        display: inline !important;
    }

    .sidebar .nav-item.active {
        background: rgba(0, 173, 239, 0.1) !important;
        color: var(--accent) !important;
        font-weight: 700 !important;
        filter: none !important;
    }

    .main-content {
        height: calc(100vh - 65px) !important;
        padding-bottom: 80px !important;
    }

    .topbar {
        padding: 1rem 1.5rem !important;
        flex-direction: column !important;
        gap: 0.8rem !important;
        align-items: stretch !important;
    }

    /* Grids stacking on mobile */
    .stats-grid, 
    .test-sections-grid, 
    .empresas-grid, 
    .cat-grid, 
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Modals styling on mobile */
    .modal-content {
        width: 95% !important;
        margin: 2rem auto !important;
        padding: 1.5rem !important;
    }
}

