:root {
    /* ============== BOOTSTRAP THEME COLOURS ============== */
    /* === Old Orange : #fd910d; === */
    /* --bs-primary:    #fd910d; */
    /* --bs-primary-rgb: 253, 145, 13; */

    /* === New Blue/Purple : #; === */
    --bs-primary:    #08087F;
    --bs-primary-rgb: 8, 8, 127;

    --bs-primary-hover:  color-mix(in srgb, var(--bs-primary) 88%, black);
    --bs-primary-active: color-mix(in srgb, var(--bs-primary) 78%, black);

    --bs-secondary:   #6c757d;
    --bs-secondary-rgb: 108, 117, 125;

    --bs-success:     #198754;
    --bs-success-rgb: 25, 135, 84;

    --bs-info:        #0dcaf0;
    --bs-info-rgb:    13, 202, 240;

    --bs-warning:     #ffc107;
    --bs-warning-rgb: 255, 193, 7;

    --bs-danger:      #dc3545;
    --bs-danger-rgb:  220, 53, 69;

    --bs-light:       #f8f9fa;
    --bs-light-rgb:   248, 249, 250;

    --bs-dark:        #212529;
    --bs-dark-rgb:    33, 37, 41;

    --bs-third-colour: #0dfd0d;
    --bs-third-rgb: 13, 253, 13;

    --bs-fourth-colour: #8916e0;
    --bs-fourth-rgb: 137, 22, 224;

    /* ============== CUSTOM COLOUR PALLET COLOURS ============== */
    --strata-logo-colour-0: #2596be; /* RGB rgba(37, 150, 190) - HSL (196, 67%, 45%) */
    --strata-logo-colour-1: #B6D5FF; /* top stripe of logo */
    --strata-logo-colour-2: #338DFF; /* second top stripe of logo */
    --strata-logo-colour-3: #0F4CFF; /* second from bottom stripe of logo */
    --strata-logo-colour-4: #0C08B5; /* bottom stripe of logo */
    --strata-logo-colour-text: #08087F; /* text colour of strata in logo */

    /* === BASE COLOURS === */
    --base-green: #0be642;  /* → HSV (135, 95%, 90%) → HSL (135, 91%, 47%) */
    --base-yellow: #e6e60b;  /* → HSV (60, 95%, 90%) → HSL (60, 91%, 47%) */
    --base-orange: #e68b0b;  /* → HSV (35, 95%, 90%) → HSL (35, 91%, 47%) */
    --base-red: #e60b0b;  /* → HSV (0, 95%, 90%) → HSL (0, 91%, 47%) */
    --base-white: #fff;  /* → HSV (0, 0%, 100%) → HSL (0, 0%, 100%) */

    /* === LIGHT SHADE A COLOURS (LIGHTEST) === */
    --light-a-green: #9df2b4;  /* → HSV (135, 35%, 95%) → HSL (135, 77%, 78%) */
    --light-a-yellow: #f2f29d;  /* → HSV (60, 35%, 95%) → HSL (60, 77%, 78%) */
    --light-a-orange: #f2cf9d;  /* → HSV (35, 35%, 95%) → HSL (35, 77%, 78%) */
    --light-a-red: #f29d9d;  /* → HSV (0, 35%, 95%) → HSL (0, 77%, 78%) */

    /* === DARK SHADE A COLOURS (DARKEST) === */
    --dark-a-green: #011a07;  /* → HSV (135, 97%, 10%) → HSL (135, 93%, 5%) */
    --dark-a-yellow: #1a1a01;  /* → HSV (60, 97%, 10%) → HSL (60, 93%, 5%) */
    --dark-a-orange: #1a0f01;  /* → HSV (35, 97%, 10%) → HSL (35, 93%, 5%) */
    --dark-a-red: #1a0101;  /* → HSV (0, 97%, 10%) → HSL (0, 93%, 5%) */

    /* === LIGHT SHADE B COLOURS (MIDDLE LIGHT) === */
    --light-b-green: #57d977;  /* → HSV (135, 60%, 85%) → HSL (135, 63%, 60%) */
    --light-b-yellow: #d9d957;  /* → HSV (60, 60%, 85%) → HSL (60, 63%, 60%) */
    --light-b-orange: #d9a357;  /* → HSV (35, 60%, 85%) → HSL (35, 63%, 60%) */
    --light-b-red: #d95757;  /* → HSV (0, 60%, 85%) → HSL (0, 63%, 60%) */

    /* === DARK SHADE B COLOURS (MIDDLE DARK) === */
    --dark-b-green: #084d19;  /* → HSV (135, 90%, 30%) → HSL (135, 81%, 17%) */
    --dark-b-yellow: #4d4d08;  /* → HSV (60, 90%, 30%) → HSL (60, 81%, 17%) */
    --dark-b-orange: #4d3008;  /* → HSV (35, 90%, 30%) → HSL (35, 81%, 17%) */
    --dark-b-red: #4d0808;  /* → HSV (0, 90%, 30%) → HSL (0, 81%, 17%) */

    /* ============== RISK SCORE BADGE COLOURS (Light bg, with dark text) ============== */
    --score-low-bg-colour: var(--light-b-green);
    --score-low-text-colour: var(--dark-b-green);
    --score-med-bg-colour: var(--light-b-orange);
    --score-med-text-colour: var(--dark-b-orange);
    --score-high-bg-colour: var(--light-b-red);
    --score-high-text-colour: var(--dark-b-red);

    /* ============== COLOUR CONFIG ============== */
    --sidebar-expanded-width: 280px;
    --sidebar-collapsed-width: 90px;
    --sidebar-hover-bg: var(--strata-logo-colour-1);
    --sidebar-open-bg: var(--strata-logo-colour-1);
    --sidebar-active-bg: var(--strata-logo-colour-4);
    --sidebar-preview-bg: #fff;
    --sidebar-scrollbar-thumb: #c1c1c1;
    --search-input-bg: #f1f1f1;
    --search-boarder: #dadce0;
    --search-focus-bg: #e5e5e5;
    --search-focus-border: #9aa0a6;
    --search-btn: #606060;
    --search-btn-hover: #202124;
    --side-bar-navlink-text: #030303;
    --back-btn: #555;
    --form-section-card-header-bg: var(--strata-logo-colour-1);
    --form-section-card-header-text: black;


    /* ============== FONT FAMILY ============== */
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-font-monospace: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,  monospace;
}

