/* ============================================
   MIRAGE TENANT - Consolidated Theme CSS
   ============================================
   Sources:
   1. tenant/styles.blade.php         - Main tenant theme
   2. surface/_surface-styles.blade.php - Surface module styles
   3. shared/wysiwyg.blade.php        - WYSIWYG editor + rich content
   4. shared/dark-mode.blade.php      - Global dark mode
   5. Auth pages (login/register)     - Auth page styles
   ============================================ */

/* ============================================
   CSS Variables (:root)
   ============================================ */

:root {
    /* Primary Colors */
    --primary: #092738;
    --primary-dark: #061a26;
    --primary-light: #0d3a52;
    --primary-subtle: rgba(9, 39, 56, 0.1);

    /* Accent Colors */
    --accent: #06b6d4;
    --accent-dark: #0891b2;

    /* Status Colors */
    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-subtle: rgba(59, 130, 246, 0.1);

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Bootstrap overrides */
    --bs-primary: #092738;
    --bs-primary-rgb: 9, 39, 56;
    --theme-primary: #092738;
    --theme-primary-rgb: 9, 39, 56;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info: #3b82f6;
    --bs-info-rgb: 59, 130, 246;

    /* Severity colours */
    --severity-critical: purple;
    --severity-high: #e33244;
    --severity-medium: #fcc633;
    --severity-low: #5cb85c;
    --severity-info: #126da7;

    /* Surface brand */
    --surface-brand: #359C8F;
    --surface-brand-rgb: 53, 156, 143;
}

/* ============================================
   Base & Typography
   ============================================ */

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    height: 100%;
    overflow: hidden;
    color: var(--gray-700);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ============================================
   Main Layout
   ============================================ */

main {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.min-h-0 { min-height: 0; }

/* ============================================
   Navbar
   ============================================ */

.navbar {
    height: var(--header-height);
    min-height: var(--header-height);
    max-height: var(--header-height);
    padding: 0;
    background: #092738 !important;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.navbar-logo {
    width: var(--sidebar-width);
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-right: 1px solid var(--gray-200);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.sidebar .nav-title {
    padding: 16px 16px 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.sidebar .nav-header {
    padding: 20px 16px 8px 16px;
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-400);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.sidebar ul.nav {
    padding: 0 8px;
}

.sidebar ul.nav li .nav-link {
    padding: 10px 12px;
    margin: 2px 0;
    color: var(--gray-600);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.sidebar ul.nav li .nav-link i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0.7;
}

.sidebar ul.nav li .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(9, 39, 56, 0.4);
    border-right: none;
}

.sidebar ul.nav li .nav-link.active i {
    opacity: 1;
}

/* Submenu styles */
.sidebar ul.nav li .nav-link .fa-chevron-down {
    transition: transform 0.2s ease;
}

.sidebar ul.nav li .nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar ul.nav .collapse ul.nav {
    border-left: 2px solid var(--gray-200);
    margin-left: 20px;
    padding-left: 0;
}

.sidebar ul.nav .collapse ul.nav .nav-link {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    margin: 1px 0;
}

.sidebar ul.nav .collapse ul.nav .nav-link i {
    margin-right: 8px;
    width: 14px;
    font-size: 12px;
}

.sidebar ul.nav .collapse ul.nav .nav-link.active {
    background: var(--primary-subtle);
    color: var(--primary);
    box-shadow: none;
    font-weight: 600;
}

.sidebar-logout {
    border-top: 1px solid var(--gray-200);
}

.sidebar-logout a {
    color: var(--gray-400);
    font-size: 18px;
}

.sidebar-logout a:hover {
    color: var(--danger);
}

/* Tenant Switcher */
#btn-chng-tnt {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#btn-chng-tnt a {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

#btn-chng-tnt a img {
    height: 28px;
    width: 28px;
    border-radius: var(--radius-sm);
    margin-right: 10px;
}

/* ============================================
   Header / Breadcrumb
   ============================================ */

.header {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li + li::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 8px;
    padding-right: 10px;
    color: var(--gray-300);
}

.breadcrumb li a {
    color: var(--gray-500);
    font-weight: 500;
}

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

.breadcrumb li i {
    margin-right: 6px;
    font-size: 12px;
}

.breadcrumb li.active a,
.breadcrumb li.active {
    color: var(--gray-700);
}

/* ============================================
   Cards
   ============================================ */

.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: white;
    overflow: visible;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    color: var(--gray-800);
}

.card-header h5, .card-header h6 {
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
    overflow: visible;
}

.card-body.p-0 {
    padding: 0;
    overflow: visible;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(135deg, transparent 0%, rgba(9, 39, 56, 0.03) 100%);
    transform: rotate(-15deg);
}

.card .card-body.text-center h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.card .card-body.text-center small {
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* ============================================
   Tables
   ============================================ */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    color: var(--gray-700);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

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

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

.table-hover tbody tr:hover {
    background: linear-gradient(90deg, var(--primary-subtle) 0%, transparent 100%);
}

.table tbody tr[onclick],
#vulnTable tbody tr {
    cursor: pointer;
}

.table-striped > tbody > tr:nth-child(odd) {
    background-color: var(--gray-50);
}

.table-striped > tbody > tr:nth-child(odd):hover {
    background: linear-gradient(90deg, var(--primary-subtle) 0%, var(--gray-50) 100%);
}

/* Fix dropdown overflow in responsive tables */
.table-responsive {
    overflow: visible;
}

@media (max-width: 991.98px) {
    .table-responsive {
        overflow-x: auto;
    }

    .table-responsive .dropdown-menu {
        position: fixed !important;
    }
}

/* ============================================
   Badges
   ============================================ */

.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 5px 10px;
    letter-spacing: 0.3px;
} 

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

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

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

.badge.bg-warning {
    background: var(--warning) !important;
    color: white !important;
}

.badge.bg-info {
    background: var(--info) !important;
}

