html, body {
  font-family: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
}

a, .btn-link {
  color: #006bb7;
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
  padding-top: 1.1rem;
}

h1:focus {
  outline: none;
}

.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}

.invalid {
  outline: 1px solid #e50000;
}

.validation-message {
  color: #e50000;
}

.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI26Mw2IDUxQzI2NC43MTkgNSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA6NTAgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDgNMyAyNjMzLjU4NiA2Ni4wMTgzWk0yNjMuNTc2IDg2LjA1NDdDMjYxLjA0OSA4Ni4wNTQ3IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA4NSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
  border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Design tokens ===== */
:root {
  --brand-primary: #0070BA;
  --brand-deep-blue: #0013BA;
  --brand-orange: #F6A226;
  --brand-pink: #E52152;
  --brand-green: #00BA4A;
  --brand-white: #FFFFFF;
  --brand-ice: #EEF8FF;
  --brand-navy: #001625;
  --brand-active: #0B66C3;

  --text-primary: #0D1C39;
  --focus-outline: rgba(11,102,195,0.18);

  --surface: #F6F7F8;
  --muted: rgba(0,0,0,0.06);

  --grey-50:  #FBFCFD;
  --grey-100: #F2F6F8;
  --grey-200: #E6EEF4;
  --grey-250: #DDDDDD;
  --grey-300: #D9E6ED;
  --grey-400: #BFCFDA;
  --grey-600: #6B7A86;
  --grey-800: #23323A;
  --grey-900: #0A1620;

  --icon-color: var(--brand-primary);

  --header-height: 82px;
  --footer-height: 56px;
}

[data-bs-theme="dark"] {
  --surface: #0f1720;
  --text-primary: #e8eef6;
  --bg: #0b1220;
  color-scheme: dark;
}