/* ============== BUTTON FIXES ============== */

/* ======== PRIMARY ======== */
.btn-primary {
    --bs-btn-bg: var(--bs-primary) !important;
    --bs-btn-border-color: var(--bs-primary) !important;
    --bs-btn-color: var(--base-white) !important;
}

.btn-primary:hover {
    --bs-btn-hover-bg: var(--bs-primary-hover) !important;
    --bs-btn-hover-border-color: var(--bs-primary-hover) !important;
    --bs-btn-hover-color: var(--base-white) !important;
}

.btn-primary:active,
.btn-primary.active {
    --bs-btn-active-bg: var(--bs-primary-active) !important;
    --bs-btn-active-border-color: var(--bs-primary-active) !important;
    --bs-btn-active-color: var(--base-white) !important;
}

.bg-primary {
    --bs-bg-opacity: 1 !important;
    background-color: var(--bs-primary) !important;
}

/* Make sure chevrons are always visible in expanded mode */
.sidebar .submenu-trigger .bi-chevron-down {
    margin-left: auto;
    font-size: 1.1rem;
    opacity: 0.85;
}

.sidebar .nav-link .bi-chevron-down {
    transition: transform 0.2s ease;
    margin-left: auto;
    font-size: 1.1rem;
    opacity: 0.85;
    flex-shrink: 0;
}

body {
    background-color: var(--bs-light);
    font-family: var(--bs-body-font-family) !important;
}

/* Top navbar */
.top-navbar {
    height: 64px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: var(--base-white);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    width: var(--sidebar-expanded-width);
    transition: width 0.3s ease;
    background-color: var(--base-white);
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    font-size: 0.85rem;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-footer-container {
    display: none !important;
}

/* === SIDEBAR NAV STYLES === */
.sidebar .nav-link {
    padding: 12px 20px;
    color: var(--side-bar-navlink-text);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: normal;
    line-height: 1.4;
    min-height: 56px;
    box-sizing: border-box;
}

.sidebar .submenu-trigger {
    justify-content: space-between !important;
}

.sidebar.collapsed .nav-link {
    padding: 14px 0 !important;
    justify-content: center;
    gap: 0;
    min-height: 56px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Icon styling */
.sidebar .nav-link .bi {
    font-size: 1.55rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

/* Icon in collapsed mode */
.sidebar.collapsed .nav-link .bi {
    font-size: 1.65rem;
    width: 42px;
    text-align: center;
}

/* Hide text + chevrons in collapsed mode */
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .bi-chevron-down {
    display: none !important;
}

/* Force submenu triggers to center properly */
.sidebar.collapsed .submenu-trigger {
    justify-content: center !important;
}

/* Make bottom footer look intentional when collapsed */
.sidebar.collapsed li.mt-auto {
    padding: 20px 0px !important;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Tighter HR spacing in both states */
.sidebar hr {
    margin: 10px 12px;
}
.sidebar.collapsed hr {
    margin: 8px 12px;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
}

.sidebar .submenu-trigger:has(+ .submenu.show) {
    background-color: var(--sidebar-active-bg);
    color: white;
}

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

/* Submenus */
.submenu {
    list-style: none;
    padding-left: 12px;
    font-size: 0.85rem;
    display: none;
}

.submenu.show {
    display: block;
}

.submenu .nav-link {
    padding: 8px 20px;
    white-space: normal;
    line-height: 1.4;
}

/* Hover preview */
.sidebar-preview {
    position: fixed;
    left: var(--preview-left, 300px);
    top: var(--preview-top, 100px);
    background: var(--sidebar-preview-bg);
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 16px;
    width: 260px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-preview.show {
    display: block;
    opacity: 1;
}

.sidebar-preview img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* Main content */
.main-content {
    margin-top: 24px;
    margin-left: var(--sidebar-expanded-width);
    transition: margin-left 0.3s ease;
    padding: 12px 24px 24px 24px;   /* smaller top padding */
    min-height: calc(100vh - 64px);
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width) !important;
}

/* Wrapper for breadcrumb + page header */
.page-header-area {
    margin-bottom: 1rem;             /* Controls space after the whole header */
}

#filter-badges {
    margin-top: 16px;
}

#announcement-banner,
.announcement-banner {
    margin-bottom: 0.75rem !important;
    border-radius: 0;
}

/* Small screens - always full width (overlay mode) */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
}

/* === SEARCH BAR STYLES === */
.search-group {
    max-width: 440px;
    width: 100%;
}

.search-group .input-group {
    width: 100% !important;
    background-color: var(--search-input-bg);
    border: 1px solid var(--search-boarder);
    border-radius: 9999px;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Hover & focus states */
.search-group .input-group:hover,
.search-group .input-group:focus-within {
    background-color: var(--search-focus-bg);
    border-color: var(--search-focus-border);
}

.search-group .form-control {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.65rem 1.25rem 0.65rem 20px;
    font-size: 1rem;
}

.search-group .btn {
    background: transparent;
    border: none;
    padding: 0.65rem 18px;
    color: var(--search-btn);
    transition: color 0.2s;
}

.search-group .btn:hover {
    color: var(--search-btn-hover);
}

/* Notification badge */
.notification-btn .badge {
    top: 4px !important;
    left: 20px !important;
    font-size: 0.65rem;
}

/* === ASSESSMENTS CARDS STYLES === */
.assessment-card {
    border-radius: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
    margin-bottom: 24px;
}

/* Dynamic colored top bar + badge using CSS variables */
.card-top-bar {
    height: 8px;
    background-color: var(--bar-color) !important;
}

.assessment-card .badge.text-white.px-3 {
    background-color: var(--bar-color) !important;
}

/* Coloured dot for assessment type - CSP safe */
.assessment-type-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: var(--bar-color);
    flex-shrink: 0;
    margin-right: 9px;
}

/* Residual Risk coloured badge - CSP safe & modern */
.risk-score-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 68px;
    text-align: center;
}

/* === ASSESSMENT CARDS RISK-SCORE COLOURS === */
.risk-score-low {
    background-color: var(--bs-success);
    color: white;
}
.risk-score-med {
    background-color: var(--bs-warning);
    color: black;
}
.risk-score-high {
    background-color: var(--bs-danger);
    color: white;
}

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

/* ============== PAGE HEADER ============== */
.page-header {
    /* position: relative; */
    margin-bottom: 24px;
    min-height: 48px;
    /* padding-left: 60px; */
    /* padding-right: 20px; */
}

.page-header h1 {
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--bs-secondary);
    margin-bottom: 0;
    line-height: 1.3;
    white-space: normal;
}

