/* ============================================
   CODEINSPECTOR - Professional Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    /* Neutral Colors */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    /* Status Colors */
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #ca8a04;
    --warning-light: #fef9c3;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0284c7;
    --info-light: #e0f2fe;
    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-text: #737373;
    --sidebar-active: #eff6ff;
    --sidebar-hover: #f5f5f5;
    --sidebar-accent: #2563eb;
    --sidebar-border: #e5e5e5;
    --sidebar-section-text: #a3a3a3;
    /* Layout */
    --header-height: 56px;
    --sidebar-width: 256px;
    --sidebar-collapsed: 64px;
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.06);
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    /* Transitions */
    --transition: all 0.15s ease;
}

/* --- Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: var(--transition);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 10px;
}

.brand-text {
    color: var(--gray-900);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

    .brand-text small {
        display: block;
        font-size: 0.65rem;
        color: var(--gray-400);
        font-weight: 400;
        margin-top: 1px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 3px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 4px;
    }

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text);
    padding: 8px 12px;
    margin-bottom: 2px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm, 6px);
    transition: var(--transition);
    user-select: none;
}

    .nav-section-title:hover {
        background: var(--sidebar-hover);
        color: var(--gray-600);
    }

    .nav-section-title .nav-section-icon {
        margin-right: 8px;
        font-size: 0.85rem;
        opacity: 0.7;
    }

    .nav-section-title span {
        flex: 1;
    }

    .nav-section-title .nav-chevron {
        font-size: 0.75rem;
        transition: transform 0.2s ease, color 0.2s ease;
        opacity: 0.7;
        color: var(--gray-400);
        margin-left: auto;
    }

    .nav-section-title:hover .nav-chevron {
        opacity: 1;
        color: var(--gray-600);
    }

.nav-section.expanded .nav-section-title .nav-chevron {
    transform: rotate(90deg);
    color: var(--sidebar-accent);
    opacity: 1;
}

/* Collapsible link container */
.nav-section-links {
    display: none;
}

.nav-section.expanded .nav-section-links {
    display: block;
}

/* Highlight section title when a child link is active */
.nav-section.has-active-child .nav-section-title {
    color: var(--gray-700);
}

    .nav-section.has-active-child .nav-section-title .nav-section-icon {
        opacity: 1;
        color: var(--sidebar-accent);
    }

/* Pinned items (always visible, no collapsible) */
.sidebar-pinned {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 450;
}

    .sidebar-link:hover {
        background: var(--sidebar-hover);
        color: var(--gray-900);
    }

    .sidebar-link.active {
        background: var(--sidebar-active);
        color: var(--sidebar-accent);
        font-weight: 500;
    }

    .sidebar-link i {
        width: 20px;
        margin-right: 10px;
        font-size: 1rem;
        opacity: 0.6;
    }

    .sidebar-link.active i {
        opacity: 1;
        color: var(--sidebar-accent);
    }

    .sidebar-link .badge {
        margin-left: auto;
        font-size: 0.7rem;
        padding: 2px 6px;
    }

/* New Scan Button */
.new-scan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-bottom: 12px;
    text-decoration: none;
}

    .new-scan-btn:hover {
        background: var(--primary-dark);
        color: white;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    }

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

    .sidebar-user:hover {
        background: var(--sidebar-hover);
    }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    margin-right: 10px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: var(--gray-800);
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--sidebar-text);
    font-size: 0.75rem;
}

/* --- Main Content Area --- */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-search {
    position: relative;
    width: 320px;
}

    .header-search input {
        width: 100%;
        padding: 7px 12px 7px 34px;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        font-size: 0.85rem;
        background: var(--gray-50);
        transition: var(--transition);
        color: var(--gray-700);
    }

        .header-search input:focus {
            outline: none;
            border-color: var(--primary);
            background: white;
            box-shadow: 0 0 0 2px var(--primary-100);
        }

    .header-search i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400);
    }

