/* --- ESTILOS BASE ERP y CRMY --- */

        :root {
            --bg-body: #f0f2f5;
            --sidebar-bg: #111827;
            --sidebar-hover: #1f2937;
            --accent: #d4af37;
            --text-main: #1f2937;
            --white: #ffffff;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #e5e7eb;
        }

        body { font-family: 'Inter', sans-serif; margin: 0; display: flex; background: var(--bg-body); color: var(--text-main); height: 100vh; overflow: hidden; }
        
        /* SIDEBAR */
        .sidebar { width: 260px; background: var(--sidebar-bg); height: 100vh; color: white; position: fixed; overflow-y: auto; z-index: 100; }
        .sidebar-brand { padding: 30px; font-size: 1.5rem; font-weight: bold; border-bottom: 1px solid #374151; }
        .sidebar-brand span { color: var(--accent); }
        
        .nav-group { padding: 10px 0; }
        .nav-label { padding: 0 30px; font-size: 0.7rem; text-transform: uppercase; color: #6b7280; letter-spacing: 1px; margin-bottom: 10px; display: block; }
        .nav-item { padding: 6px 30px; display: flex; align-items: center; color: #d1d5db; text-decoration: none; transition: 0.2s; font-size: 0.9rem; cursor: pointer; }
        .nav-item:hover { background: var(--sidebar-hover); color: var(--accent); }
        .nav-item.active { background: var(--accent); color: var(--sidebar-bg); font-weight: bold; }
        .nav-item-link { padding: 6px 30px; display: flex; align-items: center; color: #d1d5db; text-decoration: none; transition: 0.2s; font-size: 0.9rem; cursor: pointer; }
        .nav-item-link:hover { background: var(--sidebar-hover); color: var(--accent); }
        .nav-item-link.active { background: var(--accent); color: var(--sidebar-bg); font-weight: bold; }

        /* MAIN CONTENT AREA */
        .main { margin-left: 260px; padding: 40px; width: calc(100% - 260px); height: 100vh; overflow-y: auto; box-sizing: border-box; }
        .view { display: none; }
        .view.active { display: block; animation: fadeIn 0.3s ease-in-out; }

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

        .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }

        /* COMPONENTES REUTILIZABLES */
        .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
        .kpi-card { background: var(--white); padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
        .kpi-label { font-size: 0.85rem; color: #6b7280; }
        .kpi-value { font-size: 1.8rem; font-weight: 800; margin: 10px 0; }
        .kpi-trend { font-size: 0.8rem; font-weight: bold; }
        .trend-up { color: var(--success); }

        .dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; }
        .section-card { background: var(--white); border-radius: 12px; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 20px; }
        .section-card h3 { margin-top: 0; font-size: 1.1rem; border-bottom: 1px solid #eee; padding-bottom: 15px; }

        .item-list { list-style: none; padding: 0; }
        .item-list li { padding: 12px 0; border-bottom: 1px solid #f9f9f9; display: flex; justify-content: space-between; font-size: 0.9rem; }
        
        table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
        table th { text-align: left; color: #888; padding: 10px 0; border-bottom: 1px solid #eee; }
        table td { padding: 12px 0; border-bottom: 1px solid #f9f9f9; }

        .badge { padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; }
        .badge-hot { background: #fee2e2; color: #b91c1c; }
        .badge-repair { background: #fef3c7; color: #92400e; }
        .badge-warm { background: #fef3c7; color: #301708; }
        .badge-cold { background: #d1fae5; color: #065f46; }

        button.btn-add { background: var(--sidebar-bg); color: white; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; }
        
        /* FORM STYLES */
        .form-group { margin-bottom: 15px; }
        label { display: block; font-size: 0.85rem; margin-bottom: 5px; font-weight: 600; }
        input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; box-sizing: border-box; }

        /* USER PROFILE - SIDEBAR */
        .user-profile {
            padding: 15px 30px;
            border-bottom: 1px solid #1f2937;
            margin-bottom: 10px;
            background: rgba(0, 0, 0, 0.1); /* Un toque más oscuro que la sidebar */
        }

        .user-info {
            display: flex;
            flex-direction: row; /*column;*/
            gap: 4px;
        }

        .user-name {
            display: block;
            font-weight: 600;
            color: var(--white);
            font-size: 0.95rem;
        }

        .user-role {
            display: block;
            font-size: 0.62rem;
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 0.8px;
            font-weight: 700;
        }

        .logout-link {
            display: inline-block;
            margin-top: 12px;
            font-size: 0.8rem;
            color: #9ca3af;
            text-decoration: none;
            transition: 0.2s;
        }

        .logout-link:hover {
            color: var(--danger);
        }

        .check-label {
            display: flex;
            align-items: center; /* Alineación vertical perfecta */
            gap: 8px;            /* Espacio entre el check y el texto */
            cursor: pointer;
            font-size: 0.9em;
        }
        .check-label input[type="checkbox"] {
            margin: 0;           /* Quitamos márgenes por defecto que descuadran */
            width: 16px;
            height: 16px;
        }

        .qv-section { 
                margin-top: 2px; 
                /* border-top: 1px solid #eee; 
                padding-top: 15px; */                
        }
        .qv-section h4 { 
            font-size: 0.75rem; 
            text-transform: uppercase; 
            color: #9ca3af; 
            letter-spacing: 1px; 
            margin-bottom: 10px; 
        }
        .tag-container { 
            display: flex; 
            flex-wrap: wrap; 
            gap: 6px; 
        }
        .tag { 
            background: #f3f4f6; 
            color: #374151; 
            padding: 4px 10px; 
            border-radius: 4px; 
            font-size: 0.75rem; 
            font-weight: 500; 
        }

        .no-subrayado { 
            text-decoration: none;
            color: inherit;
        }