/* === Back BUTTON === */
.back-button {
    /* position: absolute; */
    /* top: 50%; */
    /* left: 0; */
    /* transform: translateY(-50%); */
    /* z-index: 20; */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--back-btn);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.back-button:hover {
    background-color: var(--bs-light);
    color: var(--bs-primary);
    transform: translateX(-3px);
}

.back-button i {
    font-size: 18px;
    transition: transform 0.25s ease;
}

.back-button:hover i {
    transform: translateX(-4px);
}

/* On very small screens, reduce padding slightly */
@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.65rem;
    }
}

/* ============== BREADCRUMB ============== */
.breadcrumb {
   font-size: 0.875rem;
   padding: 0;
   margin-bottom: 0.5rem !important;
   font-weight: 400;
}

.breadcrumb-item + .breadcrumb-item::before {
   content: "\203A";    /* Unicode escape for › - most reliable */
   color: var(--bs-secondary);
   margin: 0 0px;
   font-weight: 300;
}

.breadcrumb-item a {
   color: var(--bs-secondary);
   text-decoration: none !important;
   font-weight: 400;
}

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

.breadcrumb-item.active {
   color: var(--bs-dark);
   font-weight: 500;
}

/* ==================== CSP-FRIENDLY FIXES ==================== */

/* Dynamic card colors - no JS inline styles needed */
.assessment-card[data-bar-color] {
    --bar-color: attr(data-bar-color color);
}

.assessment-card[data-bar-color] .card-top-bar,
.assessment-card[data-bar-color] .assessment-type-dot,
.assessment-card[data-bar-color] .badge.text-white.px-3 {
    background-color: var(--bar-color) !important;
}

/* Hide cards with a class instead of inline display */
.assessment-card.hidden,
.col-12.hidden {
    display: none !important;
}

/* ====================== ASSESSMENT CARD COLOURS ====================== */
.assessment-card {
    --bar-color: #28a745;   /* fallback colour */
}

.assessment-card .card-top-bar,
.assessment-card .assessment-type-dot,
.assessment-card .badge.text-white.px-3 {
    background-color: var(--bar-color) !important;
}

/* ====================== RISK SCORE BOX ====================== */
.risk-score-layout {
    background: var(--bs-light);
    /* max-width: 560px; */
    /* margin-left: auto; */
    /* margin-right: auto; */
    border-radius: 14px;
    padding: 24px 20px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}



.risk-box {
    min-width: 110px;
    height: 72px;
    font-size: 2.4rem;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--bs-success);
    color: white;
}

.risk-box:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

#raw-risk-level-indicator {
    min-height: 32px;
}

#consequenceDisplay,
#probabilityDisplay {
    min-height: 38px !important;
    padding: 6px 18px !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.1;
    white-space: nowrap;
    /* border-radius: 50px; */
}

/* Optional: a little more breathing room between the two badges */
#consequenceDisplay {
    margin-bottom: 8px;
}

/* Colour the box based on score (via JS) */
.risk-box.bg-success { background-color: var(--bs-success) !important; color: white; }
.risk-box.bg-warning { background-color: var(--bs-warning) !important; color: black; }
.risk-box.bg-danger  { background-color: var(--bs-danger) !important; color: white; }

/* Prevent overflow on small screens */
@media (max-width: 576px) {
    /*
    .risk-score-layout {
        padding: 20px 12px;
    }
    .risk-box {
        min-width: 110px;
        height: 90px;
        font-size: 2.2rem;
    }
     */
}

