:root {
    /* Updates Theme Palette */
    --primary: #C8102E;
    --primary-light: #FF4D6D;
    --primary-dark: #6B1421;
    --primary-darker: #4A0E1C;
    --accent-gold: #D4AF37;

    /* Gradients */
    /* Hero Gradient from Updates */
    --primary-gradient: linear-gradient(135deg, #4A0E1C 0%, #6B1421 50%, #4A0E1C 100%);
    --gradient-hero: linear-gradient(135deg, #4A0E1C 0%, #6B1421 50%, #4A0E1C 100%);
    --primary-gradient-hover: linear-gradient(135deg, #C8102E 0%, #E94560 100%);

    /* Neutral Colors - Warm Theme */
    --background: #F5F0EB;
    --surface: #FFFBF7;
    --border: #E8E0D8;
    --border-light: #F3EBE3;

    --text-main: #2D2D2D;
    --text-secondary: #5A5A5A;
    --text-light: #887B75;
    --text-muted: #A89B95;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 80px;
    /* Slightly taller for hero feel */

    /* Shadows - Premium Depth */
    --shadow-sm: 0 1px 3px rgba(75, 14, 28, 0.08);
    --shadow-md: 0 4px 15px rgba(75, 14, 28, 0.12);
    --shadow-lg: 0 10px 40px rgba(75, 14, 28, 0.15);
    --shadow-xl: 0 20px 50px rgba(75, 14, 28, 0.2);

    --shadow-red: 0 4px 14px -3px rgba(200, 16, 46, 0.3);
    --shadow-red-lg: 0 10px 25px -5px rgba(200, 16, 46, 0.4);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-md);
    z-index: 20;
}

.brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: white;
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.brand-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-darker);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.nav-links {
    padding: 24px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-btn i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: 0.3s;
    opacity: 0.7;
    color: var(--text-light);
}

.nav-btn:hover {
    background: rgba(200, 16, 46, 0.05);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-btn:hover i {
    opacity: 1;
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-red);
}

.nav-btn.active i {
    opacity: 1;
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, #F5F0EB 100%);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-red);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--background);
}

/* ===== HERO HEADER ===== */
.hero-header {
    background: var(--gradient-hero);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.header-container {
    padding: 12px 24px;
    /* Compact padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-container {
    width: 60px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 4px;
}

.logo-container i {
    font-size: 32px;
    color: var(--primary);
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.title-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    color: white;
}

.title-text p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure mobile menu button is visible in hero header */
.mobile-menu-btn {
    margin-right: 20px;
    color: white;
    font-size: 24px;
}

.scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    /* Reduced from 32px 40px */
    scroll-behavior: smooth;
    background: var(--background);
}

.view-section {
    max-width: 100%;
    /* Default to full width for responsiveness */
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1600px) {
    .view-section {
        max-width: 1500px;
        /* Only cap on very large screens */
    }
}

/* ===== DASHBOARD STATS ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(200, 16, 46, 0.2);
}

/* Remove old gradient bars */
.stat-card::before,
.stat-card::after {
    display: none;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 38px;
    font-weight: 800;
    color: var(--primary-darker);
    line-height: 1;
    letter-spacing: -2px;
}

.stat-icon-bg {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    color: var(--primary);
}

/* ===== SECTION CONTAINERS ===== */
.section-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-darker);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.3px;
}

.section-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--primary-gradient);
    border-radius: 4px;
}