.header-info-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    font-size: 0.78rem;
    color: var(--gray-700);
    white-space: nowrap;
    transition: var(--transition);
}

    .header-info-pill i {
        font-size: 0.82rem;
        color: var(--gray-500);
    }

    .header-info-pill:hover {
        background: var(--gray-100);
        border-color: var(--gray-300);
    }

.header-pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

    .header-pill-badge.critical {
        background: var(--danger);
    }

    .header-pill-badge.high {
        background: #fd7e14;
    }

.header-info-pill.over-budget {
    border-color: var(--danger);
    background: #fff5f5;
    color: var(--danger);
}

    .header-info-pill.over-budget i {
        color: var(--danger);
    }

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

    .header-btn:hover {
        background: var(--gray-50);
        border-color: var(--gray-300);
    }

    .header-btn .badge-dot {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 8px;
        height: 8px;
        background: var(--danger);
        border-radius: 50%;
        border: 2px solid white;
    }

/* --- Page Content --- */
.app-content {
    flex: 1;
    padding: 24px;
    background: var(--gray-50);
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 24px;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.025em;
}

.page-subtitle {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* --- Breadcrumb --- */
.breadcrumb-nav {
    margin-bottom: 16px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb-item {
    color: var(--gray-500);
}

    .breadcrumb-item a {
        color: var(--gray-500);
        text-decoration: none;
    }

        .breadcrumb-item a:hover {
            color: var(--primary);
        }

    .breadcrumb-item.active {
        color: var(--gray-800);
    }

.breadcrumb-divider {
    color: var(--gray-300);
}

/* --- Cards --- */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: none;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .card-title i {
        color: var(--gray-400);
    }

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* --- Content Cards (used across dashboard and platform views) --- */
.content-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

    .content-card.p-0 {
        padding: 0;
    }

/* --- Stat Cards --- */
.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

    .stat-card-icon.primary {
        background: var(--primary-100);
        color: var(--primary);
    }

    .stat-card-icon.success {
        background: var(--success-light);
        color: var(--success);
    }

    .stat-card-icon.warning {
        background: var(--warning-light);
        color: var(--warning);
    }

    .stat-card-icon.danger {
        background: var(--danger-light);
        color: var(--danger);
    }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

.stat-card-label {
    color: var(--gray-500);
    font-size: 0.8rem;
    font-weight: 450;
}

.stat-card-trend {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .stat-card-trend.up {
        color: var(--success);
    }

    .stat-card-trend.down {
        color: var(--danger);
    }

/* --- Tables --- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .data-table th {
        background: var(--gray-50);
        padding: 10px 16px;
        text-align: left;
        font-weight: 500;
        font-size: 0.75rem;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        border-bottom: 1px solid var(--gray-200);
    }

    .data-table td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--gray-100);
        vertical-align: middle;
        font-size: 0.875rem;
    }

    .data-table tbody tr:hover {
        background: var(--gray-50);
    }

    .data-table tbody tr:last-child td {
        border-bottom: none;
    }

    /* Table fixed layout - Description kolonuna kalan boşluğu ver */
    .data-table.table-fixed-layout {
        table-layout: fixed;
    }

        .data-table.table-fixed-layout th,
        .data-table.table-fixed-layout td {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding: 10px 8px;
        }

            .data-table.table-fixed-layout th.col-description,
            .data-table.table-fixed-layout td.col-description {
                white-space: normal;
                word-wrap: break-word;
            }

            .data-table.table-fixed-layout td:hover {
                overflow: visible;
                white-space: normal;
                position: relative;
                z-index: 1;
            }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

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

    .btn-primary:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
        color: white;
    }

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

    .btn-success:hover {
        background: #047857;
        border-color: #047857;
        color: white;
    }

.btn-outline {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

    .btn-outline:hover {
        background: var(--gray-50);
        border-color: var(--gray-400);
    }

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: none;
}

    .btn-ghost:hover {
        background: var(--gray-100);
        color: var(--gray-800);
    }

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

    .btn-icon.btn-sm {
        width: 32px;
        height: 32px;
    }

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Severity Badges */
.severity-critical {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.severity-high {
    background: var(--danger-light);
    color: var(--danger);
}

.severity-medium {
    background: var(--warning-light);
    color: var(--warning);
}

.severity-low {
    background: var(--info-light);
    color: var(--info);
}

.severity-info {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    transition: var(--transition);
    color: var(--gray-800);
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 2px var(--primary-100);
    }

    .form-control:disabled {
        background: var(--gray-100);
        cursor: not-allowed;
    }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

.form-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* --- Tabs --- */
.nav-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--gray-500);
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        transition: var(--transition);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .nav-tabs .nav-link:hover {
            color: var(--gray-700);
        }

        .nav-tabs .nav-link.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

/* --- Progress --- */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-primary {
    background: var(--primary);
}

.progress-bar-success {
    background: var(--success);
}

.progress-bar-warning {
    background: var(--warning);
}

.progress-bar-danger {
    background: var(--danger);
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}

.alert-icon {
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--gray-400);
    font-size: 1.5rem;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--gray-500);
    margin-bottom: 16px;
}