.uniform-badge {
    padding: 8px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
}

/* ====================== RISK SCORE BOX - FORCE VISIBLE ====================== */
/*
#riskScoreBox {
    min-width: 160px !important;
    height: 90px !important;
    font-size: 2.8rem !important;
    font-weight: 700 !important;
    border: 6px solid #fff !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 16px !important;
    background: #f8f9fa !important;
    color: #212529 !important;
}

#riskScoreBox:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4) !important;
}

// Make sure the content inside is visible
#riskScoreBoxContent {
    font-size: 2.8rem !important;
    font-weight: 700 !important;
}

*/

/* ====================== FORM LABELS ====================== */
.form-label {
    font-weight: 600;              /* Bolder than default */
    font-size: 1.0rem;
    color: #212529;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

/* Make required fields stand out */
.form-label.required::after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
    font-size: 1.1rem;
}

/* Optional: Slightly larger and more modern look */
.form-label strong {
    font-weight: 600;
}

/* ====================== FORM TOOLTIP ICON ====================== */
.form-label .tooltip-icon {
    font-size: 0.85rem;
    color: #6c757d;
    margin-left: 4px;
    cursor: help;
    transition: color 0.2s;
}

.form-label .tooltip-icon:hover {
    color: var(--bs-primary);
}

.form-check-label .tooltip-icon {
    font-size: 0.85rem;
    color: #6c757d;
    margin-left: 4px;
    cursor: help;
    transition: color 0.2s;
}

.form-check-label .tooltip-icon:hover {
    color: var(--bs-primary);
}

/* ====================== FORM SECTION CARDS ====================== */
.form-section-card {
    border: 1px solid #e5e5e5;
    /* border-radius: 12px; */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.form-section-card .card-header {
    background: var(--form-section-card-header-bg);
    color: var(--form-section-card-header-text);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 14px 20px;
    border-bottom: none;
}

.form-section-card .card-body {
    background: #f8f9fa;    /* Light, clean body background */
    padding: 24px;
}

/* Optional: Make the body slightly different on hover */
.form-section-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
}

.create-modal-hazard-button {
    margin-right: 24px;
}

/* ====================== MAIN FORM CONTAINER ====================== */
.form-container {
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 32px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.form-container:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

/* Optional: Add a subtle accent line at the top using your primary colour */
.form-container::before {
    content: '';
    display: block;
    height: 6px;
    background: var(--bs-primary);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    margin: -32px -32px 32px -32px;
}

/* ====================== MAIN FORM CONTAINER FORM GROUP ====================== */
.form-container .form-group .form-select {
    /* background: var(--bs-primary); */
}

.form-container .form-group .form-control {
    /* background: var(--bs-primary); */
}

/* ====================== ADDITIONAL CONTROLS CHECKBOXES ====================== */
.additional-controls-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    /* max-height: 320px; */
    overflow-y: auto;
}

.form-check-bool-custom {
    padding-top: 3px;
    padding-bottom: 6px;
    padding-left: 2.5rem;
    transition: all 0.2s ease;
}

.form-check-bool-custom input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-bool-custom input[type="checkbox"]:hover {
    background-color: rgba(253, 145, 13, 0.08);
    border-radius: 8px;
}

.form-check-bool-custom input[type="checkbox"]:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.form-check-bool-custom input[type="checkbox"]:checked::after {
    color: white;
    font-size: 14px;
}

.form-check-custom {
    padding-top: 3px;
    padding-bottom: 6px;
    padding-left: 2.5rem;
    transition: all 0.2s ease;
}

.form-check-custom:hover {
    background-color: rgba(253, 145, 13, 0.08);
    border-radius: 8px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.form-check-input:checked::after {
    color: white;
    font-size: 14px;
}

.form-check-label {
    font-size: 1.0rem;
    color: #212529;
    padding-left: 10px;
    cursor: pointer;
    user-select: none;
}

/* Make the whole row clickable */
.form-check-custom label {
    cursor: pointer;
}

.residual-risk-score-container {
    /* background: var(--bs-primary); */
}

.generated-item-box {
    /* max-width: 626.4px;*/          /* Smaller than full width */
    /* margin-left: auto; */
    /* margin-right: auto; */
    /* padding-left: 24px; */
    /* padding-right: 24px; */
    padding: 0px 0px;
    /* display: inline-flex; */
}

.generated-item-container {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    /* width: 100%; */
    /* margin-left: 12px; */
    padding: 12px 24px;
    border-radius: 16px;
    background: var(--bs-light);
    /* color: black; */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: all 0.25s ease;
    /* align-items: center; */
    /* justify-content: center; */
    /* display: flex; */
}

.generated-item-container:hover {
    /* box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); */
}

.generated-item-container .generated-item-label {
    font-weight: 600;              /* Bolder than default */
    font-size: 1.0rem;
    /* color: black; */
    /* padding-top: 4px; */
    /* margin-bottom: 6px; */
    /* display: flex; */
    align-items: center;
}

.generated-item-container .generated-item-content {
    /* color: black; */
    line-height: 1.5;
    flex-grow: 1;
    margin-top: 12px;
}

/* Make the content area flexible for longer text */
.generated-item-container .generated-item-content #hazard-display {
    /* white-space: pre-wrap; */
    /* word-break: break-word; */
}

/* Location Field */
.form-location-field {
    /* max-width: 680px; */
}

