/* ========================================
   ENTERPRISE UI SYSTEM
   8px Grid | Inter Font | Finance-Safe Palette
   ======================================== */

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

:root {
    /* Primary Palette */
    --ds-blue-600: #2563EB;
    --ds-blue-500: #3B82F6;
    --ds-blue-100: #DBEAFE;
    --ds-blue-50: #EFF6FF;
    
    /* Semantic Colors */
    --ds-success: #059669;
    --ds-success-light: #D1FAE5;
    --ds-warning: #D97706;
    --ds-warning-light: #FEF3C7;
    --ds-danger: #DC2626;
    --ds-danger-light: #FEE2E2;
    --ds-cyan: #0891B2;
    --ds-cyan-light: #CFFAFE;
    --ds-purple: #7C3AED;
    --ds-purple-light: #EDE9FE;
    
    /* Neutrals */
    --ds-gray-900: #111827;
    --ds-gray-700: #374151;
    --ds-gray-600: #4B5563;
    --ds-gray-500: #6B7280;
    --ds-gray-400: #9CA3AF;
    --ds-gray-300: #D1D5DB;
    --ds-gray-200: #E5E7EB;
    --ds-gray-100: #F3F4F6;
    --ds-gray-50: #F9FAFB;
    --ds-white: #FFFFFF;
    
    /* Spacing (8px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--ds-gray-50);
    color: var(--ds-gray-900);
}

/* Utilities */
.mb-6 { margin-bottom: var(--space-6) !important; }
.gap-2 { gap: var(--space-2) !important; }

/* KPI Card */
.kpi-card {
    background: var(--ds-white);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ds-gray-100);
    height: 100%;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-1);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ds-gray-900);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

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

.kpi-icon i { font-size: 18px; }
.kpi-icon.blue { background: var(--ds-blue-50); color: var(--ds-blue-500); }
.kpi-icon.green { background: var(--ds-success-light); color: var(--ds-success); }
.kpi-icon.amber { background: var(--ds-warning-light); color: var(--ds-warning); }
.kpi-icon.purple { background: var(--ds-purple-light); color: var(--ds-purple); }
.kpi-icon.red { background: var(--ds-danger-light); color: var(--ds-danger); }
.kpi-icon.cyan { background: var(--ds-cyan-light); color: var(--ds-cyan); }

.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 12px;
    font-weight: 600;
}

.trend-indicator.up { color: var(--ds-success); }
.trend-indicator.down { color: var(--ds-danger); }
.trend-indicator.neutral { color: var(--ds-gray-500); }

/* Filter Bar */
.filter-bar {
    background: var(--ds-white);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ds-gray-100);
    margin-bottom: var(--space-6);
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
    display: block;
}