/* --- Code Block --- */
.code-block {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 16px;
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* --- Dropdown --- */
.dropdown-menu {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    min-width: 180px;
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .dropdown-item:hover {
        background: var(--gray-100);
    }

    .dropdown-item i {
        width: 16px;
        color: var(--gray-500);
    }

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* --- Modal (Bootstrap uyumlu) --- */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-dialog.modal-sm {
    max-width: 340px;
}

.modal-header {
    padding: 12px 16px;
}

    .modal-header.border-0 {
        border-bottom: none !important;
    }

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 8px 16px;
}

    .modal-body .alert {
        margin-bottom: 12px;
    }

.modal-footer {
    padding: 8px 16px;
    gap: 8px;
}

    .modal-footer.border-0 {
        border-top: none !important;
    }

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1060;
}

.toast {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    min-width: 300px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* --- Offcanvas --- */
.offcanvas {
    position: fixed;
    background: white;
    z-index: 1045;
    transition: transform 0.3s ease;
}

.offcanvas-top {
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    border-bottom: 1px solid var(--gray-200);
}

    .offcanvas-top.show {
        transform: translateY(0);
    }

.offcanvas-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offcanvas-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.offcanvas-body {
    padding: 20px;
}

/* --- Utilities --- */
.text-muted {
    color: var(--gray-500) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary-light {
    background: var(--primary-100) !important;
}

.bg-success-light {
    background: var(--success-light) !important;
}

.bg-warning-light {
    background: var(--warning-light) !important;
}

.bg-danger-light {
    background: var(--danger-light) !important;
}

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.rounded {
    border-radius: var(--radius) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

        .app-sidebar.show {
            transform: translateX(0);
        }

    .app-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .page-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        justify-content: flex-start;
    }

    .header-search {
        width: 100%;
        max-width: 240px;
    }

    .header-info-pill {
        display: none !important;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--gray-400);
    }

/* --- Bootstrap Overrides --- */
.table > :not(caption) > * > * {
    padding: 12px 16px;
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--gray-50);
}

.dropdown-toggle::after {
    display: none;
}

/* User Avatar Button Override */
.user-avatar-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

    .user-avatar-btn:focus {
        outline: none !important;
        box-shadow: none !important;
    }

/* --- Custom Component: Scan History --- */
.scan-row {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

    .scan-row:hover {
        background: var(--gray-50);
    }

    .scan-row:last-child {
        border-bottom: none;
    }

.scan-info {
    flex: 1;
    min-width: 0;
}

.scan-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.scan-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    gap: 16px;
}