.form-location-hide-add-field {
    /* max-width: 626.4px; */
    /* max-width: 680px; */
    /* padding-right: 45.6px; */
    padding-right: 53.6px;
    /* margin-right: 12px; */
}

/* General Form Field */
.form-general-select-box-field {
    max-width: 626.4px;
    padding: 0 0 16px 0;
    margin-top: 16px;
}

.btn-location-add {
    /* background: var(--bs-secondary); */
    color: var(--bs-primary);
    /* font-size: 1.55rem; */
    /* width: 40px; */
    /* text-align: center; */
    /* flex-shrink: 0; */
}

.btn-location-add:hover {
    background-color: var(--bs-light);
    color: var(--bs-primary);
    /* transform: translateX(-3px); */
    transform: scale(1.05);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}
/* Icon styling */
.btn-location-add .bi {
    font-size: 1.75rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.view-risk-box-display-box {
    min-width: 110px;
    height: 72px;
    font-size: 2.4rem;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    /* cursor: pointer; */
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--bs-success);
    color: white;
}

.residual-risk-display-box {
    min-width: 110px;
    height: 72px;
    font-size: 2.4rem;
    font-weight: 700;
    border: 6px solid var(--bs-secondary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    /* cursor: pointer; */
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--bs-success);
    color: white;
}

. display-raw-risk-level-indicator-level {
    min-width: 110px;
    height: 42px;
    font-size: 2.4rem;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--bs-success);
    /* color: white; */
}

.display-consequence-probability-level {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 54px;
    padding: 10px 14px !important;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.35;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box;
    border-radius: 12px;
    background-color: var(--bs-success);
}

.display-consequence-probability-level.bg-success { background-color: var(--bs-success) !important; color: white; }
.display-consequence-probability-level.bg-warning { background-color: var(--bs-warning) !important; color: black; }
.display-consequence-probability-level.bg-danger  { background-color: var(--bs-danger) !important; color: white; }

/* Extra safety on small screens */
/*
@media (max-width: 576px) {
    .display-consequence-probability-level {
        min-height: 50px;
        padding: 8px 12px !important;
        font-size: 0.9rem;
    }
}
 */

.custom-checkbox-controls-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    /* max-height: 320px; */
    overflow-y: auto;
}

/* Style for the gauge canvas */
#risk-score-gauge {
    display: block;
    margin: 0 auto;
}

/* Setup Hierarchy */
.department-row {
    border: 2px solid #e9ecef;
}

.task-row {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

.jobtitle-row {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

.hierarchy-department-container {
    border: 4px solid #dee2e6;
}

.hierarchy-task-container {
    border: 4px solid #dee2e6;
}

.hierarchy-jobtitle-container {
    border: 4px solid #dee2e6;
}

/* ====================== NOTIFICATION ITEM HOVER ====================== */
.notification-item {
    cursor: pointer !important;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;   /* Prepares space for accent */
}

.notification-item:hover {
    background-color: rgba(253, 145, 13, 0.08);   /* Very light orange tint */
    border-left: 3px solid var(--bs-primary);     /* Orange accent on left */
    transform: translateX(4px);                   /* Subtle slide effect */
}

.notification-item:active {
    background-color: rgba(253, 145, 13, 0.15);
}

/* Stronger hover for unread items (already have bg-light) */
.notification-item.bg-light:hover {
    background-color: rgba(253, 145, 13, 0.12);
}

.app-logo-navbar {
    /* display: flex; */
    /* align-items: center; */
    text-decoration: none;
    color: #212529;           /* Dark text color */
    transition: all 0.25s ease;
}

.app-logo-navbar:hover {
    color: #212529;           /* Keep text dark on hover */
}

.app-logo-navbar .app-logo-navbar-text {
    font-weight: 700;
    font-size: 1.35rem;
    margin-left: 10px;
    transition: color 0.25s ease;
}

.app-logo-navbar:hover .app-logo-navbar-text {
    color: var(--bs-primary);   /* Turns orange on hover */
}

/* Optional: Make icon also change slightly on hover */
.app-logo-navbar:hover i {
    transform: scale(1.08);
    transition: all 0.25s ease;
}

/* ====================== COOKIE CONSENT BANNER ====================== */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    border-top: 1px solid #e5e5e5;
    z-index: 1050;
    display: none; /* Hidden by default */
}

.cookie-consent-banner.show {
    display: block;
    animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Make it look premium */
.cookie-consent-banner .btn {
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
}

.cookie-consent-banner .btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* User Avatar Circle */
.user-avatar-circle {
    width: 38px !important;
    height: 38px !important;
    background-color: var(--bs-primary);
    color: white !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /*
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
     */
}

.user-avatar-circle:hover {
    transform: scale(1.08) !important;
}


/* ==================== NEW ==================== */
/* ==================== NEW ==================== */
/* ==================== NEW ==================== */
/* ==================== NEW ==================== */
/* ==================== NEW ==================== */
/* ==================== NEW ==================== */

/* ==================== NEW LIGHT SIDEBAR ==================== */
.sidebar {
    background-color: color-mix(in srgb, var(--strata-logo-colour-1) 10%, white);
    color: black;
    border-right: 1px solid #1f2937;
}

.sidebar .nav-link {
    color: black;
    padding: 14px 20px;
    border-radius: 6px;
    margin: 2px 8px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--strata-logo-colour-1);
    color: black;
}

/* Active / Selected state */
.sidebar .nav-link.active {
    background-color: var(--strata-logo-colour-4);
    color: white;
    font-weight: 500;
}

/* Icon styling */
.sidebar .nav-link i {
    font-size: 1.4rem;
    width: 28px;
    flex-shrink: 0;
}

/* Counter badges */
.sidebar .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    min-width: 20px;
    text-align: center;
}