.search-input {
    padding: 12px 20px 12px 46px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 300px;
    font-size: 14px;
    background: var(--background);
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    color: var(--text-main);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== TABLES ===== */
th {
    background: #FAFAFA;
    padding: 14px 20px;
    /* Reduced padding */
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    white-space: nowrap;
}

th:hover {
    background: #F3F4F6;
    color: var(--primary);
}

.sort-icon {
    margin-left: 6px;
    font-size: 10px;
    opacity: 0.3;
}

th:hover .sort-icon {
    opacity: 1;
}

td {
    padding: 14px 20px;
    /* Reduced padding */
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
    background: white;
    transition: background 0.2s;
}

/* Sticky Action Column */
th:last-child,
td:last-child {
    position: sticky;
    right: 0;
    z-index: 11;
    border-left: 1px solid var(--border-light);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}

th:last-child {
    background: #FAFAFA;
    z-index: 20;
    /* Higher than normal sticky header */
}

td:last-child {
    background: white;
}

tbody tr:hover td:last-child {
    background: #FFF5F7;
    /* Match hover effect manually since it covers the row hover */
}

/* Responsive Table */
.table-view {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

tbody tr:hover td {
    background: rgba(200, 16, 46, 0.02);
}

/* ===== BADGES ===== */
.status-badge {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge-active {
    background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
    color: #15803D;
    border: 1px solid #86EFAC;
}

.badge-inactive {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #B91C1C;
    border: 1px solid #FCA5A5;
}

.badge-gray {
    background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
    color: #374151;
    border: 1px solid #D1D5DB;
}

/* ===== BUTTONS ===== */
.btn-save {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    box-shadow: var(--shadow-red);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-save:hover {
    background: var(--primary-gradient-hover);
    box-shadow: var(--shadow-red-lg);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-red);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.4);
    transform: translateY(-2px);
}

.btn-primary i {
    font-size: 16px;
}

/* Secondary Button (Export PDF) */
.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #FFF5F7;
    border-color: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.btn-secondary i {
    color: var(--primary);
}

/* ===== CERTIFICATIONS STATS ===== */
.cert-stat-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.cert-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(200, 16, 46, 0.1);
}

.cert-stat-item::before {
    display: none;
    /* Remove old colored bars */
}

/* ===== MODAL ===== */
.modal {
    background: rgba(74, 14, 28, 0.6);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex !important;
    /* Keep flex to maintain centering when visible */
}

.modal-box,
.modal-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 500px;
    max-width: 90%;
    padding: 32px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-darker);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 12px 16px;
    transition: all 0.3s;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 20px;
    /* Spacing between fields */
    height: 48px;
    /* Consistent height */
}

.form-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
    outline: none;
}

/* Fix for Select elements to align with inputs */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

/* ===== RESPONSIVE & COLLAPSED SIDEBAR ===== */