.badge.bg-secondary {
    background: var(--gray-500)  !important;
}

.badge.bg-light {
    background: var(--gray-100) !important;
    color: var(--gray-600) !important;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: 13px;
    transition: all 0.2s ease;
    border: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

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

.btn-primary {
    background: var(--primary);
    box-shadow: 0 4px 14px rgba(9, 39, 56, 0.4);
    color: white !important;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 6px 20px rgba(9, 39, 56, 0.5);
    transform: translateY(-1px);
    color: white !important;
}

.btn-success {
    background: var(--success);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    color: white !important;
}

.btn-success:hover {
    color: white !important;
}

.btn-danger {
    background: var(--danger);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    color: white !important;
}

.btn-danger:hover {
    background: #dc2626;
    color: white !important;
}

.btn-warning {
    background: var(--warning);
    color: white !important;
}

.btn-info {
    background: var(--info);
    color: white !important;
}

.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(9, 39, 56, 0.4);
}

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

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

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

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

.btn-outline-success {
    border: 1.5px solid var(--success);
    color: var(--success);
    background: transparent;
}

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

.btn-group .btn {
    box-shadow: none;
}

.btn-check:checked+.btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check)+.btn:active {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   Forms
   ============================================ */

.form-control {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

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

.form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 13px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

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

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

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--danger-subtle);
}

.invalid-feedback {
    color: var(--danger);
    font-size: 12px;
}

/* ============================================
   Checkboxes & Radio Buttons
   ============================================ */

.form-check {
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.1rem;
    margin-left: -1.75rem;
    border: 2px solid var(--gray-300);
    background-color: white;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:hover {
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
    outline: none;
}

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

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 80%;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input:checked[type="radio"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-check-input:disabled ~ .form-check-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-check-label {
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
    padding-left: 0.25rem;
}

/* Switch style */
.form-switch {
    padding-left: 3rem;
}

.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.35rem;
    margin-left: -3rem;
    border-radius: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23adb5bd'/%3e%3c/svg%3e");
    background-position: left center;
    background-size: contain;
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23092738'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Inline checkboxes/radios */
.form-check-inline {
    display: inline-flex;
    align-items: center;
    padding-left: 0;
    margin-right: 1rem;
}

.form-check-inline .form-check-input {
    position: relative;
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Card-style checkbox/radio (for selection cards) */
.form-check-card {
    position: relative;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-card:hover {
    border-color: var(--primary);
    background-color: var(--gray-50);
}

.form-check-card .form-check-input {
    position: absolute;
    top: 1rem;
    right: 1rem;
    margin: 0;
}

.form-check-card .form-check-input:checked ~ .form-check-label {
    color: var(--primary);
}

.form-check-card:has(.form-check-input:checked) {
    border-color: var(--primary);
    background-color: var(--primary-subtle);
}

.form-check-card .form-check-label {
    padding-left: 0;
    padding-right: 2rem;
    width: 100%;
}

/* Success/Danger variants */
.form-check-success .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.form-check-danger .form-check-input:checked {
    background-color: var(--danger);
    border-color: var(--danger);
}

.form-check-warning .form-check-input:checked {
    background-color: var(--warning);
    border-color: var(--warning);
}

/* ============================================
   Plan Feature Lists
   ============================================ */

.plan-feature {
    display: flex;
    align-items: flex-start;
}

.plan-feature i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================
   Nav Pills
   ============================================ */

.nav-pills .nav-link {
    color: var(--gray-600);
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(9, 39, 56, 0.3);
}

.nav-pills .nav-link.active:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-weight: 500;
}

.alert-success {
    background: var(--success-subtle);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: var(--danger-subtle);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-subtle);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: var(--info-subtle);
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* ============================================
   List Groups
   ============================================ */

.list-group {
    border-radius: var(--radius-md);
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 14px 18px;
    transition: background-color 0.15s ease;
}

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

.list-group-item-action:hover {
    background: var(--gray-50);
}

.list-group-flush .list-group-item {
    border-radius: 0;
}

/* ============================================
   Progress Bars
   ============================================ */

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

.progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* ============================================
   Dropdowns
   ============================================ */

.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    z-index: 1050;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--gray-700);
    transition: background-color 0.15s ease;
}

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

.dropdown-item.active,
.dropdown-item:active {
    background: var(--primary);
    color: white;
}

/* ============================================
   Modals
   ============================================ */

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

.modal-header {
    border-bottom: 1px solid var(--gray-100);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--gray-100);
    padding: 16px 24px;
}

/* ============================================
   Custom Components
   ============================================ */

/* Activity Items */
.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Status Indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px var(--success-subtle); }
.status-dot.offline { background: var(--gray-400); }
.status-dot.busy { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-subtle); }
.status-dot.away { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-subtle); }

/* Empty States */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--gray-500);
}

.empty-state > i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--gray-300);
}