/* ==================== SUBMENU - VERTICAL LINE + DOTS ==================== */

/* The container for the submenu (the <ul>) */
.submenu {
    position: relative;           /* This makes it the positioning context for absolute children */
    padding-left: 56px;           /* Creates space on the left for the line + dots */
    margin-top: 4px;
    list-style: none;
}

/* ──────── THE VERTICAL LINE ──────── */
/* Drawn once on the <ul class="submenu"> */
.submenu::before {
    content: '';                  /* Required for pseudo-elements to show */
    position: absolute;           /* Removed from normal flow */
    left: 24px;                   /* ← Horizontal position of the line (this is the key number) */
    top: 24px;                    /* Starts 24px down (below the first dot) */
    bottom: 24px;                 /* Ends 24px before the bottom (above the last dot) */
    width: 2px;                   /* Thickness of the line */
    background-color: #374151;    /* Dark gray color (matches your dark theme) */
    z-index: 0;                   /* Behind the dots */
}

/* ──────── THE DOTS ──────── */
/* Drawn on EVERY <li> inside the submenu */
.submenu li {
    position: relative;           /* Makes each <li> a positioning context for its own ::before */
}

.submenu li::before {
    content: '';
    position: absolute;
    margin: 0px 0px 0px -34px;
    left: 0px;                 /* ← Must match the line's left value so dot sits ON the line */
    top: 50%;
    transform: translateY(-50%);
    width: 7px;                   /* Size of the dot */
    height: 7px;
    background-color: #6b7280;    /* Gray color for the dot */
    border-radius: 50%;           /* Makes it a circle */
    z-index: 1;                   /* In front of the line */
}

/* Submenu link styling */
.submenu .nav-link {
    padding: 10px 20px 10px 16px;   /* ← This is the key: pushes background to the right of the dot */
    margin: 0px 0px 0px 0px;
    font-size: 0.95rem;
    color: black;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}

/* Hover / Active background - only covers icon + text */
.submenu .nav-link:hover,
.submenu .nav-link.active {
    background-color: var(--strata-logo-colour-1);
    color: black;
}

/* Chevron rotation on parent item */
.submenu-trigger .bi-chevron-down {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.submenu-trigger[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* ====================== Submenu First and Land Elements Dots ====================== */
.submenu .submenu-first-list-item::before {
    top: 24px;
    transform: none;
}

.submenu .submenu-last-list-item::before {
    bottom: 24px;
    top: auto;
    transform: none;
}


/* ====================== SIDEBAR collapse ====================== */
/* Collapsed mode adjustments (keep your existing collapsed styles) */
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .bi-chevron-down {
    display: none !important;
}

/* ====================== SIDEBAR BADGE COUNTER ====================== */

/* Normal (expanded) state - badge on the right */
.sidebar .nav-link .badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border-radius: 9999px;
}

/* Collapsed state - badge sits on top of the icon (exactly like notification bell) */
.sidebar.collapsed .nav-link {
    position: relative;
}

.sidebar.collapsed .nav-link .badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.65rem;
    padding: 1px 5px;
    min-width: 17px;
    height: 17px;
    line-height: 1;
    box-shadow: 0 0 0 2px #111827;   /* dark background edge */
}

/* ============================================
   SELECT2 + BOOTSTRAP 5 THEME OVERRIDES
   ============================================ */

/* === Select2 Bootstrap 5 Theme Overrides === */

/* Main container */
.select2-container {
    width: 100% !important;
    display: block;
}

/* Selection box (the visible part) */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 42px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    background-color: #fff !important;
    padding: 4px 8px !important;
}

/* Selected tags (pills) in multi-select */
.select2-container--bootstrap-5 .select2-selection__choice {
    background-color: #e7f1ff !important;
    border: 1px solid #b6d4fe !important;
    color: #084298 !important;
    border-radius: 0.375rem !important;
    padding: 4px 10px !important;
    margin: 3px 3px 3px 0 !important;
    font-size: 0.875rem;
}

/* Remove button on tags */
.select2-container--bootstrap-5 .select2-selection__choice__remove {
    color: #084298 !important;
    margin-right: 6px !important;
    font-size: 1rem;
    line-height: 1;
}

/* Search input inside the multi-select box */
.select2-container--bootstrap-5 .select2-search__field {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
    padding: 4px 10px !important;
    margin: 3px 0 !important;
}

/* Dropdown */
.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Fix for multi-select height when many tags are selected */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 42px !important;
}

/* Prevent form-control styles from leaking into Select2 */
.select2-container input,
.select2-container .select2-search__field {
    box-shadow: none !important;
}

/* === STANDARDIZED CONTENT SPACING === */

/* Main wrapper for breadcrumb + heading */
.content-header {
    margin-bottom: 1.5rem;           /* Consistent spacing after header */
    padding-bottom: 0.5rem;          /* Optional: Make the whole header area more compact */
}

/* Page Header (Back button + Title) */
.page-header {
    margin-bottom: 0;                /* We control spacing via .content-header */
}

/* Messages */
.messages .alert {
    margin-bottom: 0.75rem;          /* Tighter spacing between alerts */
}

/* Optional: Make the whole header area more compact */
.content-header {
    padding-bottom: 0.5rem;
}

