/* SecureVector Theme - Cyan to Red Gradient */
/* Light and Dark mode support */

:root {
    /* Gradient colors */
    --gradient-start: #5eadb8;
    --gradient-end: #c0655e;
    --gradient: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));

    /* Base colors - Dark mode default */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #161b22;
    --bg-hover: #1c2129;

    --text-primary: #e6edf3;
    --text-secondary: #b1bac4;
    --text-muted: #8b949e;

    --border-default: #30363d;
    --border-light: #3d444d;

    --accent-primary: #5eadb8;
    --accent-secondary: #c0655e;

    /* Status colors */
    --success: #10b981;
    --success-text: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --error: #ef4444;
    --info: #3b82f6;

    /* Severity colors */
    --severity-critical: #ef4444;
    --severity-high: #f97316;
    --severity-medium: #f59e0b;
    --severity-low: #60a5fa;

    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;

    /* Header */
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

    /* Warning / amber — theme-aware (dark mode: lighter for readability) */
    --warning-text: #fcd34d;
    --warning-text-muted: #fbbf24;
    --warning-chip-bg: rgba(245,158,11,0.15);
    --warning-chip-border: rgba(245,158,11,0.35);
}

/* Light mode */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eef1f5;
    --bg-card: #ffffff;
    --bg-hover: #eef1f5;

    --text-primary: #1f2328;
    --text-secondary: #424a53;
    --text-muted: #656d76;

    --border-default: #b8c0c8;
    --border-light: #c8ced6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Accent — light mode: darker for contrast on white */
    --accent-primary: #2b8a97;

    /* Success / green — light mode: darker for contrast on white */
    --success-text: #059669;

    /* Warning / amber — light mode: darker for contrast on white */
    --warning-text: #b45309;
    --warning-text-muted: #92400e;
    --warning-chip-bg: rgba(180,83,9,0.1);
    --warning-chip-border: rgba(180,83,9,0.25);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    position: relative;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
}

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

.sidebar-mascot {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.sidebar-mascot:hover {
    transform: scale(1.1);
}

/* Animate mascot eyes with subtle pulse */
@keyframes mascot-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.sidebar-mascot circle[fill="#00d4ff"],
.sidebar-mascot circle[fill="#ff3366"] {
    animation: mascot-pulse 3s ease-in-out infinite;
}

.sidebar-mascot circle[fill="#ff3366"] {
    animation-delay: 0.5s;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to right, #5eadb8, #c0908a, #5eadb8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .sidebar-logo {
    background: linear-gradient(to right, #5eadb8, #ef4444, #5eadb8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brand text column — stacks the wordmark and tagline vertically next
   to the favicon. Line-height tight so the two lines hug the header bar. */
.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    gap: 2px;
}

/* Tagline under the SecureVector wordmark. Theme-aware — uses
   --text-muted so it tracks whatever palette is active. Kept on a
   single line: nowrap + tightened tracking so it fits the header
   width under the wordmark without wrapping. */
.sidebar-tagline {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collapsed sidebar: hide tagline alongside the wordmark. */
.sidebar.collapsed .sidebar-tagline {
    display: none;
}

/* Cloud Toggle in Header */
.cloud-toggle-wrapper {
    margin-right: 8px;
}

.cloud-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cloud-toggle-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.cloud-toggle-btn svg {
    width: 15px;
    height: 15px;
}

.cloud-toggle-btn.gradient-btn {
    background: var(--gradient);
    border: none;
    padding: 6px 12px;
    color: #ffffff;
    font-weight: 600;
}

.cloud-toggle-btn.gradient-btn:hover {
    opacity: 0.9;
}


/* LLM Toggle in Header (Primary Feature) */
.llm-toggle-wrapper {
    margin-right: 8px;
}

.llm-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.llm-toggle-btn:hover {
    background: rgba(94, 173, 184, 0.1);
}

.llm-toggle-btn svg {
    width: 15px;
    height: 15px;
    color: var(--accent-primary);
}

.llm-toggle-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    animation: llm-flash 3s ease-in-out infinite;
}

@keyframes llm-flash {
    0%, 100% {
        border-color: var(--accent-primary);
    }
    50% {
        border-color: var(--danger);
    }
}

@keyframes submenu-flash {
    0%, 100% {
        color: var(--text-secondary);
    }
    50% {
        color: var(--accent-primary);
    }
}

.llm-toggle-btn.active svg {
    color: var(--accent-primary);
}

.llm-toggle-btn.active:hover {
    opacity: 0.9;
}

.llm-toggle-indicator {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    margin-left: 4px;
}

.llm-toggle-indicator.on {
    background: rgba(16, 185, 129, 0.8);
    color: #ffffff;
}

/* Output Scan Toggle - Smart Output Detection */
/* Block Mode Toggle */
.block-mode-toggle-wrapper {
    margin-right: 8px;
}

.block-mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.block-mode-toggle-btn:hover {
    border-color: var(--danger);
    color: var(--text-primary);
}

.block-mode-toggle-btn.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.block-mode-toggle-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Output Scan Toggle */
.output-scan-toggle-wrapper {
    margin-right: 8px;
}

.output-scan-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.output-scan-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.output-scan-toggle-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.output-scan-toggle-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.output-scan-toggle-btn.active svg {
    color: var(--success);
}

.output-scan-toggle-btn.active:hover {
    background: rgba(16, 185, 129, 0.25);
}

/* Mini Toggle Switch */
.mini-toggle {
    display: inline-block;
    width: 28px;
    height: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: 7px;
    position: relative;
    margin-left: 4px;
    transition: all var(--transition-fast);
}

.mini-toggle-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.mini-toggle.on {
    background: var(--success);
    border-color: var(--success);
}

.mini-toggle.on .mini-toggle-knob {
    left: 15px;
    background: #ffffff;
}

/* LLM Dropdown Menu */
.llm-toggle-wrapper {
    position: relative;
}

.llm-toggle-btn .dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
}

.llm-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.llm-dropdown-menu.active {
    display: block;
}

.llm-menu-row {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-default);
}

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