/* Desktop Collapsed State */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-btn span,
.sidebar.collapsed .user-card {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-footer .nav-btn {
    padding: 12px;
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .brand {
    justify-content: center;
    padding: 16px;
}

.sidebar.collapsed .nav-btn {
    justify-content: center;
    padding: 14px;
}

.sidebar.collapsed .nav-btn i {
    font-size: 20px;
    margin: 0;
}

/* Mobile Responsive */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-btn {
    display: block;
    /* Show on desktop too */
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-right: 16px;
}

.mobile-menu-close {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px !important;
        /* Force width on mobile even if collapsed class is present */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .brand-text,
    .sidebar .nav-btn span,
    .sidebar .sidebar-footer {
        display: block !important;
        /* Always show content on mobile when open */
    }

    .mobile-menu-btn {
        display: block;
    }

    .mobile-menu-close {
        display: block;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 18px;
        cursor: pointer;
        margin-left: auto;
    }

    .top-header {
        padding: 0 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .header-title h1 {
        font-size: 18px;
    }

    .header-actions span {
        display: none;
        /* Hide text in header buttons on mobile */
    }

    .header-btn {
        padding: 8px 12px;
    }
}

/* ===== FILTER TABS (ADDED) ===== */
.filter-tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-tab:hover {
    background: #F8FAFC;
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(200, 16, 46, 0.2);
}

/* ===== CERTIFICATION STATS (ADDED) ===== */
.cert-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.cert-stat-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cert-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cert-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.cs-green {
    background: #DCFCE7;
    color: #166534;
}

.cs-yellow {
    background: #FEF3C7;
    color: #92400E;
}

.cs-red {
    background: #FEE2E2;
    color: #991B1B;
}

.cs-gray {
    background: #F1F5F9;
    color: #475569;
}

.cert-stat-info {
    display: flex;
    flex-direction: column;
}

.cert-stat-info div:first-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-stat-info div:last-child {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .cert-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== HARDWARE CARD GRID ===== */
.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

.hardware-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Red accent top bar */
.hardware-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #DC2626 0%, #B91C1C 100%);
}

.hardware-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(220, 38, 38, 0.18), 0 4px 8px rgba(0, 0, 0, 0.06);
    border-color: rgba(220, 38, 38, 0.35);
}

/* Header: gradient red background */
.hw-card-header {
    padding: 16px 18px 14px;
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.hw-card-header-info {
    flex: 1;
    min-width: 0;
}

.hw-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.1px;
}

.hw-card-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Total count badge in header */
.hw-total-badge {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Stat chips grid: 5 per row */
.hw-card-body {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    flex: 1;
}

.hw-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    font-size: 11px;
    color: #94A3B8;
    transition: all 0.2s;
    text-align: center;
    cursor: default;
}

.hw-stat-item i {
    font-size: 15px;
    color: #CBD5E1;
}

.hw-stat-item span {
    font-size: 13px;
    font-weight: 700;
    color: #CBD5E1;
    line-height: 1;
}

.hw-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Active chip: has hardware */
.hw-stat-item.active {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border-color: rgba(220, 38, 38, 0.2);
}

.hw-stat-item.active i {
    color: #DC2626;
}

.hw-stat-item.active span {
    color: #991B1B;
}

.hw-stat-item.active .hw-stat-label {
    color: #B91C1C;
}

.hw-stat-item:hover.active {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: rgba(220, 38, 38, 0.4);
    transform: scale(1.05);
}

/* Actions footer */
.hw-card-actions {
    padding: 12px 16px;
    background: #FAFAFA;
    border-top: 1px solid #F1F5F9;
}

.hw-view-btn {
    width: 100%;
    padding: 9px 16px;
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.hw-view-btn:hover {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .hardware-grid {
        grid-template-columns: 1fr;
    }

    .hw-card-body {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== HARDWARE INVENTORY DETAIL TABLE ===== */
.hw-inv-row {
    transition: background 0.15s;
}

.hw-inv-row:hover td {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.03) 0%, rgba(220, 38, 38, 0.01) 100%) !important;
}

/* Action buttons in inventory rows */
.hw-inv-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hw-inv-btn-ghost {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

.hw-inv-btn-ghost:hover {
    background: #E2E8F0;
    color: #334155;
    transform: translateY(-1px);
}

.hw-inv-btn-primary {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.hw-inv-btn-primary:hover {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

/* Styled checkbox */
.hw-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #DC2626;
    cursor: pointer;
}

/* ===== HARDWARE PREMIUM NAV BAR ===== */
.hw-nav-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hw-nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    text-align: left;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

/* Subtle left accent bar */
.hw-nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #E2E8F0;
    border-radius: 14px 0 0 14px;
    transition: background 0.25s;
}

.hw-nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(220, 38, 38, 0.25);
}

.hw-nav-btn:hover::before {
    background: var(--primary);
}

.hw-nav-btn.active {
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
}

.hw-nav-btn.active::before {
    background: rgba(255, 255, 255, 0.3);
}

/* Icon circle */
.hw-nav-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.08);
    color: #DC2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.25s;
}

.hw-nav-btn.active .hw-nav-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.hw-nav-btn:hover:not(.active) .hw-nav-icon {
    background: rgba(220, 38, 38, 0.12);
}

/* Text block */
.hw-nav-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hw-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: -0.1px;
    transition: color 0.25s;
}

.hw-nav-sub {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 500;
    transition: color 0.25s;
}

.hw-nav-btn.active .hw-nav-title,
.hw-nav-btn.active .hw-nav-sub {
    color: white;
}

.hw-nav-btn.active .hw-nav-sub {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .hw-nav-bar {
        gap: 10px;
    }

    .hw-nav-btn {
        min-width: 0;
        flex: 1;
        padding: 12px 14px;
        gap: 10px;
    }

    .hw-nav-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .hw-nav-title {
        font-size: 12px;
    }

    .hw-nav-sub {
        display: none;
    }
}