/* === LIST GENERIC ASSESSMENTS PAGE STYLES === */

/* ============================================
   LIST GENERIC ASSESSMENTS PAGE
   Styles moved from list_generic_assessments.html <style> blocks
   Added here for strict CSP compliance (no inline styles)
   Place this at the END of your base.css (or in a page-specific CSS file loaded after base.css)
   ============================================ */

/* === FILTER COLLAPSE CHEVRON ANIMATION === */
.transition-all {
    transition: transform 0.2s ease;
}

.collapse.show + .card-header .bi-chevron-down,
.card-header[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* === FILTER BADGES (header + inside collapse) === */
.filter-badges-container {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

.filter-badge-header {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

/* Hover state for remove (×) buttons inside badges */
.remove-filter-btn:hover {
    color: #ffc107 !important;
}

/* === MOBILE IMPROVEMENTS FOR FILTER HEADER === */
@media (max-width: 576px) {
    .filter-badges-container {
        order: 3;
        width: 100%;
        margin-top: 0.25rem;
        padding-top: 0.25rem;
        border-top: 1px solid #dee2e6;
    }

    /* More specific selector to avoid affecting other card-headers globally */
    .filter-container .card-header {
        flex-wrap: wrap;
    }
}

/* === GENERIC ASSESSMENTS TABLE (list view) === */
.generic-assessments-table-container {
    overflow-x: auto;
    width: 100%;
}

.generic-assessments-table-container-inner {
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
}

.assessments_table {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* === Improved Table Striping (uses existing CSS vars from :root for consistency) === */
.assessments_table tbody tr:nth-of-type(odd) {
    background-color: color-mix(in srgb, var(--strata-logo-colour-2) 25%, white);
}

.assessments_table tbody tr:nth-of-type(even) {
    background-color: #ffffff;   /* Even Rows - clean white */
}

/* Hover effect - bright blue with good contrast */
.assessments_table tbody tr:hover {
    background-color: color-mix(in srgb, var(--strata-logo-colour-2) 40%, white);
    color: black;
}

/* Header styling (matches logo accent) */
.table-header-gray {
    background-color: color-mix(in srgb, var(--strata-logo-colour-2) 65%, white);
    color: black;
}

.bg-generic-filter-light {
    background-color: color-mix(in srgb, var(--strata-logo-colour-2) 45%, white);
}

.bg-generic-filter-extra-light {
    background-color: color-mix(in srgb, var(--strata-logo-colour-2) 15%, white);
}

/* Optional: If you want even stronger zebra or future theming, you can extend here */


/* ============  View Assessments Management  ================ */

.assessment-tree .tree-item {
    cursor: pointer;
    transition: background-color 0.1s ease;
    user-select: none;
}

.assessment-tree .tree-item:hover {
    background-color: #f1f3f5;
}

.assessment-tree .tree-leaf .tree-item:hover {
    background-color: #e7f1ff;
}

.assessment-tree .tree-item.bg-primary {
    background-color: #0d6efd !important;
}

.assessment-tree ul {
    border-left: 1px solid #dee2e6;
    margin-left: 12px;
}

.assessment-tree .tree-node:last-child > ul {
    border-left: none;
}

#detail-pane {
    background: white;
    min-height: 400px;
}

/* ===== Dashboard Quick Actions ===== */

/* ===== Dashboard recent lists – single-line compact rows ===== */

.dashboard-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.dashboard-item-content {
    display: grid;
    /* Ref | Meta | Hazard | Date */
    grid-template-columns: 68px minmax(0, 1.6fr) minmax(120px, 150px) 48px;
    gap: 1.25rem;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding-left: 1rem;
}
/* ===== Dashboard Recent Lists ===== */

/* Individual columns */
.dashboard-ref {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-meta {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-hazard {
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dashboard-date {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    text-align: right;
    white-space: nowrap;
}

/* Risk badge */
.dashboard-risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    padding: 0 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

/* Slight indentation for grouped children */
/*
.dashboard-item-child .dashboard-item-content {
    padding-left: 1rem;
}
*/
.dashboard-item-content {
    padding-left: 1rem;
}

/* ===== Group Header ===== */
.dashboard-group-header {
    background-color: var(--bs-light);
    cursor: pointer;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.dashboard-group-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.dashboard-group-label {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 1rem;
}

/* Make the toggle button sit in roughly the same horizontal space
   as the risk badge on normal rows */
.dashboard-group-toggle {
    flex-shrink: 0;
    width: 42px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/*
.dashboard-group-toggle {
    flex: 0 0 auto;
    padding: 0.15rem 0.4rem;
    line-height: 1;
}
*/

.dashboard-group-toggle .bi {
    transition: transform 0.2s ease;
    font-size: 0.85rem;
}

.dashboard-group-toggle[aria-expanded="true"] .bi {
    transform: rotate(180deg);
}

/* Nested children */
.dashboard-item-child {
    position: relative;
    padding-left: 1rem !important;
}

.dashboard-item-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #0d6efd;
}

/*
.dashboard-group-children.d-none {
    display: none !important;
}
*/

/* Hazards version – only 3 columns: Ref | Meta | Date */
.dashboard-item-content--hazards {
    grid-template-columns: 68px minmax(0, 1fr) 48px;
    gap: 1.25rem;
}

/* ---------- Quick Actions ---------- */
.quick-actions .btn {
    min-height: 120px;
}

.btn-quick-action-bg-light {
    background-color: color-mix(in srgb, var(--strata-logo-colour-1) 20%, white);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

/* ---------- System preference (default) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) {
    color-scheme: dark;
  }
}

/* ---------- Explicit Dark Theme ---------- */
[data-bs-theme="dark"] {
  color-scheme: dark;

  /* === Bootstrap overrides === */
  --bs-body-bg: #12141a;
  --bs-body-color: #e4e6eb;
  --bs-secondary-color: #adb5bd;
  --bs-border-color: #2d323c;
  --bs-tertiary-bg: #1c1f26;

  --bs-primary: #4d7cff;
  --bs-primary-rgb: 77, 124, 255;
  --bs-primary-hover: #3b6aef;
  --bs-primary-active: #2f5cd6;

  --bs-secondary: #8b95a5;
  --bs-success: #2ecc71;
  --bs-warning: #f1c40f;
  --bs-danger: #e74c3c;
  --bs-info: #3498db;
  --bs-light: #1e222b;
  --bs-dark: #e4e6eb;

  /* === Your custom palette overrides === */
  --strata-logo-colour-1: #1a2a4a;
  --strata-logo-colour-2: #2a4a8a;
  --strata-logo-colour-3: #3a6aff;
  --strata-logo-colour-4: #4d7cff;
  --strata-logo-colour-text: #a8c0ff;

  --sidebar-hover-bg: #1e2a40;
  --sidebar-open-bg: #1e2a40;
  --sidebar-active-bg: #4d7cff;
  --sidebar-preview-bg: #1c1f26;
  --sidebar-scrollbar-thumb: #4a5568;

  --search-input-bg: #1e222b;
  --search-boarder: #2d323c;
  --search-focus-bg: #252a35;
  --search-focus-border: #4d7cff;
  --search-btn: #a0aec0;
  --search-btn-hover: #e2e8f0;

  --side-bar-navlink-text: #e2e8f0;
  --back-btn: #a0aec0;

  --form-section-card-header-bg: #1e2a40;
  --form-section-card-header-text: #e4e6eb;

  /* Risk score colours (kept readable in dark) */
  --score-low-bg-colour: #1a3c2a;
  --score-low-text-colour: #6ee7a8;
  --score-med-bg-colour: #3d2e12;
  --score-med-text-colour: #fbbf24;
  --score-high-bg-colour: #3f1515;
  --score-high-text-colour: #f87171;
}

/* ---------- Dark mode component fixes ---------- */

[data-bs-theme="dark"] body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .top-navbar {
  background-color: #161920 !important;
  border-bottom: 1px solid var(--bs-border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

[data-bs-theme="dark"] .sidebar {
  background-color: #161920 !important;
  border-right-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .sidebar .nav-link {
  color: #d1d5db;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover {
  background-color: var(--sidebar-hover-bg);
  color: white;
}

[data-bs-theme="dark"] .sidebar .nav-link.active {
  background-color: var(--sidebar-active-bg);
  color: white;
}

[data-bs-theme="dark"] .card {
  background-color: #1c1f26;
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .card-header {
  background-color: #22262f;
  border-bottom-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1e222b;
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #252a35;
  border-color: var(--bs-primary);
  color: var(--bs-body-color);
  box-shadow: 0 0 0 0.2rem rgba(77, 124, 255, 0.25);
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --bs-table-border-color: var(--bs-border-color);
  --bs-table-striped-bg: rgba(255,255,255,0.03);
  --bs-table-hover-bg: rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #1c1f26;
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .modal-content {
  background-color: #1c1f26;
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1c1f26;
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .dropdown-item {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: #2a303c;
  color: white;
}

[data-bs-theme="dark"] .breadcrumb-item a {
  color: #a0aec0;
}

[data-bs-theme="dark"] .page-header h1 {
  color: #e4e6eb;
}

[data-bs-theme="dark"] .form-container {
  background: #1c1f26;
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .form-section-card .card-body {
  background: #181b22;
}

[data-bs-theme="dark"] .cookie-consent-banner {
  background: #1c1f26;
  border-top-color: var(--bs-border-color);
}

[data-bs-theme] .theme-option.active,
.theme-option.active {
    background-color: var(--bs-primary);
    color: white;
}

[data-bs-theme="dark"] .theme-option.active {
    background-color: var(--bs-primary);
    color: white;
}

/* ====================== METRICS CARDS ====================== */
.metrics-card {
    border: 1px solid #e5e5e5;
    /* border-radius: 12px; */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
}

.metrics-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.metrics-card .card-header {
    background: var(--form-section-card-header-bg);
    color: var(--form-section-card-header-text);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 14px 20px;
    border-bottom: none;
    min-height: 4.75rem; /* 14px + 14px + two lines at 1.1rem / 1.3 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.metrics-card .card-header h6 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.metrics-card .card-body {
    background: #f8f9fa;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.metrics-card .metric-count-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

.metrics-card .metric-count-badges .badge-low {
    min-width: 6.75rem; /* "Low: 99999" + badge padding */
    padding-left: 0.65em;
    padding-right: 0.65em;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.metrics-card .metric-count-badges .badge-medium {
    min-width: 8.25rem; /* "Medium: 99999" + badge padding */
    padding-left: 0.65em;
    padding-right: 0.65em;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.metrics-card .metric-count-badges .badge-high {
    min-width: 7.25rem; /* "High: 99999" + badge padding */
    padding-left: 0.65em;
    padding-right: 0.65em;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.metrics-card .metric-card-actions {
    margin-top: auto;
    padding-top: 1.5rem;
}