.form-control-ds {
    border: 1px solid var(--ds-gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
    color: var(--ds-gray-900);
    width: 100%;
    transition: all 0.15s ease;
    background-color: var(--ds-white);
}

.form-control-ds:focus {
    outline: none;
    border-color: var(--ds-blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-ds {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-ds-primary {
    background: var(--ds-blue-600);
    color: white;
}

.btn-ds-primary:hover {
    background: var(--ds-blue-500);
    transform: translateY(-1px);
    color: white;
}

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

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

/* Table Card */
.table-card {
    background: var(--ds-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ds-gray-100);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.table-header-ds {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--ds-gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title-ds {
    font-size: 16px;
    font-weight: 600;
    color: var(--ds-gray-900);
    margin: 0;
}

.ds-table {
    width: 100%;
    border-collapse: collapse;
}

.ds-table th {
    text-align: left;
    padding: var(--space-3) var(--space-6);
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--ds-gray-100);
    background: var(--ds-gray-50);
}

.ds-table td {
    padding: var(--space-4) var(--space-6);
    font-size: 13px;
    color: var(--ds-gray-700);
    border-bottom: 1px solid var(--ds-gray-50);
    vertical-align: middle;
}

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

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

/* Avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar.corporate { background: var(--ds-purple-light); color: var(--ds-purple); }
.avatar.individual { background: var(--ds-blue-50); color: var(--ds-blue-600); }
.avatar.success { background: var(--ds-success-light); color: var(--ds-success); }
.avatar.warning { background: var(--ds-warning-light); color: var(--ds-warning); }
.avatar.danger { background: var(--ds-danger-light); color: var(--ds-danger); }

.item-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.item-name {
    font-weight: 500;
    color: var(--ds-gray-900);
    text-decoration: none;
    display: block;
}

.item-name:hover {
    color: var(--ds-blue-600);
}

.item-meta {
    font-size: 11px;
    color: var(--ds-gray-400);
}

/* Status Chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-chip.active, .status-chip.paid, .status-chip.settled, .status-chip.approved, .status-chip.converted, .status-chip.valid { 
    background: var(--ds-success-light); color: var(--ds-success); 
}

.status-chip.inactive, .status-chip.draft, .status-chip.closed, .status-chip.cancelled { 
    background: var(--ds-gray-100); color: var(--ds-gray-500); 
}

.status-chip.pending, .status-chip.watch-listed, .status-chip.expiring, .status-chip.settling, .status-chip.assessed { 
    background: var(--ds-warning-light); color: var(--ds-warning); 
}

.status-chip.blacklisted, .status-chip.rejected, .status-chip.expired, .status-chip.locked, .status-chip.clawback { 
    background: var(--ds-danger-light); color: var(--ds-danger); 
}

.status-chip.quoted, .status-chip.info, .status-chip.renewal { 
    background: var(--ds-blue-50); color: var(--ds-blue-500); 
}

.status-chip.corporate { background: var(--ds-purple-light); color: var(--ds-purple); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--ds-gray-500);
}

.empty-state i {
    font-size: 32px;
    margin-bottom: var(--space-2);
    color: var(--ds-gray-300);
    display: block;
}

/* Sparkline Container */
.sparkline-container {
    height: 40px;
    margin-top: auto;
    overflow: hidden;
}

/* Pagination Overrides */
.pagination {
    margin-top: var(--space-6);
    gap: var(--space-1);
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.page-link {
    border: 1px solid var(--ds-gray-200);
    color: var(--ds-gray-600);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    display: block;
}

.page-link:hover {
    background: var(--ds-gray-50);
    color: var(--ds-gray-900);
    border-color: var(--ds-gray-300);
}

.page-item.active .page-link {
    background: var(--ds-blue-600);
    border-color: var(--ds-blue-600);
    color: white;
}

.page-item.disabled .page-link {
    background: var(--ds-gray-50);
    color: var(--ds-gray-400);
    border-color: var(--ds-gray-100);
    pointer-events: none;
}

/* Action Menu */
.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu-btn {
    background: transparent;
    border: none;
    color: var(--ds-gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.action-menu-btn:hover {
    color: var(--ds-gray-700);
    background: var(--ds-gray-100);
}

.action-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--ds-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2) 0;
    min-width: 160px;
    z-index: 100;
    display: none;
    border: 1px solid var(--ds-gray-100);
}

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

.action-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: var(--ds-gray-700);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.action-menu-item:hover {
    background: var(--ds-gray-50);
    color: var(--ds-blue-600);
}

.action-menu-item.text-danger:hover {
    color: var(--ds-danger);
    background: var(--ds-danger-light);
}

/* DS Card */
.ds-card {
    background: var(--ds-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ds-gray-100);
    overflow: hidden;
}

/* DS Card in equal-height grid layouts */
.row > [class*="col"] > .ds-card:only-child {
    height: 100%;
}

.ds-card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--ds-gray-100);
}

.ds-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-gray-900);
    margin: 0;
}

.ds-card-body {
    padding: var(--space-6);
}

.ds-card-body.flush {
    padding: 0;
}

/* ========================================
   SIDEBAR LOGO COMPACT
   ======================================== */
.logo-icon-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.logo-icon-compact:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

/* Align logo spans properly */
.logo .logo-sm,
.logo .logo-lg {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Default state: show full logo, hide compact */
.logo .logo-sm {
    display: none !important;
}

.logo .logo-lg {
    display: flex !important;
}

/* Collapsed state: show compact logo, hide full */
body[data-sidebar-size="sm"] .logo .logo-sm {
    display: flex !important;
}

body[data-sidebar-size="sm"] .logo .logo-lg {
    display: none !important;
}

/* Fix navbar-brand-box positioning and z-index */
.navbar-brand-box {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: inherit;
    transition: all 0.3s ease;
}

/* Ensure logo stays above scrolling menu */
.vertical-menu .navbar-brand-box {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: var(--bs-sidebar-dark-bg, #24243c);
    padding-bottom: 10px;
}

/* For light sidebar */
body[data-sidebar="light"] .vertical-menu .navbar-brand-box {
    background: #ffffff;
}

/* Prevent menu items from overlapping logo */
.sidebar-menu-scroll {
    position: relative;
    z-index: 1;
}

/* ========================================
   FIX SIDEBAR SCROLLING ISSUE
   Sidebar should be FIXED, not scroll with page
   FORCE IT WITH MAXIMUM SPECIFICITY
   ======================================== */

/* FORCE sidebar to stay fixed - ALWAYS */
.vertical-menu,
body .vertical-menu,
body[data-sidebar-size="sm"] .vertical-menu,
body[data-sidebar-size="lg"] .vertical-menu,
body[data-sidebar="dark"] .vertical-menu,
body[data-sidebar="light"] .vertical-menu,
body[data-sidebar="brand"] .vertical-menu {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
    z-index: 1005 !important;
}

/* Override any scrollable behavior on the main layout */
body[data-layout-scrollable="true"] .vertical-menu,
body[data-layout-scrollable="true"] #page-topbar {
    position: fixed !important;
}

/* The scrollable area should be ONLY the menu content */
.vertical-menu .sidebar-menu-scroll,
body .vertical-menu .sidebar-menu-scroll {
    position: relative !important;
    height: calc(100vh - 70px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Keep navbar-brand-box at top */
.vertical-menu .navbar-brand-box,
body .vertical-menu .navbar-brand-box {
    position: relative !important;
    top: 0 !important;
    z-index: 1001 !important;
    background: var(--bs-sidebar-dark-bg, #24243c) !important;
    padding-bottom: 10px !important;
}

body[data-sidebar="light"] .vertical-menu .navbar-brand-box {
    background: #ffffff !important;
}

/* CRITICAL: Ensure layout wrapper doesn't cause sidebar to scroll */
#layout-wrapper {
    position: relative !important;
    min-height: 100vh !important;
}

/* ============================================
   MULTI-ROLE PORTAL THEMING
   ============================================ */

/* --- Portal Label (sidebar, under logo) --- */
.portal-label {
    display: none;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 12px 0;
    margin-top: -4px;
}

.portal-label i {
    font-size: 11px;
    vertical-align: -1px;
    margin-right: 2px;
}

.portal-label-admin,
.portal-label-agent,
.portal-label-operations,
.portal-label-viewonly {
    display: block;
    opacity: 0.9;
}

.portal-label-admin      { color: #818cf8; }
.portal-label-agent      { color: #2dd4bf; }
.portal-label-operations  { color: #fbbf24; }
.portal-label-viewonly    { color: #94a3b8; }

body[data-sidebar-size="sm"] .portal-label {
    display: none !important;
}

/* --- Portal Badge (topbar, left zone) --- */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;
}

.portal-badge i {
    font-size: 14px;
}

.portal-badge.admin {
    background: rgba(129, 140, 248, 0.12);
    color: #818cf8;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.portal-badge.agent {
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.25);
}

.portal-badge.operations {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.portal-badge.viewonly {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* --- Agent Context Card (sidebar footer, agent-only) --- */
.agent-context-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
}

.agent-context-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.agent-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #6b7280;
}

.agent-status-dot.active {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.agent-status-dot.inactive {
    background: #ef4444;
}

.agent-context-code {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'SFMono-Regular', Consolas, monospace;
    letter-spacing: 0.5px;
}

.agent-context-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
    padding-left: 15px;
}

.agent-context-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #2dd4bf;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.15);
    transition: all 0.15s ease;
}

.agent-context-link:hover {
    background: rgba(45, 212, 191, 0.15);
    color: #5eead4;
    text-decoration: none;
}

.agent-context-link i {
    font-size: 14px;
}

body[data-sidebar-size="sm"] .agent-context-card {
    display: none;
}

body[data-user-role="agent"] .vertical-menu .sidebar-menu-scroll {
    height: calc(100vh - 70px - 105px) !important;
}

/* ============================================
   ADMIN PORTAL - Indigo (#818cf8)
   ============================================ */
body[data-user-role="admin"][data-sidebar="dark"] {
    --bs-sidebar-dark-menu-item-active-color: #a5b4fc;
    --bs-sidebar-dark-menu-item-active-bg-color: rgba(129, 140, 248, 0.1);
    --bs-sidebar-dark-menu-item-hover-color: #c7d2fe;
}

body[data-user-role="admin"][data-sidebar="dark"] #sidebar-menu ul li.mm-active > a:before {
    background: #818cf8 !important;
}

body[data-user-role="admin"][data-sidebar="dark"] #sidebar-menu ul li.mm-active .mm-show .mm-active > a:before {
    border-color: #818cf8 !important;
    background-color: #818cf8 !important;
}

body[data-user-role="admin"][data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu li a:hover:before {
    background-color: #818cf8 !important;
    border-color: #818cf8 !important;
}

body[data-user-role="admin"][data-sidebar="dark"] .navbar-brand-box {
    border-bottom: 1px solid rgba(129, 140, 248, 0.15) !important;
}

body[data-user-role="admin"] .user-profile-btn .user-role {
    color: #818cf8;
}

/* ============================================
   AGENT PORTAL - Teal (#2dd4bf)
   ============================================ */
body[data-user-role="agent"][data-sidebar="dark"] {
    --bs-sidebar-dark-menu-item-active-color: #2dd4bf;
    --bs-sidebar-dark-menu-item-active-bg-color: rgba(45, 212, 191, 0.1);
    --bs-sidebar-dark-menu-item-hover-color: #99f6e4;
}

body[data-user-role="agent"][data-sidebar="dark"] #sidebar-menu ul li.mm-active > a:before {
    background: #2dd4bf !important;
}

body[data-user-role="agent"][data-sidebar="dark"] #sidebar-menu ul li.mm-active .mm-show .mm-active > a:before {
    border-color: #2dd4bf !important;
    background-color: #2dd4bf !important;
}

body[data-user-role="agent"][data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu li a:hover:before {
    background-color: #2dd4bf !important;
    border-color: #2dd4bf !important;
}

body[data-user-role="agent"][data-sidebar="dark"] .navbar-brand-box {
    border-bottom: 1px solid rgba(45, 212, 191, 0.15) !important;
}

body[data-user-role="agent"] .user-profile-btn .user-role {
    color: #2dd4bf;
}

/* ============================================
   OPERATIONS PORTAL - Amber (#fbbf24)
   ============================================ */
body[data-user-role="operations"][data-sidebar="dark"] {
    --bs-sidebar-dark-menu-item-active-color: #fcd34d;
    --bs-sidebar-dark-menu-item-active-bg-color: rgba(251, 191, 36, 0.1);
    --bs-sidebar-dark-menu-item-hover-color: #fde68a;
}

body[data-user-role="operations"][data-sidebar="dark"] #sidebar-menu ul li.mm-active > a:before {
    background: #fbbf24 !important;
}

body[data-user-role="operations"][data-sidebar="dark"] #sidebar-menu ul li.mm-active .mm-show .mm-active > a:before {
    border-color: #fbbf24 !important;
    background-color: #fbbf24 !important;
}

body[data-user-role="operations"][data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu li a:hover:before {
    background-color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

body[data-user-role="operations"][data-sidebar="dark"] .navbar-brand-box {
    border-bottom: 1px solid rgba(251, 191, 36, 0.15) !important;
}

body[data-user-role="operations"] .user-profile-btn .user-role {
    color: #fbbf24;
}

/* ============================================
   VIEW ONLY PORTAL - Slate (#94a3b8)
   ============================================ */
body[data-user-role="viewonly"][data-sidebar="dark"] {
    --bs-sidebar-dark-menu-item-active-color: #cbd5e1;
    --bs-sidebar-dark-menu-item-active-bg-color: rgba(148, 163, 184, 0.1);
    --bs-sidebar-dark-menu-item-hover-color: #e2e8f0;
}

body[data-user-role="viewonly"][data-sidebar="dark"] #sidebar-menu ul li.mm-active > a:before {
    background: #94a3b8 !important;
}

body[data-user-role="viewonly"][data-sidebar="dark"] #sidebar-menu ul li.mm-active .mm-show .mm-active > a:before {
    border-color: #94a3b8 !important;
    background-color: #94a3b8 !important;
}

body[data-user-role="viewonly"][data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu li a:hover:before {
    background-color: #94a3b8 !important;
    border-color: #94a3b8 !important;
}

body[data-user-role="viewonly"][data-sidebar="dark"] .navbar-brand-box {
    border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important;
}

body[data-user-role="viewonly"] .user-profile-btn .user-role {
    color: #94a3b8;
}

/* --- Responsive: portal badge icon-only on small screens --- */
@media (max-width: 991.98px) {
    .portal-badge span {
        display: none !important;
    }
    .portal-badge {
        padding: 4px 8px;
    }
}

@media (max-width: 767.98px) {
    .portal-badge {
        display: none;
    }
}