.llm-menu-row.toggle-row {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.llm-menu-row.info-row {
    font-size: 13px;
}

.llm-menu-label {
    color: var(--text-muted);
}

.llm-menu-value {
    font-weight: 500;
    color: var(--text-primary);
}

.llm-menu-row.config-row {
    justify-content: center;
    padding: 12px;
}

.toggle.small {
    transform: scale(0.8);
}

/* LLM Config Modal */
.llm-config-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.llm-config-section {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.llm-config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.llm-config-row.main-toggle {
    padding: 8px 0;
}

.llm-config-info {
    flex: 1;
}

.llm-config-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.llm-config-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.llm-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.llm-provider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.llm-provider-card {
    padding: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.llm-provider-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.llm-provider-card.selected {
    border-color: var(--accent-primary);
    background: rgba(94, 173, 184, 0.1);
}

.provider-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.provider-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.provider-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.llm-form-group {
    margin-bottom: 16px;
}

.llm-form-group:last-child {
    margin-bottom: 0;
}

.llm-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.llm-form-input,
.llm-form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.llm-form-input:focus,
.llm-form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.llm-config-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
}

.llm-test-status {
    font-size: 13px;
    font-weight: 500;
    margin-right: auto;
}

.llm-test-status.success {
    color: var(--success);
}

.llm-test-status.error {
    color: var(--danger);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cloud Connect Promo Banner */
.cloud-promo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(94, 173, 184, 0.08), rgba(244, 67, 54, 0.08));
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.cloud-promo-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.cloud-promo-icon svg {
    width: 100%;
    height: 100%;
}

.cloud-promo-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.cloud-promo-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.cloud-promo-text span {
    color: var(--text-secondary);
}

.cloud-promo-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.cloud-promo-btn:hover {
    opacity: 0.9;
}

/* Sidebar Collapse */
.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .theme-label,
.sidebar.collapsed .status-text {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0 8px;
}

.sidebar.collapsed .sidebar-logo-link {
    justify-content: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-theme-btn {
    justify-content: center;
}

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

.sidebar-header {
    display: flex;
    align-items: center;
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-collapse-btn {
    position: absolute;
    right: -12px;
    top: 72px;
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    z-index: 10;
}

.sidebar-collapse-btn svg {
    width: 14px;
    height: 14px;
}

.sidebar-collapse-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

/* Sidebar Bottom Section */
.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border-default);
}

.sidebar-theme-row {
    padding: 8px 12px;
}

.sidebar-theme-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-theme-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-theme-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.theme-label {
    font-size: 13px;
    font-weight: 500;
}

/* Sidebar Uninstall Button */
.sidebar-uninstall-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-uninstall-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.sidebar-uninstall-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-uninstall-btn span {
    display: none;
}

.sidebar.collapsed .sidebar-uninstall-btn {
    justify-content: center;
    padding: 10px;
}

/* Try SecureVector: icon-only when collapsed */
.sidebar.collapsed #try-sv-row {
    padding: 0 6px 8px 6px;
}
.sidebar.collapsed #try-sv-btn {
    justify-content: center;
    padding: 10px;
    gap: 0;
}
.sidebar.collapsed #try-sv-label {
    display: none;
}

/* Proxy banner: icon-only when collapsed */
.sidebar.collapsed #integration-proxy-banner {
    margin: 8px 6px;
    padding: 8px 4px;
}
.sidebar.collapsed #integration-banner-text,
.sidebar.collapsed #integration-banner-provider,
.sidebar.collapsed #integration-proxy-banner > div:last-child {
    display: none;
}
.sidebar.collapsed #integration-banner-icon {
    font-size: 22px;
}

/* Proxy banner: very light cyan border pulse */
@keyframes proxy-border-pulse {
    0%, 100% { border-color: rgba(94, 173, 184, 0.25); }
    50%       { border-color: rgba(94, 173, 184, 0.55); }
}
.proxy-banner-pulse {
    animation: proxy-border-pulse 3s ease-in-out infinite;
}

/* Attention pulse on the primary SIEM Forwarder add button. Box-shadow
   ring pulses briefly on first paint to draw the eye, then settles.
   Respects prefers-reduced-motion. */
@keyframes sv-siem-add-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(94,173,184,0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(94,173,184,0); }
    100% { box-shadow: 0 0 0 0 rgba(94,173,184,0); }
}
@media (prefers-reduced-motion: no-preference) {
    .sv-siem-add-pulse {
        animation: sv-siem-add-pulse 1.8s ease-out 0s 4;
    }
}

/* ── Try SecureVector trigger button ────────────────────────── */
.try-it-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 24px);
    margin: 8px 12px 4px;
    padding: 7px 12px;
    border: none;
    border-radius: 7px;
    background: linear-gradient(135deg, #5eadb8, #c0655e);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    letter-spacing: 0.2px;
}
.try-it-trigger-btn:hover { opacity: 0.88; }
.sidebar.collapsed .try-it-trigger-btn { display: none; }

/* ── Floating chat panel ─────────────────────────────────────── */
.tryit-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-height: 560px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(94,173,184,0.2);
    z-index: 9000;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
    overflow: hidden;
}
.tryit-chat-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.tryit-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 11px;
    background: linear-gradient(135deg, rgba(94,173,184,0.18) 0%, rgba(244,67,54,0.13) 100%);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.tryit-chat-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}
.tryit-chat-close:hover { color: var(--text-primary); }

.tryit-chat-feed {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.tryit-msg {
    max-width: 92%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.tryit-msg-system {
    align-self: center;
    text-align: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 12px;
    border-radius: 8px;
    padding: 8px 14px;
    max-width: 100%;
}

.tryit-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(94,173,184,0.2), rgba(244,67,54,0.15));
    color: var(--text-primary);
    border: 1px solid rgba(94,173,184,0.25);
}

.tryit-msg-thinking {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 12px;
    animation: tryit-pulse 1.2s ease-in-out infinite;
}

.tryit-msg-result {
    align-self: flex-start;
    border-radius: 10px;
    padding: 10px 13px;
    max-width: 96%;
}

.tryit-msg-result.safe {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
}

.tryit-msg-result.threat {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.3);
}

.tryit-result-badge {
    font-size: 12.5px;
    font-weight: 700;
}

