/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESET & BASE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    /* SF Pro on Apple devices; Inter on Windows/Android; Segoe UI fallback */
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #0F172A;
    background: #F1F5F9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHELL LAYOUT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.app-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: #1E293B;
    box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.3);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 14px;
    z-index: 1000;
    gap: 8px;
}
.topbar-menu-btn, .topbar-logout-btn {
    background: rgba(255,255,255,.14);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    transition: background .15s;
    flex-shrink: 0;
}
.topbar-menu-btn:hover, .topbar-logout-btn:hover { background: rgba(255,255,255,.26); }
.topbar-title { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: .4px; }
.topbar-spacer { flex: 1; }
.topbar-user {
    font-size: 12px; color: rgba(255,255,255,.92); font-weight: 500;
    background: rgba(255,255,255,.15);
    padding: 4px 12px; border-radius: 20px;
}

.app-body { display: flex; margin-top: 52px; min-height: calc(100vh - 52px); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SIDEBAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.app-sidebar {
    width: 228px; min-width: 228px;
    background: linear-gradient(180deg, #0F172A 0%, #131D2B 60%, #0C1829 100%);
    box-shadow: 2px 0 20px rgba(0,0,0,.35);
    overflow-y: auto; overflow-x: hidden;
    flex-shrink: 0;
    transition: width .22s cubic-bezier(.4,0,.2,1), min-width .22s cubic-bezier(.4,0,.2,1);
    padding-bottom: 24px;
}
.app-sidebar.sidebar-closed { width: 0 !important; min-width: 0 !important; }
.sidebar-header {
    font-size: 9px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
    color: #60A5FA; padding: 14px 18px 8px;
    border-bottom: 1px solid rgba(96,165,250,.12); margin-bottom: 4px;
}

/* ── Native nav links (replaced MudNavLink) ── */
.nav-link {
    display: flex; align-items: center; gap: 9px;
    font-size: 13px; font-weight: 400;
    color: #CBD5E1;
    padding: 8px 14px; border-radius: 8px;
    margin: 2px 10px;
    text-decoration: none; white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(96,165,250,.14); color: #fff; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(59,130,246,.28) 0%, rgba(59,130,246,.06) 100%);
    color: #fff; font-weight: 600;
    box-shadow: inset 3px 0 0 #3B82F6;
}
.nav-link-icon { font-size: 18px !important; color: #93C5FD; flex-shrink: 0; transition: color .15s; }
.nav-link:hover .nav-link-icon { color: #fff; }
.nav-link.active .nav-link-icon { color: #60A5FA; }

/* Keep mud-nav-link styles for any remaining MudNavLink usage */
.mud-nav-link {
    display: flex !important; flex-direction: row !important;
    align-items: center !important; gap: 9px !important;
    font-size: 13px !important; font-weight: 400 !important;
    color: #CBD5E1 !important;
    padding: 8px 14px !important; border-radius: 8px !important;
    margin: 2px 10px !important; min-height: 38px !important;
    text-decoration: none !important; white-space: nowrap !important;
    transition: background .15s, color .15s !important;
}
.mud-nav-link:hover { background: rgba(96,165,250,.14) !important; color: #fff !important; }
.mud-nav-link.active {
    background: linear-gradient(90deg,rgba(59,130,246,.28) 0%,rgba(59,130,246,.06) 100%) !important;
    color: #fff !important; font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #3B82F6;
}
.mud-nav-link .mud-icon-root { color: #93C5FD !important; flex-shrink: 0 !important; width: 18px !important; height: 18px !important; }
.mud-nav-link .mud-icon-root path,
.mud-nav-link .mud-svg-icon path { fill: #93C5FD !important; }
.mud-nav-link:hover .mud-icon-root path,
.mud-nav-link:hover .mud-svg-icon path { fill: #fff !important; }
.mud-nav-link.active .mud-icon-root path,
.mud-nav-link.active .mud-svg-icon path { fill: #60A5FA !important; }

.nav-label {
    font-size: 9px; font-weight: 800; letter-spacing: 1.8px;
    text-transform: uppercase; color: #60A5FA; opacity: .65;
    padding: 10px 18px 3px; user-select: none;
}
.nav-label-toggle {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; padding-right: 12px;
    transition: opacity .15s;
}
.nav-label-toggle:hover { opacity: 1; }
.nav-label-chevron {
    font-size: 14px !important; opacity: .7;
    transition: transform .2s ease;
    transform: rotate(0deg);
}
.nav-label-chevron.open { transform: rotate(90deg); }

/* Sub-category links — indented under "All Assets" */
.nav-sub-link {
    padding-left: 28px !important;
    font-size: 12px !important;
    opacity: .88;
}
.nav-sub-link .nav-link-icon { font-size: 15px !important; color: #7CB9F7; }
.nav-sub-link:hover .nav-link-icon { color: #fff; }
.nav-sub-link.active .nav-link-icon { color: #60A5FA; }
.nav-sub-bullet {
    display: block; width: 4px; height: 4px; border-radius: 50%;
    background: rgba(148,197,250,.45); flex-shrink: 0; margin-right: -2px;
}

/* Main content */
.app-main { flex: 1; min-width: 0; padding: 24px 28px; background: #F1F5F9; overflow-y: auto; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ICON SIZES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-icon-root { font-size: 20px !important; width: 20px !important; height: 20px !important; line-height: 20px !important; }
.mud-icon-size-small  { font-size: 16px !important; width: 16px !important; height: 16px !important; }
.mud-icon-size-medium { font-size: 20px !important; width: 20px !important; height: 20px !important; }
.mud-icon-size-large  { font-size: 26px !important; width: 26px !important; height: 26px !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ MUDBLAZOR FORM INPUTS — minimal overrides
   Only colors. Never touch position/layout.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
fieldset.mud-notched-outline { border-color: #D1D5DB !important; border-radius: 8px !important; }
.mud-input.mud-input-outlined:focus-within fieldset.mud-notched-outline { border-color: #2563EB !important; border-width: 2px !important; }
.mud-input.mud-input-outlined.mud-input-error fieldset.mud-notched-outline { border-color: #EF4444 !important; }
.mud-input-label-outlined { color: #6B7280 !important; }
.mud-input-label-outlined.mud-shrink { color: #1D4ED8 !important; }
.mud-input-root { font-size: 14px !important; color: #111827 !important; }
.mud-input-helper-text { font-size: 11px !important; }
.mud-input-adornment { background: transparent !important; }
.mud-input-adornment path { fill: #9CA3AF !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ NATIVE FORM FIELDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.form-field { display:flex; flex-direction:column; gap:5px; }
.form-field > label { font-size:11px; font-weight:700; color:#64748B; text-transform:uppercase; letter-spacing:.6px; white-space:nowrap; }
.form-input, .form-select, .form-textarea {
    width:100%; padding:0 12px; height:42px;
    border:1.5px solid #E2E8F0; border-radius:8px;
    font-size:14px; color:#0F172A; background:#F8FAFC;
    font-family:inherit; outline:none; box-sizing:border-box;
    transition:border-color .15s, box-shadow .15s, background .15s;
    appearance:none; -webkit-appearance:none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color:#2563EB; background:#fff;
    box-shadow:0 0 0 3px rgba(37,99,235,.1);
}
.form-input::placeholder, .form-textarea::placeholder { color:#94A3B8; }
.form-select {
    cursor:pointer;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 10px center; background-size:20px;
    padding-right:36px;
}
.form-textarea { height:auto; min-height:88px; padding:10px 12px; resize:vertical; line-height:1.6; }
.form-grid { display:grid; gap:16px; }
.form-grid-2 { grid-template-columns:repeat(2,1fr); }
.form-grid-3 { grid-template-columns:repeat(3,1fr); }
.form-grid-4 { grid-template-columns:repeat(4,1fr); }
.form-full  { grid-column:1/-1; }
@@media (max-width:800px) { .form-grid-2,.form-grid-3,.form-grid-4 { grid-template-columns:1fr !important; } }
.form-error { font-size:11px; color:#DC2626; margin-top:2px; }
.form-hint  { font-size:11px; color:#94A3B8; margin-top:2px; }

/* Native tab bar */
.tab-nav { display:flex; border-bottom:2px solid #E2E8F0; background:#FAFAFA; overflow-x:auto; }
.tab-btn  { padding:12px 18px; border:none; background:transparent; font-size:13px; font-weight:500; color:#64748B; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .15s; font-family:inherit; white-space:nowrap; display:flex; align-items:center; gap:5px; }
.tab-btn:hover:not(.tab-btn-active) { color:#374151; background:rgba(0,0,0,.025); }
.tab-btn-active { color:#2563EB; font-weight:700; border-bottom-color:#2563EB; }
.tab-content { padding:24px; }

/* Form action footer */
.form-actions { display:flex; justify-content:flex-end; gap:10px; padding:16px 24px; border-top:1px solid #F1F5F9; background:#FAFAFA; border-radius:0 0 16px 16px; }
.form-btn-cancel { padding:9px 20px; border-radius:8px; border:1.5px solid #E2E8F0; background:#fff; font-size:13px; font-weight:600; color:#64748B; cursor:pointer; font-family:inherit; transition:all .15s; }
.form-btn-cancel:hover { border-color:#CBD5E1; color:#374151; background:#F8FAFC; }
.form-btn-primary { display:inline-flex; align-items:center; gap:6px; padding:9px 22px; border-radius:8px; border:none; background:linear-gradient(135deg,#2563EB,#1D4ED8); font-size:13px; font-weight:700; color:#fff; cursor:pointer; font-family:inherit; box-shadow:0 2px 10px rgba(37,99,235,.35); transition:all .15s; }
.form-btn-primary:hover:not(:disabled) { background:linear-gradient(135deg,#3B82F6,#2563EB); box-shadow:0 4px 16px rgba(37,99,235,.5); transform:translateY(-1px); }
.form-btn-primary:disabled { opacity:.55; cursor:not-allowed; transform:none !important; box-shadow:none; }

/* Toggle switch (replaces MudSwitch) */
.toggle-switch { display:inline-flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.toggle-switch input[type=checkbox] { position:absolute; opacity:0; width:0; height:0; }
.toggle-track { width:44px; height:24px; background:#CBD5E1; border-radius:12px; position:relative; transition:background .2s; flex-shrink:0; }
.toggle-track::after { content:''; position:absolute; width:18px; height:18px; background:#fff; border-radius:50%; top:3px; left:3px; transition:left .2s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-track { background:#2563EB; }
.toggle-switch input:checked + .toggle-track::after { left:23px; }
.toggle-label-text { font-size:13px; font-weight:600; color:#64748B; }
.toggle-switch input:checked ~ .toggle-label-text { color:#2563EB; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ NATIVE FILTER BAR — full control styling
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.fb-field {
    display: flex; align-items: center; gap: 6px; flex: 1; min-width: 150px;
    height: 40px; padding: 0 12px;
    background: #F9FAFB; border: 1.5px solid #E5E7EB; border-radius: 8px;
    transition: border-color .15s, box-shadow .15s, background .15s;
    position: relative;
}
.fb-field:focus-within {
    border-color: #2563EB; background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.fb-input {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 13px; color: #111827; font-family: inherit;
}
.fb-input::placeholder { color: #9CA3AF; }
.fb-select {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 13px; color: #111827; font-family: inherit;
    appearance: none; -webkit-appearance: none; cursor: pointer;
    padding-right: 4px; height: 100%;
}
.fb-select option { color: #111827; background: #fff; }
.fb-chevron { font-size: 18px !important; color: #9CA3AF; pointer-events: none; flex-shrink: 0; }
.fb-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 14px; border-radius: 8px;
    border: 1.5px solid #CBD5E1; background: #fff;
    font-size: 13px; font-weight: 600; color: #374151;
    cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.fb-btn:hover { border-color: #2563EB; color: #1D4ED8; background: #EEF2FF; }
.fb-btn-clear { color: #DC2626; border-color: #FECACA; }
.fb-btn-clear:hover { background: #FEF2F2; border-color: #EF4444; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ BUTTONS — Gradient, rounded, bold
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-button-root {
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    letter-spacing: .3px !important;
    text-transform: none !important;
    transition: all .18s ease !important;
}
/* Primary filled button */
.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
    box-shadow: 0 2px 10px rgba(37,99,235,.38) !important;
    color: #fff !important;
}
.mud-button-filled.mud-button-filled-primary:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    box-shadow: 0 4px 16px rgba(37,99,235,.52) !important;
    transform: translateY(-1px) !important;
}
/* Secondary filled */
.mud-button-filled.mud-button-filled-secondary {
    background: linear-gradient(135deg, #0891B2, #0E7490) !important;
    box-shadow: 0 2px 10px rgba(8,145,178,.3) !important;
    color: #fff !important;
}
/* Outlined button */
.mud-button-outlined {
    border: 2px solid #BFDBFE !important;
    color: #1D4ED8 !important;
    background: #fff !important;
}
.mud-button-outlined:hover {
    background: #EEF2FF !important;
    border-color: #2563EB !important;
}
/* Text button */
.mud-button-text { color: #1D4ED8 !important; }
/* Icon button size */
.mud-button-root .mud-icon-root { font-size: 16px !important; width: 16px !important; height: 16px !important; }
/* Small variant */
.mud-button-root.mud-button-size-small { font-size: 12px !important; padding: 4px 12px !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ TABS — Pill style
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-tabs .mud-tab-header {
    background: #EEF2FF !important;
    border-radius: 12px !important;
    padding: 4px !important;
    gap: 2px !important;
}
.mud-tab {
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 9px !important;
    padding: 7px 18px !important;
    min-width: 80px !important;
    color: #475569 !important;
    text-transform: none !important;
    transition: all .18s ease !important;
}
.mud-tab.mud-tab-active {
    background: #fff !important;
    color: #1D4ED8 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.1) !important;
}
/* Hide default tab indicator line */
.mud-tab-slider { display: none !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ CHIPS / BADGES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-chip {
    font-size: 11px !important; font-weight: 600 !important;
    height: 22px !important; padding: 0 9px !important;
    border-radius: 20px !important;
    letter-spacing: .2px !important;
}
.mud-chip-content { font-size: 11px !important; line-height: 22px !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ ALERT / NOTIFICATION BANNERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-alert {
    border-radius: 10px !important;
    border: none !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
}
.mud-alert-filled-info    { background: #EEF2FF !important; color: #1E40AF !important; border-left: 4px solid #2563EB !important; }
.mud-alert-filled-success { background: #F0FDF4 !important; color: #166534 !important; border-left: 4px solid #22C55E !important; }
.mud-alert-filled-warning { background: #FFFBEB !important; color: #92400E !important; border-left: 4px solid #F59E0B !important; }
.mud-alert-filled-error   { background: #FEF2F2 !important; color: #991B1B !important; border-left: 4px solid #EF4444 !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ TABLES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-table { border-radius: 12px !important; overflow: hidden !important; }
.mud-table-head .mud-table-cell {
    font-size: 10px !important; font-weight: 800 !important;
    text-transform: uppercase; letter-spacing: .8px;
    color: #64748B !important; background: #F8FAFC !important;
    padding: 10px 14px !important; border-bottom: 2px solid #E2E8F0 !important;
}
.mud-table-cell {
    font-size: 13px !important; padding: 8px 14px !important;
    vertical-align: middle !important; color: #0F172A !important;
    border-bottom: 1px solid #F1F5F9 !important;
}
.mud-table-row:hover .mud-table-cell { background: #F8FAFC !important; }
/* MudDataGrid specifics */
.mud-data-grid .mud-table-head .mud-table-cell { font-size:10px !important; font-weight:800 !important; text-transform:uppercase !important; letter-spacing:.8px !important; color:#64748B !important; background:#F8FAFC !important; padding:10px 14px !important; border-bottom:2px solid #E2E8F0 !important; }
.mud-data-grid .mud-table-body .mud-table-cell { font-size:13px !important; padding:8px 14px !important; color:#0F172A !important; border-bottom:1px solid #F1F5F9 !important; }
.mud-data-grid .mud-table-body .mud-table-row:hover .mud-table-cell { background:#F8FAFC !important; }
.mud-data-grid .mud-table-root { border-radius:0 !important; box-shadow:none !important; }
/* Pager container */
.mud-data-grid-pager { border-top:1px solid #F1F5F9 !important; padding:10px 16px !important; font-size:12px !important; color:#64748B !important; display:flex !important; align-items:center !important; gap:8px !important; }
/* Pager: page-size MudSelect — collapse to a slim inline control */
.mud-data-grid-pager .mud-input-control { min-width:60px !important; max-width:72px !important; margin:0 !important; }
.mud-data-grid-pager .mud-input-control-input-container { padding:0 !important; }
.mud-data-grid-pager .mud-input.mud-input-outlined { min-height:28px !important; }
.mud-data-grid-pager .mud-input-root { font-size:12px !important; min-height:28px !important; padding:0 4px !important; }
.mud-data-grid-pager .mud-input-root .mud-select-input { padding:0 4px !important; font-size:12px !important; }
.mud-data-grid-pager fieldset.mud-notched-outline { border-radius:6px !important; border-color:#E2E8F0 !important; }
.mud-data-grid-pager .mud-input-label-outlined { display:none !important; }
.mud-data-grid-pager .mud-input-adornment { display:none !important; }
/* Pager: navigation icon-buttons */
.mud-data-grid-pager .mud-icon-button {
    width:30px !important; height:30px !important; padding:4px !important;
    border-radius:6px !important; border:1.5px solid #E2E8F0 !important;
    background:#fff !important; color:#475569 !important;
    transition:all .15s !important; margin:0 1px !important;
}
.mud-data-grid-pager .mud-icon-button:hover:not(:disabled) { border-color:#2563EB !important; color:#2563EB !important; background:#EEF2FF !important; }
.mud-data-grid-pager .mud-icon-button:disabled { opacity:.35 !important; cursor:default !important; }
.mud-data-grid-pager .mud-icon-button .mud-icon-root { width:16px !important; height:16px !important; font-size:16px !important; }
.mud-data-grid-pager .mud-icon-button .mud-icon-root path { fill:#475569 !important; }
.mud-data-grid-pager .mud-icon-button:hover:not(:disabled) .mud-icon-root path { fill:#2563EB !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ CARDS / PAPER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-paper { border-radius: 14px !important; }
.mud-paper-outlined { border: 1.5px solid #E2E8F0 !important; border-radius: 14px !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ DIALOG
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-dialog { border-radius: 16px !important; overflow: hidden !important; }
.mud-dialog-title {
    font-size: 16px !important; font-weight: 700 !important;
    padding: 20px 24px 14px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    color: #0F172A !important;
}
.mud-dialog-content { padding: 20px 24px !important; }
.mud-dialog-actions { padding: 14px 24px 18px !important; border-top: 1px solid #F1F5F9 !important; gap: 8px !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ AUTOCOMPLETE DROPDOWN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-popover { border-radius: 12px !important; box-shadow: 0 8px 30px rgba(0,0,0,.12) !important; }
.mud-list-item { font-size: 13px !important; padding: 8px 16px !important; }
.mud-list-item:hover { background: #EEF2FF !important; }
.mud-list-item.mud-selected { background: #DBEAFE !important; color: #1D4ED8 !important; font-weight: 600 !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ TOGGLE / SWITCH
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-switch-track { border-radius: 20px !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ★ TYPOGRAPHY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mud-typography-h4     { font-size: 1.5rem !important; font-weight: 800 !important; color: #0F172A !important; }
.mud-typography-h5     { font-size: 1.2rem !important; font-weight: 700 !important; color: #0F172A !important; }
.mud-typography-h6     { font-size: 1rem   !important; font-weight: 600 !important; color: #0F172A !important; }
.mud-typography-body1  { font-size: 14px   !important; color: #0F172A !important; }
.mud-typography-body2  { font-size: 13px   !important; color: #475569 !important; }
.mud-typography-caption{ font-size: 12px   !important; color: #64748B !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DASHBOARD CARDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    border: 1.5px solid #E2E8F0;
    transition: box-shadow .18s, transform .18s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.1); transform: translateY(-1px); }
.stat-card .stat-accent {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; border-radius: 14px 0 0 14px;
}
.stat-card .stat-label { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #64748B; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1; color: #0F172A; }
.stat-card .stat-sub   { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.stat-card .stat-icon  { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); opacity: .06; font-size: 60px !important; width: 60px !important; height: 60px !important; }
.stat-card .stat-icon svg  { width: 60px !important; height: 60px !important; }
.stat-card .stat-icon path { fill: #0F172A !important; }

/* Dashboard bottom grid */
.dash-grid { display:grid; grid-template-columns:1fr 300px; gap:16px; align-items:start; }
@@media (max-width:900px) { .dash-grid { grid-template-columns:1fr; } }
.cat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@@media (max-width:700px) { .cat-grid { grid-template-columns:repeat(2,1fr); } }

.cat-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1.5px solid #E2E8F0;
    border-radius: 10px; cursor: pointer;
    background: #FAFAFA; transition: all .15s ease;
}
.cat-card:hover { background: #EEF2FF; border-color: #93C5FD; box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.cat-card .cat-icon-wrap {
    width: 34px; height: 34px; border-radius: 8px;
    background: #EEF2FF;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cat-card .cat-icon-wrap path { fill: #1D4ED8 !important; }
.cat-card .cat-count { font-size: 16px; font-weight: 800; color: #0F172A; line-height: 1.1; }
.cat-card .cat-name  { font-size: 11px; color: #64748B; }

.section-card { background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 6px rgba(0,0,0,.06); border:1.5px solid #E2E8F0; }
.section-card-title { font-size: 13px; font-weight: 700; color: #0F172A; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; text-transform:uppercase; letter-spacing:.5px; }

.action-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; border-radius: 10px; border: none;
    cursor: pointer; width: 100%; font-size: 13px; font-weight: 600;
    margin-bottom: 8px; transition: all .15s; text-decoration: none;
    font-family: inherit;
}
.action-btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #fff; box-shadow: 0 2px 12px rgba(37,99,235,.35);
}
.action-btn-primary:hover { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); box-shadow: 0 4px 18px rgba(37,99,235,.5); transform: translateY(-1px); }
.action-btn-outline { background: #fff; color: #1D4ED8; border: 2px solid #BFDBFE; }
.action-btn-outline:hover { background: #EEF2FF; border-color: #2563EB; }
.action-btn .ab-icon { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.action-btn-primary .ab-icon { background: rgba(255,255,255,.2); }
.action-btn-outline .ab-icon { background: #EEF2FF; }
.action-btn .ab-icon svg { width: 16px !important; height: 16px !important; }
.action-btn-primary .ab-icon path { fill: #fff !important; }
.action-btn-outline .ab-icon path { fill: #1D4ED8 !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SCROLLBAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #BFDBFE; border-radius: 3px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MISC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#blazor-error-ui { display: none; }
.valid.modified:not([type=checkbox]) { outline: 1.5px solid #22C55E; }
.invalid            { outline: 1.5px solid #EF4444; }
.validation-message { color: #DC2626; font-size: 11px; margin-top: 4px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARED PAGE PATTERNS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* KPI 4-column grid — not subject to MudBlazor breakpoints */
.kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
@@media (max-width:900px) { .kpi-grid { grid-template-columns:repeat(2,1fr); } }
@@media (max-width:500px) { .kpi-grid { grid-template-columns:1fr; } }

.page-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:12px; }
.page-hdr h1 {
    font-size: 22px; font-weight: 800; margin: 0 0 3px; line-height: 1.2;
    /* Gradient title: deep blue → indigo */
    background: linear-gradient(120deg, #1D4ED8 0%, #4F46E5 55%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.3px;
}
.page-hdr p  { font-size:13px; color:#64748B; margin:0; }
.page-hdr-right { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

.filter-bar { background:#F8FAFC; border-radius:12px; padding:12px 16px; margin-bottom:16px; box-shadow:0 1px 4px rgba(0,0,0,.06); display:flex; gap:10px; align-items:center; flex-wrap:wrap; border:1.5px solid #E2E8F0; }
.filter-bar .fb-item { min-width:160px; flex:1; } /* legacy — kept for MudBlazor form pages */
.filter-bar .fb-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; margin-left:auto; }

.page-card { background:#fff; border-radius:16px; box-shadow:0 2px 10px rgba(0,0,0,.06); overflow:hidden; }
.page-card-body { padding:24px; }
.card-hdr { display:flex; align-items:center; justify-content:space-between; padding:16px 22px; border-bottom:1px solid #F1F5F9; }
.card-hdr-title { font-size:14px; font-weight:700; color:#0F172A; display:flex; align-items:center; gap:8px; }

/* Status badges */
.badge { display:inline-flex; align-items:center; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; white-space:nowrap; }
.badge-active       { background:#DCFCE7; color:#166534; }
.badge-inactive     { background:#F1F5F9; color:#475569; }
.badge-maintenance  { background:#FEF9C3; color:#854D0E; }
.badge-decomm       { background:#FEE2E2; color:#991B1B; }
.badge-planned      { background:#DBEAFE; color:#1E40AF; }
.badge-prod         { background:#FEE2E2; color:#991B1B; }
.badge-staging      { background:#FEF9C3; color:#854D0E; }
.badge-dev          { background:#DBEAFE; color:#1E40AF; }
.badge-test         { background:#F3E8FF; color:#6B21A8; }
.badge-default      { background:#F1F5F9; color:#475569; }
.badge-role-super   { background:linear-gradient(135deg,#7C3AED,#4F46E5); color:#fff; }
.badge-role-admin   { background:#FEE2E2; color:#991B1B; }
.badge-role-mgr     { background:#EEF2FF; color:#1D4ED8; }
.badge-role-dev     { background:#FEF3C7; color:#92400E; }
.badge-role-ro      { background:#F1F5F9; color:#475569; }

/* Detail table */
.detail-table { width:100%; border-collapse:collapse; font-size:13px; }
.detail-table tr { border-bottom:1px solid #F1F5F9; }
.detail-table tr:last-child { border-bottom:none; }
.detail-table tr:hover td { background:#F8FAFC; }
.detail-table td { padding:10px 14px; vertical-align:top; }
.detail-table td:first-child { font-weight:700; color:#64748B; width:36%; font-size:11px; text-transform:uppercase; letter-spacing:.6px; }
.detail-table td:last-child  { color:#0F172A; word-break:break-word; }

.detail-notes { background:#F8FAFC; border-left:3px solid #2563EB; border-radius:0 10px 10px 0; padding:12px 16px; margin-top:12px; font-size:13px; line-height:1.7; color:#334155; white-space:pre-wrap; }
.detail-notes-label { font-size:10px; font-weight:800; color:#2563EB; text-transform:uppercase; letter-spacing:.8px; margin-bottom:6px; }

/* Relationship table */
.rel-table { width:100%; border-collapse:collapse; font-size:13px; }
.rel-table thead tr { border-bottom:2px solid #E2E8F0; }
.rel-table thead th { background:#F8FAFC; font-size:10px; font-weight:800; color:#64748B; text-transform:uppercase; letter-spacing:.8px; padding:10px 14px; text-align:left; }
.rel-table tbody td { padding:10px 14px; border-bottom:1px solid #F1F5F9; }
.rel-table tbody tr:hover td { background:#EEF2FF; }
.rel-table a { color:#1D4ED8; font-weight:600; text-decoration:none; }
.rel-table a:hover { text-decoration:underline; }

/* Asset hero header */
.asset-hdr { background:linear-gradient(135deg,#0F172A 0%,#1E293B 100%); border-radius:16px; padding:24px 28px; margin-bottom:20px; color:#fff; display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.asset-hdr-icon { width:54px; height:54px; border-radius:14px; background:rgba(255,255,255,.12); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.asset-hdr-icon path,.asset-hdr-icon svg path { fill:#fff !important; }
.asset-hdr-icon svg { width:26px !important; height:26px !important; }
.asset-hdr h1 { font-size:20px; font-weight:800; margin:0 0 4px; color:#fff; }
.asset-hdr p { font-size:13px; opacity:.75; margin:0; color:#fff; }
.asset-hdr-right { margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* Back pill */
.back-pill { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; color:#64748B; background:#F1F5F9; border:none; border-radius:8px; padding:5px 10px; cursor:pointer; text-decoration:none; transition:background .15s; }
.back-pill:hover { background:#E2E8F0; color:#0F172A; }

/* MudTabs removed — all pages now use native .tab-nav / .tab-btn */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CUSTOM DATA GRID PAGER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.custom-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #F1F5F9;
    background: #FAFAFA;
    border-radius: 0 0 16px 16px;
    flex-wrap: wrap;
}
.cp-label { font-size: 12px; color: #94A3B8; white-space: nowrap; }
.cp-count { font-size: 12px; color: #64748B; white-space: nowrap; }
.cp-spacer { flex: 1; }
.cp-nav { display: flex; gap: 4px; align-items: center; }
.cp-nav .icon-btn:disabled { opacity: .3; cursor: default; pointer-events: none; }
/* Suppress any remaining MudDataGridPager rendering */
.mud-data-grid-pager { display: none !important; }

/* Access denied */
.access-denied { text-align:center; padding:60px 20px; }
.access-denied .ad-icon { font-size:56px; margin-bottom:16px; }
.access-denied h2 { font-size:20px; font-weight:700; color:#0F172A; margin:0 0 8px; }
.access-denied p { font-size:14px; color:#64748B; margin:0; }

/* Config form sections */
.cfg-section { border-radius:12px; border:1.5px solid #E2E8F0; padding:20px 22px; margin-bottom:16px; background:#fff; }
.cfg-section-title { font-size:13px; font-weight:700; color:#0F172A; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.cfg-section-title .cs-icon { width:28px; height:28px; border-radius:7px; background:#EEF2FF; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.cfg-section-title .cs-icon path { fill:#1D4ED8 !important; }
.cfg-section-title .cs-icon svg { width:14px !important; height:14px !important; }

/* Legend for map */
.legend-bar { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; background:#fff; border-radius:12px; padding:12px 18px; margin-bottom:14px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.legend-item { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:500; color:#374151; white-space:nowrap; }
.legend-swatch { width:14px; height:14px; border-radius:4px; flex-shrink:0; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.legend-dot { width:10px; height:10px; border-radius:3px; flex-shrink:0; }

/* Map info panel */
.map-info-panel { position:absolute; bottom:16px; left:16px; width:260px; background:#fff; border-radius:14px; box-shadow:0 4px 20px rgba(0,0,0,.14); padding:16px; z-index:10; }
.map-info-name { font-size:14px; font-weight:700; color:#0F172A; margin-bottom:4px; }
.map-info-detail { font-size:12px; color:#64748B; line-height:1.6; }

/* Map zoom controls */
.map-zoom-controls {
    position: absolute; top: 12px; right: 12px; z-index: 10;
    display: flex; flex-direction: column; gap: 2px;
    background: #fff; border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15); padding: 4px;
    border: 1px solid #E2E8F0;
}
.map-zoom-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 7px; border: none;
    background: transparent; color: #475569; cursor: pointer;
    transition: background .12s, color .12s;
}
.map-zoom-btn:hover { background: #EEF2FF; color: #2563EB; }
.map-zoom-btn .material-icons { font-size: 18px; }
.map-zoom-divider { height: 1px; background: #F1F5F9; margin: 2px 0; }

/* Keyboard shortcut hint */
.map-hint {
    position: absolute; bottom: 12px; right: 12px; z-index: 10;
    font-size: 11px; color: #94A3B8;
    background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
    padding: 5px 10px; border-radius: 6px;
    border: 1px solid #E2E8F0;
}
.map-hint kbd {
    display: inline-block; padding: 0 5px; border-radius: 4px;
    background: #F1F5F9; border: 1px solid #CBD5E1;
    font-size: 10px; font-family: monospace; color: #475569;
}

/* Config section extras */
.cfg-section-icon { font-size:18px; color:#1D4ED8; }
.cfg-toggle { margin-left:auto; }
.cfg-actions { display:flex; justify-content:flex-end; margin-top:20px; padding-top:16px; border-top:1px solid #F1F5F9; }
.cfg-info-box { display:flex; align-items:flex-start; gap:10px; background:#EEF2FF; border:1px solid #BFDBFE; border-radius:10px; padding:12px 14px; margin-bottom:18px; font-size:13px; color:#0C4A6E; line-height:1.5; }
.cfg-warn-box { display:flex; align-items:flex-start; gap:10px; background:#FFFBEB; border:1px solid #FDE68A; border-radius:10px; padding:12px 14px; margin-top:14px; font-size:13px; color:#78350F; line-height:1.5; }

/* Legend title */
.legend-title { font-size:11px; font-weight:800; color:#64748B; text-transform:uppercase; letter-spacing:.8px; margin-right:4px; flex-shrink:0; }

/* Map canvas wrapper */
.map-canvas-wrap { position:relative; background:#fff; border-radius:16px; box-shadow:0 2px 12px rgba(0,0,0,.08); overflow:hidden; height:calc(100vh - 310px); min-height:480px; }

/* Error / 404 page */
.error-page { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:80px 20px; text-align:center; gap:8px; }
.error-page-code { font-size:96px; font-weight:900; color:#C7D2FE; line-height:1; margin-bottom:8px; }
.error-page-title { font-size:22px; font-weight:700; color:#0F172A; margin:0; }
.error-page-msg { font-size:14px; color:#64748B; margin:0 0 16px; }
.error-request-id { display:flex; align-items:center; gap:8px; margin-bottom:12px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DETAIL PAGE — Two-column layout
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.detail-layout { display:grid; grid-template-columns:1fr 320px; gap:20px; align-items:start; }
@@media (max-width:960px) { .detail-layout { grid-template-columns:1fr; } }
.detail-sidebar { display:flex; flex-direction:column; gap:14px; }

/* Connected CI items in sidebar */
.conn-item { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid #F1F5F9; }
.conn-item:last-child { border-bottom:none; }
.conn-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.conn-dot-out { background:#1D4ED8; }
.conn-dot-in  { background:#0891B2; }
.conn-link { font-size:13px; color:#1D4ED8; text-decoration:none; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.conn-link:hover { text-decoration:underline; }
.conn-link-in { color:#0891B2; }
.conn-type { font-size:10px; font-weight:700; color:#94A3B8; text-transform:uppercase; flex-shrink:0; }

/* Relationship section headers */
.rel-section-hdr { font-size:10px; font-weight:800; letter-spacing:1px; text-transform:uppercase; color:#64748B; margin-bottom:8px; padding:4px 0; }

/* Empty state */
.empty-state { text-align:center; padding:36px 24px; color:#94A3B8; }
.empty-state-icon { font-size:36px; margin-bottom:10px; }
.empty-state-title { font-size:14px; font-weight:600; color:#475569; margin-bottom:4px; }
.empty-state-sub { font-size:13px; }

/* Diff values in history table */
.diff-old { font-size:12px; color:#DC2626; text-decoration:line-through; background:#FEF2F2; padding:2px 6px; border-radius:4px; }
.diff-new { font-size:12px; color:#166534; font-weight:600; background:#DCFCE7; padding:2px 6px; border-radius:4px; }
.text-muted { color:#64748B; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STANDALONE BUTTONS (outside EditForm)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btn-primary { display:inline-flex; align-items:center; gap:6px; padding:8px 18px; border-radius:8px; border:none; background:linear-gradient(135deg,#2563EB,#1D4ED8); font-size:13px; font-weight:700; color:#fff !important; cursor:pointer; font-family:inherit; text-decoration:none !important; box-shadow:0 2px 8px rgba(37,99,235,.28); transition:all .15s; white-space:nowrap; }
.btn-primary:hover { background:linear-gradient(135deg,#3B82F6,#2563EB); box-shadow:0 4px 14px rgba(37,99,235,.45); transform:translateY(-1px); color:#fff !important; }
.btn-primary-sm { padding:5px 12px !important; font-size:12px !important; box-shadow:0 1px 4px rgba(37,99,235,.18) !important; }
.btn-ghost-white { display:inline-flex; align-items:center; gap:6px; padding:7px 16px; border-radius:8px; border:1.5px solid rgba(255,255,255,.4); background:rgba(255,255,255,.15); font-size:13px; font-weight:600; color:#fff !important; cursor:pointer; font-family:inherit; text-decoration:none !important; transition:all .15s; white-space:nowrap; }
.btn-ghost-white:hover { background:rgba(255,255,255,.28); border-color:rgba(255,255,255,.7); color:#fff !important; }
.btn-scan { display:inline-flex; align-items:center; gap:5px; padding:7px 16px; border-radius:8px; border:1.5px solid rgba(34,197,94,.6); background:rgba(34,197,94,.18); font-size:13px; font-weight:600; color:#fff !important; cursor:pointer; font-family:inherit; transition:all .15s; white-space:nowrap; }
.btn-scan:hover:not(:disabled) { background:rgba(34,197,94,.32); border-color:rgba(34,197,94,.9); }
.btn-scan:disabled, .btn-scan-busy { opacity:.7; cursor:not-allowed; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ICON BUTTONS (table actions)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:6px; border:1.5px solid #E2E8F0; background:#fff; color:#64748B; cursor:pointer; transition:all .15s; padding:0; flex-shrink:0; text-decoration:none !important; }
.icon-btn:hover { border-color:#2563EB; color:#2563EB; background:#EEF2FF; }
.icon-btn-danger { border-color:#FECACA !important; color:#DC2626 !important; }
.icon-btn-danger:hover { border-color:#EF4444 !important; background:#FEF2F2 !important; color:#DC2626 !important; }
.icon-btn-success { border-color:#BBF7D0 !important; color:#16A34A !important; }
.icon-btn-success:hover { border-color:#86EFAC !important; background:#F0FDF4 !important; }
.icon-btn .material-icons { font-size:15px; line-height:1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   COMPACT SELECT (inline in tables)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.form-select-sm { height:32px; padding:0 30px 0 10px; border-radius:6px; border:1.5px solid #E2E8F0; font-size:12px; font-weight:500; color:#0F172A; background:#F8FAFC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2394A3B8'/%3E%3C/svg%3E") no-repeat right 6px center / 16px; font-family:inherit; outline:none; cursor:pointer; appearance:none; -webkit-appearance:none; transition:border-color .15s; min-width:130px; }
.form-select-sm:focus { border-color:#2563EB; background-color:#fff; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NATIVE MODAL OVERLAY
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-overlay { position:fixed; inset:0; background:rgba(15,23,42,.5); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; z-index:2000; padding:16px; }
.modal-box { background:#fff; border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,.25); width:460px; max-width:100%; overflow:hidden; animation:modal-in .18s ease; }
@@keyframes modal-in { from { opacity:0; transform:scale(.96) translateY(8px); } to { opacity:1; transform:none; } }
.modal-hdr { display:flex; align-items:center; justify-content:space-between; padding:20px 24px 16px; border-bottom:1px solid #F1F5F9; }
.modal-hdr-title { font-size:15px; font-weight:700; color:#0F172A; display:flex; align-items:center; gap:8px; }
.modal-close-btn { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:6px; border:none; background:transparent; color:#94A3B8; cursor:pointer; padding:0; }
.modal-close-btn:hover { background:#F1F5F9; color:#0F172A; }
.modal-close-btn .material-icons { font-size:18px; }
.modal-body { padding:20px 24px; display:flex; flex-direction:column; gap:14px; }
.modal-footer { display:flex; justify-content:flex-end; gap:10px; padding:14px 24px; border-top:1px solid #F1F5F9; background:#FAFAFA; }

/* Modal danger variant */
.modal-box-sm { width:380px; }
.modal-danger-icon { width:44px; height:44px; border-radius:12px; background:#FEF2F2; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-bottom:12px; }
.modal-danger-icon .material-icons { font-size:22px; color:#DC2626; }
.btn-danger { display:inline-flex; align-items:center; gap:6px; padding:8px 18px; border-radius:8px; border:none; background:linear-gradient(135deg,#EF4444,#DC2626); font-size:13px; font-weight:700; color:#fff; cursor:pointer; font-family:inherit; transition:all .15s; }
.btn-danger:hover { background:linear-gradient(135deg,#F87171,#EF4444); box-shadow:0 4px 14px rgba(220,38,38,.4); transform:translateY(-1px); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MULTISELECT DROPDOWN (filter bar)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.ms-wrap { position: relative; flex: 1; min-width: 160px; }
.ms-trigger {
    display: flex; align-items: center; gap: 6px;
    width: 100%; height: 40px; padding: 0 10px 0 12px;
    background: #F9FAFB; border: 1.5px solid #E5E7EB; border-radius: 8px;
    font-size: 13px; color: #374151; font-family: inherit;
    cursor: pointer; white-space: nowrap;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.ms-trigger:hover { border-color: #CBD5E1; background: #F3F4F6; }
.ms-open .ms-trigger {
    border-color: #2563EB; background: #EFF6FF;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.ms-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.ms-chevron { font-size: 18px !important; color: #9CA3AF; flex-shrink: 0; transition: transform .15s; }
.ms-open .ms-chevron { transform: rotate(180deg); color: #2563EB; }

.ms-panel {
    position: absolute; top: calc(100% + 5px); left: 0;
    min-width: 220px; max-height: 300px; overflow-y: auto;
    background: #fff; border: 1.5px solid #E2E8F0; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    z-index: 300; padding: 5px 0;
    animation: ms-drop .12s ease;
}
@@keyframes ms-drop { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

.ms-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer;
    font-size: 13px; color: #374151;
    transition: background .1s; user-select: none;
}
.ms-option:hover { background: #F8FAFC; }
.ms-checked { color: #1D4ED8; font-weight: 600; background: #F0F7FF; }
.ms-checked:hover { background: #E0EDFF; }
.ms-chk { font-size: 18px !important; color: #CBD5E1; flex-shrink: 0; transition: color .1s; }
.ms-checked .ms-chk { color: #2563EB; }
.ms-cat-ico { font-size: 15px !important; color: #94A3B8; flex-shrink: 0; }
.ms-checked .ms-cat-ico { color: #2563EB; }
.ms-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ms-dot-green { background: #16A34A; }
.ms-dot-amber { background: #D97706; }
.ms-dot-red   { background: #DC2626; }
.ms-dot-blue  { background: #0891B2; }
.ms-dot-gray  { background: #94A3B8; }

.ms-footer { border-top: 1px solid #F1F5F9; padding: 6px 10px; }
.ms-clear-btn {
    background: none; border: none; font-size: 12px; font-weight: 600;
    color: #94A3B8; cursor: pointer; font-family: inherit; padding: 2px 4px;
    border-radius: 4px; transition: color .1s, background .1s;
}
.ms-clear-btn:hover { color: #DC2626; background: #FEF2F2; }

/* full-screen backdrop to catch outside clicks */
.ms-backdrop { position: fixed; inset: 0; z-index: 299; cursor: default; }

/* filter-bar must allow overflow for dropdowns */
.filter-bar { overflow: visible !important; }

/* ── Topbar search ─────────────────────────────────────────────────────────── */
.topbar-search {
    display: flex; align-items: center;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    padding: 0 10px;
    height: 32px;
    min-width: 220px;
    max-width: 320px;
    margin-right: 12px;
    transition: background .15s, border-color .15s;
}
.topbar-search:focus-within {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.35);
}
.topbar-search-icon { font-size: 16px !important; color: rgba(255,255,255,.5); margin-right: 6px; flex-shrink: 0; }
.topbar-search-input {
    background: transparent; border: none; outline: none;
    color: #fff; font-size: 13px; font-family: inherit;
    width: 100%; min-width: 0;
}
.topbar-search-input::placeholder { color: rgba(255,255,255,.45); }

/* ── Global search page ────────────────────────────────────────────────────── */
.search-page-bar {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid #E2E8F0;
    border-radius: 12px; padding: 6px 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.search-page-bar:focus-within { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.search-page-icon { color: #94A3B8; font-size: 20px !important; flex-shrink: 0; }
.search-page-input {
    flex: 1; border: none; outline: none;
    font-size: 15px; font-family: inherit; color: #0F172A;
    background: transparent;
}
.search-page-input::placeholder { color: #94A3B8; }
.search-page-clear {
    background: none; border: none; cursor: pointer; padding: 2px;
    color: #94A3B8; display: flex; align-items: center;
    border-radius: 4px; transition: color .1s;
}
.search-page-clear:hover { color: #475569; }
.search-page-btn { height: 32px; padding: 0 16px; font-size: 13px; flex-shrink: 0; }

.search-summary {
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: #475569; margin-bottom: 20px;
}
.search-elapsed { color: #94A3B8; font-size: 12px; }

.search-empty {
    text-align: center; padding: 60px 0;
}

.search-hint { padding: 16px 0 32px; }
.search-hint-grid {
    display: grid; grid-template-columns: repeat(3,1fr); gap: 16px;
}
@media (max-width: 600px) { .search-hint-grid { grid-template-columns: 1fr; } }
.search-hint-card {
    background: #fff; border: 1px solid #E2E8F0;
    border-radius: 12px; padding: 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.search-hint-card .material-icons { font-size: 24px !important; margin-bottom: 4px; }
.search-hint-card > div:nth-child(2) { font-size: 13px; font-weight: 700; color: #0F172A; }
.search-hint-card > div:nth-child(3) { font-size: 12px; color: #94A3B8; }

.search-group { margin-bottom: 24px; }
.search-group-hdr {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #64748B;
    padding: 0 4px 8px; border-bottom: 1px solid #E2E8F0;
    margin-bottom: 4px;
}
.search-group-count {
    margin-left: auto;
    background: #E2E8F0; color: #475569;
    font-size: 11px; font-weight: 600;
    border-radius: 10px; padding: 0 7px; height: 18px;
    line-height: 18px;
}
.search-group-body { display: flex; flex-direction: column; }

.search-result-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px; border-radius: 8px;
    text-decoration: none; color: inherit;
    transition: background .1s;
}
.search-result-row:hover { background: #F1F5F9; }
.srr-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: #EEF2FF; display: flex; align-items: center;
    justify-content: center; color: #3B82F6; flex-shrink: 0;
}
.srr-body { flex: 1; min-width: 0; }
.srr-title { font-size: 13px; font-weight: 600; color: #0F172A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srr-sub   { font-size: 12px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.srr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.srr-when  { font-size: 11px; color: #94A3B8; white-space: nowrap; }

mark.search-mark { background: #FEF08A; color: #0F172A; border-radius: 2px; padding: 0 1px; }

/* ── CSV Import ────────────────────────────────────────────────────────────── */
.csv-steps {
    display: flex; align-items: center; margin-bottom: 28px;
}
.csv-step { display: flex; align-items: center; gap: 8px; }
.csv-step-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: #E2E8F0; color: #94A3B8;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
    transition: background .2s, color .2s;
}
.csv-step.active .csv-step-dot  { background: #3B82F6; color: #fff; }
.csv-step.done   .csv-step-dot  { background: #16A34A; color: #fff; }
.csv-step-label  { font-size: 12px; font-weight: 600; color: #94A3B8; white-space: nowrap; }
.csv-step.active .csv-step-label { color: #3B82F6; }
.csv-step.done   .csv-step-label { color: #16A34A; }
.csv-step-line {
    flex: 1; height: 2px; background: #E2E8F0; margin: 0 8px;
    min-width: 24px; transition: background .2s;
}
.csv-step-line.done { background: #16A34A; }

.csv-upload-zone {
    border: 2px dashed #CBD5E1; border-radius: 12px;
    padding: 40px 24px; text-align: center;
    background: #F8FAFC; transition: border-color .15s, background .15s;
    cursor: default;
}
.csv-upload-zone.dragging { border-color: #3B82F6; background: #EFF6FF; }

.csv-error-box {
    display: flex; align-items: center; gap: 8px;
    background: #FEF2F2; border: 1px solid #FECACA;
    border-radius: 8px; padding: 10px 14px;
    font-size: 13px; color: #DC2626;
}

.csv-map-table { width: 100%; border-collapse: collapse; }
.csv-map-table th {
    text-align: left; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: #94A3B8;
    padding: 0 12px 8px; border-bottom: 1px solid #E2E8F0;
}
.csv-map-table td {
    padding: 8px 12px; border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}
.csv-map-table tr:last-child td { border-bottom: none; }

.csv-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.csv-preview-table th {
    background: #F8FAFC; padding: 7px 12px; text-align: left;
    font-size: 11px; font-weight: 700; color: #64748B;
    border-bottom: 1px solid #E2E8F0; white-space: nowrap;
}
.csv-preview-table td {
    padding: 7px 12px; border-bottom: 1px solid #F1F5F9;
    color: #0F172A; max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.csv-preview-table tr:last-child td { border-bottom: none; }
.csv-preview-table tr:hover td { background: #F8FAFC; }

.csv-result-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 500px) { .csv-result-grid { grid-template-columns: repeat(2, 1fr); } }
.csv-result-tile {
    border-radius: 10px; padding: 16px; text-align: center;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.csv-result-tile .material-icons { font-size: 22px !important; }
.csv-result-num { font-size: 24px; font-weight: 800; line-height: 1; }
.csv-result-tile.green { background: #F0FDF4; color: #16A34A; }
.csv-result-tile.blue  { background: #EFF6FF; color: #2563EB; }
.csv-result-tile.gray  { background: #F8FAFC; color: #64748B; }
.csv-result-tile.red   { background: #FEF2F2; color: #DC2626; }

/* ── Risk Management ──────────────────────────────────────────────────── */
.rm-levels-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 0;
}
@media (max-width: 900px) { .rm-levels-grid { grid-template-columns: 1fr; } }
.rm-levels-grid .page-card { padding: 20px; }

.rm-level-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700;
    white-space: nowrap;
}
.rm-color-swatch {
    display: inline-block; width: 16px; height: 16px;
    border-radius: 4px; vertical-align: middle;
}

/* Matrix */
.rm-matrix-card { padding: 20px 24px; overflow: visible; }
.risk-matrix-table { border-collapse: separate; border-spacing: 0; width: 100%; margin-top: 4px; }
.risk-matrix-table th { padding: 10px 16px; text-align: center; }
.risk-matrix-table td { padding: 10px 12px; }
.rm-axis-label { text-align: left; font-size: 12px; font-weight: 600; color: #94A3B8; background: transparent; min-width: 160px; }
.rm-col-header { font-size: 12px; font-weight: 700; color: #475569; background: #F1F5F9; border-radius: 6px; letter-spacing: .02em; }
.rm-row-header { text-align: left; font-size: 12px; font-weight: 700; color: #475569; white-space: nowrap; padding-right: 20px; }
.rm-cell { min-width: 160px; transition: background .15s; border-radius: 8px; padding: 8px 10px; }
.rm-cell-select {
    width: 100%; border: 1px solid #E2E8F0; border-radius: 7px;
    padding: 7px 10px; font-size: 13px; background: #fff; cursor: pointer;
    font-weight: 500;
}
.rm-cell-select:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 2px #BFDBFE; }

/* Risk summary bar */
.risk-summary-bar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.risk-summary-chip {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 16px; border-radius: 8px; background: #F8FAFC; gap: 2px; min-width: 80px;
}
.risk-summary-count { font-size: 22px; font-weight: 800; line-height: 1; }
.risk-summary-label { font-size: 11px; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: .04em; }

/* Inline add button */
.btn-add-inline {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
    padding: 5px 12px; border-radius: 7px; border: 1.5px dashed #CBD5E1;
    font-size: 12px; font-weight: 600; color: #64748B; background: transparent; cursor: pointer;
}
.btn-add-inline:hover { border-color: #2563EB; color: #2563EB; background: #EFF6FF; }

/* Risk register table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748B; white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #F1F5F9; vertical-align: top; }
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-link { color: #2563EB; font-weight: 600; text-decoration: none; }
.table-link:hover { text-decoration: underline; }

/* Icon buttons */
.icon-btn { background: none; border: none; cursor: pointer; padding: 3px 4px; border-radius: 5px; color: #64748B; line-height: 1; }
.icon-btn:hover { background: #F1F5F9; color: #1D4ED8; }
.icon-btn-danger:hover { background: #FEF2F2; color: #DC2626; }

/* btn-ghost */
.btn-ghost {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border-radius: 7px; border: 1.5px solid #E2E8F0;
    font-size: 13px; font-weight: 600; color: #475569; background: #fff; cursor: pointer;
}
.btn-ghost:hover { border-color: #2563EB; color: #2563EB; background: #EFF6FF; }

/* Tab content padding */
.tab-content { padding: 16px 0; }
