/* ============================================
   Control Plane - Blazor + Radzen Theme
   Primary Brand Color: #0A4EB7
   ============================================ */

:root {
    /* Elevate Radzen dialogs above the document viewer drawer (z-index 1200/1201). */
    --rz-dialog-mask-zindex: 1300;
    --rz-dialog-zindex: 1301;

    --rz-primary: #0A4EB7;
    --rz-primary-lighter: #4D8FE0;
    --rz-primary-light: #2B6FCC;
    --rz-primary-dark: #073A8A;
    --rz-primary-darker: #04275D;
    --logo-color: var(--rz-primary);
    --surface-0: #ffffff;
    --surface-50: #f8fafc;
    --surface-100: #f1f5f9;
    --surface-200: #e2e8f0;
    --surface-300: #cbd5e1;
    --surface-400: #94a3b8;
    --surface-500: #64748b;
    --surface-600: #475569;
    --surface-700: #334155;
    --surface-800: #1e293b;
    --surface-900: #0f172a;
    --surface-950: #020617;
    --text-color: var(--surface-900);
    --text-color-secondary: var(--surface-500);
    --layout-sidebar-width: 240px;
    --layout-topbar-height: 60px;

    /* Pill / badge palette (the single source of truth for status pills — task #2630).
       Fixed hex chips so a status reads identically on every page and in both themes.
       Consumed by the .rz-badge.rz-badge-* rules; change a colour here, not per page. */
    --pill-green-bg: #E7F7F1;  --pill-green-text: #0D7A54;
    --pill-amber-bg: #FEF3E2;  --pill-amber-text: #B45309;
    --pill-gray-bg:  #F1F5F9;  --pill-gray-text:  #64748B;
    --pill-red-bg:   #FEE2E2;  --pill-red-text:   #C02626;
}

.app-dark {
    --text-color: #ffffffde;
    --text-color-secondary: #ffffff99;
    --surface-0: #121212;
    --surface-50: #1e1e1e;
    --surface-100: #252525;
    --surface-200: #2e2e2e;
    --surface-300: #3b3b3b;
    --surface-400: #5e5e5e;
    --surface-500: #8b8b8b;
    --surface-600: #b0b0b0;
    --surface-700: #d4d4d4;
    --surface-800: #e8e8e8;
    --surface-900: #f5f5f5;
    --surface-950: #fafafa;
    --logo-color: #ffffff;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background: var(--surface-50);
}

/* Layout Container */
.layout-container {
    display: flex;
    min-height: 100vh;
}

.layout-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--layout-sidebar-width);
    background: var(--surface-0);
    border-right: 1px solid var(--surface-200);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, width 0.3s;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    height: var(--layout-topbar-height);
}

.app-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.app-logo svg { height: 24px; }
.app-logo .app-logo-small { display: none; }

.layout-menu-container {
    overflow-y: auto;
    flex-grow: 1;
    padding: 0.5rem 0;
}

.layout-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.layout-menuitem-root-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-color-secondary);
    padding: 1rem 1rem 0.5rem;
}

.layout-menu li a,
.layout-menu li .menu-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.875rem;
}

.layout-menu li a:hover,
.layout-menu li .menu-link:hover {
    background: var(--surface-100);
}

.layout-menuitem-icon {
    font-size: 1.125rem;
    color: var(--text-color-secondary);
    width: 1.25rem;
    text-align: center;
}

.layout-menuitem-text {
    flex-grow: 1;
}

.layout-submenu-toggler {
    font-size: 0.75rem;
    color: var(--text-color-secondary);
    transition: transform 0.3s ease;
}

.layout-submenu-toggler.rotated {
    transform: rotate(-180deg);
}

.active-menuitem > a .layout-submenu-toggler,
.active-menuitem > .menu-link .layout-submenu-toggler {
    transform: rotate(-180deg);
}

.active-menuitem-toggle .layout-submenu-toggler {
    transform: rotate(-180deg);
}

.active-menuitem > a,
.active-menuitem > .menu-link {
    color: var(--rz-primary);
}

.active-menuitem > a .layout-menuitem-icon,
.active-menuitem > .menu-link .layout-menuitem-icon {
    color: var(--rz-primary);
}

.layout-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.layout-root-submenulist {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.layout-root-submenulist.layout-submenu-expanded {
    max-height: 1000px !important;
    opacity: 1 !important;
    overflow: visible;
}

.layout-root-submenulist.layout-submenu-collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden;
}

