@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');


:root {
    /* Light Theme (Default) */
    --bg-color: #F8F9FA;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #0d6efd;
    --sidebar-accent: #0d6efd;
    --sidebar-text: #343a40;
    --sidebar-icon: #6c757d;
    --sidebar-active-bg: rgba(13, 110, 253, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.dark-mode {
    /* Dark Theme */
    --bg-color: #1a1b1e;
    --sidebar-bg: #212226;
    --card-bg: #2c2d30;
    --text-primary: #e8e6e3;
    --text-secondary: #a8a6a2;
    --border-color: #404144;
    --accent-color: #589bff;
    --sidebar-accent: #589bff;
    --sidebar-text: #d1d0c5;
    --sidebar-icon: #a8a6a2;
    --sidebar-active-bg: rgba(88, 155, 255, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --hover-bg: #343a40;
}


/* --- 2. GLOBAL STYLES --- */
body {
    font-family: var(--font-family-sans-serif);
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.main-content-header h1 {
    font-weight: 700;
    color: var(--text-primary);
}

.main-content-header .text-muted {
    color: var(--text-secondary);
}

/* --- 3. THEME TOGGLE SWITCH --- */
/* Add this HTML where you want the toggle:
<div class="theme-switch-wrapper">
    <label class="theme-switch" for="theme-toggle">
        <input type="checkbox" id="theme-toggle" />
        <span class="slider round"></span>
    </label>
</div>
*/
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-color);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* --- 4. THEMED COMPONENTS --- */
/* Update key components to use the new CSS variables */

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color); /* This will be subtle in dark mode */
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px var(--shadow-color); /* More refined shadow */
    color: var(--text-primary);
    border-radius: 12px; /* A slightly larger border-radius for a softer look */
}


.form-card, .docs-container, .login-container,
.report-table-container, .filter-card, .log-details-panel,
.model-evaluation-page .config-card, .model-evaluation-page .results-card,
.model-evaluation-page .prompt-display {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    color: var(--text-primary);
}
.card-header, .panel-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    color: var(--sidebar-text);
}
.sidebar-heading { color: var(--text-secondary); }
.sidebar-nav .nav-link { color: var(--sidebar-text); }
.sidebar-nav .nav-link .nav-icon { color: var(--sidebar-icon); }
.sidebar-nav .nav-link:hover { background-color: var(--sidebar-active-bg); }
.sidebar-nav .nav-link.active, .sidebar-nav .nav-link:hover .nav-icon, .sidebar-nav .nav-link:hover span { color: var(--sidebar-accent); }
.sidebar-nav .nav-link.active { background-color: var(--sidebar-active-bg); }

.report-table th { background-color: var(--hover-bg); }
.report-table tbody tr:hover { background-color: var(--hover-bg); }
.top-header { background-color: var(--card-bg); border-bottom-color: var(--border-color); }

input, textarea, select {
    background-color: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}


/* --- Theme Toggle Icon --- */
#theme-toggle-btn .theme-icon-moon { display: none; }
body.dark-mode #theme-toggle-btn .theme-icon-sun { display: none; }
body.dark-mode #theme-toggle-btn .theme-icon-moon { display: inline-block; }