[data-bs-theme="dark"] .app-shell {
  background: var(--bg, #0b1220);
}

[data-bs-theme="dark"] .side-nav,
[data-bs-theme="dark"] .fui-sidenav {
  background: #151d28;
  border-right-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .nav-list .nav-item {
  color: #e8eef6;
}

[data-bs-theme="dark"] .nav-list .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .nav-list .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .content-area,
[data-bs-theme="dark"] .grid-content {
  color: #e8eef6;
}

[data-bs-theme="dark"] .page-header h1 {
  color: #e8eef6;
}

[data-bs-theme="dark"] .page-header .lead {
  color: #b8c5d1;
}

/* ===== Side nav ===== */
.content-sidenav {
  height: 100%;
  width: 250px;
  position: fixed;
  z-index: 1;
  top: 140px;
  left: 15px;
  overflow-x: hidden;
  padding: 0 5px;
}

.content-sidenav a {
  padding: 6px 8px 6px 16px;
  text-decoration: none;
  font-size: 25px;
  display: block;
}

/* ===== Grid content ===== */
.grid-content {
    margin-top: 0.5rem;
    width: 100%;
    max-width: none;
    font-size: 14px;
    margin-left: 0 auto;
    box-sizing: border-box;
}

/* ===== App shell layout ===== */
.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

.app-shell {
  flex: 1 1 auto;
  display: flex;
  background: var(--bg, #ffffff);
}

.side-nav {
  width: 220px;
  background: #f4f6f8;
  border-right: 1px solid rgba(0,0,0,0.06);
  padding: 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-nav .brand {
  text-align: center;
  padding: 0 8px;
}

.side-nav .brand img {
  max-width: 160px;
}

.nav-list { padding: 0 8px; }
.nav-list ul { list-style: none; margin: 0; padding: 0; }
.nav-list .nav-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  color: #222;
  cursor: pointer;
  text-decoration: none;
}
.nav-list .nav-item:hover { background: rgba(0,0,0,0.03); }
.nav-list .nav-item.active { background: rgba(0,0,0,0.06); font-weight: 600; }

.content-area {
  flex: 1;
  padding-bottom: var(--footer-height, 56px);
}

/* ===== Page header ===== */
.page-header h1 {
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: #0b2545;
}

.page-header .lead {
  color: #394a57;
  margin-bottom: 1.5rem;
}

/* ===== Cards / grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.card-col { display: flex; flex-direction: column; gap: 16px; }
.clickable-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.disabled-card {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none; 
    transform: none !important;
    box-shadow: none !important;
}
/* Feature cards � use brand tokens */
.feature-card { border-radius: 6px; box-shadow: 0 1px 2px rgba(16,24,40,0.05); }
.feature-orange { border-left: 6px solid var(--brand-orange); }
.feature-green  { border-left: 6px solid var(--brand-green); }
.feature-blue   { border-left: 6px solid var(--brand-primary); }
.feature-pink   { border-left: 6px solid var(--brand-pink); }
.feature-navy   { border-left: 6px solid var(--brand-navy); }

.feature-list { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; color: #0b2545; }
.feature-list li { padding: 8px 4px; border-bottom: 1px dashed rgba(11,37,69,0.04); }

/* ===== Icon color ===== */
.app-shell i,
.app-shell svg,
.app-shell .bi {
  color: var(--icon-color);
  fill: var(--icon-color);
}

/* ===== Fluent card ===== */
.fluent-card {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  height: auto !important;
}

.fluent-card-title {
  text-align: center;
}

.fluent-card-button-wrapper {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--grey-400);
  border-bottom: 1px solid var(--grey-400);
}

.fluent-button {
  width: fit-content;
}

.fluent-card::part(control) {
    background-color: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--elevation-shadow-card);
}



/* ===== Brand header + border helpers ===== */
.header-brand-orange   { background: var(--brand-orange);    color: var(--brand-white); }
.header-brand-green    { background: var(--brand-green);     color: var(--brand-white); }
.header-brand-blue     { background: var(--brand-primary);   color: var(--brand-white); }
.header-brand-deepblue { background: var(--brand-deep-blue); color: var(--brand-white); }
.header-brand-pink     { background: var(--brand-pink);      color: var(--brand-white); }
.header-brand-navy     { background: var(--brand-navy);      color: var(--brand-white); }

.border-brand-orange   { border: 1px solid var(--brand-orange); }
.border-brand-green    { border: 1px solid var(--brand-green); }
.border-brand-blue     { border: 1px solid var(--brand-primary); }
.border-brand-deepblue { border: 1px solid var(--brand-deep-blue); }
.border-brand-pink     { border: 1px solid var(--brand-pink); }
.border-brand-navy     { border: 1px solid var(--brand-navy); }

/* ===== Footer ===== */
.footer {
  flex-shrink: 0;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  z-index: 200;
  background: #0b66c3;
  color: #fff;
}

/* ===== Modal ===== */
.modal {
  position: fixed !important;
  z-index: 2000 !important;
}

.modal-backdrop {
  position: fixed !important;
  z-index: 1990 !important;
  pointer-events: none !important;
}

/* ===== Misc utilities ===== */
.scrollable-list {
  max-height: 220px;
  overflow-y: auto;
}

.bottom-right-footer {
  position: sticky;
  bottom: 0;
  padding: 8px 12px;
  border-top: 1px solid #dee2e6;
  text-align: right;
}

.multi-dropdown .btn.is-invalid {
  border-color: #dc3545;
}

/* ===== Table headers � brand mid-grey ===== */

table thead th,
.table thead th,
.bb-table thead th,
.table-responsive table thead th {
    background-color: var(--grey-250) !important;
    color: var(--text-primary) !important;
}

/* Dark mode override */
[data-bs-theme="dark"] table thead th,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .bb-table thead th,
[data-bs-theme="dark"] .table-responsive table thead th {
    background-color: #1f2a36 !important;
    color: #e8eef6 !important;
}

/* ===== 6px rounded card for grid tables ===== */

div.grid-content table.bb-table,
div.grid-content table.table {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--grey-200) !important;
}
div.grid-content table.bb-table,
div.grid-content table.table {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--grey-200) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}
/* ===== Hide BlazorBootstrap Grid filter operator buttons (search-grid) ===== */
table.search-grid thead .bb-grid-filter,
table.search-grid thead td .dropdown-menu {
  display: none !important;
}

table.search-grid thead td .d-flex {
  display: block !important;
}

table.search-grid thead td .d-flex > input.form-control {
  width: 100% !important;
  border-radius: 4px !important;
}