.layout-submenu-expanded {
    max-height: 1000px;
    opacity: 1;
}

.layout-submenu-collapsed {
    max-height: 0;
    opacity: 0;
}

.layout-submenu li a,
.layout-submenu li .menu-link {
    padding-left: 2.75rem;
}

.layout-submenu .layout-submenu li a,
.layout-submenu .layout-submenu li .menu-link {
    padding-left: 4rem;
}

.layout-submenu .layout-submenu .layout-submenu li a,
.layout-submenu .layout-submenu .layout-submenu li .menu-link {
    padding-left: 5.25rem;
}

.active-route,
a.active-route,
.menu-link.active-route {
    background: color-mix(in srgb, var(--rz-primary) 10%, transparent);
    color: var(--rz-primary) !important;
    font-weight: 600;
}

.active-route .layout-menuitem-icon {
    color: var(--rz-primary) !important;
}

.layout-content-wrapper {
    margin-left: var(--layout-sidebar-width);
    flex-grow: 1;
    /* As a flex child its default min-width:auto refuses to shrink below its content's intrinsic
       width, so any page wider than the content area pushed a viewport-level horizontal scrollbar.
       min-width:0 lets it shrink to the available width so content reflows instead. */
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.layout-content {
    padding: 2rem;
    flex-grow: 1;
    /* Contain any residual horizontal overflow from page content so it never produces a page-wide
       scrollbar. `clip` (not `hidden`) leaves the vertical axis visible — no nested scroll container,
       so sticky/positioned elements keep working. Wide grids/tables use their own overflow-x:auto
       scroll containers (e.g. .deals-grid-scroll) and are unaffected. */
    min-width: 0;
    overflow-x: clip;
}

.layout-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--layout-topbar-height);
    padding: 0 2rem;
    background: var(--surface-0);
    border-bottom: 1px solid var(--surface-200);
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-end {
    display: flex;
    align-items: center;
}

.topbar-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.topbar-menubutton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 1.25rem;
}

.topbar-menubutton:hover {
    background: var(--surface-100);
}

.topbar-profile button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.topbar-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.layout-breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
}

.layout-breadcrumb-chevron {
    color: var(--surface-400);
}

.layout-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

/* Menu Modes */
.layout-static-inactive .layout-sidebar { transform: translateX(-100%); }
.layout-static-inactive .layout-content-wrapper { margin-left: 0; }

.layout-overlay .layout-sidebar { transform: translateX(-100%); }
.layout-overlay .layout-content-wrapper { margin-left: 0; }
.layout-overlay.layout-overlay-active .layout-sidebar { transform: translateX(0); }
.layout-overlay.layout-overlay-active .layout-mask { display: block; }

.layout-slim .layout-sidebar { width: 72px; }
.layout-slim .app-logo .app-logo-normal { display: none; }
.layout-slim .app-logo .app-logo-small { display: block; }
.layout-slim .layout-menuitem-root-text,
.layout-slim .layout-menuitem-text,
.layout-slim .layout-submenu-toggler { display: none; }
.layout-slim .layout-content-wrapper { margin-left: 72px; }

.layout-horizontal .layout-sidebar { position: relative; width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid var(--surface-200); }
.layout-horizontal .layout-menu-container { overflow-x: auto; overflow-y: visible; }
.layout-horizontal .layout-menu { display: flex; flex-direction: row; }
.layout-horizontal .layout-content-wrapper { margin-left: 0; }

.layout-reveal .layout-sidebar { width: 72px; }
.layout-reveal .app-logo .app-logo-normal { display: none; }
.layout-reveal .app-logo .app-logo-small { display: block; }
.layout-reveal .layout-menuitem-root-text,
.layout-reveal .layout-menuitem-text,
.layout-reveal .layout-submenu-toggler { display: none; }
.layout-reveal .layout-content-wrapper { margin-left: 72px; }
.layout-reveal.layout-sidebar-expanded .layout-sidebar { width: var(--layout-sidebar-width); }
.layout-reveal.layout-sidebar-expanded .app-logo .app-logo-normal { display: block; }
.layout-reveal.layout-sidebar-expanded .app-logo .app-logo-small { display: none; }
.layout-reveal.layout-sidebar-expanded .layout-menuitem-root-text,
.layout-reveal.layout-sidebar-expanded .layout-menuitem-text,
.layout-reveal.layout-sidebar-expanded .layout-submenu-toggler { display: inline; }