/* Style for the button wrapper to match other header icons */
.header-icon-wrapper {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-icon-wrapper:hover {
    background-color: var(--sidebar-active-bg);
    color: var(--accent-color);
}



/* --- Global & Body --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
}

.page-container {
    display: flex;
    min-height: 100vh;
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- Login Page --- */
body.auth-page {
    display: flex;
    align-items: center; /* Vertically centers the content */
    justify-content: center; /* Horizontally centers the content */
    min-height: 100vh; /* Ensures the body takes up the full screen height */
}


.login-container {
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    text-align: center;
    margin: auto;
}
.login-container h1 { color: var(--text-primary); }
.login-container p { color: var(--text-secondary); }

/* --- General Form Elements --- */
.form-group { margin-bottom: 20px; text-align: left; }
label { display: block; margin-bottom: 8px; color: #495057; font-weight: 500; }
input[type="text"], input[type="password"], textarea, select, input[type="date"], input[type="email"]   {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus, input[type="date"]:focus, input[type="email"]:focus {
    outline: none;
    border-color: #80bdff;
}
.btn {
    background-color: #0d6efd;
    color: white;
    padding: 12px 20px;
    border: 1px solid transparent; /* Added for consistency */
    border-radius: 8px;
    cursor: pointer;
    width: auto;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-family: 'Inter', sans-serif;
    text-align: center;
    text-decoration: none; /* For link buttons */
    display: inline-block; /* For link buttons */
}
.btn:hover { background-color: #1766dd; color: white; }

/* Add this new rule or modify the existing 'input[type="text"], ..., select' rule */
/* If adding new: */
select.form-select { /* Using .form-select class for more specificity and future-proofing */
    height: 50px; /* Explicit height to match typical input height with 12px padding (12+12+1+1=26px content height + 18px line-height approx) */
    line-height: 1.5; /* Often helps with vertical alignment of text inside select */
    appearance: none; /* Removes default browser styling for dropdown arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); /* Custom SVG arrow for consistency */
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
}

/* --- Flash Messages --- */
.flash-message { padding: 12px; border-radius: 8px; margin-bottom: 20px; text-align: left; }
.flash-error { background-color: #f8d7da; color: #721c24; }
.flash-success { color: #0f5132; background-color: #d1e7dd; }

/* --- Main Layout --- */
.sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    padding: 8px;
    width: 290px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-main { flex-grow: 1; }



.main-content { padding: 40px; overflow-y: auto; flex-grow: 1; }

/* --- Top Header --- */
.top-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
}


.header-right-controls { display: flex; align-items: center; gap: 20px; }
.agent-filter-container { display: flex; align-items: center; gap: 10px; }
.agent-filter-container label { white-space: nowrap; margin-bottom: 0; }
.user-menu-container { position: relative; }
.user-bubble {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-image: linear-gradient(180deg, #4da1ff 0%, #0d6efd 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px; 
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.user-bubble:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.user-bubble .down-arrow { stroke: white; width: 10px; height: 10px; transition: transform 0.2s ease-in-out; }
.user-menu.show ~ .user-bubble .down-arrow { transform: rotate(180deg); }
.user-menu {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 220px;
    z-index: 1010;
    border: 1px solid #e9ecef;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}
.user-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu-header { padding: 12px 15px; border-bottom: 1px solid #e9ecef; color: #6c757d; }
.user-menu a { display: block; padding: 12px 15px; text-decoration: none; color: #495057; }
.user-menu a:hover { background-color: #f8f9fa; }

/* --- Sidebar Navigation --- */
.sidebar h2 { 
    font-weight: 600; 
    color: #212529; 
    margin: 0;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    margin-bottom: 30px;
}
.sidebar-header .logo-icon {
    font-size: 24px;
    color: #0d6efd;
}
.sidebar-nav { list-style-type: none; padding: 0; margin: 0; }
.sidebar-nav li a.nav-link { 
    display: flex; 
    align-items: center;
    gap: 15px;
    padding: 5px 15px; 
    text-decoration: none; 
    color: #495057; 
    border-radius: 8px; 
    font-weight: 500; 
    margin-bottom: 5px; 
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-nav li a.nav-link .nav-icon {
    font-size: 16px;
    width: 20px; /* To align text even if icons have different widths */
    text-align: center;
    color: #6c757d;
    transition: color 0.2s;
}
.sidebar-nav li a.nav-link:hover {
    background-color: #f0f4f9;
}
.sidebar-nav li a.nav-link:hover .nav-icon, .sidebar-nav li a.nav-link:hover span {
    color: #0d6efd;
}
.sidebar-nav li a.nav-link.active { 
    background-color: #e7f1ff; 
    color: #0d6efd; 
}
.sidebar-nav li a.nav-link.active .nav-icon {
    color: #0d6efd;
}

.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid #e9ecef; }
.copyright { font-size: 12px; color: #6c757d; text-align: center; }
.copyright.version { margin-top: 5px; color: #adb5bd; }

/* --- Dashboard & Page Headers --- */
.main-content-header h1 { margin: 0; font-weight: 600; font-size: 28px; margin-bottom: 30px;}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-bottom: 40px; }
.stat-card { background-color: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.stat-card .title { font-size: 16px; font-weight: 600; color: #495057; }
.stat-card .value { font-size: 32px; font-weight: 700; color: #212529; margin-top: 8px; }
.stat-card-link { text-decoration: none; }
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-bottom: 40px; }
.chart-card { background-color: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); min-height: 350px; }
.nlp-chart-card { grid-column: 1 / -1; }

/* --- Reports Page & Dashboard Table --- */
.report-table-container { background-color: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); overflow: hidden; }
.report-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.report-table th, .report-table td { padding: 15px; text-align: left; border-bottom: 1px solid #e9ecef; word-wrap: break-word; vertical-align: middle; }

.report-table th:nth-child(1), .report-table td:nth-child(1) { width: 12%; } /* Date */
.report-table th.severity-column, .report-table td.severity-column { width: 10%; } /* Severity */
.report-table th:nth-child(3), .report-table td:nth-child(3) { width: 13%; } /* Agent */
.report-table th:nth-child(4), .report-table td:nth-child(4) { width: 20%; } /* Prompt */
.report-table th:nth-child(5), .report-table td:nth-child(5) { width: 15%; } /* Response */
.report-table th:nth-child(6), .report-table td:nth-child(6) { width: 20%; } /* Categories */
.report-table th.actions-column, .report-table td.actions-column { width: 10%; text-align: center; }

.report-table th { background-color: #f8f9fa; font-weight: 600; }
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover { background-color: #f8f9fa; }

/* Cell Highlighting */
.report-table td.cell-match-found {
    background-color: #f8dfe1; /* Light red background, same as flash-error */
    color: #721c24; /* Darker red text, same as flash-error */
}

/* Ensure this remains consistent or is part of a combined rule */
.report-table td.cell-mismatch {
    background-color: #f8dfe1; /* Light red background */
    color: #7d333b; /* Darker red text */
}

/* Actions Column Icon Button */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #6c757d;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}
.icon-btn:hover {
    color: #0d6efd;
    text-decoration: none;
}

/* --- Severity Badges --- */
.badge {
    display: inline-block;
    padding: .35em .65em;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
}
.badge-critical { background-color: #8B0000; } /* Dark Red */
.badge-high { background-color: #dc3545; } /* Red */
.badge-medium { background-color: #fd7e14; } /* Orange */
.badge-low { background-color: #ffc107; color: #212529 !important; }
.badge-informational { background-color: #0dcaf0; color: #212529 !important; }


/* --- Alert Notification Styles --- */
.alerts-container {
    position: relative;
}
.alerts-icon-wrapper {
    position: relative;
    cursor: pointer;
    color: #495057;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out;
}
.alerts-icon-wrapper:hover {
    background-color: #f1f3f5;
}
.alerts-icon-wrapper .fa-bell {
    font-size: 20px;
}
.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
}
.alerts-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    width: 360px;
    z-index: 1010;
    border: 1px solid #e9ecef;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}
.alerts-container:focus-within .alerts-dropdown,
.alerts-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}
.alerts-header a {
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: #0d6efd;
}
.alerts-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}
.alerts-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}
.alerts-list li:last-child a { border-bottom: none; }
.alerts-list li a:hover { background-color: #f8f9fa; }
.alert-dropdown-content { display: flex; align-items: center; margin-bottom: 5px; }
.alert-dropdown-message {
    margin: 0; font-size: 14px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1;
}
.no-alerts {
    display: flex; align-items: center; justify-content: center;
    padding: 30px 15px; color: #6c757d; font-size: 14px;
}

/* --- Alerts Page Styles (Original from Context) --- */
.alerts-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.alert-actions {
    display: flex;
    gap: 10px;
}
.severity-group {
    margin-bottom: 40px;
}
.severity-group-title {
    font-size: 22px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}
.severity-group-title .badge {
    margin-right: 15px;
    font-size: 1em;
    padding: .5em .75em;
}

.alert-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alert-card.unread {
    background-color: #f0f6ff;
    border-left: 4px solid #0d6efd;
}
.alert-icon-container {
    font-size: 20px;
    margin-right: 20px;
    color: #6c757d;
}
.alert-card.unread .alert-icon-container {
    color: #0d6efd;
}
.alert-content {
    flex-grow: 1;
}
.alert-content p {
    margin: 0;
    font-weight: 500;
}
.alert-timestamp {
    font-size: 14px;
    color: #6c757d;
    margin-left: 20px;
    white-space: nowrap;
}
.no-alerts-message {
    text-align: center;
    padding: 50px;
    background-color: #fff;
    border-radius: 12px;
}

/* --- Modal Styles (Custom Log Details Modal) --- */
/* This is your custom modal overlay that will be dynamically added/removed */
#details-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; /* Initially hidden via JS, shown with flex */
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

/* Styles for the content container of your custom modal */
#details-modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 900px; /* Adjusted width */
    max-height: 90vh;
    display: flex; /* Ensure it's a flex container for its children */
    flex-direction: column; /* Stack children vertically */
}

/* --- Custom Modal Styles (for Agent Deletion) --- */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Hidden by default, shown by JS */
    justify-content: center;
    align-items: center;
    z-index: 1500; /* Lower z-index than main overlay if both could be open */
}

/* General styles for modal header, body, footer can be reused from your existing .modal-content children */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #e9ecef; padding-bottom: 15px; margin-bottom: 20px;
}
.modal-header h3 { margin: 0; font-size: 20px; font-weight: 600; color: #212529; }
/* Re-use modal-close-btn for custom modal */
.modal-close-btn {
    width: auto;
    background: none;
    padding: 0;
    margin: 0 0 0 15px;
    border: none;
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
}
.modal-close-btn:hover {
    color: #212529;
    background: none; 
}


/* Ensure the modal-body allows its children to fill space */
.modal-body {
    overflow-y: auto;
    /* If modal-details-grid is limiting width, ensure it allows full width */
    /* Remove if it causes other layout issues */
    width: 100%;
    box-sizing: border-box; /* Necessary for proper width calculation */
}

.modal-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-item { display: flex; flex-direction: column; }
.modal-details-grid strong { font-weight: 800; color: #495057; margin-bottom: 5px; }

/* If the problem is due to .modal-details-grid restricting it, add a specific rule: */
.modal-details-grid .framework-section {
    grid-column: 1 / -1; /* Make it span all columns if it's within a grid */
}


.detail-item p { margin: 0; color: #212529; }
.detail-item pre {
    white-space: pre-wrap; word-break: break-all; font-size: 14px;
    background-color: #282c34; color: #abb2bf;
    padding: 15px; border-radius: 8px; margin: 0;
}
.detail-item.detail-full-width { grid-column: 1 / -1; }

/* --- Framework Info in Modal --- */
/* If framework-section itself is too narrow, try this */
.framework-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    /* Ensure this section also takes full width */
    width: 100%;
    box-sizing: border-box;
}

.framework-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-top: 10px;
    /* Ensure it takes full available width */
    width: 100%; /* Make it explicitly 100% of its container */
    box-sizing: border-box; /* Include padding and border in the element's total width */
}
.framework-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
}
.framework-body {
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
}
.framework-body p {
    margin-bottom: 10px;
}
.framework-body p:last-child {
    margin-bottom: 0;
}

/* --- Manage Agents Page --- */
.agent-manager { max-width: 800px; }
.form-card { background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); margin-bottom: 30px; }
.filter-heading { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.filter-heading h3 { margin: 0; }
.coming-soon { font-size: 12px; color: #fff; background-color: #6c757d; padding: 2px 6px; border-radius: 4px; }
.subtitle { color: #6c757d; margin-top: 5px; margin-bottom: 15px; font-size: 14px; }
.checkbox-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 10px; 
    margin-bottom: 20px; 
}
.checkbox-item { display: flex; align-items: center; }
.checkbox-item input { width: auto; margin-right: 10px; }
.disclaimer { font-size: 12px; color: #6c757d; margin-top: 15px; font-style: italic; }
.agent-list-container { display: flex; flex-direction: column; gap: 15px; }
.agent-card { background-color: #fff; border-radius: 8px; padding: 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.agent-info { display: flex; flex-direction: column; }
.agent-name { font-weight: 500; font-size: 16px; }
.agent-id { font-size: 12px; color: #6c757d; margin-top: 4px; }
.agent-actions button, .agent-actions a.btn {
    width: auto;
    padding: 5px;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
}
.agent-actions .delete-btn { color: #dc7a82; }

/* Specific style for the Create Agent button */
.form-card .create-btn {
    background-color: #0d6efd;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin-top: 20px;
}

.form-card .create-btn:hover {
    background-color: #0b5ed7;
}

/* --- Documentation Page --- */
.docs-container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 900px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    line-height: 1.7;
}
.docs-section { margin-bottom: 40px; }
.docs-section h2 {
    font-size: 24px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #212529;
}
.docs-container p { margin-bottom: 1.5em; color: #495057; }
.docs-container code {
    font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace;
    background-color: #e9ecef;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #212529;
}
.docs-container pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    margin: 20px 0;
}


/* --- Other Component Styles --- */
.pagination { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; }
.page-link { color: #0d6efd; text-decoration: none; font-weight: 500; }
.page-info { color: #6c757d; }
.filter-card { background-color: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); margin-bottom: 30px; }
.filter-card form { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; }
.filter-btn { width: auto; align-self: flex-end; }


/* --- DataTables Custom Styling --- */
div.dataTables_wrapper div.row {
    padding: 10px;
}

/* Style for the "Show X entries" dropdown */
.dataTables_length label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dataTables_length select {
    width: auto !important;
    display: inline-block;
    padding: 4px 30px 4px 10px;
    border-radius: 8px;
    border: 1px solid #ced4da;
}

/* Style for the "Search" input */
.dataTables_filter label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.dataTables_filter input {
    display: inline-block;
    width: auto;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ced4da;
}

/* Style for the "Showing X to Y of Z entries" text */
.dataTables_info {
    padding-top: 8px !important; /* Align with pagination buttons */
    font-size: 14px;
    color: #6c757d;
}

/* Styling for pagination buttons */
.dataTables_paginate .paginate_button {
    margin-left: 2px;
    border-radius: 8px !important; /* Override default square corners */
    border: 1px solid transparent !important;
    transition: background-color 0.2s, color 0.2s;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
    background: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #0d6efd !important;
}

.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
    color: #6c757d !important;
    background: transparent !important;
    border-color: transparent !important;
}


/* --- Responsive Design --- */
@media (max-width: 1200px) { .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 992px) {
    .page-container { flex-direction: column; }
    .sidebar { display: none; }
    .top-header { padding: 0 20px; }
    .report-table { table-layout: auto; }
}
@media (max-width: 768px) {
    .main-content { padding: 20px; }
    .top-header { flex-direction: column; height: auto; align-items: flex-start; padding: 15px 20px; gap: 15px;}
    .header-right-controls { width: 100%; justify-content: space-between;}
    .filter-card form { flex-direction: column; align-items: stretch; }
    .dataTables_filter label, .dataTables_length label {
        justify-content: flex-start;
    }
}
.d-flex {
    display: flex !important;
}

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

.align-items-center {
    align-items: center !important;
}

.btn-sm {
    padding: .25rem .5rem;
    font-size: .875rem;
    border-radius: .2rem;
}

.btn-outline-secondary {
    /* color: #6c757d; */
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    /* color: #fff;
    background-color: transparent; */
    border-color: #6c757d;
}
.text-center {
    text-align: center !important;
}

.mt-5 {
    margin-top: 3rem !important;
}

.fa-3x {
    font-size: 3em;
}

.text-success {
    color: #198754 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}
.text-muted {
    color: #6c757d !important;
}

/* --- Alerts Page Styles (Corrected) --- */
.alert-card {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}
.alert-card.unread {
    background-color: #f0f6ff;
    border-left: 4px solid #0d6efd;
}
.alert-icon-container {
    font-size: 20px;
    margin-right: 20px;
    color: #6c757d;
}
.alert-card.unread .alert-icon-container {
    color: #0d6efd;
}
.alert-content {
    flex-grow: 1;
}
.alert-content p {
    margin: 0 0 5px 0;
    font-weight: 500;
}
.alert-timestamp {
    font-size: 14px;
    color: #6c757d;
    margin-left: 20px;
    white-space: nowrap;
}
.no-alerts-message {
    text-align: center;
    padding: 50px;
    background-color: #fff;
    border-radius: 12px;
}
.alert-card-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.severity-title {
    font-size: 22px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    padding-left: 15px;
    border-left: 4px solid #ccc; /* Default border */
}
.severity-title.severity-critical { border-left-color: #8B0000; }
.severity-title.severity-high { border-left-color: #dc3545; }
.severity-title.severity-medium { border-left-color: #fd7e14; }
.severity-title.severity-low { border-left-color: #ffc107; }
.severity-title.severity-informational { border-left-color: #0dcaf0; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef; /* Add a top border for separation */
    margin-top: 20px; /* Space from body */
}

/* Ensure these button styles exist or are similar in your styles.css */
.btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}
.btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}
.btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* For the exclamation icon */
.fa-exclamation-triangle {
    color: #ffc107; /* Or #dc3545 if you want a more severe red */
    font-size: 1.2em; /* Slightly larger icon */
}

/* Added margin to the right of the icon */
.me-2 {
    margin-right: 0.5rem !important; /* Adjust as needed */
}

/* You might want a stronger text-danger color */
.text-danger {
    color: #dc3545 !important;
}


.flash-error { background-color: #f8d7da; color: #721c24; }
.flash-success { color: #0f5132; background-color: #d1e7dd; }
.flash-warning { background-color: #fff3cd; color: #856404; }
.flash-info { background-color: #d1ecf1; color: #0c5460; }

/* Style for truncated text in tables */
.truncated-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Adjust as needed for your table layout */
    display: block;
}

/* Specific button styles for Custom Rules page */
.custom-rules-manager .btn {
    width: auto; /* Override general btn width if it's 100% */
}

/* For badges within tables, etc. */
.badge.bg-success {
    background-color: #198754 !important; /* Bootstrap success green */
}
.badge.bg-secondary {
    background-color: #6c757d !important; /* Bootstrap secondary grey */
}
/* Ensure the standard Bootstrap alert styles are also linked, if not already */
/* Ensure the standard Bootstrap alert styles are also linked, if not already */
/* Example for your flash messages: */
.alert.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}
.alert.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}
.alert.alert-error { /* If you are using this specifically */
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Styles for MITRE ATLAS section within modal */
/* --- Styles for MITRE ATLAS section within the panel --- */
.atlas-section {
    border-top: 1px dashed #e9ecef; /* Dashed line to visually separate */
    padding-top: 10px;
    margin-top: 15px;
}

.atlas-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.atlas-body {
    font-size: 0.9em;
    line-height: 1.4;
}

.atlas-body p {
    margin-bottom: 5px; /* Reduce margin for tight spacing */
}

.atlas-body a {
    color: #0d6efd; /* Link color */
    text-decoration: none;
}
.atlas-body a:hover {
    text-decoration: underline;
}

.atlas-icon {
    font-size: 1.1em;
    color: #495057;
}

/* For the custom rules list items in the modal */
.list-group-item-warning {
    color: #664d03; /* Dark yellow/orange text */
    background-color: #fff3cd; /* Light yellow/orange background */
    border-color: #ffecb5;
}




/* New/Adjusted styles for modal framework sections */
.framework-section h4 { /* Style for section titles like "OWASP LLM Top 10 Violations" */
    font-size: 1.15rem; /* Slightly smaller than h3, larger than default text */
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

/* Ensure the .atlas-section has proper spacing within the framework-card */
.framework-card .atlas-section {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #e9ecef;
    margin-left: 15px;;
}

/* Adjustments for truncated text in tables */
.truncated-cell-container {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px; /* Adjust this value as needed based on your column width */
    display: block;
}

/* And ensure the base badge styling is consistent */
.badge-critical { background-color: #8B0000; color: white !important; }
.badge-high { background-color: #dc3545; color: white !important; }
.badge-medium { background-color: #fd7e14; color: white !important; }
.badge-low { background-color: #ffc107; color: #212529 !important; }
.badge-informational { background-color: #0dcaf0; color: #212529 !important; }

/* --- Profile Page Styles --- */
.profile-page-content {
    /* Removed max-width */
    width: 100%; /* Make it full width */
    margin: 0; /* Remove auto margin to left align */
    box-sizing: border-box; /* Include padding in width calculation */
    text-align: left; /* Ensure content is left-aligned within the full width */
}

/* Make cards span full width */
.profile-page-content .card {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.api-key-section {
    margin-top: 20px;
}

.api-key-section .input-group {
    display: flex; /* Makes input and buttons align */
    width: 30%;
}

.api-key-section .form-control {
    flex-grow: 1; /* Allows the input to take available space */
    /* Removed individual border-radius settings as button rules handle it */
}

/* Custom styles for API key buttons within the input group */
.api-key-btn {
    background-color: #e9ecef; /* Light gray background */
    border: 1px solid #ced4da; /* Match input border */
    color: #495057; /* Default icon color */
    padding: 0.75rem 1rem; /* Adjust padding to match input height */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    display: flex; /* To center icon */
    align-items: center;
    justify-content: center;
    line-height: 1; /* Ensure icon doesn't affect height */
    z-index: 2; /* Keep buttons above input border */
    border-radius: 0; /* Remove default rounded corners from .btn, as specific rules will apply */
}

.api-key-btn:hover {
    background-color: #d8dee6; /* Slightly darker on hover */
    color: #0d6efd; /* Blue on hover */
    border-color: #ced4da; /* Keep border color */
}

/* Specific rounded corners for the buttons in the input group */
.api-key-section .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#toggle-api-key {
    border-radius: 0; /* No rounding */
    border-left: none; /* Merge with input */
    border-right: none; /* Merge with copy button */
}

#copy-api-key {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    /* Ensure the right radius is applied for the last button */
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}


.api-key-btn i {
    font-size: 1.1em; /* Slightly larger icons */
}

/* Remove default focus outline on buttons for a cleaner look */
.api-key-btn:focus {
    box-shadow: none;
    outline: none;
}
/* Ensure the form-text class for small text below the input is styled */
.form-text.text-muted {
    font-size: 0.875em;
    margin-top: 0.25rem;
    display: block;
}

/* Adjust general card body padding to accommodate full-width elements */
.card-body {
    padding: 20px;
}

/* Container for the <pre> tag and its copy button */
.payload-container {
    position: relative;
}

/* Style for the copy button */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
}

.payload-container:hover .copy-btn {
    opacity: 1; /* Show button on hover */
}

.copy-btn:hover {
    background-color: #d8dee6;
}

.copy-btn .fas {
    font-size: 14px;
}

/* --- ADD THESE NEW STYLES AT THE END OF THE FILE --- */

/* Styles for Multimodal Scan Results in Modal */
.multimodal-section {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

.multimodal-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
}

.multimodal-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    font-weight: 600;
    border-bottom: 1px solid #d8dee6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multimodal-body {
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.multimodal-body p {
    margin-bottom: 8px;
}

/* Style for scrollable text areas (for OCR/transcripts) */
.multimodal-text-box {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 10px;
    margin-top: 5px;
    max-height: 150px; /* Controls the height before scrolling */
    overflow-y: auto;   /* Adds a scrollbar when content exceeds max-height */
    white-space: pre-wrap; /* Preserves whitespace and wraps text */
    word-break: break-word;
    font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace;
    font-size: 0.85em;
    color: #212529;
}



/* In cs_web/static/css/styles.css */

/* --- ADD THESE NEW STYLES AT THE END OF THE FILE --- */

/* New Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 for main column, 1/3 for sidebar */
    grid-gap: 30px;
    align-items: stretch; /* <<< THIS IS THE FIX */
}


/* --- ADD THESE TWO NEW RULES AT THE END OF THE FILE --- */

.dashboard-sidebar-column {
    display: flex; /* Allows child elements to grow */
}

.dashboard-sidebar-column .chart-card {
    width: 100%; /* Ensure card takes full width */
    display: flex; /* Allows inner content to be arranged vertically */
    flex-direction: column;
}

.dashboard-main-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Tab Styles */
.dashboard-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}
.dashboard-tabs .nav-link {
    color: #495057;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
}
.dashboard-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 2px solid #0d6efd;
    background-color: transparent;
}

/* Recent Events Feed Styles */
.recent-events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.recent-events-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.recent-events-header a {
    font-size: 14px;
    text-decoration: none;
}

.recent-events-feed {
    max-height: 780px; /* Adjust height as needed */
    overflow-y: auto;
    flex-grow: 1; /* <<< ADD THIS LINE TO MAKE THE FEED FILL THE SPACE */
}

.event-item {
    display: flex;
    align-items: center;
    padding: 12px 5px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}
.event-item:hover {
    background-color: #f8f9fa;
}
.event-item:last-child {
    border-bottom: none;
}

.event-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    color: #fff;
}
.event-icon-container.severity-critical { background-color: #8B0000; }
.event-icon-container.severity-high { background-color: #dc3545; }
.event-icon-container.severity-medium { background-color: #fd7e14; }

.event-details {
    flex-grow: 1;
}
.event-details p {
    margin: 0;
    line-height: 1.3;
}
.event-title {
    font-weight: 500;
    color: #343a40;
    margin-bottom: 2px !important;
}
.event-meta {
    font-size: 13px;
    color: #6c757d;
}

.event-time {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    margin-left: 10px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
}

/* Add this to the end of your styles.css file */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 70vh; /* Adjust as needed */
}
.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}
.chat-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 80%;
}
.chat-message.agent {
    background-color: #e9ecef;
    align-self: flex-start;
}
.chat-message.user {
    background-color: #0d6efd;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}
.chat-message p { margin-bottom: 5px; }
.chat-message p:last-child { margin-bottom: 0; }

.chat-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

/* Style for generic header icons to make them consistent */
.header-icon-wrapper {
    position: relative;
    cursor: pointer;
    color: #495057;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out;
}

.header-icon-wrapper:hover {
    background-color: #f1f3f5;
    color: #343a40; /* Darken icon color on hover */
}

.header-icon-wrapper .fas {
    font-size: 18px; /* Slightly smaller than bell for balance */
}

/* Make alerts icon use the same base style */
.alerts-icon-wrapper {
    /* This can inherit from .header-icon-wrapper if you refactor, */
    /* but for now we'll just ensure it looks the same. */
    cursor: pointer;
    color: #495057;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out;
}

.alerts-icon-wrapper:hover {
    background-color: #f1f3f5;
    color: #343a40; /* Darken icon color on hover */
}

.alerts-icon-wrapper .fa-bell {
    font-size: 20px;
}
/* Chat Panel Slide-out */
.chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px; /* Adjust width as needed */
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.chat-panel.show {
    transform: translateX(0);
}

.chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.chat-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6c757d;
}

/* Chat Panel Overlay */
.chat-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 2999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.chat-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Re-using chat styles from previous step */
.chat-history { flex-grow: 1; overflow-y: auto; padding: 20px; }
.chat-message { margin-bottom: 15px; padding: 10px 15px; border-radius: 12px; max-width: 80%; word-wrap: break-word; }
.chat-message.agent { background-color: #e9ecef; align-self: flex-start; }
.chat-message.user { background-color: #0d6efd; color: white; align-self: flex-end; margin-left: auto; }
.chat-message p { margin-bottom: 5px; }
.chat-message p:last-child { margin-bottom: 0; }
.chat-input { display: flex; gap: 10px; padding: 15px; border-top: 1px solid #dee2e6; flex-shrink: 0; }
.chat-suggestions { padding: 10px 15px; border-top: 1px solid #e9ecef; display: flex; gap: 10px; flex-shrink: 0; }
.suggestion-btn { font-size: 12px; padding: 5px 10px; background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 20px; cursor: pointer; }
.suggestion-btn:hover { background-color: #e9ecef; }

textarea[readonly] {
    background-color: #e9ecef; /* Lighter background for non-editable fields */
    cursor: not-allowed; /* Indicate it's not editable */
    opacity: 0.8; /* Slightly faded look */
}

/* --- log_details_panel.css: Styles for the Log Details Slide-out Panel --- */

.log-details-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent background */
    z-index: 1999; /* Below panel, above main content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.log-details-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 800px; /* Wider panel as requested */
    height: 100%;
    background-color: #ffffff;
    box-shadow: -8px 0 20px rgba(0,0,0,0.15); /* Shadow to make it stand out */
    z-index: 2000; /* Above overlay */
    display: flex;
    flex-direction: column;
    transform: translateX(100%); /* Start off-screen to the right */
    transition: transform 0.3s ease-in-out;
    overflow-y: hidden; /* Hide overflow from body before scrolling panel-body */
}

/* State when the panel is active */
.log-details-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

.log-details-panel.show {
    transform: translateX(0); /* Slide into view */
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0; /* Prevent header from shrinking */
    background-color: #ffffff; /* Ensure header background is white */
}

.panel-header .panel-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.panel-header .panel-close-btn {
    background: none;
    border: none;
    font-size: 2rem; /* Larger 'x' icon */
    line-height: 1;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease-in-out;
}

.panel-header .panel-close-btn:hover {
    color: #212529;
}

.panel-body {
    flex-grow: 1; /* Allow body to take remaining space */
    overflow-y: auto; /* Enable scrolling for panel content */
    padding: 25px; /* Padding for the content inside the body */
    display: flex; /* Use flexbox to stack sections */
    flex-direction: column;
    gap: 25px; /* Space between main sections */
}

/* Styling for main sections within the panel body */
.panel-section {
    background-color: #ffffff; /* Default background */
    padding: 0; /* No padding on section itself, handled by inner elements or gap */
    border-radius: 8px; /* Slightly rounded corners for sections */
}

.panel-section h4 {
    font-size: 1.15rem; /* Section title size */
    font-weight: 600;
    color: #343a40;
    margin-bottom: 15px; /* Space below title */
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon and title */
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef; /* Separator under title */
    margin-top: 0; /* Remove default top margin for h4 */
}

/* Specific styling for the initial info grid */
.panel-section .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive grid for 2-column items */
    gap: 15px 20px; /* Row and column gap */
}

.panel-section .detail-item {
    display: flex;
    flex-direction: column;
}

.panel-section .detail-item strong {
    font-weight: 700;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.panel-section .detail-item p {
    margin: 0;
    color: #212529;
    font-size: 0.95rem;
    word-break: break-word; /* Ensure long text wraps */
}

/* Styles for embedded cards within sections (like multimodal or framework details) */
.multimodal-card, .framework-card {
    background-color: #f8f9fa; /* Light background for nested cards */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 10px; /* Space between nested cards if multiple */
    width: 100%; /* Ensure cards take full width */
    box-sizing: border-box;
    overflow: hidden; /* Ensure content stays within borders */
}
/* No need for margin-bottom on last-child if using gap on parent flex container */

.multimodal-header, .framework-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    font-weight: 600;
    border-bottom: 1px solid #d8dee6;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem; /* Smaller header for nested cards */
}
.multimodal-body, .framework-body {
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Specific lists within framework/remediation cards */
.framework-body ul {
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 0;
}
.framework-body li {
    margin-bottom: 5px;
}
.framework-body li:last-child {
    margin-bottom: 0;
}

/* Raw payload preformatted text styles */
.payload-container {
    position: relative;
    margin-top: 10px; /* Space above payload boxes */
}
.payload-container pre {
    background-color: #282c34; /* Dark background for code */
    color: #abb2bf; /* Light text for code */
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap; /* Preserve whitespace and wrap long lines */
    word-break: break-all; /* Break long words */
    font-family: 'Fira Code', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 250px; /* Limit height for payloads */
    overflow-y: auto; /* Scroll if content overflows */
}

/* Copy button for payloads */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255,255,255,0.15); /* Slightly transparent white on dark background */
    color: #abb2bf;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 10; /* Ensure it's above the text */
}
.copy-btn:hover {
    opacity: 1;
    background-color: rgba(255,255,255,0.25);
}
.copy-btn .fas {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .log-details-panel {
        max-width: 100%; /* Full width on smaller screens */
    }
    .panel-details-grid {
        grid-template-columns: 1fr; /* Stack primary details vertically on small screens */
    }
    .panel-section .info-grid {
        grid-template-columns: 1fr; /* Stack info items vertically on small screens */
    }
}



/* Specific styles for Select2 in the header area */
.top-header .agent-filter-container .select2-container {
    min-width: 150px; /* Give it a controlled minimum width */
    max-width: 180px; /* Prevent it from being too wide */
    width: auto !important; /* Override Select2's inline width if it sets it too wide */
    flex-shrink: 1; /* Allow it to shrink if space is tight on smaller screens */
    /* Ensure it has vertical alignment, important if parent is flex */
    vertical-align: middle;
}

.top-header .agent-filter-container .select2-selection--single {
    height: 40px !important; /* Ensure consistent height in header */
    min-height: 40px !important;
    padding: 6px 12px !important; /* Adjust padding for header context */
    font-size: 14px !important; /* Smaller font size for header */
    border-radius: 6px !important;
    box-shadow: none !important; /* Remove shadow if not desired in header */
    display: flex !important; /* Use flexbox to align content */
    align-items: center !important; /* Vertically center content */
}

.top-header .agent-filter-container .select2-selection--single .select2-selection__rendered {
    color: #212529 !important; /* Ensure text is visible */
    padding: 0 !important; /* Remove internal padding from rendered text */
    line-height: inherit !important; /* Inherit line-height from parent */
    height: 100% !important; /* Fill parent height */
    flex-grow: 1; /* Allow the text area to take available space */
    overflow: hidden !important; /* Hide overflow text */
    text-overflow: ellipsis !important; /* Add ellipsis for long text */
    white-space: nowrap !important; /* Keep text on a single line */
    display: flex !important; /* Use flex to ensure vertical centering of text */
    align-items: center !important;
}

.top-header .agent-filter-container .select2-selection__clear {
    font-size: 1rem !important; /* Adjust clear button size */
    margin-right: 5px !important; /* Spacing */
    line-height: 1 !important; /* Vertical align */
    color: #6c757d !important; /* Ensure clear button color */
}

.top-header .agent-filter-container .select2-selection__arrow {
    height: 100% !important; /* Ensure arrow container fills height */
    width: 20px !important; /* Consistent width for the arrow area */
    top: 0 !important; /* Align to top */
    right: 0 !important; /* Align to right */
    position: absolute !important; /* Ensure it's positioned absolutely relative to .select2-selection--single */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
/* Ensure the arrow icon itself is styled */
.top-header .agent-filter-container .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent !important; /* Arrow color */
    border-width: 5px 4px 0 4px !important; /* Size of the arrow icon */
}

/* Ensure the dropdown results list and its options match the header style */
.select2-container--bootstrap5 .select2-dropdown {
    font-size: 14px; /* Consistent font size */
    border-radius: 6px; /* Consistent border-radius */
}
.select2-container--bootstrap5 .select2-results__option {
    padding: 8px 12px; /* Adjust padding for options */
}


/* --- Collapsible Sidebar Styles --- */
.sidebar {
    transition: width 0.3s ease-in-out;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .sidebar-heading,
.sidebar.collapsed .copyright {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-toggle {
    margin-top: 15px;
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

.sidebar.collapsed .sidebar-toggle .nav-icon {
    transform: rotate(180deg);
}


/* Header hamburger menu for toggling when collapsed */
.header-menu-toggle {
    display: none; /* Hidden by default */
    cursor: pointer;
    font-size: 20px;
    color: #495057;
}

.sidebar.collapsed ~ .top-header .header-menu-toggle {
    display: block;
}


.card
{
    border: 0px;
}

.btn-light
{
    color: white;
    --bs-btn-hover-color: none;
}



/* REPLACE the existing .checkbox-grid rule */
.checkbox-grid {
    display: grid;
    /* Create 3 equal columns, with a minimum width of 220px before they wrap */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px 20px; /* Vertical and horizontal gap */
    margin-bottom: 20px;
}

/* REPLACE the existing .checkbox-item rule */
.checkbox-item {
    display: flex;
    align-items: center; /* Vertically align checkbox and label */
    gap: 8px; /* Space between checkbox and label */
}

/* Ensure form-check styles from Bootstrap are applied correctly */
.checkbox-item input[type="checkbox"] {
    width: 1.25em; /* Standard checkbox size */
    height: 1.25em;
    flex-shrink: 0; /* Prevent checkbox from shrinking */
}

.checkbox-item label {
    margin-bottom: 0; /* Remove default bottom margin from labels */
    font-weight: 500;
}

.select2-container .select2-search--inline .select2-search__field {
    height: 35px;
    padding-top: 5px;
}

.model-scanner-container .form-control[type="file"] {
    height:48px;
    padding: 0.5rem 0.75rem; /* Adjust padding for the new height */
    line-height: 1.5; /* Helps with vertical alignment */
}

/* --- Styles for Sidebar Headings --- */
.sidebar-heading {
    padding: 10px 15px 5px 15px; /* Top, Right, Bottom, Left */
    font-size: 0.75rem;
    font-weight: 600;
    color: #adb5bd; /* A light grey color */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 20px; /* Space above each heading */
}


/* --- Live Activity Feed --- */
.live-activity-feed {
    display: flex;
    flex-direction: column;
}
.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 8px;
}
.activity-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
    flex-shrink: 0;
    color: #fff;
}
.activity-icon .feather {
    width: 20px;
    height: 20px;
}
.activity-content {
    flex-grow: 1;
    min-width: 0; /* Prevents text overflow issues in flexbox */
}
.activity-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}
.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 1.5rem;
}
.nav-pills-sm .nav-link {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}