.tryit-msg-result.safe .tryit-result-badge { color: #10b981; }
.tryit-msg-result.threat .tryit-result-badge { color: #ef4444; }

.tryit-result-score {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    flex-shrink: 0;
}

@keyframes tryit-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.tryit-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border-default);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.tryit-chat-input {
    flex: 1;
    min-height: 36px;
    max-height: 96px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.45;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
    overflow-y: auto;
}
.tryit-chat-input::placeholder { color: var(--text-muted); }
.tryit-chat-input:focus { border-color: var(--accent-primary); }

.tryit-chat-send {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #5eadb8, #c0655e);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tryit-chat-send:hover { opacity: 0.85; }

@media (max-width: 480px) {
    .tryit-chat-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 12px;
        max-height: 70vh;
    }
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 16px 12px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

@keyframes sv-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(249,115,22,0.7); }
    70%  { box-shadow: 0 0 0 5px rgba(249,115,22,0); }
    100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

.nav-section-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-muted);
    padding: 8px 16px 2px;
    opacity: 0.6;
}

.sidebar.collapsed .nav-section-label {
    display: none;
}

.nav-section-divider {
    height: 1px;
    background: var(--border-default);
    margin: 4px 12px;
    opacity: 0.5;
}

.nav-core-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-core-dot {
    display: none;
}

.nav-pulse-dot {
    position: absolute;
    top: 9px;
    left: 30px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f97316;
    pointer-events: none;
    animation: sv-pulse-ring 1.8s ease-in-out infinite;
    z-index: 1;
}

.sidebar.collapsed .nav-pulse-dot {
    top: 6px;
    left: auto;
    right: 6px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 16px;
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(94,173,184,0.18), rgba(244,63,94,0.18));
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 #5eadb8;
}

[data-theme="light"] .nav-item.active {
    background: linear-gradient(135deg, rgba(94,173,184,0.2), rgba(244,63,94,0.2));
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 #5eadb8;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    font-weight: 500;
}

.nav-badge {
    margin-left: auto;
    background: #5eadb8;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-badge {
    display: none;
}

/* Sidebar Logo Image */
.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

/* Try SecureVector Button in Sidebar */
.try-securevector-btn {
    margin: 12px;
    margin-top: auto;
    background: var(--gradient);
    color: #ffffff !important;
    border-radius: var(--radius-md);
}

.try-securevector-btn:hover {
    opacity: 0.9;
}

/* Sidebar Server Status */
.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.sidebar-status .status-dot.healthy {
    background: var(--success);
    animation: pulse-live 2s ease-in-out infinite;
}

.sidebar-status .status-dot.degraded {
    background: var(--warning);
}

.sidebar-status .status-dot.offline {
    background: var(--danger);
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

/* Floating Chat FAB (Floating Action Button) */
.floating-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: #ffffff;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    z-index: 1000;
}

.floating-chat-fab:hover {
    transform: scale(1.1);
}

.floating-chat-fab.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.floating-chat-fab svg {
    width: 24px;
    height: 24px;
}

/* Floating Chat Window */
.floating-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 400px;
    min-width: 280px;
    min-height: 300px;
    max-width: 500px;
    max-height: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    resize: both;
    overflow: hidden;
}

.floating-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gradient);
    color: #ffffff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.floating-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.floating-chat-logo {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
}

.floating-chat-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-right: 8px;
}

.floating-chat-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

.floating-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.floating-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.floating-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-primary);
}

.chat-message {
    padding: 8px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    line-height: 1.4;
    max-width: 90%;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--accent-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}

.chat-message.bot.loading {
    color: var(--text-muted);
    font-style: italic;
}

.chat-message.bot.safe {
    border-left: 3px solid var(--success);
}

.chat-message.bot.threat {
    border-left: 3px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.chat-message.bot.error {
    border-left: 3px solid var(--danger);
    color: var(--danger);
}

.chat-result {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-result-status {
    font-weight: 600;
    font-size: 12px;
}

.chat-message.safe .chat-result-status {
    color: var(--success);
}

.chat-message.threat .chat-result-status {
    color: var(--danger);
}

.chat-result-risk {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-block;
    width: fit-content;
}

.chat-result-risk.risk-low {
    background: rgba(96, 165, 250, 0.2);
    color: var(--severity-low);
}

.chat-result-risk.risk-medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--severity-medium);
}

.chat-result-risk.risk-high {
    background: rgba(249, 115, 22, 0.2);
    color: var(--severity-high);
}

.chat-result-risk.risk-critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--severity-critical);
}

.chat-result-type {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-result-source {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
    opacity: 0.8;
}

.chat-rules-note {
    font-size: 10px;
    color: var(--accent-primary);
    margin-top: 4px;
    opacity: 0.9;
}

/* Sample threat buttons */
.chat-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.chat-sample-btn {
    padding: 6px 10px;
    font-size: 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-sample-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.floating-chat-input {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-default);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.floating-chat-input input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.floating-chat-input input:focus {
    border-color: var(--accent-primary);
}

.floating-chat-input input::placeholder {
    color: var(--text-muted);
}

.floating-chat-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.floating-chat-send:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.floating-chat-send svg {
    width: 18px;
    height: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    height: var(--header-height);
    min-height: var(--header-height);
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.mobile-menu-btn {
    display: none;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(to right, #5eadb8, #c0908a, #5eadb8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .header-title {
    background: linear-gradient(to right, #5eadb8, #ef4444, #5eadb8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--danger);
}

/* Page Content */
.page-content {
    flex: 1;
    min-height: 0;
    padding: 24px;
    overflow: hidden auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--bg-primary);
}

.page-content::-webkit-scrollbar {
    display: none;
}

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--gradient-start), var(--gradient-end), var(--gradient-start));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.btn:hover {
    background: var(--bg-hover);
}

.btn-primary {
    background: rgba(94, 173, 184, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(94, 173, 184, 0.3);
}

.btn-primary:hover {
    background: rgba(94, 173, 184, 0.25);
    border-color: rgba(94, 173, 184, 0.5);
}

[data-theme="light"] .btn-primary {
    background: var(--gradient);
    color: #ffffff;
    border: none;
}

[data-theme="light"] .btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-secondary.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
}

.btn-secondary.active:hover {
    opacity: 0.88;
}

.data-table tbody tr.selected {
    background: rgba(var(--accent-primary-rgb, 99, 179, 237), 0.08);
}

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

.auto-refresh-btn.active:hover {
    background: var(--primary-dark);
}

.dashboard-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.card-gradient-border {
    position: relative;
    background: var(--bg-card);
    border: none;
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: var(--gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
    opacity: 0.6;
}

.stat-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Lists */
.list-container {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.list-title {
    font-size: 16px;
    font-weight: 600;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-default);
    transition: background var(--transition-fast);
}

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

.list-item:hover {
    background: var(--bg-hover);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--severity-critical);
}

.badge-high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--severity-high);
}

