               /* Header Banner */
        .header-banner::before {
            content: "";
            position: absolute;
            inset: 0;
            background: rgba(0,0,0,0.3);
        }

        .header-banner .container {
            position: relative;
            z-index: 1;
        }

        .header-logo {
            height: 100px;
            width: auto;
            object-fit: contain;
        }

        .header-text h1 {
            font-size: 1.8rem;
            font-weight: 200;
            margin: 0;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .header-text .subtitle {
            font-size: 1rem;
            opacity: 0.9;
        }

        /* Main Content */
        .main-content {
            display: block;
            min-height: 100vh;
            padding: 30px 40px;
            margin-left: 340px; /* leave space for fixed sidebar */
            transition: margin-left 0.2s;
        }

        .main-content .container-fluid {
            max-width: 1200px;
            width: 100%;
        }

        /* Search Card */
        .search-card {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.08);
            margin-bottom: 25px;
        }

        .search-card h2 {
            color: #1e3c72;
            font-weight: 700;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            font-size: 1.5rem;
        }

        .search-card h2 i {
            margin-right: 10px;
            color: #667eea;
        }

        .form-label {
            font-weight: 500;
            color: #555;
            margin-bottom: 6px;
            font-size: 0.9rem;
        }

        .form-control, .form-select {
            border-radius: 6px;
            border: 2px solid #e0e0e0;
            padding: 8px 12px;
            transition: all 0.3s;
            font-size: 0.9rem;
        }

        .form-control:focus, .form-select:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        }

        .btn-search {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            color: white;
            padding: 10px 30px;
            font-weight: 600;
            border-radius: 20px;
            transition: all 0.3s;
            box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
        }

        .btn-search:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        }

        .btn-reset {
            background: white;
            border: 2px solid #667eea;
            color: #667eea;
            padding: 8px 25px;
            font-weight: 600;
            border-radius: 20px;
            transition: all 0.3s;
        }

        .btn-reset:hover {
            background: #667eea;
            color: white;
        }

        /* Stats Cards */
        .stats-row {
            margin-bottom: 30px;
        }

        .stat-card {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transition: all 0.3s;
            text-align: center;
        }

        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        }

        .stat-card i {
            font-size: 2.5rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 10px;
        }

        .stat-card h3 {
            font-size: 2rem;
            font-weight: 700;
            color: #1e3c72;
            margin: 10px 0 5px 0;
        }

        .stat-card p {
            color: #666;
            margin: 0;
            font-weight: 500;
        }


        .materials-card {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        
        .material-item {
            background: white;
            border-radius: 12px;
            padding: 20px;
            border: 2px solid #e0e0e0;
            transition: all 0.3s;
            cursor: pointer;
        }

 

        .badge-expertise {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .badge-level {
            background: #f0f0f0;
            color: #555;
        }

        .badge-domain {
            background: #e8f4fd;
            color: #2196F3;
        }

        .badge-pump-station {
            background: #fff3e0;
            color: #ff9800;
        }

        .btn-view {
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
            border: none;
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-view:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(40, 167, 69, 0.5);
        }

        .btn-download {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.3s;
        }

            .sidebar {
            position: fixed;
            left: 50px;
            top: 200px;          /* dưới header */
            bottom: 200px;        /* 🔸 chừa mép dưới, không còn height:100vh/calc */
            width: 250px;        /* 🔸 thu gọn */
            overflow: auto;
            padding: 12px 12px 16px;
            border-radius: 12px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.06);
            border: 1px solid rgba(0,0,0,0.04);
            z-index: 999;
            }

                .sidebar-header{
                    display:flex;
                    gap:8px;
                    margin-bottom:8px;
                }

                .sidebar-header button{
                    flex:1;
                    padding:8px 10px;
                    border-radius:6px;
                    border:1px solid transparent;
                    background: transparent;
                    cursor: pointer;
                    font-weight:600;
                    color:#333;
                }

                .sidebar-header button.tab-active{
                    background:#ffffff;
                    border:1px solid #e6eef8;
                    box-shadow: 0 2px 6px rgba(33,150,243,0.06);
                }


            .btn-download:hover {
                transform: scale(1.05);
                box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
            }

            .btn-answer {
                background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
                border: none;
                color: white;
                padding: 8px 16px;
                border-radius: 20px;
                font-size: 0.85rem;
                font-weight: 600;
                transition: all 0.3s;
            }

            .btn-answer:hover {
                transform: scale(1.05);
                box-shadow: 0 4px 15px rgba(255, 152, 0, 0.5);
            }

        /* Pagination */
        .pagination-custom {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-top: 30px;
            gap: 5px;
        }

        .pagination-custom .page-link {
            background: rgba(255, 255, 255, 0.9);
            border: 1px solid #ddd;
            color: #333;
            padding: 8px 12px;
            border-radius: 4px;
            font-weight: 500;
            transition: all 0.3s;
            text-decoration: none;
            cursor: pointer;
        }

        .pagination-custom .page-link:hover:not(.disabled):not(.active) {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .pagination-custom .page-link.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-color: transparent;
        }

        .pagination-custom .page-link.disabled {
            opacity: 0.5;
            cursor: not-allowed;
            pointer-events: none;
        }

        /* Loading */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 9999;
            justify-content: center;
            align-items: center;
        }

        .loading-spinner {
            background: rgba(222, 222, 222, 0.8);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            padding: 30px;
            border-radius: 15px;
            text-align: center;
        }

        .spinner-border {
            width: 3rem;
            height: 3rem;
            border-width: 4px;
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

        .empty-state i {
            font-size: 4rem;
            margin-bottom: 20px;
            color: #ddd;
        }

        .empty-state h4 {
            color: #666;
            margin-bottom: 10px;
        }


        /* Footer */
        .footer {
            background: rgba(222, 222, 222, 0.8);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            padding: 20px 0;
            margin-top: 50px;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        }

        .footer p {
            margin: 0;
            color: #666;
        }
        /* Nút toggle chỉ hiện trên mobile */
                .btn-toggle-sidebar{
                position: absolute; /* cố định tại vị trí */
                top: 80px; 
                right: 16px;
                width: 44px;
                height: 44px;
                border: none; border-radius:10px;
                display:none; z-index:1100;
                background: linear-gradient(90deg,#667eea,#764ba2);
                color:#fff; font-size:20px;
                z-index: 2000;
                }

                /* Trạng thái ẩn/hiện sidebar trên mobile */
                @media (max-width: 992px){
                #sidebar{ left:-280px; transition:left .3s ease; }
                #sidebar.active{ left:16px; }
                .btn-toggle-sidebar{ display:flex; align-items:center; justify-content:center; }
                .main-content{ margin-left:0 !important; }
            }

        /* Responsive */
            @media (max-width: 768px) {
            .header-text h1 {
                font-size: 1.3rem;
            }

            .materials-grid {
                grid-template-columns: 1fr;
            }

            .search-card {
                padding: 15px;
            }
            /* Make sidebar stack above content on small screens */

            .main-content {
                margin-left: 0;
                padding: 15px;
            }

            .sidebar .nav-link {
            color: #333;
            font-weight: 500;
            border-radius: 8px;
            margin-bottom: 6px;
            transition: all 0.2s;
            }

            .sidebar .nav-link:hover,
            .sidebar .nav-link.active {
            background-color: #364fbf;
            color: white;
            }
        }