/* Severity Colors */
.severity-critical { color: #dc2626; }
.severity-high { color: #ea580c; }
.severity-medium { color: #ca8a04; }
.severity-low { color: #2563eb; }
.severity-info { color: var(--gray-500); }

.bg-critical { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important; }
.bg-high { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important; }
.bg-medium { background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%) !important; }
.bg-low { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important; }

/* Code/Monospace */
code {
    background: var(--gray-100);
    color: var(--danger);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.font-monospace {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 12px;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
}

/* Border utilities */
.b-b { border-bottom: 1px solid var(--gray-200); }
.b-t { border-top: 1px solid var(--gray-200); }
.b-l { border-left: 1px solid var(--gray-200); }
.b-r { border-right: 1px solid var(--gray-200); }
.b-light { border-color: var(--gray-200); }

/* Background utilities */
.bg-dk { background-color: var(--gray-50); }
.bg-dker { background-color: var(--gray-100); }

/* Icon muted */
.icon-muted { color: var(--gray-400); }
a.icon-muted:hover { color: var(--gray-600); }

/* Orange variant */
.bg-orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important; }
.text-orange { color: #ea580c; }

/* Severity badge classes */
.badge-severity-critical { background-color: var(--severity-critical) !important; color: #fff; }
.badge-severity-high { background-color: var(--severity-high) !important; color: #fff; }
.badge-severity-medium { background-color: var(--severity-medium) !important; color: #fff; }
.badge-severity-low { background-color: var(--severity-low) !important; color: #fff; }
.badge-severity-info { background-color: var(--severity-info) !important; color: #fff; }
.text-severity-critical { color: var(--severity-critical) !important; }
.text-severity-high { color: var(--severity-high) !important; }
.text-severity-medium { color: var(--severity-medium) !important; }
.text-severity-low { color: var(--severity-low) !important; }
.text-severity-info { color: var(--severity-info) !important; }
.border-severity-critical { border-color: var(--severity-critical) !important; }
.border-severity-high { border-color: var(--severity-high) !important; }
.border-severity-medium { border-color: var(--severity-medium) !important; }
.border-severity-low { border-color: var(--severity-low) !important; }
.border-severity-info { border-color: var(--severity-info) !important; }

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 992px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .navbar-logo {
        width: 220px;
        height: var(--header-height);
        min-height: var(--header-height);
    }

    .navbar {
        height: var(--header-height);
        min-height: var(--header-height);
        max-height: var(--header-height);
    }
}

/* ============================================
   Mobile / Tablet Breakpoint
   ============================================ */

/* Hidden by default - shown via media query */
.mobile-menu-toggle {
    display: none;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.sidebar-backdrop.show {
    display: block;
}

@media (max-width: 767.98px) {
    html, body {
        overflow: auto;
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
    }

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

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-left: 12px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: var(--radius-md);
        color: white;
        font-size: 18px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }

    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .navbar-logo {
        width: auto;
        min-width: 0;
        padding: 0 12px;
        background: transparent;
    }

    .header .breadcrumb {
        font-size: 12px;
        flex-wrap: wrap;
    }

    main > .p-4 {
        padding: 1rem !important;
    }

    /* Stack page headers: title above, buttons below */
    .p-4 > .d-flex.justify-content-between.align-items-center:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    /* Keep action buttons compact and wrapping */
    .p-4 > .d-flex.justify-content-between.align-items-center:first-child > .d-flex {
        flex-wrap: wrap;
        gap: 6px;
    }

    .p-4 > .d-flex.justify-content-between.align-items-center:first-child > .d-flex > .btn,
    .p-4 > .d-flex.justify-content-between.align-items-center:first-child > .d-flex > a.btn {
        font-size: 12px;
        padding: 6px 10px;
        white-space: nowrap;
    }

    /* Stat cards: 2 per row */
    .row > [class*="col-md-3"],
    .row > [class*="col-lg-3"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Tables: smaller font, ensure horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 12px;
    }

    .table thead th {
        font-size: 10px;
        padding: 10px 8px;
    }

    .table tbody td {
        padding: 10px 8px;
    }

    /* Navbar right-side items: reduce spacing */
    .navbar .d-flex.ms-auto {
        gap: 6px;
    }

    .navbar .d-flex.ms-auto .me-4 {
        margin-right: 0.75rem !important;
    }

    /* Card body padding reduction */
    .card-body {
        padding: 14px;
    }

    .card-header {
        padding: 12px 14px;
    }
}

/* ============================================
   Small Phone Breakpoint
   ============================================ */

@media (max-width: 479.98px) {
    /* Stat cards: full width */
    .row > [class*="col-md-3"],
    .row > [class*="col-lg-3"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    main > .p-4 {
        padding: 0.75rem !important;
    }

    /* Modal dialogs: nearly full width */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Breadcrumb: hide middle items */
    .breadcrumb li:not(:first-child):not(:last-child) {
        display: none;
    }

    .card-body {
        padding: 12px;
    }

    .card-header {
        padding: 10px 12px;
    }

    /* Further reduce table cell padding */
    .table thead th {
        padding: 8px 6px;
    }

    .table tbody td {
        padding: 8px 6px;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* ============================================
   Pagination Styling
   ============================================ */

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-link {
    color: var(--primary);
}

.page-link:hover {
    color: var(--primary-dark);
}

/* ============================================
   Sortable Table Headers
   ============================================ */

.table th a.text-decoration-none {
    transition: color 0.15s ease;
}

.table th a.text-decoration-none:hover {
    color: var(--primary) !important;
}

.table th a.text-decoration-none:hover i.fa-sort {
    opacity: 1 !important;
    color: var(--primary) !important;
}

.table th i.fa-sort,
.table th i.fa-sort-up,
.table th i.fa-sort-down {
    font-size: 11px;
}

/* ============================================
   Dashboard - Security Gauge & Metrics
   ============================================ */

.security-gauge-container,
.risk-gauge-container {
    position: relative;
    width: 280px;
    height: 160px;
    margin: 0 auto;
}

.security-gauge-bg,
.risk-gauge-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 20;
}

.security-gauge-fill,
.risk-gauge-fill {
    fill: none;
    stroke-width: 20;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.security-score,
.risk-score {
    font-size: 4rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
}

.status-label,
.risk-label {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
}

.status-card,
.risk-card {
    transition: all 0.3s ease;
}

.metric-card,
.threat-metric {
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.metric-card:hover,
.threat-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.metric-card .metric-value,
.threat-metric .metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.metric-card .metric-label,
.threat-metric .metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.severity-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: #e9ecef;
}

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

.severity-critical { background: linear-gradient(90deg, #dc3545, #ff6b6b); }
.severity-high { background: linear-gradient(90deg, #fd7e14, #ffb347); }
.severity-medium { background: linear-gradient(90deg, #ffc107, #ffdf5d); }
.severity-low { background: linear-gradient(90deg, #6c757d, #adb5bd); }

.assessment-item {
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
}

.assessment-item:hover {
    background-color: rgba(9, 39, 56, 0.05);
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(160px); opacity: 0; }
}

.critical-pulse {
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   Organisation Selector
   ============================================ */

.org-option {
    cursor: pointer;
    transition: all 0.2s ease;
}

.org-option:hover {
    background-color: #f8f9fa;
}

.org-option.selected {
    background-color: #e8f4fd;
    border-color: #0d6efd;
}

.org-option.selected .org-check {
    display: block !important;
}

.org-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

/* ============================================
   Scanner Styles
   ============================================ */

.scan-type-card {
    transition: all 0.3s ease;
}

.scan-type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
}

.scan-type-icon-wrap {
    transition: all 0.3s ease;
}

.scan-type-card:hover .scan-type-icon-wrap {
    min-width: 110px !important;
}

/* ============================================
   Threat Intelligence Styles
   ============================================ */

.actor-item {
    border-left: 3px solid #dc3545;
    transition: all 0.2s ease;
}

.actor-item:hover {
    background-color: rgba(220,53,69,0.05);
}

.news-item {
    border-left: 3px solid transparent;
    padding-left: 12px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.news-item:hover {
    border-left-color: #0d6efd;
    background-color: rgba(13,110,253,0.05);
}

.news-item.news-critical { border-left-color: #dc3545; }
.news-item.news-warning { border-left-color: #fd7e14; }

/* ============================================
   Messages / Chat Styles
   ============================================ */

.messages-container {
    background: #f8f9fa;
}

.conversations-sidebar {
    background: white;
    border-right: 1px solid var(--gray-200);
}

.conversation-item {
    transition: background-color 0.15s;
}

.conversation-item:hover {
    background-color: #f8f9fa;
}

.conversation-item.active {
    background-color: var(--primary-subtle);
    border-left: 3px solid var(--primary);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 8px;
}

.message-bubble.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    background: white;
    color: var(--gray-800);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message-content {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
}

.message-own {
    background-color: var(--bs-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-own .message-header small {
    color: rgba(255,255,255,0.8) !important;
}

.message-other {
    background-color: white;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.message-body {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.badge-sm {
    font-size: 0.65rem;
    padding: 0.2em 0.5em;
}

/* ============================================
   Planner / Calendar Styles
   ============================================ */

.calendar-table {
    table-layout: fixed;
    width: 100%;
}

.calendar-table th,
.calendar-table td {
    width: 14.2857%;
    overflow: hidden;
}

.calendar-table th {
    text-align: center;
    font-weight: 600;
    padding: 10px;
}

.calendar-table td {
    height: 100px;
    vertical-align: top;
    padding: 4px;
    transition: background-color 0.2s;
}

.calendar-table td:hover {
    background-color: rgba(23, 123, 187, 0.05) !important;
}

.calendar-table td.today {
    background-color: rgba(13, 110, 253, 0.1);
}

.calendar-table td.other-month {
    background-color: var(--gray-50);
    color: var(--gray-400);
}

.calendar-day .badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Purple color variant */
.bg-purple {
    background-color: #9b59b6 !important;
}

.text-purple {
    color: #9b59b6 !important;
}

.bg-purple.bg-opacity-10 {
    background-color: rgba(155, 89, 182, 0.1) !important;
}

.calendar-event {
    font-size: 11px;
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event:hover {
    opacity: 0.9;
}

/* ============================================
   Assessment Wizard Styles
   ============================================ */

.wizard-step {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.wizard-step.active {
    background: var(--primary-subtle);
}

.wizard-step.completed {
    color: var(--success);
}

.wizard-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    margin-right: 10px;
    border: 2px solid currentColor;
}

.wizard-step.active .wizard-step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.wizard-step.completed .wizard-step-number {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* ============================================
   Report Styles
   ============================================ */

.report-section {
    page-break-inside: avoid;
}

.finding-card {
    border-left: 4px solid;
    margin-bottom: 16px;
}

.finding-card.severity-critical { border-left-color: #dc3545; }
.finding-card.severity-high { border-left-color: #fd7e14; }
.finding-card.severity-medium { border-left-color: #ffc107; }
.finding-card.severity-low { border-left-color: #6c757d; }
.finding-card.severity-informational { border-left-color: #17a2b8; }

/* ============================================
   User / Profile Styles
   ============================================ */

.user-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 28px;
}

/* ============================================
   Assets Page Styles
   ============================================ */

.asset-card {
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
}

.asset-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(9, 39, 56, 0.1);
}

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

/* ============================================
   File Vault Styles
   ============================================ */

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease;
}

.file-item:hover {
    background-color: var(--gray-50);
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.folder-icon { background: #fef3c7; color: #d97706; }
.pdf-icon { background: #fee2e2; color: #dc2626; }
.doc-icon { background: #dbeafe; color: #2563eb; }
.image-icon { background: #d1fae5; color: #059669; }
.default-icon { background: var(--gray-100); color: var(--gray-500); }


/* ============================================
   SURFACE MODULE STYLES
   ============================================ */

.btn-surface { background-color: var(--surface-brand); border-color: var(--surface-brand); color: #fff; }
.btn-surface:hover { background-color: #2d8578; border-color: #2d8578; color: #fff; }
.btn-outline-surface { color: var(--surface-brand); border-color: var(--surface-brand); }
.btn-outline-surface:hover { background-color: var(--surface-brand); border-color: var(--surface-brand); color: #fff; }
.text-surface { color: var(--surface-brand) !important; }
.bg-surface-subtle { background-color: rgba(var(--surface-brand-rgb), 0.1) !important; }
.border-surface { border-color: var(--surface-brand) !important; }

.surface-stat-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.04);
}
.surface-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.surface-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.surface-stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.surface-stat-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #6c757d; }

.surface-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}
.surface-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}
.surface-table tbody tr {
    transition: background-color 0.15s;
}
.surface-table tbody tr:hover {
    background-color: rgba(var(--surface-brand-rgb), 0.03);
}

.surface-header {
    background: linear-gradient(135deg, rgba(var(--surface-brand-rgb), 0.05) 0%, transparent 100%);
    border: 1px solid rgba(var(--surface-brand-rgb), 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}
.surface-header-name {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 1.4rem;
    font-weight: 700;
}

.surface-info-card {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04);
}
.surface-info-card .card-header {
    border-bottom: 1px solid #f1f3f5;
    padding: 0.875rem 1.25rem;
}
.surface-info-card .card-header h6 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}

.surface-info-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.25rem;
}
.surface-info-value { margin-bottom: 1rem; }

.surface-mono {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.surface-sort-link {
    text-decoration: none;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}
.surface-sort-link:hover { color: var(--surface-brand); }
.surface-sort-link.active-sort { color: var(--surface-brand); }

.surface-filter-bar {
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.surface-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 6px;
}
.surface-count-pill.has-items { background: rgba(var(--surface-brand-rgb), 0.1); color: var(--surface-brand); }
.surface-count-pill.danger { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.surface-count-pill.warning { background: rgba(255, 193, 7, 0.15); color: #997404; }
.surface-count-pill.empty { background: #f8f9fa; color: #adb5bd; }

.surface-monitor-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.surface-monitor-dot.active { background: #198754; box-shadow: 0 0 6px rgba(25, 135, 84, 0.4); }
.surface-monitor-dot.inactive { background: #6c757d; }

.surface-threat-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.surface-threat-indicator.critical { background: #dc3545; animation: surfaceBlink 1s infinite; }
.surface-threat-indicator.high { background: #fd7e14; }
.surface-threat-indicator.medium { background: #ffc107; }
.surface-threat-indicator.low { background: #6c757d; }
.surface-threat-indicator.info { background: #0dcaf0; }
@keyframes surfaceBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.surface-section-card .list-group-item {
    padding: 0.75rem 1.25rem;
    border-color: #f1f3f5;
    transition: background-color 0.15s;
}
.surface-section-card .list-group-item:hover {
    background-color: rgba(var(--surface-brand-rgb), 0.03);
}

.surface-empty-state {
    padding: 3rem 1rem;
    text-align: center;
}
.surface-empty-state .surface-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.surface-risk-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    gap: 2px;
}
.surface-risk-bar .segment {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.surface-dns-provider {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.surface-monitor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}


/* ============================================
   WYSIWYG EDITOR & RICH CONTENT STYLES
   ============================================ */

/* Editor Frame Styles */
.note-editor.note-frame {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}
.note-editor.note-frame .note-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.5rem;
}
.note-editor.note-frame .note-editing-area {
    background-color: #fff;
}
.note-editor.note-frame .note-editing-area .note-editable {
    padding: 1rem;
    min-height: 150px;
}
.note-editor.note-frame .note-statusbar {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}
.note-btn {
    border: 1px solid #dee2e6 !important;
    background-color: #fff !important;
    border-radius: 4px !important;
    padding: 0.25rem 0.5rem !important;
}
.note-btn:hover {
    background-color: #e9ecef !important;
}
.note-btn.active {
    background-color: #0d6efd !important;
    color: #fff !important;
}
.note-dropdown-menu {
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Custom button styles */
.note-btn[data-name="codeblock"] {
    font-family: monospace;
}
.note-btn[data-name="note"] {
    color: #dc3545 !important;
}

/* Content Styles - Apply to both editor and rendered content */
.note-editable, .rich-content {
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Headings */
.note-editable h3, .rich-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 1.25rem 0 0.75rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid #0d6efd;
}
.note-editable h4, .rich-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #343a40;
    margin: 1rem 0 0.5rem 0;
}
.note-editable h5, .rich-content h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0.875rem 0 0.5rem 0;
}
.note-editable h6, .rich-content h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.75rem 0 0.5rem 0;
}

/* Inline Code */
.note-editable code, .rich-content code {
    background-color: #f1f3f5;
    color: #d63384;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
}

/* Code Blocks */
.note-editable pre, .rich-content pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 4px solid #0d6efd;
}
.note-editable pre code, .rich-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Red Notes / Warnings */
.note-editable .note-warning, .rich-content .note-warning,
.note-editable .note-danger, .rich-content .note-danger {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #dc3545;
    color: #c53030;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}
.note-editable .note-warning::before, .rich-content .note-warning::before,
.note-editable .note-danger::before, .rich-content .note-danger::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0.5rem;
}

/* Info Notes */
.note-editable .note-info, .rich-content .note-info {
    background-color: #e7f5ff;
    border: 1px solid #a5d8ff;
    border-left: 4px solid #0d6efd;
    color: #1864ab;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}
.note-editable .note-info::before, .rich-content .note-info::before {
    content: "\f05a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0.5rem;
}

/* Success Notes */
.note-editable .note-success, .rich-content .note-success {
    background-color: #d3f9d8;
    border: 1px solid #8ce99a;
    border-left: 4px solid #28a745;
    color: #2b8a3e;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}
.note-editable .note-success::before, .rich-content .note-success::before {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0.5rem;
}

/* Tables */
.note-editable table, .rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.note-editable table th, .rich-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 0.625rem 0.75rem;
    border: 1px solid #dee2e6;
}
.note-editable table td, .rich-content table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
}
.note-editable table tr:hover td, .rich-content table tr:hover td {
    background-color: #f8f9fa;
}

/* Lists */
.note-editable ul, .rich-content ul,
.note-editable ol, .rich-content ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}
.note-editable li, .rich-content li {
    margin-bottom: 0.375rem;
}

/* Blockquotes */
.note-editable blockquote, .rich-content blockquote {
    border-left: 4px solid #dee2e6;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
    background-color: #f8f9fa;
    border-radius: 0 0.375rem 0.375rem 0;
}

/* Links */
.note-editable a, .rich-content a {
    color: #0d6efd;
    text-decoration: underline;
}
.note-editable a:hover, .rich-content a:hover {
    color: #0a58ca;
}

/* Horizontal Rule */
.note-editable hr, .rich-content hr {
    border: none;
    border-top: 2px solid #dee2e6;
    margin: 1.5rem 0;
}


/* ============================================
   GLOBAL DARK MODE STYLES
   Applied when html has .dark-mode class
   ============================================ */

/* CSS Variables for Dark Mode */
html.dark-mode,
html.dark-mode body {
    --dark-bg-primary: #092738;
    --dark-bg-secondary: #0c3148;
    --dark-bg-tertiary: #071e2c;
    --dark-border: #13495f;
    --dark-text: #e2e8f0;
    --dark-text-muted: #8ba4b8;
    --dark-hover: #0e3b54;

    /* Override light mode gray variables */
    --gray-50: #092738;
    --gray-100: #0c3148;
    --gray-200: #071e2c;
    --gray-800: #e2e8f0;

    /* Override primary color */
    --bs-primary: #38bdf8;
    --bs-primary-rgb: 56, 189, 248;
    --primary: #38bdf8;
    --theme-primary: #38bdf8;
    --theme-primary-rgb: 56, 189, 248;
}

/* Primary color utilities */
.dark-mode .text-primary {
    color: #7dd3fc !important;
}

.dark-mode .bg-primary {
    background-color: #0369a1 !important;
}

/* Body & Main Background */
.dark-mode {
    background-color: var(--dark-bg-primary) !important;
    color: var(--dark-text);
}

.dark-mode .bg-dk,
.dark-mode main {
    background: var(--dark-bg-primary) !important;
    background-color: var(--dark-bg-primary) !important;
}

/* Main content wrapper (div after header) */
.dark-mode main > div,
.dark-mode main .p-4,
.dark-mode main > header + div {
    background-color: var(--dark-bg-primary) !important;
}

/* Override any inline styles using gray variables */
.dark-mode [style*="gray-50"],
.dark-mode .bg-dker {
    background-color: var(--dark-bg-secondary) !important;
}

/* Navbar */
.dark-mode .navbar {
    background: var(--dark-bg-secondary) !important;
    border-bottom: 1px solid var(--dark-border);
}

/* Sidebar */
.dark-mode .sidebar {
    background: var(--dark-bg-secondary) !important;
    border-right: 1px solid var(--dark-border);
}

.dark-mode .sidebar .b-b,
.dark-mode .sidebar .b-t {
    border-color: var(--dark-border) !important;
}

.dark-mode .sidebar .nav-title {
    color: var(--dark-text-muted);
}

.dark-mode .sidebar .nav-header {
    color: var(--dark-text-muted) !important;
}

.dark-mode .sidebar .user-avatar {
    background: #0c5a8a !important;
}

.dark-mode .sidebar .fw-semibold {
    color: var(--dark-text) !important;
}

.dark-mode .sidebar .text-muted {
    color: var(--dark-text-muted) !important;
}

.dark-mode .sidebar .nav-link,
.dark-mode .sidebar ul.nav li .nav-link {
    color: #b0c9d9 !important;
}

.dark-mode .sidebar .nav-link:hover,
.dark-mode .sidebar ul.nav li .nav-link:hover {
    background-color: var(--dark-hover) !important;
    color: #ffffff !important;
}

.dark-mode .sidebar .nav-link.active {
    background: #0c5a8a !important;
    color: white;
}

.dark-mode .sidebar .nav-link i {
    color: inherit;
}

.dark-mode .sidebar .collapse .nav-link {
    color: var(--dark-text-muted);
}

.dark-mode .sidebar .collapse .nav-link:hover {
    color: var(--dark-text);
}

.dark-mode .sidebar .collapse .nav-link.active,
.dark-mode .sidebar ul.nav .collapse ul.nav .nav-link.active {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.dark-mode .sidebar .btn-outline-secondary {
    border-color: var(--dark-border);
    color: var(--dark-text-muted);
}

.dark-mode .sidebar .btn-outline-secondary:hover {
    background-color: var(--dark-hover);
    color: var(--dark-text);
}

/* Header / Breadcrumb */
.dark-mode .header {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
}

.dark-mode .breadcrumb li a {
    color: #9dbbd0 !important;
}

.dark-mode .breadcrumb li + li::before {
    color: #5a7d93 !important;
}

.dark-mode .breadcrumb li.active a,
.dark-mode .breadcrumb li.active {
    color: #ffffff !important;
}

/* Cards */
.dark-mode .card {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
}

.dark-mode .card-header {
    background: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text);
}

.dark-mode .card-header.bg-white {
    background: var(--dark-bg-tertiary) !important;
}

.dark-mode .card-body {
    color: var(--dark-text);
}

.dark-mode .card-title,
.dark-mode .card h5,
.dark-mode .card h6 {
    color: var(--dark-text);
}

.dark-mode .card .text-muted {
    color: var(--dark-text-muted) !important;
}

/* Tables */
.dark-mode .table {
    color: var(--dark-text);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

.dark-mode .table-light,
.dark-mode thead.table-light {
    --bs-table-bg: var(--dark-bg-tertiary);
    --bs-table-color: var(--dark-text);
}

.dark-mode .table th {
    background: var(--dark-bg-tertiary) !important;
    color: var(--dark-text);
    border-color: var(--dark-border);
}

.dark-mode .table td {
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .table-hover tbody tr:hover {
    background-color: var(--dark-hover);
}

.dark-mode .table a:not(.btn) {
    color: var(--bs-primary);
}

/* Forms */
.dark-mode .form-control,
.dark-mode .form-select {
    background-color: var(--dark-bg-primary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: var(--dark-bg-primary);
    border-color: var(--bs-primary);
    color: var(--dark-text);
}

.dark-mode .form-control::placeholder {
    color: var(--dark-text-muted);
}

.dark-mode .form-label {
    color: var(--dark-text);
}

.dark-mode .form-check-input {
    background-color: var(--dark-bg-primary);
    border-color: var(--dark-border);
}

.dark-mode .form-check-input:checked {
    background-color: #0284c7;
    border-color: #0284c7;
}

.dark-mode .input-group-text {
    background-color: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
    color: var(--dark-text-muted);
}

/* Buttons */
.dark-mode .btn-light {
    background-color: #0e3b54 !important;
    border-color: var(--dark-border) !important;
    color: #ffffff !important;
}

.dark-mode .btn-light:hover,
.dark-mode .btn-light:focus {
    background-color: #13495f !important;
    border-color: #13495f !important;
    color: #ffffff !important;
}

.dark-mode .btn-light:active,
.dark-mode .btn-light.active {
    background-color: #071e2c !important;
    border-color: #071e2c !important;
    color: #ffffff !important;
}

.dark-mode .btn-outline-secondary {
    border-color: var(--dark-border);
    color: var(--dark-text-muted);
}

.dark-mode .btn-outline-secondary:hover {
    background-color: var(--dark-hover);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .btn-outline-primary {
    border-color: #0284c7 !important;
    color: #38bdf8 !important;
}

.dark-mode .btn-outline-primary:hover,
.dark-mode .btn-outline-primary:focus {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Solid buttons - remove gradients */
.dark-mode .btn-primary {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    box-shadow: none !important;
}

.dark-mode .btn-primary:hover,
.dark-mode .btn-primary:focus {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
}

.dark-mode .btn-success {
    background: #059669 !important;
    border-color: #059669 !important;
    box-shadow: none !important;
}

.dark-mode .btn-success:hover,
.dark-mode .btn-success:focus {
    background: #10b981 !important;
    border-color: #10b981 !important;
}

.dark-mode .btn-danger {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: none !important;
}

.dark-mode .btn-danger:hover,
.dark-mode .btn-danger:focus {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}

.dark-mode .btn-warning {
    background: #d97706 !important;
    border-color: #d97706 !important;
    box-shadow: none !important;
}

.dark-mode .btn-warning:hover,
.dark-mode .btn-warning:focus {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
}

.dark-mode .btn-info {
    background: #0891b2 !important;
    border-color: #0891b2 !important;
    box-shadow: none !important;
}

.dark-mode .btn-info:hover,
.dark-mode .btn-info:focus {
    background: #06b6d4 !important;
    border-color: #06b6d4 !important;
}

/* Dropdowns */
.dark-mode .dropdown-menu {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

.dark-mode .dropdown-item {
    color: var(--dark-text);
}

.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:focus {
    background-color: var(--dark-hover);
    color: var(--dark-text);
}

.dark-mode .dropdown-header {
    color: var(--dark-text-muted);
}

.dark-mode .dropdown-divider {
    border-color: var(--dark-border);
}

/* Alerts */
.dark-mode .alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.25);
    color: #22d3ee;
}

.dark-mode .alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.25);
    color: #34d399;
}

.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.25);
    color: #fbbf24;
}

.dark-mode .alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.25);
    color: #f87171;
}

/* List Groups */
.dark-mode .list-group-item {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .list-group-item-action:hover {
    background-color: var(--dark-hover);
    color: var(--dark-text);
}

.dark-mode .list-group-flush .list-group-item {
    border-color: var(--dark-border);
}

/* Badges - keep their colors but adjust for dark mode */
.dark-mode .badge.bg-secondary {
    background-color: var(--dark-border) !important;
}

.dark-mode .badge.bg-light {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text) !important;
}

/* Pagination */
.dark-mode .pagination .page-link {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .pagination .page-link:hover {
    background-color: var(--dark-hover);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .pagination .page-item.active .page-link {
    background-color: #0284c7;
    border-color: #0284c7;
}

.dark-mode .pagination .page-item.disabled .page-link {
    background-color: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
    color: var(--dark-text-muted);
}

/* Modals */
.dark-mode .modal-content {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

.dark-mode .modal-header {
    border-color: var(--dark-border);
}

.dark-mode .modal-header .modal-title {
    color: var(--dark-text);
}

.dark-mode .modal-header .btn-close {
    filter: invert(1);
}

.dark-mode .modal-body {
    color: var(--dark-text);
}

.dark-mode .modal-footer {
    border-color: var(--dark-border);
}

/* Text colors */
.dark-mode h1, .dark-mode h2, .dark-mode h3,
.dark-mode h4, .dark-mode h5, .dark-mode h6 {
    color: var(--dark-text);
}

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

.dark-mode .text-muted {
    color: var(--dark-text-muted) !important;
}

.dark-mode p {
    color: var(--dark-text);
}

.dark-mode strong {
    color: var(--dark-text);
}

.dark-mode a:not(.btn):not(.badge):not(.nav-link):not(.dropdown-item):not(.list-group-item) {
    color: var(--bs-primary);
}

/* Borders */
.dark-mode .border,
.dark-mode .border-bottom,
.dark-mode .border-top,
.dark-mode .border-start,
.dark-mode .border-end {
    border-color: var(--dark-border) !important;
}

.dark-mode .b-b,
.dark-mode .b-t,
.dark-mode .b-light {
    border-color: var(--dark-border) !important;
}

/* Background utilities */
.dark-mode .bg-white {
    background-color: var(--dark-bg-secondary) !important;
}

.dark-mode .bg-light {
    background-color: var(--dark-bg-tertiary) !important;
}

/* Shadows - more subtle in dark mode */
.dark-mode .shadow,
.dark-mode .shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4) !important;
}

/* Security Gauge / Barometer */
.dark-mode .security-gauge-bg,
.dark-mode .risk-gauge-bg {
    stroke: #0e3b54 !important;
}

.dark-mode .gauge-tick {
    stroke: #13495f !important;
}

/* Surface filter bar */
.dark-mode .surface-filter-bar {
    background: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
}

/* Severity bars */
.dark-mode .severity-bar {
    background: #0e3b54;
}

/* Risk factor bars */
.dark-mode .risk-factor-bar {
    background: #0e3b54;
}

/* Surface gauge SVG */
.dark-mode .surface-gauge-bg {
    stroke: #0e3b54;
}

/* Campaign cards */
.dark-mode .campaign-card {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}
.dark-mode .campaign-card .card-bottom {
    background: var(--dark-bg-tertiary);
    border-top-color: var(--dark-border);
}
.dark-mode .campaign-card .camp-name {
    color: var(--dark-text);
}
.dark-mode .campaign-card .camp-stat .stat-val {
    color: var(--dark-text-secondary);
}
.dark-mode .campaign-card .progress-thin {
    background: #0e3b54;
}
.dark-mode .campaign-card .obj-pips .pip.pending {
    background: #13495f;
}

/* Bootstrap subtle backgrounds */
.dark-mode .bg-info-subtle {
    background-color: rgba(13, 202, 240, 0.15) !important;
}
.dark-mode .bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.15) !important;
}
.dark-mode .bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.15) !important;
}
.dark-mode .bg-primary-subtle {
    background-color: rgba(13, 110, 253, 0.15) !important;
}
.dark-mode .bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.15) !important;
}
.dark-mode .bg-secondary-subtle {
    background-color: rgba(108, 117, 125, 0.15) !important;
}
.dark-mode .bg-white-subtle {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* Code elements */
.dark-mode code {
    background-color: var(--dark-bg-tertiary);
    color: #7dd3fc;
}

.dark-mode pre {
    background-color: var(--dark-bg-primary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

/* Scrollbar styling for dark mode */
.dark-mode ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: var(--dark-bg-primary);
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #1a6080;
}

/* ==========================================
   MESSAGES SPECIFIC DARK MODE
   ========================================== */

.dark-mode .messages-container {
    background: var(--dark-bg-primary);
}

.dark-mode .conversations-sidebar {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border) !important;
}

.dark-mode .conversations-sidebar .p-3.border-bottom.bg-white,
.dark-mode .conversations-sidebar > .p-3:first-child {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
}

.dark-mode .conversations-sidebar h5 {
    color: var(--dark-text);
}

.dark-mode .conversations-sidebar .p-2.border-bottom.bg-light {
    background: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
}

.dark-mode .conversation-item {
    border-color: var(--dark-border) !important;
}

.dark-mode .conversation-item:hover {
    background-color: var(--dark-hover);
}

.dark-mode .conversation-item.active {
    background-color: rgba(56, 189, 248, 0.1);
    border-left-color: var(--bs-primary);
}

.dark-mode .conversation-item strong,
.dark-mode .conversation-info strong {
    color: var(--dark-text) !important;
}

.dark-mode .chat-area {
    background: var(--dark-bg-primary) !important;
}

.dark-mode .chat-header {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
}

.dark-mode .chat-header h6 {
    color: var(--dark-text);
}

.dark-mode .chat-messages {
    background: var(--dark-bg-primary) !important;
}

.dark-mode .message-other {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text);
}

.dark-mode .message-own {
    background: #0284c7 !important;
}

.dark-mode .chat-input {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
}

/* ==========================================
   MOBILE ELEMENTS DARK MODE
   ========================================== */

.dark-mode .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.dark-mode .mobile-menu-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.dark-mode .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* ============================================
   WYSIWYG / RICH CONTENT DARK MODE
   ============================================ */

.dark-mode .note-editor.note-frame {
    border-color: #495057;
}
.dark-mode .note-editor.note-frame .note-toolbar {
    background-color: #343a40;
    border-color: #495057;
}
.dark-mode .note-editor.note-frame .note-editing-area {
    background-color: #212529;
}
.dark-mode .note-editor.note-frame .note-editing-area .note-editable {
    background-color: #212529;
    color: #f8f9fa;
}
.dark-mode .note-editor.note-frame .note-statusbar {
    background-color: #343a40;
    border-color: #495057;
}
.dark-mode .note-btn {
    background-color: #343a40 !important;
    border-color: #495057 !important;
    color: #f8f9fa !important;
}
.dark-mode .note-btn:hover {
    background-color: #495057 !important;
}
.dark-mode .note-editable h3, .dark-mode .rich-content h3 {
    color: #f8f9fa;
    border-bottom-color: #0d6efd;
}
.dark-mode .note-editable h4, .dark-mode .rich-content h4 {
    color: #e9ecef;
}
.dark-mode .note-editable code, .dark-mode .rich-content code {
    background-color: #343a40;
}
.dark-mode .note-editable table th, .dark-mode .rich-content table th {
    background-color: #343a40;
    border-color: #495057;
}
.dark-mode .note-editable table td, .dark-mode .rich-content table td {
    border-color: #495057;
}
.dark-mode .note-editable blockquote, .dark-mode .rich-content blockquote {
    background-color: #343a40;
    border-color: #495057;
}


/* ============================================
   AUTH PAGE STYLES
   ============================================ */

/* Auth page responsive */
@media (max-width: 479.98px) {
    .min-vh-100 { padding: 1rem; }
    .auth-card { border-radius: 12px; }
    .auth-card .card-body { padding: 1.25rem !important; }
    .auth-card .form-control { font-size: 16px; }
}

/* Registration page styles */
.password-requirements {
    font-size: 0.75rem;
    color: #6c757d;
}
.password-requirements li {
    margin-bottom: 0.25rem;
}
.password-requirements li.valid {
    color: #198754;
}
.password-requirements li.valid::before {
    content: '\2713 ';
}
.password-requirements li.invalid::before {
    content: '\2717 ';
    color: #dc3545;
}
.security-notice {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}
.security-notice i {
    color: var(--bs-primary);
}
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}
.turnstile-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}
@media (max-width: 479.98px) {
    .name-row { flex-direction: column; }
    .name-row > div { width: 100%; }
    .form-control, .form-select { font-size: 16px; }
}