.badge-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--severity-medium);
}

.badge-low {
    background: rgba(96, 165, 250, 0.15);
    color: var(--severity-low);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--gradient);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: #ffffff;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.char-count {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

/* Page Title Bar */
.page-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Rule Limit Bar */
.rule-limit-bar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Cloud Upgrade */
.cloud-upgrade-content {
    text-align: center;
}

.upgrade-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    color: var(--accent-primary);
}

.upgrade-icon svg {
    width: 100%;
    height: 100%;
}

.upgrade-features {
    list-style: none;
    text-align: left;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 16px 0;
}

.upgrade-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.upgrade-features li::before {
    content: "\2713";
    color: var(--success);
    font-weight: bold;
}

/* Patterns Preview */
.patterns-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
}

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.generated-patterns-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.generated-pattern-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.generated-pattern-item .pattern-num {
    color: var(--text-muted);
    flex-shrink: 0;
}

.generated-pattern-item .pattern-code {
    flex: 1;
    word-break: break-all;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.generated-pattern-item .pattern-confidence {
    flex-shrink: 0;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-default);
}

/* Code Block */
.code-block {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.code-copy-btn:hover {
    opacity: 0.9;
}

.code-copy-btn.copied {
    background: var(--success);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1100;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

/* Settings Sections */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-default);
}

.settings-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-label {
    font-weight: 500;
}

.settings-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Filters */
.filters-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-input {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 150px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-muted);
    padding: 0 16px;
}

/* Agent Dropdown */
.agent-dropdown {
    position: relative;
}

.agent-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.agent-dropdown-btn:hover {
    border-color: var(--accent-primary);
}

.agent-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}

.agent-dropdown-menu.active {
    display: block;
}

.agent-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.agent-dropdown-item:hover {
    background: var(--bg-hover);
}

.agent-dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.agent-dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    max-width: 400px;
}

/* Page Titles */
.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* Header Right */
.header-left {
    display: flex;
    align-items: center;
}

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

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-tertiary);
}

.status-badge.healthy {
    color: var(--success);
}

.status-badge.degraded {
    color: var(--warning);
}

.status-badge.offline {
    color: var(--danger);
}

.status-badge.checking {
    color: var(--text-muted);
}

.status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.dashboard-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.dashboard-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Enhanced Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-primary .stat-icon { background: rgba(94, 173, 184, 0.15); color: var(--accent-primary); }
.stat-danger .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-success .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-warning .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-info .stat-icon { background: rgba(59, 130, 246, 0.15); color: var(--info); }

/* Highlighted Latency Card - Flashing Cyan Border */
.stat-latency {
    animation: cyan-glow 1.5s ease-in-out infinite;
}
.stat-latency .stat-icon {
    background: rgba(94, 173, 184, 0.15);
    color: #5eadb8;
}

@keyframes cyan-glow {
    0%, 100% {
        border-color: rgba(94, 173, 184, 0.3);
        box-shadow: 0 0 5px rgba(94, 173, 184, 0.2);
    }
    50% {
        border-color: rgba(94, 173, 184, 0.9);
        box-shadow: 0 0 15px rgba(94, 173, 184, 0.5), 0 0 25px rgba(94, 173, 184, 0.3);
    }
}

/* Donut Chart */
.risk-donut-chart {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
}

.donut-container {
    flex-shrink: 0;
}

.donut-svg {
    width: 120px;
    height: 120px;
}

.donut-segment {
    transition: opacity 0.2s;
}

.donut-segment:hover {
    opacity: 0.8;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-label {
    color: var(--text-secondary);
    flex: 1;
}

.legend-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Horizontal Bar Chart */
.horizontal-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar {
    height: 8px;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.bar-0 { background: var(--accent-primary); opacity: 0.75; }
.bar-1 { background: var(--warning); opacity: 0.75; }
.bar-2 { background: var(--success); opacity: 0.75; }
.bar-3 { background: var(--info); opacity: 0.75; }

.bar-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Activity Table */
.activity-table {
    display: flex;
    flex-direction: column;
}

.activity-header,
.activity-row {
    display: grid;
    grid-template-columns: 2fr 1fr 80px 80px;
    gap: 12px;
    padding: 10px 12px;
    align-items: center;
}

.activity-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-default);
    background: var(--bg-secondary);
}

.activity-row {
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.activity-row:hover {
    background: var(--bg-hover);
}

.activity-cell {
    font-size: 13px;
}

.content-cell {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-cell {
    color: var(--text-muted);
    font-size: 12px;
}

.type-badge-small {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.empty-state-inline {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-subtext {
    font-size: 12px;
    margin-top: 4px;
}

/* Card Component */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.card-gradient {
    position: relative;
}

.card-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Stat Card */
.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-trend {
    font-size: 12px;
    margin-top: 8px;
}

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

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

.stat-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.3;
}

.stat-icon svg {
    width: 32px;
    height: 32px;
}

/* Threat List */
.threat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.threat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.threat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.threat-name {
    font-weight: 500;
    font-size: 14px;
}

.threat-type {
    font-size: 12px;
    color: var(--text-muted);
}

/* Risk Badge */
.risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.risk-badge.risk-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--severity-critical);
}

.risk-badge.risk-high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--severity-high);
}

.risk-badge.risk-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--severity-medium);
}

.risk-badge.risk-low {
    background: rgba(96, 165, 250, 0.15);
    color: var(--severity-low);
}

/* Action badges for threats table */
.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
}