.layout-drawer .layout-sidebar { width: 72px; }
.layout-drawer .app-logo .app-logo-normal { display: none; }
.layout-drawer .app-logo .app-logo-small { display: block; }
.layout-drawer .layout-menuitem-root-text,
.layout-drawer .layout-menuitem-text,
.layout-drawer .layout-submenu-toggler { display: none; }
.layout-drawer .layout-content-wrapper { margin-left: 72px; }
.layout-drawer.layout-sidebar-expanded .layout-sidebar { width: var(--layout-sidebar-width); box-shadow: 0 0 40px rgba(0, 0, 0, 0.1); }
.layout-drawer.layout-sidebar-expanded .app-logo .app-logo-normal { display: block; }
.layout-drawer.layout-sidebar-expanded .app-logo .app-logo-small { display: none; }
.layout-drawer.layout-sidebar-expanded .layout-menuitem-root-text,
.layout-drawer.layout-sidebar-expanded .layout-menuitem-text,
.layout-drawer.layout-sidebar-expanded .layout-submenu-toggler { display: inline; }

/* Menu Themes */
.layout-primarycolor-menu .layout-sidebar { background: var(--rz-primary); border-right-color: var(--rz-primary-dark); }
.layout-primarycolor-menu .sidebar-header { border-bottom: 1px solid var(--rz-primary-light); }
.layout-primarycolor-menu .layout-menuitem-root-text { color: rgba(255,255,255,0.6); }
.layout-primarycolor-menu .layout-menu li a,
.layout-primarycolor-menu .layout-menu li .menu-link { color: rgba(255,255,255,0.85); }
.layout-primarycolor-menu .layout-menu li a:hover,
.layout-primarycolor-menu .layout-menu li .menu-link:hover { background: rgba(255,255,255,0.1); }
.layout-primarycolor-menu .layout-menu li a .layout-menuitem-icon,
.layout-primarycolor-menu .layout-menu li .menu-link .layout-menuitem-icon { color: rgba(255,255,255,0.6); }
.layout-primarycolor-menu .layout-menu li a.active-route,
.layout-primarycolor-menu .layout-menu li .menu-link.active-route { background: rgba(255,255,255,0.2); color: #ffffff !important; }

.layout-transparent-menu .layout-sidebar { background: transparent; border-right: none; }

/* Dark Mode */
.app-dark .layout-sidebar { background: var(--surface-50); border-right-color: var(--surface-200); }
.app-dark .layout-topbar { background: var(--surface-50); border-bottom-color: var(--surface-200); }
.app-dark .layout-content { background: var(--surface-0); }

/* Mobile */
@media (max-width: 991px) {
    .layout-sidebar { transform: translateX(-100%); }
    .layout-content-wrapper { margin-left: 0 !important; }
    .layout-mobile-active .layout-sidebar { transform: translateX(0); }
    .layout-mobile-active .layout-mask { display: block; }
}

/* Card */
.card {
    background: var(--surface-0);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--surface-200);
}

.app-dark .card {
    background: var(--surface-50);
    border-color: var(--surface-200);
}

/* Grid */
.grid { display: grid; }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-5 { grid-column: span 5 / span 5; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-7 { grid-column: span 7 / span 7; }
.col-span-8 { grid-column: span 8 / span 8; }
.col-span-9 { grid-column: span 9 / span 9; }
.col-span-12 { grid-column: span 12 / span 12; }

@media (min-width: 1280px) {
    .xl\:col-span-3 { grid-column: span 3 / span 3; }
    .xl\:col-span-4 { grid-column: span 4 / span 4; }
    .xl\:col-span-5 { grid-column: span 5 / span 5; }
    .xl\:col-span-6 { grid-column: span 6 / span 6; }
    .xl\:col-span-7 { grid-column: span 7 / span 7; }
    .xl\:col-span-8 { grid-column: span 8 / span 8; }
    .xl\:col-span-9 { grid-column: span 9 / span 9; }
}

@media (min-width: 1024px) {
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .lg\:col-span-5 { grid-column: span 5 / span 5; }
    .lg\:col-span-6 { grid-column: span 6 / span 6; }
    .lg\:col-span-7 { grid-column: span 7 / span 7; }
    .lg\:col-span-8 { grid-column: span 8 / span 8; }
    .lg\:col-span-9 { grid-column: span 9 / span 9; }
}

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }

/* Spacing */
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-auto { margin-left: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--rz-primary); }
.text-center { text-align: center; }
.text-muted { color: var(--text-color-secondary); }

/* Sizing */
.w-full { width: 100%; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }

/* Misc */
.border { border: 1px solid var(--surface-200); }
.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,0.1); }
.bg-primary { background-color: var(--rz-primary); }
.bg-surface-0 { background: var(--surface-0); }
.bg-surface-50 { background: var(--surface-50); }
.cursor-pointer { cursor: pointer; }
.overflow-hidden { overflow: hidden; }
.list-none { list-style: none; }
.relative { position: relative; }
.hidden { display: none; }
.transition { transition: all 0.15s ease; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; border-radius: 9999px; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Body Scroll Blocking (mobile menu open) */
body.blocked-scroll { overflow: hidden; }

/* Color Swatch (configurator) */
.color-swatch { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.color-swatch:hover { transform: scale(1.2); }
.color-swatch-active { box-shadow: 0 0 0 2px var(--primary-color, #0A4EB7); transform: scale(1.15); }

/* View Transition (dark mode toggle) */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* WAM deal-management filter bar — labeled fields, bottom-aligned so controls line up */
.deal-filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; margin-bottom: 1rem; }
.deal-filters .filter-field { display: flex; flex-direction: column; gap: 0.3rem; }
.deal-filters .filter-field > label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-color-secondary); }
.deal-filters .range { display: flex; align-items: center; gap: 0.4rem; }
.deal-filters .range > span { color: var(--text-color-secondary); }
.deal-filters .filter-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.deal-filters .filter-count { color: var(--text-color-secondary); font-size: 0.8125rem; white-space: nowrap; }

/* Deals grid horizontal scroll — the grid keeps a min-width (set inline) so its 10 columns don't
   compress on narrow screens; this wrapper scrolls horizontally instead of squashing them. */
.deals-grid-scroll { overflow-x: auto; }

/* Let grid HEADER titles wrap instead of truncating with an ellipsis, app-wide. Radzen renders
   each column title single-line with `text-overflow: ellipsis`, so narrow columns clip the title
   (e.g. "IOI Due D…", "ACCOUNT TYPE", "Approved / Declined") even when the cell data fits. Allow
   the header to wrap to two lines on every WAM grid. This is the single source of truth — pages
   should NOT re-declare a `.rz-column-title` wrap rule of their own. */
.rz-column-title,
.rz-column-title-content {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: break-word !important;
}

/* Plain-text columns (Asset Class, Sector, Deal Type) that hold longer values — allow the cell text
   to wrap instead of clipping with an ellipsis. Beats Radzen's default `.rz-cell-data { nowrap }`. */
.wrap-cell.rz-cell-data,
.wrap-cell .rz-cell-data {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* ============================================
   Shared FilterMultiSelect dropdown (Shared/FilterMultiSelect.razor) — a button trigger that opens a
   "FILTER BY …" popover with a Clear link and a scrollable checkbox list. Used by every list page's
   filter bar so the design stays consistent.
   ============================================ */
.filter-dd { position: relative; display: inline-block; }
.filter-dd-trigger {
    display: inline-flex; align-items: center; gap: 0.4rem; width: 100%;
    padding: 0.5rem 0.75rem; background: var(--surface-0, #fff);
    border: 1px solid var(--surface-300, #d1d5db); border-radius: 8px;
    font-size: 0.875rem; color: var(--text-color); cursor: pointer;
}
.filter-dd-trigger:hover { border-color: var(--surface-400, #9ca3af); }
.filter-dd-trigger.open { border-color: var(--primary-color); box-shadow: 0 0 0 1px var(--primary-color); }
.filter-dd-label { flex: 1; text-align: left; white-space: nowrap; }
.filter-dd-caret { margin-left: auto; color: var(--text-color-secondary); font-size: 1.15rem; }
.filter-dd-count {
    display: inline-flex; align-items: center; justify-content: center; padding: 0 0.35rem;
    min-width: 1.15rem; height: 1.15rem; border-radius: 999px;
    background: var(--primary-color); color: #fff; font-size: 0.7rem; font-weight: 600;
}
/* Transparent click-catcher behind the panel so clicking away closes it. */
.filter-dd-backdrop { position: fixed; inset: 0; z-index: 1000; background: transparent; }
.filter-dd-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 1001; min-width: 250px;
    background: var(--surface-0, #fff); border: 1px solid var(--surface-200, #e5e7eb);
    border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); overflow: hidden;
}
.filter-dd-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem 0.5rem;
}
.filter-dd-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--text-color-secondary); }
.filter-dd-clear {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--primary-color); font-size: 0.8125rem; font-weight: 600;
}
.filter-dd-clear:disabled { color: var(--surface-400, #9ca3af); cursor: default; }
.filter-dd-list { max-height: 280px; overflow-y: auto; padding: 0.25rem 0 0.5rem; }
.filter-dd-item {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1rem;
    cursor: pointer; font-size: 0.9rem; color: var(--text-color);
}
.filter-dd-item:hover { background: var(--surface-100, #f3f4f6); }
.filter-dd-item input[type="checkbox"] { width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--primary-color); flex: 0 0 auto; }
.filter-dd-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: 0 0 auto; }
.filter-dd-empty { padding: 0.75rem 1rem; color: var(--text-color-secondary); font-size: 0.85rem; }

/* Shared "Clear Filters" button (Shared/ClearFiltersButton.razor) — one consistent outlined pill
   used on every list view's filter bar. Outlined, uppercase, with the filter-off icon. */
.wam-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--surface-0, #fff);
    border: 1px solid var(--surface-300, #d1d5db);
    border-radius: 8px;
    color: var(--text-color-secondary, #64748b);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wam-clear-filters:hover:not(:disabled) {
    background: var(--surface-100, #f3f4f6);
    border-color: var(--surface-400, #9ca3af);
    color: var(--text-color, #0f172a);
}
.wam-clear-filters:disabled { opacity: 0.5; cursor: default; }
.wam-clear-filters .rz-icon { font-size: 1rem; }

/* WAM deals list — the Status label can be very long ("Closing in Progress – No Longer Accepting
   Indications of Interest"). Unlike other list pages, let THIS status pill wrap to multiple lines
   inside the cell instead of staying on one line, overriding the single-line grid-cell rules below
   (.rz-cell-data:has(.rz-badge) and .rz-cell-data .rz-badge) which use !important. Both the
   compound (class on the same <td> as .rz-cell-data) and descendant selectors are covered so this
   holds regardless of where Radzen puts the column CssClass. */
.deal-status-cell.rz-cell-data:has(.rz-badge),
.deal-status-cell .rz-cell-data:has(.rz-badge) {
    white-space: normal !important;
    overflow: visible !important;
}
/* Two-class-deep selectors (0,3,0) so these beat the later, equal-source-order global rule
   `.rz-cell-data .rz-badge { white-space: nowrap !important }` (0,2,0). Both the compound-on-td
   and separate-div DOM shapes are covered. */
.deal-status-cell.rz-cell-data .rz-badge,
.deal-status-cell .rz-cell-data .rz-badge,
.deal-status-cell.rz-cell-data .rz-badge.rz-badge--wrapped,
.deal-status-cell .rz-cell-data .rz-badge.rz-badge--wrapped {
    white-space: normal !important;
    width: auto !important;
    max-width: 15rem;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* WAM deal tags — darker text and outline so they read clearly (theme-aware via surface scale) */
.deal-tags .rz-badge {
    color: var(--surface-900) !important;
    border: 1px solid var(--surface-500) !important;
    background: transparent !important;
    font-weight: 600;
}

/* ============================================
   Outlined action buttons — invert on hover (task #2118)
   Radzen's default outlined hover only fills a pale tint (--rz-*-lighter) and keeps
   coloured text, which is hard to read. Instead fill with the SOLID action colour and
   flip the text to its on-colour so the label stays legible. !important is needed to
   beat Radzen material-base's per-colour hover rules.
   ============================================ */
.rz-button.rz-variant-outlined.rz-primary:not(.rz-state-disabled):hover {
    background-color: var(--rz-primary) !important;
    border-color: var(--rz-primary) !important;
    color: var(--rz-on-primary) !important;
}
.rz-button.rz-variant-outlined.rz-success:not(.rz-state-disabled):hover {
    background-color: var(--rz-success) !important;
    border-color: var(--rz-success) !important;
    color: var(--rz-on-success) !important;
}
.rz-button.rz-variant-outlined.rz-warning:not(.rz-state-disabled):hover {
    background-color: var(--rz-warning) !important;
    border-color: var(--rz-warning) !important;
    color: var(--rz-on-warning) !important;
}
.rz-button.rz-variant-outlined.rz-danger:not(.rz-state-disabled):hover {
    background-color: var(--rz-danger) !important;
    border-color: var(--rz-danger) !important;
    color: var(--rz-on-danger) !important;
}
.rz-button.rz-variant-outlined.rz-base:not(.rz-state-disabled):hover {
    background-color: var(--rz-base) !important;
    border-color: var(--rz-base) !important;
    color: var(--rz-on-base) !important;
}

/* ============================================
   Neutral (Base/Light) buttons — readable RESTING state (task #2630)
   Radzen paints a resting "Base" outlined button's border AND label in --rz-base (a light grey
   ~#9e9e9e), and a "Light" button's label in the same pale grey — so Cancel / Back / dismiss
   buttons (dialog footers, inline edit, and Radzen's own Confirm dialog) are hard to read.
   Spec (user): the Cancel button is a GREY OUTLINE with a BLACK label. Repaint the resting label
   black and give outlined buttons a clearly visible grey border. In dark mode a black label would
   be unreadable, so .app-dark restores the near-white foreground. Hover still inverts to the solid
   fill (block above). !important beats Radzen material-base's per-colour resting rules.
   ============================================ */
.rz-button.rz-variant-outlined.rz-base:not(.rz-state-disabled),
.rz-button.rz-variant-text.rz-base:not(.rz-state-disabled),
.rz-button.rz-light:not(.rz-state-disabled) {
    color: #000 !important;
}
.app-dark .rz-button.rz-variant-outlined.rz-base:not(.rz-state-disabled),
.app-dark .rz-button.rz-variant-text.rz-base:not(.rz-state-disabled),
.app-dark .rz-button.rz-light:not(.rz-state-disabled) {
    color: var(--text-color) !important;
}
.rz-button.rz-variant-outlined.rz-base:not(.rz-state-disabled) {
    border-color: var(--surface-400) !important;
}

/* ============================================
   Dropdown selected item
   Global rule: a selected option renders white on the full primary colour (not Radzen's
   pale --rz-primary-lighter) so the text has readable contrast. Applies to single-select
   (.rz-dropdown-item) and multi-select (.rz-multiselect-item) lists app-wide. !important
   beats Radzen's own same-specificity .rz-state-highlight rules, which cascade after app.css.
   ============================================ */
.rz-dropdown-item.rz-state-highlight,
.rz-multiselect-item.rz-state-highlight {
    background-color: var(--rz-primary) !important;
}
.rz-dropdown-item.rz-state-highlight,
.rz-dropdown-item.rz-state-highlight *,
.rz-multiselect-item.rz-state-highlight,
.rz-multiselect-item.rz-state-highlight * {
    color: #fff !important;
}

/* ============================================
   Badges / status pills (task #2118)
   1) In data-grid cells, keep status pills on a single line (see the .rz-cell-data rules
      below); standalone/header badges keep their natural width.
   2) Soften the palette: Radzen's filled badges use fully-saturated solid colours;
      re-skin each style as a light tint of the semantic colour with darker text.
      color-mix keeps the tint theme-aware (blends into --surface-0 / --text-color),
      so it works in both light and dark mode without separate overrides.
   Two-class selectors (.rz-badge.rz-badge-*) beat Radzen's single-class rules; the
   more specific .deal-tags .rz-badge override is unaffected.
   ============================================ */
.rz-badge {
    /* !important on these because Radzen's own .rz-badge rule (same specificity)
       cascades after app.css and would otherwise win — notably white-space:nowrap,
       which prevented long labels from wrapping even when max-width capped them. */
    white-space: normal !important;
    height: auto;
    line-height: 1.3;
    vertical-align: middle;
    text-align: center;
    border-radius: 9999px !important;
    padding: 0.25rem 0.5rem !important;
    /* Pin the font so every pill reads identically regardless of the context it sits in
       (grid cells, page headers, detail cards). Without this the badge inherits the
       surrounding font-size, so the same status looked different from page to page.
       !important beats Radzen's own .rz-badge font-size (same specificity, cascades later). */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    /* Uniform capitalization: Title-case every pill so labels read the same across pages
       (e.g. sentence-case "Changes pending approval" -> "Changes Pending Approval").
       `capitalize` only upper-cases the first letter of each word — it leaves existing
       capitals alone, so acronyms like "OFAC" are preserved. It can't down-case an
       already all-caps literal, so those (e.g. hardcoded "PRIMARY") are fixed in source. */
    text-transform: capitalize;
}
/* The four record-state pills draw from the --pill-* tokens (:root) so every status looks
   identical app-wide. Green=success, Amber=warning, Red=danger, Gray=neutral (secondary/
   light/base). Info keeps its own blue tint — it is outside the 4-colour record-state palette. */
.rz-badge.rz-badge-success {
    background-color: var(--pill-green-bg);
    color: var(--pill-green-text);
}
.rz-badge.rz-badge-warning {
    background-color: var(--pill-amber-bg);
    color: var(--pill-amber-text);
}
.rz-badge.rz-badge-danger {
    background-color: var(--pill-red-bg);
    color: var(--pill-red-text);
}
.rz-badge.rz-badge-info {
    background-color: color-mix(in srgb, var(--rz-info) 15%, var(--surface-0));
    color: color-mix(in srgb, var(--rz-info) 72%, var(--text-color));
}
.rz-badge.rz-badge-secondary,
.rz-badge.rz-badge-light,
.rz-badge.rz-badge-base {
    background-color: var(--pill-gray-bg);
    color: var(--pill-gray-text);
}
/* When a label wraps to 2+ lines, LayoutInterop.initBadgeWrapWatch adds this class:
   shrink the font and hug the wrapped text so it isn't marooned in dead space. */
.rz-badge.rz-badge--wrapped {
    font-size: 0.7rem;
    line-height: 1.35;
    padding: 0.55rem 0.55rem !important;
    /* Hug the wrapped text: min-content makes the pill only as wide as its longest word.
       word-break/overflow-wrap normal force breaks at spaces only (never mid-word), so the
       pill can't collapse into a one-character-wide vertical strip. */
    width: min-content;
    word-break: normal !important;
    overflow-wrap: normal !important;
}
/* Status pills stay on a SINGLE line in data-grid cells — a long label (e.g. "Document
   Submission Required") must never wrap to two or three lines. Radzen's default clips a long
   badge (overflow:hidden); we let it overflow visibly instead so the whole pill shows, and the
   column sizes to fit. Keeping badges one line reads more cleanly than the old wrapped pill. */
.rz-cell-data:has(.rz-badge) {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}
.rz-cell-data .rz-badge {
    white-space: nowrap !important;
    max-width: none;
}

/* Detail pages: Radzen pads .rz-tabview-panel (var(--rz-tabs-padding) = 1rem all sides),
   which insets cards inside tabs relative to the full-width header card above them.
   Zero the horizontal padding so tab content lines up edge-to-edge with the header card;
   keep the vertical padding for spacing under the tab strip. !important because Radzen's
   panel rule cascades after app.css. */
.rz-tabview-panel {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ============================================
   Pagination active page (task #2118)
   Radzen highlights the current page button with a solid blue fill but leaves the number
   dark-blue, which is low-contrast. Force the highlighted page number white so it reads
   clearly on the fill. Applies to every list grid's pager app-wide.
   ============================================ */
.rz-pager .rz-pager-page.rz-state-active {
    color: #fff !important;
}

/* ============================================
   WAM dialog form conventions (task #2118)
   Shared primitives for every create/edit dialog (RadzenTemplateForm). Defined once here
   instead of being copy-pasted into each dialog's inline <style>. Validation errors render
   inline beneath the field via the RadzenTemplateForm validators and block submission — they
   are never toasted; a successful save surfaces a transient toast (see NotifySuccess).
   - .wam-form        two-column responsive grid used by the simple edit dialogs
   - .wam-form .full  span both columns
   - .wam-label       field label
   - .req             the red required-field asterisk (and legend marker)
   - .wam-hint        secondary helper text under a field
   ============================================ */
.wam-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.wam-form .full { grid-column: 1 / -1; }
.wam-label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.wam-label .req, .req { color: #ef4444; font-weight: 700; }
.wam-hint { color: var(--text-color-secondary); font-size: 0.75rem; margin-top: 0.35rem; line-height: 1.4; }
.wam-required-legend { color: var(--text-color-secondary); font-size: 0.8125rem; }