.scan-stats {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.scan-actions {
    display: flex;
    gap: 4px;
    margin-left: 16px;
}

/* --- Compliance Score Ring --- */
.score-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

    .score-ring svg {
        transform: rotate(-90deg);
    }

.score-ring-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.score-ring-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.score-ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

/* --- Page Header Enhanced --- */
.page-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title-section {
    flex: 1;
    min-width: 0;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stats-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1200px) {
    .stats-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Stat Card Variants --- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.stat-card-compact {
    padding: 16px;
}

    .stat-card-compact .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0;
    }

    .stat-card-compact .stat-card-value {
        font-size: 1.5rem;
    }

.stat-card-icon.secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

.stat-card-icon.info {
    background: var(--info-light);
    color: var(--info);
}

/* --- Card Header Content --- */
.card-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* --- Badge Variants --- */
.badge-critical {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-high {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-medium {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-low {
    background: var(--info-light);
    color: var(--info);
}

.badge-info {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

/* --- Table Cell Styles --- */
.cell-primary {
    font-weight: 500;
    color: var(--gray-900);
}

.cell-secondary {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* --- Severity Badges Container --- */
.severity-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* --- Compliance Score Display --- */
.compliance-score {
    font-weight: 600;
    font-size: 1rem;
}

.compliance-score-display {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    gap: 4px;
}

/* --- Pagination Wrapper --- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
}

/* --- Empty State Enhanced --- */
.empty-state-description {
    color: var(--gray-500);
    max-width: 400px;
    margin: 0 auto 24px;
}

/* --- Info List --- */
.info-list {
    margin: 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

    .info-item dt {
        color: var(--gray-500);
        font-weight: 400;
    }

    .info-item dd {
        color: var(--gray-900);
        font-weight: 500;
        margin: 0;
        text-align: right;
    }

/* --- File Path Display --- */
.file-path {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--gray-700);
}

/* --- Line Number Display --- */
.line-number {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
}

/* --- Finding Detail Rows --- */
.finding-row {
    cursor: pointer;
}

.finding-detail-row {
    background: var(--gray-50);
}

    .finding-detail-row td {
        padding: 8px 16px;
        border-bottom: 1px solid var(--gray-100);
    }

.finding-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finding-description {
    color: var(--gray-600);
    font-size: 0.85rem;
}

    .finding-description i {
        color: var(--info);
    }

.finding-recommendation {
    color: var(--success);
    font-size: 0.85rem;
}

    .finding-recommendation i {
        color: var(--success);
    }

/* --- Code Snippet --- */
.code-snippet {
    background: var(--gray-900);
    border-radius: var(--radius);
    overflow: hidden;
}

    .code-snippet pre {
        margin: 0;
        padding: 12px 16px;
        overflow-x: auto;
    }

    .code-snippet code {
        color: #e5e7eb;
        font-family: 'JetBrains Mono', 'Fira Code', monospace;
        font-size: 0.8rem;
        white-space: pre;
    }

/* --- Scan Summary Card --- */
.scan-summary-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.summary-value {
    color: var(--gray-900);
    font-weight: 600;
}

/* --- Loading Spinner --- */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* --- Form Controls Enhanced --- */
.form-control:placeholder-shown {
    color: var(--gray-400);
}

.form-control::placeholder {
    color: var(--gray-400);
}

/* --- Button Outline Variants --- */
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

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

.btn-outline-secondary {
    color: var(--gray-600);
    border-color: var(--gray-300);
    background: transparent;
}

    .btn-outline-secondary:hover {
        background: var(--gray-100);
        color: var(--gray-800);
    }

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
    background: transparent;
}

    .btn-outline-danger:hover {
        background: var(--danger);
        color: white;
    }

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

    .btn-danger:hover {
        background: #b91c1c;
        border-color: #b91c1c;
        color: white;
    }

.btn-secondary {
    background: var(--gray-600);
    color: white;
    border-color: var(--gray-600);
}

    .btn-secondary:hover {
        background: var(--gray-700);
        border-color: var(--gray-700);
        color: white;
    }

/* --- Alert Light --- */
.alert-light {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

/* ============================================
   RTL (Right-to-Left) Support for Arabic
   ============================================ */
[dir="rtl"] {
    /* Sidebar positioning */
    .app-sidebar

{
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--sidebar-border);
}

.app-main {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

/* Brand logo */
.brand-logo {
    margin-right: 0;
    margin-left: 12px;
}

/* Sidebar link icons */
.sidebar-link i {
    margin-right: 0;
    margin-left: 12px;
}

.sidebar-link .badge {
    margin-left: 0;
    margin-right: auto;
}

/* Collapsible nav section icons */
.nav-section-title .nav-section-icon {
    margin-right: 0;
    margin-left: 8px;
}

.nav-section-title .nav-chevron {
    margin-left: 0;
    margin-right: auto;
}

.nav-section.expanded .nav-section-title .nav-chevron {
    transform: rotate(-90deg);
}

/* User avatar */
.user-avatar {
    margin-right: 0;
    margin-left: 10px;
}

/* Header */
.header-right {
    margin-left: 0;
    margin-right: auto;
}

.header-search i {
    left: auto;
    right: 12px;
}

.header-search input {
    padding: 8px 36px 8px 12px;
}

/* Tables */
.data-table th,
.data-table td {
    text-align: right;
}

/* Info list */
.info-item dd {
    text-align: left;
}

/* Scan components */
.scan-stats {
    margin-left: 0;
    margin-right: 16px;
}

.scan-actions {
    margin-left: 0;
    margin-right: 16px;
}

/* Form select arrow */
.form-select {
    background-position: left 10px center;
    padding-right: 12px;
    padding-left: 40px;
}

/* Dropdowns */
.dropdown-menu {
    text-align: right;
}

/* Breadcrumb */
.breadcrumb {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* Toast container */
.toast-container {
    right: auto;
    left: 24px;
}

/* Card title icons */
.card-title i {
    margin-right: 0;
    margin-left: 8px;
}

/* Buttons with icons */
.btn i:first-child {
    margin-right: 0;
    margin-left: 6px;
}

/* Alerts */
.alert {
    flex-direction: row-reverse;
}

/* Stat cards */
.stat-card {
    flex-direction: row-reverse;
}

}

/* RTL responsive overrides */
@media (max-width: 1024px) {
    [dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }

        [dir="rtl"] .app-sidebar.show {
            transform: translateX(0);
        }

    [dir="rtl"] .app-main {
        margin-right: 0;
    }
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
}

    .language-switcher .dropdown-toggle {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        font-size: 0.85rem;
        color: var(--gray-700);
        cursor: pointer;
        transition: var(--transition);
    }

        .language-switcher .dropdown-toggle:hover {
            background: var(--gray-100);
            border-color: var(--gray-300);
        }

    .language-switcher .dropdown-menu {
        min-width: 160px;
    }

    .language-switcher .dropdown-item {
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .language-switcher .dropdown-item.active {
            background: var(--primary-100);
            color: var(--primary);
        }

        .language-switcher .dropdown-item i {
            width: 16px;
            text-align: center;
        }

/* ═══ ICMF Badge Styles ═══ */
.icmf-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.icmf-FIN {
    background: #dc3545;
    color: #fff;
}

.icmf-AUD {
    background: #fd7e14;
    color: #fff;
}

.icmf-AUTH {
    background: #6f42c1;
    color: #fff;
}

.icmf-DATA {
    background: #0d6efd;
    color: #fff;
}

.icmf-XSYS {
    background: #0dcaf0;
    color: #000;
}

.icmf-name {
    font-size: 0.72rem;
    color: var(--gray-600);
    margin-top: 2px;
}

.icmf-impact-panel {
    background: rgba(220, 53, 69, 0.06);
    border-left: 3px solid #dc3545;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin-bottom: 12px;
}

    .icmf-impact-panel .icmf-impact-title {
        font-weight: 700;
        font-size: 0.9rem;
        color: #dc3545;
        margin-bottom: 6px;
    }

    .icmf-impact-panel .icmf-impact-body {
        font-size: 0.88rem;
        color: var(--gray-800);
        line-height: 1.5;
    }

    .icmf-impact-panel .icmf-meta {
        margin-top: 8px;
        font-size: 0.8rem;
        color: var(--gray-600);
    }
/* ═══ Financial Risk Dashboard ═══ */
.fr-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fr-summary-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

    .fr-summary-card .fr-value {
        font-size: 2rem;
        font-weight: 800;
        color: var(--primary);
    }

    .fr-summary-card .fr-label {
        font-size: 0.82rem;
        color: var(--gray-600);
        margin-top: 4px;
    }

    .fr-summary-card.fr-danger .fr-value {
        color: #dc3545;
    }

.fr-bar-chart .fr-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.fr-bar-chart .fr-bar-label {
    width: 220px;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.fr-bar-chart .fr-bar-track {
    flex: 1;
    height: 22px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.fr-bar-chart .fr-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.fr-bar-chart .fr-bar-count {
    width: 32px;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
}

.fr-business-summary {
    border-left: 4px solid #dc3545;
    background: rgba(220, 53, 69, 0.04);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.25rem 1.5rem;
}

    .fr-business-summary.fr-clean {
        border-left-color: #198754;
        background: rgba(25, 135, 84, 0.04);
    }

@media (max-width: 992px) {
    .fr-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .fr-summary-cards {
        grid-template-columns: 1fr;
    }
}




/* ============================================
   SECODX ENTERPRISE UI REFINEMENT
   ============================================ */

/* Global background refinement */
body {
    background: #F7F9FC;
    color: #1f2937;
}

/* Card system */
.card, .panel, .widget {
    background: #ffffff;
    border: 1px solid #E6EAF0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
    transition: box-shadow .2s ease, transform .05s ease;
}

    .card:hover {
        box-shadow: 0 4px 14px rgba(16,24,40,0.06);
    }

/* Metric cards */
.metric-card {
    background: #ffffff;
    border: 1px solid #E6EAF0;
    border-radius: 10px;
    padding: 18px;
}

    .metric-card h3,
    .metric-card .metric-value {
        font-size: 28px;
        font-weight: 600;
        color: #111827;
    }

/* Table system */
table {
    border-collapse: separate;
    border-spacing: 0;
}

    table thead th {
        background: #F9FAFB;
        font-weight: 600;
        font-size: 13px;
        border-bottom: 1px solid #E6EAF0;
    }

    table tbody tr {
        transition: background .15s ease;
    }

        table tbody tr:hover {
            background: #F9FAFB;
        }

/* Buttons */
.btn-primary {
    background: #2563eb;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    .btn-primary:hover {
        background: #1d4ed8;
    }

/* Badge severity system */
.badge-critical {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-high {
    background: #ffedd5;
    color: #c2410c;
}

.badge-medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-low {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Section headers */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
}

/* Chart containers */
.chart-container {
    background: #ffffff;
    border: 1px solid #E6EAF0;
    border-radius: 10px;
    padding: 16px;
}

/* Sidebar refinement */
.sidebar a {
    border-radius: 8px;
}

    .sidebar a:hover {
        background: #F3F4F6;
    }

.sidebar .active {
    background: #EFF6FF;
    color: #2563eb;
    font-weight: 500;
}

/* Form inputs */
input, select, textarea {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
    }

/* Dashboard hero metric */
.hero-metric {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
}




/* ============================================
   SecodX Unified Summary Metrics
   Neutral enterprise cards with accent values
   ============================================ */
.summary-metrics {
    margin-bottom: 1.5rem;
}

.summary-metric-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    min-height: 112px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .summary-metric-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    }

    .summary-metric-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 4px;
        border-radius: 16px 0 0 16px;
        background: var(--gray-300);
    }

    .summary-metric-card .card-body {
        padding: 0;
        width: 100%;
    }

    .summary-metric-card h3,
    .summary-metric-card .metric-value {
        margin: 0;
        font-size: 2rem;
        line-height: 1.05;
        font-weight: 800;
        letter-spacing: -0.03em;
        color: var(--gray-900);
    }

    .summary-metric-card small,
    .summary-metric-card .metric-label {
        display: block;
        margin-top: .45rem;
        font-size: .82rem;
        font-weight: 600;
        color: var(--gray-700);
    }

    .summary-metric-card .metric-sub {
        margin-top: .2rem;
        font-size: .74rem;
        color: var(--gray-500);
    }

    .summary-metric-card.metric-critical::before,
    .summary-metric-card.is-critical::before {
        background: #ef4444;
    }

    .summary-metric-card.metric-warning::before,
    .summary-metric-card.is-warning::before {
        background: #f59e0b;
    }

    .summary-metric-card.metric-info::before,
    .summary-metric-card.is-info::before {
        background: #06b6d4;
    }

    .summary-metric-card.metric-primary::before,
    .summary-metric-card.is-primary::before {
        background: #2563eb;
    }

    .summary-metric-card.metric-purple::before,
    .summary-metric-card.is-purple::before {
        background: #7c3aed;
    }

    .summary-metric-card.metric-neutral::before,
    .summary-metric-card.is-neutral::before {
        background: #64748b;
    }

    .summary-metric-card.metric-critical h3,
    .summary-metric-card.is-critical h3,
    .summary-metric-card.metric-critical .metric-value,
    .summary-metric-card.is-critical .metric-value {
        color: #dc2626;
    }

    .summary-metric-card.metric-warning h3,
    .summary-metric-card.is-warning h3,
    .summary-metric-card.metric-warning .metric-value,
    .summary-metric-card.is-warning .metric-value {
        color: #d97706;
    }

    .summary-metric-card.metric-info h3,
    .summary-metric-card.is-info h3,
    .summary-metric-card.metric-info .metric-value,
    .summary-metric-card.is-info .metric-value {
        color: #0891b2;
    }

    .summary-metric-card.metric-primary h3,
    .summary-metric-card.is-primary h3,
    .summary-metric-card.metric-primary .metric-value,
    .summary-metric-card.is-primary .metric-value {
        color: #2563eb;
    }

    .summary-metric-card.metric-purple h3,
    .summary-metric-card.is-purple h3,
    .summary-metric-card.metric-purple .metric-value,
    .summary-metric-card.is-purple .metric-value {
        color: #6d28d9;
    }

    .summary-metric-card.metric-neutral h3,
    .summary-metric-card.is-neutral h3,
    .summary-metric-card.metric-neutral .metric-value,
    .summary-metric-card.is-neutral .metric-value {
        color: #334155;
    }

    .summary-metric-card.score-card h3 {
        display: inline-flex;
        align-items: baseline;
        gap: .2rem;
    }

        .summary-metric-card.score-card h3 .score-scale {
            font-size: .52em;
            color: var(--gray-400);
            font-weight: 600;
        }

.threat-summary-hero .metric-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    min-height: 108px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

    .threat-summary-hero .metric-card .metric-value {
        font-size: 1.95rem;
    }

    .threat-summary-hero .metric-card .metric-label {
        color: var(--gray-800);
        font-weight: 700;
    }

    .threat-summary-hero .metric-card .metric-sub {
        color: var(--gray-500);
    }

@media (max-width: 768px) {
    .summary-metric-card {
        min-height: 96px;
        padding: 1rem;
    }

        .summary-metric-card h3,
        .summary-metric-card .metric-value {
            font-size: 1.7rem;
        }
}