.action-badge.action-blocked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.action-badge.action-redacted {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.action-badge.action-logged {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    padding: 4px 8px;
    min-width: unset;
}

/* Type List */
.type-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.type-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.type-label {
    font-size: 14px;
    text-transform: capitalize;
}

.type-count {
    font-weight: 600;
    color: var(--accent-primary);
}

/* Threat Type Chart */
.threat-type-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-label {
    width: 120px;
    min-width: 120px;
    font-size: 13px;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar {
    height: 100%;
    background: var(--gradient);
    border-radius: var(--radius-sm);
    min-width: 4px;
    transition: width 0.3s ease;
}

.chart-count {
    position: absolute;
    right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Indicator Cell */
.indicator-cell {
    max-width: 300px;
}

.indicator-cell .indicator {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Guardian Owl Mascot */
.guardian-owl-container {
    padding: 16px;
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.guardian-owl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: owlFloat 3s ease-in-out infinite;
}

.owl-svg {
    width: 80px;
    height: 90px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.owl-head {
    transform-origin: 40px 30px;
    animation: owlWatch 5s ease-in-out infinite;
}

/* Red glowing eyes */
.owl-eye {
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.9)) drop-shadow(0 0 12px rgba(239, 68, 68, 0.5));
    animation: eyeGlow 2s ease-in-out infinite;
}

.owl-pupil {
    animation: pupilMove 5s ease-in-out infinite;
}

/* Wing flapping animation */
.owl-wing {
    transform-origin: center;
}

.owl-wing-left {
    animation: wingFlapLeft 0.4s ease-in-out infinite;
}

.owl-wing-right {
    animation: wingFlapRight 0.4s ease-in-out infinite;
}

@keyframes wingFlapLeft {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(-15deg) translateY(-3px); }
}

@keyframes wingFlapRight {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(15deg) translateY(-3px); }
}

/* Floating/flying effect */
@keyframes owlFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Head watching motion */
@keyframes owlWatch {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-25deg); }
    40% { transform: rotate(0deg); }
    60% { transform: rotate(25deg); }
    80% { transform: rotate(0deg); }
}

/* Red eye glow pulse */
@keyframes eyeGlow {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.9)) drop-shadow(0 0 12px rgba(239, 68, 68, 0.5));
    }
    50% {
        opacity: 0.85;
        filter: drop-shadow(0 0 10px rgba(239, 68, 68, 1)) drop-shadow(0 0 20px rgba(239, 68, 68, 0.7));
    }
}

@keyframes pupilMove {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-1.5px); }
    60% { transform: translateX(1.5px); }
}

.owl-status {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* Side Drawer */
.side-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.side-drawer-overlay.open {
    opacity: 1;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-default);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.side-drawer.open {
    right: 0;
}

@keyframes drawerShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.side-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-tertiary);
}

.side-drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.side-drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.side-drawer-close:hover {
    color: var(--text-primary);
}

.side-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Threat Detail Styles */
.threat-detail-risk {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.threat-detail-section {
    margin-bottom: 20px;
}

.detail-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.threat-detail-text {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.detail-label {
    color: var(--text-muted);
    font-size: 13px;
}

.detail-value {
    font-weight: 500;
    font-size: 13px;
}

.matched-rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.matched-rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.matched-rule-name {
    font-size: 13px;
    font-weight: 500;
}

.matched-rule-cat {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

/* LLM Review Section in Threat Details */
.llm-review-section {
    background: linear-gradient(135deg, rgba(94, 173, 184, 0.05), rgba(244, 67, 54, 0.05));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.llm-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.llm-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
}

.llm-model-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.llm-verdict-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.llm-verdict-label {
    font-size: 13px;
    color: var(--text-muted);
}

.llm-verdict-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.llm-verdict-badge.agrees {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.llm-verdict-badge.disagrees {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.llm-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-default);
}

.llm-stat-row:last-of-type {
    border-bottom: none;
}

.llm-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.llm-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.llm-stat-value.risk-up {
    color: var(--danger);
}

.llm-stat-value.risk-down {
    color: var(--success);
}

/* LLM Badge in table */
.llm-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.tokens-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 5px;
    font-size: 9px;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 3px;
    vertical-align: middle;
}

/* LLM Expandable Section */
.llm-toggle {
    display: flex;
    align-items: center;
    user-select: none;
}

.llm-toggle:hover {
    opacity: 0.8;
}

.llm-expand-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.llm-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.llm-content.expanded {
    max-height: 1000px;
    opacity: 1;
}

.llm-save-row {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: flex-end;
}

.llm-save-btn {
    padding: 8px 20px;
}

.llm-reasoning-box {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
}

.llm-reasoning-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.llm-reasoning-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* LLM Recommendation Box */
.llm-recommendation-box {
    margin-top: 16px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.llm-recommendation-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.llm-recommendation-label::before {
    content: "\2713";
    font-size: 10px;
    background: var(--primary);
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.llm-recommendation-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 500;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    font-size: 32px;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 16px;
}

.error-state p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.error-details {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-spacer {
    flex: 1;
}

.filters-bar .btn {
    height: 38px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-select {
    padding: 8px 32px 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ------------------------------------------------------------------ */
/* DataTable — shared table component                                  */
/* ------------------------------------------------------------------ */

.table-wrapper,
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

/* Header — visually distinct from body */
.data-table thead th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Body rows */
.data-table tbody td {
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

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

.data-table tbody tr:hover td {
    background: var(--bg-hover);
}

.data-table .indicator {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

/* Sortable header (used by makeTableSortable and DataTable component) */
.data-table th.sortable,
.data-table th.sv-table-th-sort {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
    transition: color 0.15s, background 0.15s;
}
.data-table th.sortable:hover,
.data-table th.sv-table-th-sort:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.data-table th.sortable::after {
    /* CSS unicode escapes use `\<hex>`, not the JS-style `\u<hex>`. */
    /* `\2195 ` = ↕ (UP DOWN ARROW). Trailing space terminates the escape. */
    content: '\2195 ';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 10px;
}
.data-table th.sort-asc::after {
    content: '\2191 ';  /* ↑ UPWARDS ARROW */
    opacity: 1;
    color: var(--accent-primary);
}
.data-table th.sort-desc::after {
    content: '\2193 ';  /* ↓ DOWNWARDS ARROW */
    opacity: 1;
    color: var(--accent-primary);
}

/* DataTable component sort arrows (inline span) */
.sv-sort-arrow {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.35;
}
.sv-sort-arrow.active {
    opacity: 1;
    color: var(--accent-primary);
}

/* ---- Selection: Linear/Notion-style overlay checkbox ---- */

/* Custom checkbox base */
.sv-selectable input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-light);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    vertical-align: middle;
    flex-shrink: 0;
}
.sv-selectable input[type="checkbox"]:hover {
    border-color: var(--accent-primary);
}
.sv-selectable input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
.sv-selectable input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: -1px;
    left: 2px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.sv-selectable input[type="checkbox"]:indeterminate {
    border-color: var(--accent-primary);
}
.sv-selectable input[type="checkbox"]:indeterminate::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 3px;
    width: 8px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

/* First header cell: checkbox + label side by side */
.sv-th-first { padding-left: 12px !important; }
.sv-th-first-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sv-th-first-inner .sv-select-all {
    opacity: 0;
    transition: opacity 0.15s;
}
.sv-selectable thead:hover .sv-select-all,
.sv-select-all:checked,
.sv-select-all:indeterminate {
    opacity: 1;
}
.sv-th-label { white-space: nowrap; }

/* First body cell: checkbox overlays content on hover */
.sv-td-first { padding-left: 12px !important; }
.sv-td-first-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.sv-row-cb-wrap {
    width: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.sv-row-cb-wrap .sv-row-cb {
    opacity: 0;
    transition: opacity 0.15s;
}
.data-table tbody tr:hover .sv-row-cb,
.sv-row-cb:checked {
    opacity: 1;
}
.sv-td-first-content {
    min-width: 0;
    flex: 1;
}

/* Selected row highlight */
.data-table tbody tr.sv-row-selected td {
    background: rgba(94, 173, 184, 0.06);
}
.data-table tbody tr.sv-row-selected:hover td {
    background: rgba(94, 173, 184, 0.1);
}

/* ---- Floating selection bar ---- */
.sv-selection-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    animation: sv-bar-in 0.15s ease;
}
@keyframes sv-bar-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sv-selection-count {
    font-weight: 600;
    color: var(--accent-primary);
    margin-right: 4px;
}
.sv-selection-clear {
    margin-left: auto;
    color: var(--text-secondary) !important;
    border: none !important;
    background: none !important;
    font-size: 12px;
}
.sv-selection-clear:hover { color: var(--text-primary) !important; }

/* ---- Row hover action icons ---- */
.sv-row-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
    background: linear-gradient(90deg, transparent, var(--bg-card) 20%);
    padding-left: 24px;
}
.data-table tbody tr:hover .sv-row-actions {
    opacity: 1;
    pointer-events: auto;
}
.sv-row-action-btn {
    appearance: none;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}
.sv-row-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sv-row-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

/* DataTable pagination */
.sv-table-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.sv-table-page-info {
    font-size: 12px;
    color: var(--text-secondary);
}

/* DataTable empty state */
.sv-table-empty {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 24px 16px;
    text-align: center;
}

/* Disabled row */
.data-table tbody tr.disabled-row td {
    opacity: 0.5;
}

.type-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 12px;
    text-transform: capitalize;
}

.type-badge.output-scan {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2), rgba(255, 152, 0, 0.2));
    border: 1px solid var(--warning);
    color: var(--warning);
}

.output-scan-label {
    display: inline-flex;
    padding: 2px 6px;
    background: var(--warning);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-badge {
    display: inline-flex;
    padding: 3px 8px;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

/* Small Button */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Page Info */
.page-info {
    font-size: 14px;
    color: var(--text-muted);
    padding: 0 16px;
}

/* Threat Details */
.threat-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-default);
}

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

.detail-label {
    color: var(--text-muted);
    font-size: 13px;
}

.detail-value {
    font-weight: 500;
}

.detail-description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
}

.detail-description strong {
    display: block;
    margin-bottom: 8px;
}

.detail-description p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Rules Page */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.rules-stats {
    font-size: 14px;
    color: var(--text-muted);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.rule-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-fast);
}