/* ===== Detail view � shrink spacer tds and stretch content td ===== */
table.search-grid tr.collapse > td:not([colspan]),
table.search-grid tr.collapse.show > td:not([colspan]) {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

table.search-grid tr.collapse > td[colspan],
table.search-grid tr.collapse.show > td[colspan] {
  width: 100% !important;
  padding: 5px !important;
}

table.search-grid td[colspan] .table-responsive,
table.search-grid td[colspan] > table {
  width: 100% !important;
  margin: 0 !important;
}

/* ===== Role Access Manager � kill all hover/active/striped highlights ===== */
.role-access-page table.table-hover > tbody > tr:hover > *,
.role-access-page table.table-hover > tbody > tr:hover {
  background-color: transparent !important;
  background: transparent !important;
  --bs-table-hover-bg: transparent !important;
  --bs-table-accent-bg: transparent !important;
  --bs-table-bg-state: transparent !important;
  --bs-table-bg-type: transparent !important;
}

.role-access-page table.table-hover,
.role-access-page table {
  --bs-table-hover-bg: transparent !important;
  --bs-table-accent-bg: transparent !important;
  --bs-table-active-bg: transparent !important;
  --bs-table-bg-state: transparent !important;
  --bs-table-bg-type: transparent !important;
}

.role-access-page table > tbody > tr.table-active > *,
.role-access-page table > tbody > tr.table-active,
.role-access-page table > tbody > tr.selected > *,
.role-access-page table > tbody > tr.selected {
  background-color: transparent !important;
  background: transparent !important;
  --bs-table-active-bg: transparent !important;
  --bs-table-accent-bg: transparent !important;
  --bs-table-bg-state: transparent !important;
  --bs-table-bg-type: transparent !important;
}

/* ===== Kill BlazorBootstrap selection hover highlight (all pages) ===== */
.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked):hover > *,
.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked):hover {
  background-color: transparent !important;
  color: inherit !important;
}

.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked) > *,
.bb-table > tbody tr:has(input[type=checkbox].bb-grid-form-check-input:checked) {
  background-color: transparent !important;
  color: inherit !important;
}

.invalid-group {
    border: 1px solid red;
    border-radius: 5px;
}
.swal2-container {
    z-index: 20000 !important;
}

.profile-action {
    position: relative;
    display: inline-flex;
    flex-direction: column;
}
.profile-action::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px;
}
.profile-action:hover .profile-menu,
.profile-menu:hover {
    display: block;
}

/* Container */
.profile-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-meta {
    text-align: right;
    line-height: 1.2;
}
.role {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}
.company {
    font-size: 12px;
    color: #9ca3af;
}
.profile-action {
    position: relative;
    display: inline-flex;
    flex-direction: column;
}
.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.profile-btn:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}
.profile-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.profile-name {
    font-size: 14px;
    font-weight: 600;
}
.profile-menu {
    position: absolute;
    top: 98%;
    right: 0;
    min-width: 200px;
    padding: 6px;
    border-radius: 12px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    display: none;
    z-index: 1000;
}
.profile-action:hover .profile-menu,
.profile-menu:hover {
    display: block;
}
.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
    background: none;
    border: none;
    text-align: left;
    text-decoration: none;
    color: #111827;
    cursor: pointer;
    transition: background 0.15s ease;
}
.menu-item:hover {
    background: #f3f4f6;
}
.menu-divider {
    height: 1px;
    margin: 6px 0;
    background: #e5e7eb;
}
.menu-item.danger {
    color: #dc2626;
}
.menu-item.danger:hover {
    background: #fee2e2;
}
.profile-action .profile-name,
.profile-action .chev {
    color: #ffffff;
    transition: color 0.2s ease;
}
.profile-action .profile-btn:hover .profile-name,
.profile-action .profile-btn:hover .chev {
    color: var(--grey-900); 
}
.profile-action .profile-btn:hover .chev {
    transform: translateY(1px);
    transition: transform 0.2s ease, color 0.2s ease;
}
.nav-children {
    padding-left: 1.5rem; 
}
.nav-item.child {
    padding-left: 2.5rem; 
}
.actions-nowrap {
    white-space: nowrap !important;
    width: 100px !important;
    min-width: 100px !important;
    padding-right: 16px;
}.tabs-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.tab-link {
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 16px;
    color: var(--bs-body-color);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.tab-link:hover {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-secondary-color);
}
.tab-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    font-weight: 600;
}
.search-grid th:first-child,
.search-grid td:first-child {
    text-align: center !important;
    vertical-align: middle !important;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    padding: 0 !important;
    padding-left: 16px !important;
}
.search-grid input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}
.search-grid th:first-child input[type="checkbox"],
.search-grid td:first-child input[type="checkbox"] {
    display: block;
    margin: auto;
}
.search-grid .form-check,
.search-grid .form-check-input {
    margin: 0 !important;
    padding: 0 !important;
}
.alert-message-content {
    text-align: initial; 
}
.alert-message-content .ql-align-center {
    text-align: center;
}
.alert-message-content .ql-align-right {
    text-align: right;
}
.alert-message-content .ql-align-left {
    text-align: left;
}
.fluent-wizard .fluent-typography.fluent-wizard-title {
    color: #276fe2;
    transition: color 0.2s ease;
}
.divider {
    border-bottom: 1px solid;
    margin-top: 12px;
}
.small-text-alert {
    font-size: 0.875rem !important;
}