/* Shared UX foundations; all tenant identity belongs to the active profile. */
:root { --vb-ux-gap: 1.5rem; --vb-ux-border: var(--bs-border-color, #d2d6db); }
:focus-visible { outline: 3px solid var(--bs-primary, #0d6efd); outline-offset: 3px; }
.vb-filter-panel { background:var(--bs-body-bg); border:1px solid var(--vb-ux-border); border-radius:4px; padding:32px; margin-block:24px; }
.vb-filter-panel-header { display:flex; justify-content:space-between; align-items:start; gap:16px; }
.vb-filter-panel h2 { font-size:20px; line-height:30px; margin:0; }
.vb-filter-panel p { color:var(--bs-secondary-color); font-size:14px; margin-block:6px 0; }
.vb-filter-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin-block:24px; }
.vb-filter-field { display:flex; flex-direction:column; gap:8px; min-width:0; }
.vb-filter-field label { font-size:14px; }
.vb-filter-field .dxbl-text-edit { min-height:40px; }
.vb-filter-chips { display:flex; flex-wrap:wrap; gap:8px; padding-block:24px; border-bottom:1px solid var(--vb-ux-border); }
.vb-filter-chip { display:inline-flex; gap:8px; align-items:center; background:var(--bs-tertiary-bg); border:1px solid var(--vb-ux-border); border-radius:4px; padding:4px 12px; min-height:32px; }
.vb-filter-actions { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.vb-form-review { border:1px solid var(--vb-ux-border); border-radius:4px; margin:24px; padding:24px; }
.vb-review-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.vb-review-fields dt { color:var(--bs-secondary-color); font-size:14px; font-weight:400; }
.vb-review-fields dd { margin:8px 0 0; overflow-wrap:anywhere; white-space:pre-wrap; }
.vb-field-counter { font-size:12px; color:var(--bs-secondary-color); display:block; text-align:end; }
.vb-attachment-drop { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:140px; border:1px dashed var(--vb-ux-border); border-radius:4px; padding:24px; background:var(--bs-tertiary-bg); }
.vb-attachment-drop:focus-within { outline:3px solid var(--bs-primary); outline-offset:3px; }
.vb-attachment-drop input[type=file] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.vb-attachment-drop:has(input:disabled) { opacity:.6; }
.vb-recovery-banner { margin:16px 24px; padding:16px; border:1px solid var(--vb-ux-border); border-radius:4px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.vb-skip-link { position:absolute; inset-inline-start:16px; top:-100px; z-index:10000; padding:12px; background:var(--bs-body-bg); color:var(--bs-body-color); }
.vb-skip-link:focus { top:8px; }
@media(max-width:900px) {
.vb-filter-fields,.vb-review-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }

}
@media(max-width:576px) {
.vb-filter-panel,.vb-form-review { padding:16px; margin:16px 0; }
.vb-filter-fields,.vb-review-fields { grid-template-columns:1fr; }

}
@media(prefers-reduced-motion:reduce) {
*,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; }

}
.vb-tree-filter-status { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-block:16px; }
.vb-error-state { padding:48px 24px; max-width:800px; margin:32px auto; text-align:center; background:var(--bs-body-bg); border:1px solid var(--vb-ux-border); border-radius:4px; }

.module-card-link { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:inherit; text-decoration:none; flex:1; }
.module-card-link:hover { color:inherit; text-decoration:none; }
.module-card-link::after { content:""; position:absolute; inset:0; }
.module-card .module-newtab-btn { z-index:2; }
:where(html:not([data-ui-profile=ncgr])) .module-card:focus-within { outline:3px solid var(--bs-primary); outline-offset:3px; }

/* Keep filters and results reachable in short embedded viewports. */
.dynamic-grid-container:has(> .vb-filter-panel) { overflow-y:auto; }
.dynamic-grid-container > .vb-filter-panel { flex-shrink:0; padding:24px; }
.dynamic-grid-container:has(> .vb-filter-panel) > .vb-grid-dom-host { min-height:180px; flex-shrink:0; }
.vb-filter-fields { gap:16px 24px; margin-block:16px; }
.vb-filter-chips { padding-block:12px; }

/* Sidebar colors travel together. Portaled menus use the native body foreground. */
.navigation-drawer .dxbl-drawer-panel {
 --vb-nav-border:rgba(255,255,255,.6);
 --vb-nav-text:#fff;
 --vb-nav-hover-bg:rgba(0,0,0,.12);
 --vb-nav-active-bg:rgba(0,0,0,.20);
 --vb-nav-accent:#fff;
}
.navigation-drawer .dxbl-drawer-panel :is(.navroot-item,.menu-modules-title,.menu-modules-child,.menu-item) { color:var(--vb-nav-text); }
.navigation-drawer .dxbl-drawer-panel :is(.navroot-item,.menu-modules-title,.menu-modules-child):hover { background-color:var(--vb-nav-hover-bg); }

.navigation-drawer .dxbl-drawer-header .btn-outline-secondary {
 color:var(--vb-nav-text,var(--bs-body-color))!important;
 border-color:var(--vb-nav-border,var(--bs-border-color));
 background:transparent;
}
.navigation-drawer .dxbl-drawer-header .btn-outline-secondary:is(:hover,:focus-visible) {
 color:var(--vb-nav-text,var(--bs-body-color))!important;
 background:var(--vb-nav-hover-bg,var(--bs-tertiary-bg));
}
.navigation-drawer .dxbl-drawer-header .btn-outline-secondary i { color:inherit!important; }

/* Fluent's secondary palette is a surface color; outlined HTML buttons need a foreground. */
.btn-outline-secondary {
 --bs-btn-color:var(--bs-body-color);
 --bs-btn-border-color:var(--bs-secondary-color);
 --bs-btn-hover-color:var(--bs-emphasis-color,var(--bs-body-color));
 --bs-btn-hover-bg:var(--bs-secondary-bg);
 --bs-btn-hover-border-color:var(--bs-secondary-color);
 --bs-btn-active-color:var(--bs-emphasis-color,var(--bs-body-color));
 --bs-btn-active-bg:var(--bs-secondary-bg);
 --bs-btn-active-border-color:var(--bs-secondary-color);
 --bs-btn-disabled-color:var(--bs-secondary-color);
}

/* Editors fill the drawer's remaining space; only their own panes scroll. */
#vb-main-content .dxbl-drawer-content:has(> .p-4 > :is(.ts-layout,.sql-studio:not(.embedded),.bc-layout,.rag-layout,.vb-aichat-host,.vb-user-host,.vb-wf-host,.iframe-wrapper,.module-shell)) { overflow:hidden; }
#vb-main-content .dxbl-drawer-content > .p-4:has(> :is(.ts-layout,.sql-studio:not(.embedded),.bc-layout,.rag-layout,.vb-aichat-host,.vb-user-host,.vb-wf-host,.iframe-wrapper,.module-shell)) { flex:1 1 0%; min-height:0; overflow:hidden; display:flex; flex-direction:column; }
#vb-main-content .p-4 > :is(.ts-layout,.sql-studio:not(.embedded),.bc-layout,.rag-layout,.vb-aichat-host,.vb-user-host,.vb-wf-host,.iframe-wrapper,.module-shell) { height:auto; min-height:0; flex:1 1 0%; }
#vb-main-content .p-4:has(> .sql-studio:not(.embedded)) { padding:0!important; }
#vb-main-content .p-4 > .sql-studio:not(.embedded) { margin:0; width:100%; }

#vb-main-content .p-4 > .vb-context-help-bar { flex-shrink:0; }
#vb-main-content .module-shell { min-height:0; flex:1 1 0%; display:flex; flex-direction:column; }
#vb-main-content .module-shell > .iframe-wrapper { height:auto; min-height:0; flex:1 1 0%; }

/* Home uses the drawer padding once; compact spacing preserves the approved card structure. */
.index-container { width:100%; max-width:1280px; padding:0; }
.index-container .welcome-gridlayout { align-content:start; }
.index-container .welcome-cards { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:16px; margin-top:0; }
@media(max-width:576px) {
 .index-container .welcome-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .index-container .gradient-card { padding:16px 10px; }
 .index-container .gradient-card h3 { overflow-wrap:anywhere; }
}

/* Mirror logical navigation only. Expanded/down and semantic/status glyphs keep their orientation. */
html[dir="rtl"] .dxbl-grid-group-row[aria-expanded="false"] .dxbl-grid-expand-button > svg,
html[dir="rtl"] .navigation-drawer .menu-modules-chevron.fa-chevron-right,
html[dir="rtl"] .ob-chevron.fa-chevron-right,
html[dir="rtl"] :is(.vb-fw-step-arrow,.vb-obw-step-arrow) .fa-chevron-right,
html[dir="rtl"] .vb-fw-buttons :is(.fa-arrow-left,.fa-arrow-right),
html[dir="rtl"] .vb-obw-buttons :is(.fa-arrow-left,.fa-arrow-right),
html[dir="rtl"] .vb-drill-circle-arrow.fa-arrow-right { transform:scaleX(-1); }
html[dir] .navigation-drawer .menu-modules-chevron.fa-chevron-down { transform:none; }
html[dir="ltr"] .navigation-drawer .menu-modules-chevron.fa-chevron-right { transform:none; }
/* Pair navigation foreground and surface in every interaction state. */
.navigation-drawer .dxbl-drawer-panel :is(.menu-item,.navroot-item,.menu-modules-title,.menu-modules-child):is(:hover,:focus-visible,:focus-within) {
 color:var(--vb-nav-text); background-color:var(--vb-nav-hover-bg);
}
/* Preserve each standard tenant's branded sidebar; NCGR owns its white shell. */
html:not([data-ui-profile=ncgr]) .navigation-drawer > .dxbl-drawer-panel {
 background-image:linear-gradient(180deg,var(--vb-nav-start,var(--bs-primary)) 0%,#000 150%);
}
/* Help is a neutral button on a coloured welcome surface, independent of theme. */
html:not([data-ui-profile=ncgr]) .index-header .vb-context-help {
 --bs-btn-color:#384250; --bs-btn-bg:#fff; --bs-btn-border-color:#fff;
 --bs-btn-hover-color:#161616; --bs-btn-hover-bg:#eef0f2; --bs-btn-hover-border-color:#d2d6db;
 --bs-btn-active-color:#161616; --bs-btn-active-bg:#e5e7eb; --bs-btn-active-border-color:#9da4ae;
}
.gradient-card:focus-visible .card-newtab-btn,.gradient-card:focus-within .card-newtab-btn { opacity:1; }
html:not([data-ui-profile=ncgr]) .gradient-card .card-newtab-btn:is(:hover,:focus-visible) { color:#161616; background:#fff; }

/* Landing pages share one title/help row and use the shell padding once. */
.vb-page-intro { display:flex; align-items:center; justify-content:space-between; gap:16px; min-block-size:112px; text-align:start; }
.vb-page-intro-content { flex:1 1 auto; min-width:0; }
.vb-page-intro-actions { display:flex; flex:0 0 auto; align-items:center; justify-content:flex-end; }
.vb-page-intro-content :is(h1,h2) { margin-block:0 4px; }
.vb-page-intro-content p { margin:0; }
.app-menu-container { width:100%; max-width:1280px; padding:0; min-height:0; overflow-x:visible; }
.module-card-link { min-width:0; }
@media(max-width:576px) { .vb-page-intro { flex-wrap:wrap; gap:12px; } .vb-page-intro-content { flex-basis:100%; } .vb-page-intro-actions { margin-inline-start:auto; } }

.vb-page-intro-content > h1 { justify-content:flex-start!important; flex-wrap:wrap; row-gap:8px; }

/* Reserve the same scrollbar width on short and long landing pages. */
.dxbl-drawer-content:has(> .p-4 > :is(.index-container,.app-menu-container)) { scrollbar-gutter:stable; }

/* New-tab actions remain visible and readable when reached by keyboard. */
.module-card:focus-within .module-newtab-btn { opacity:1; }
.module-newtab-btn { color:var(--bs-body-color); }
.module-newtab-btn:is(:hover,:focus-visible) { color:var(--bs-body-color); background:var(--bs-secondary-bg); }