.rule-card.disabled {
    opacity: 0.6;
}

.rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rule-name {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.rule-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.rule-meta {
    display: flex;
    gap: 8px;
}

.rule-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

.rule-badge.category {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.rule-badge.severity-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--severity-critical);
}

.rule-badge.severity-high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--severity-high);
}

.rule-badge.severity-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--severity-medium);
}

.rule-badge.severity-low {
    background: rgba(96, 165, 250, 0.15);
    color: var(--severity-low);
}

/* Settings Page */
.settings-section {
    margin-bottom: 24px;
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.section-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-default);
}

.setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-label {
    font-weight: 500;
}

.setting-description {
    font-size: 13px;
    color: var(--text-muted);
}

/* Theme Buttons */
.theme-buttons {
    display: flex;
    gap: 8px;
}

/* Agent Select */
.agent-select {
    min-width: 200px;
}

/* Agent Instructions */
.agent-instructions {
    margin-top: 16px;
}

.agent-info {
    margin-bottom: 16px;
}

.agent-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.agent-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.instructions-block {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
}

.instructions-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.instructions-block code {
    display: block;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Cloud Connect Guide */
.cloud-connect-guide {
    color: var(--text-primary);
}

.cloud-highlight-banner {
    background: linear-gradient(135deg, rgba(94, 173, 184, 0.15), rgba(244, 67, 54, 0.15));
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.cloud-highlight-banner strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.cloud-highlight-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.cloud-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cloud-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.step-text {
    flex: 1;
}

.step-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Rules Table Styles */
.rules-table .rule-name-cell {
    max-width: 400px;
}

.rules-table .rule-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rules-table .rule-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.rules-table .patterns-cell {
    min-width: 100px;
}

.pattern-count {
    color: var(--accent-primary);
    font-size: 13px;
}

.disabled-row {
    opacity: 0.6;
}

.disabled-row td {
    color: var(--text-muted);
}

/* Expand Button */
.expand-cell {
    text-align: center;
    width: 40px;
}

.expand-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.expand-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* Status Label */
.status-cell {
    min-width: 100px;
}

.status-label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.status-label.enabled {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-label.disabled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-label:hover {
    transform: scale(1.02);
}

/* Light mode status labels */
[data-theme="light"] .status-label.enabled {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

[data-theme="light"] .status-label.disabled {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Patterns Expandable Row */
.patterns-row {
    background: var(--bg-secondary);
}

.patterns-expand-cell {
    padding: 16px 24px !important;
    border-left: 3px solid var(--accent-primary);
}

.patterns-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.pattern-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pattern-num {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 24px;
    padding-top: 6px;
}

.pattern-code {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    word-break: break-all;
    color: var(--accent-primary);
}

/* Confirmation Dialog */
.confirm-content {
    text-align: center;
}

.confirm-content p {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.confirm-warning {
    color: var(--warning) !important;
    font-size: 13px;
    margin-top: 16px !important;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row:hover {
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.05));
}

.clickable-row:active {
    background-color: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
}

/* Checkbox styling */
.checkbox-cell {
    width: 40px;
    text-align: center;
}

.threat-checkbox,
.threat-select-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary, #5eadb8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s, transform 0.1s;
}

tr:hover .threat-checkbox,
thead tr:hover .threat-select-all,
#threats-data-table.has-selection .threat-checkbox,
#threats-data-table.has-selection .threat-select-all {
    opacity: 1;
    pointer-events: auto;
}

.threat-checkbox:hover,
.threat-select-all:hover {
    transform: scale(1.1);
}

/* Custom audit checkboxes */
.audit-row-cb,
#audit-select-all {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border-strong, #475569);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: opacity 0.12s, border-color 0.15s, background 0.15s;
    vertical-align: middle;
    opacity: 0;
    pointer-events: none;
}

tr:hover .audit-row-cb,
thead tr:hover #audit-select-all,
#audit-activity-table.has-selection .audit-row-cb,
#audit-activity-table.has-selection #audit-select-all {
    opacity: 1;
    pointer-events: auto;
}

.audit-row-cb:hover,
#audit-select-all:hover {
    border-color: #5eadb8;
}

.audit-row-cb:checked,
#audit-select-all:checked {
    background: #5eadb8;
    border-color: #5eadb8;
}

.audit-row-cb:checked::after,
#audit-select-all:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 1px;
    width: 5px;
    height: 8px;
    border: 1.5px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

#audit-select-all:indeterminate {
    background: rgba(94,173,184,0.2);
    border-color: #5eadb8;
}

#audit-select-all:indeterminate::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 5px;
    width: 8px;
    height: 1.5px;
    background: #5eadb8;
}

/* Custom rules checkboxes */
.rule-row-cb,
.rule-select-all {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary, #5eadb8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}

tr:hover .rule-row-cb,
thead tr:hover .rule-select-all,
#custom-rules-table.has-selection .rule-row-cb,
#custom-rules-table.has-selection .rule-select-all {
    opacity: 1;
    pointer-events: auto;
}

/* Cost records checkboxes */
.record-checkbox,
#records-select-all {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary, #5eadb8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}

tr:hover .record-checkbox,
thead tr:hover #records-select-all,
#costs-records-table.has-selection .record-checkbox,
#costs-records-table.has-selection #records-select-all {
    opacity: 1;
    pointer-events: auto;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* Toast Enhancements */
.toast.active {
    animation: slideIn 0.3s ease forwards;
}

.toast.dismissing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Modal Size Variants */
.modal-small {
    max-width: 400px;
}

.modal-medium {
    max-width: 600px;
}

.modal-large {
    max-width: 800px;
}

/* Agent Dropdown in Header */
.agent-dropdown-wrapper {
    position: relative;
}

.agent-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.agent-dropdown-btn:hover {
    background: var(--bg-hover);
}

.agent-dropdown-btn svg {
    width: 18px;
    height: 18px;
}

.agent-dropdown-btn .dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
}

/* Flashing cyan border animation */
.flashing-border {
    animation: flash-border 1.5s ease-in-out infinite;
}

@keyframes flash-border {
    0%, 100% {
        border-color: var(--accent-primary);
        box-shadow: 0 0 5px var(--accent-primary);
    }
    50% {
        border-color: var(--gradient-end);
        box-shadow: 0 0 15px var(--accent-primary), 0 0 5px var(--gradient-end);
    }
}

.agent-dropdown-wrapper .agent-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.agent-dropdown-wrapper .agent-dropdown-menu.active {
    display: block;
}

.agent-dropdown-wrapper .agent-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.agent-dropdown-wrapper .agent-dropdown-item:hover {
    background: var(--bg-hover);
}

.agent-dropdown-wrapper .agent-dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.agent-dropdown-wrapper .agent-dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Test Analyze Section */
.test-analyze-section {
    margin-top: 24px;
}

.test-analyze-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-analyze-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.test-analyze-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.test-analyze-actions {
    display: flex;
    gap: 12px;
}

.test-result {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-primary);
}

.test-result.threat {
    border-left-color: var(--danger);
}

.test-result.safe {
    border-left-color: var(--success);
}

.test-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.test-result-title {
    font-weight: 600;
    font-size: 16px;
}

.test-result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.test-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.test-result-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.test-result-value {
    font-weight: 500;
}

/* Create Rule Suggestion */
.create-rule-suggestion {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent-secondary);
}

/* LLM Settings */
.llm-select,
.llm-input {
    max-width: 300px;
    min-width: 200px;
}

.llm-test-result {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: var(--radius-md);
}

.llm-test-result.testing {
    color: var(--text-muted);
}

.llm-test-result.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.llm-test-result.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* LLM Review Info in Analysis Result */
.llm-review-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
}

.llm-review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.llm-review-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.llm-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(94, 173, 184, 0.15);
    color: var(--accent-primary);
}

.llm-review-reasoning {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: var(--radius-md);
    line-height: 1.5;
}

/* Empty State Enhancement */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    max-width: 400px;
    margin-bottom: 16px;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Tool permissions: max 3 cols on tablet */
    .tool-permissions-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 56px;
    }

    /* Hamburger menu button */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-md);
        cursor: pointer;
        margin-right: 12px;
    }

    .mobile-menu-btn svg {
        width: 20px;
        height: 20px;
        stroke: var(--text-primary);
    }

    .mobile-menu-btn {
        flex-direction: column;
        gap: 4px;
    }

    .hamburger-line {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 1px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* Mobile overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mobile-overlay.active {
        display: block;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    /* Sidebar mobile */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        left: 0;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content full width */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Header adjustments */
    .header {
        padding: 0 12px;
    }

    .header-title {
        font-size: 16px;
    }

    .header-actions {
        gap: 8px;
    }

    /* Hide some header elements on mobile */
    .cloud-toggle-btn span {
        display: none;
    }

    .cloud-toggle-btn {
        padding: 8px;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    /* Dashboard grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Rules grid */
    .rules-grid {
        grid-template-columns: 1fr;
    }

    /* Filters bar */
    .filters-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .filter-spacer {
        display: none;
    }

    /* Table responsive */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Actions cell */
    .actions-cell {
        flex-direction: column;
        gap: 4px;
    }

    .action-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Cards */
    .card {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Tool permissions: single column on mobile */
    .tool-permissions-grid {
        grid-template-columns: 1fr !important;
    }

    /* Tool card enforcement row wraps on small screens */
    #tool-permissions-enforcement-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Side drawer full screen on mobile */
    .side-drawer {
        width: 100% !important;
        max-width: 100% !important;
    }

    .side-drawer-header {
        padding: 16px;
    }

    .side-drawer-content {
        padding: 16px;
    }

    /* Settings page */
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .setting-section {
        padding: 16px;
    }

    /* Welcome popup mobile */
    .welcome-popup {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }

    .welcome-content {
        padding: 20px;
    }

    .welcome-steps {
        gap: 16px;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    /* Proxy page */
    .proxy-stats {
        flex-direction: column;
        gap: 12px;
    }

    .proxy-stat {
        width: 100%;
    }

    /* LLM section */
    .llm-review-section {
        padding: 12px;
    }

    .llm-stat-row {
        flex-direction: column;
        gap: 4px;
    }

    /* Agent dropdown */
    .agent-dropdown-btn span:not(.dropdown-arrow) {
        display: none;
    }

    .agent-dropdown-btn {
        padding: 8px 12px;
    }

    /* Threat details */
    .threat-details {
        padding: 12px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Empty state */
    .empty-state {
        padding: 32px 16px;
    }

    .empty-state-icon svg {
        width: 48px;
        height: 48px;
    }
}

/* Responsive - Small phones */
@media (max-width: 480px) {
    .header-title {
        font-size: 14px;
    }

    .sidebar-logo {
        font-size: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .indicator {
        max-width: 120px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}


/* Uninstall Section */
.uninstall-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.uninstall-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.uninstall-tabs {
    display: flex;
    gap: 8px;
}

.uninstall-tab {
    padding: 8px 16px;
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.uninstall-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.uninstall-tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.uninstall-code {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* Uninstall Modal Styles */
.uninstall-modal {
    max-width: 560px;
}

.uninstall-modal .uninstall-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-default);
}

.uninstall-modal .uninstall-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.uninstall-modal h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.uninstall-modal p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.uninstall-modal p.muted {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

.uninstall-modal ol {
    margin: 12px 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.uninstall-modal ol li {
    margin-bottom: 6px;
    font-size: 13px;
}

.uninstall-modal code {
    display: block;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: var(--accent-primary);
    margin: 8px 0;
}

.uninstall-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--danger);
    font-size: 13px;
    margin-top: 16px;
}

/* ==================== Costs / Tab UI ==================== */

.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color);
    border-radius: 0;
    padding: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
    background: transparent;
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
    background: transparent;
}

@keyframes tab-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

.tab-btn-unseen {
    position: relative;
}

.tab-btn-unseen::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    pointer-events: none;
    animation: tab-dot-pulse 1.2s ease-in-out 3;
}

/* Badge variants used in costs page */
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Alert banners */
.alert {
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* Inline help/note text */
.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Pagination row */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-sm {
    font-size: 12px;
    padding: 4px 10px;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Compact toolbar buttons
 *
 * The default .btn is padded for page-level primary actions (Save, Cancel
 * at the bottom of a form). That padding reads as bulky inside toolbars
 * where 3–4 small utility actions (Auto Refresh / Export CSV / Export PDF)
 * sit next to each other. `.btn-compact` dials them down to toolbar scale:
 * smaller padding, slightly smaller type, tight letter-spacing. Theming
 * stays — the variant composes with .btn-secondary / .btn-primary.
 * ───────────────────────────────────────────────────────────────────── */
.btn.btn-compact {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
    border-radius: var(--radius-sm, 6px);
    gap: 6px;
}
.btn.btn-compact:active {
    transform: translateY(1px);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Audit-chain integrity banner
 *
 * Three states (ok | fail | unknown) driven by class names on
 * `.sv-integrity-banner`. All colors come from theme-aware CSS variables
 * so the banner renders correctly in BOTH light and dark modes — the
 * previous hard-coded white background was unreadable in dark theme.
 * The banner is positioned above the 7-day chart. The Re-verify action
 * lives in its own `.sv-integrity-actions` slot right below the banner.
 * ───────────────────────────────────────────────────────────────────── */
.sv-integrity-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 12px 0;
    padding: 14px 44px 14px 18px; /* right padding leaves room for close */
    border-radius: 10px;
    border: 1px solid var(--border-default);
    border-left: 6px solid var(--text-muted);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-height: 56px;
}
.sv-integrity-banner .sv-integrity-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.sv-integrity-banner .sv-integrity-text {
    flex: 1;
    line-height: 1.45;
}
.sv-integrity-banner .sv-integrity-meta {
    color: var(--text-secondary);
    opacity: 0.85;
}
.sv-integrity-banner .sv-integrity-device {
    font-family: monospace;
    font-size: 12.5px;
}
.sv-integrity-banner .sv-integrity-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}
.sv-integrity-banner .sv-integrity-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* OK state — verified chain. Green accent that works in both themes. */
.sv-integrity-banner.ok {
    border-color: rgba(16, 185, 129, 0.35);
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-primary);
}
.sv-integrity-banner.ok .sv-integrity-icon { color: #10b981; }
[data-theme="light"] .sv-integrity-banner.ok {
    background: #ecfdf5;
    color: #065f46;
}

/* FAIL state — tampered chain. Red, loud. */
.sv-integrity-banner.fail {
    border-color: rgba(239, 68, 68, 0.4);
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: var(--text-primary);
}
.sv-integrity-banner.fail .sv-integrity-icon { color: #ef4444; }
[data-theme="light"] .sv-integrity-banner.fail {
    background: #fef2f2;
    color: #991b1b;
}

/* Unknown state — endpoint didn't respond. Neutral. */
.sv-integrity-banner.unknown,
.sv-integrity-banner.loading {
    border-left-color: var(--text-muted);
    background: var(--bg-card);
    color: var(--text-secondary);
}

/* Re-verify lives in its own slot so the banner stays clean +
   dismissible. Right-aligned to mirror table action toolbars. */
.sv-integrity-actions {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 18px 0;
}
.sv-integrity-actions .sv-integrity-reverify {
    color: var(--text-secondary);
}
