/* Optima Precision Workbench 2.2 — scoped visual shell.
   Reuses optima_v2.css brandkit and existing Bootstrap components.
   Authorization, business actions and data remain server-owned. */
:root {
  --opt-rail-expanded:232px; --opt-rail-collapsed:62px;
  --opt-workbench-bg:#f7f6fa; --opt-workbench-border:#e5dfed;
  --opt-workbench-action:#5d4e9a;
}
body.optima-workbench {
  --opt-rail-width:var(--opt-rail-expanded);
  display:grid; grid-template-columns:var(--opt-rail-width) minmax(0,1fr);
  min-height:100vh; background:var(--opt-workbench-bg);
  color:var(--opt-text); font:400 .875rem/1.45 "Roboto","Segoe UI",Arial,sans-serif;
}
body.optima-workbench.optima-rail-collapsed { --opt-rail-width:var(--opt-rail-collapsed); }
.optima-workbench .optima-skip-link {
  position:fixed; top:-100px; left:12px; z-index:2000;
  padding:10px 14px; background:#fff; color:#252039;
  border:2px solid var(--opt-primary); border-radius:8px; font-weight:500;
}
.optima-workbench .optima-skip-link:focus { top:10px; }
.optima-workbench .optima-sidebar {
  grid-column:1; grid-row:1; position:sticky; top:0; z-index:1040;
  display:flex; flex-direction:column; align-items:stretch;
  width:100%; height:100vh; min-width:0; overflow:hidden;
  padding:0!important; margin:0!important; border:0;
  background:linear-gradient(175deg,#28233e,#18162b)!important;
  box-shadow:3px 0 20px #18162b22!important;
}
.optima-workbench .optima-sidebar-inner {
  display:flex; flex-direction:column; align-items:stretch;
  width:100%; height:100%; min-height:0; padding:0;
  overflow-x:hidden; overflow-y:auto; scrollbar-width:thin;
  scrollbar-color:#736a92 transparent;
}
.optima-workbench .optima-sidebar-brand {
  display:flex; align-items:center; justify-content:space-between;
  gap:6px; min-height:78px; padding:12px; border-bottom:1px solid #ffffff23;
}
.optima-workbench .optima-brand-link {
  display:flex; align-items:center; min-width:0; padding:6px 5px;
  background:white; border-radius:8px;
}
.optima-workbench .optima-brand-link img { display:block; max-width:100%; height:auto; }
.optima-workbench .optima-rail-toggle {
  display:grid; place-items:center; flex:0 0 32px; height:32px;
  color:#eeeafa; background:#ffffff14; border:1px solid #ffffff38; border-radius:8px;
}
.optima-workbench .optima-sidebar .navbar-toggler { display:none!important; }
.optima-workbench .optima-sidebar .navbar-collapse {
  display:flex!important; flex:1 0 auto; flex-direction:column;
  align-items:stretch; width:100%; min-width:0;
}
.optima-workbench .optima-sidebar .navbar-nav {
  display:flex!important; flex-direction:column!important;
  align-items:stretch; gap:3px; width:100%;
  padding:12px 8px; margin:0!important;
}
.optima-workbench .optima-sidebar .navbar-nav:last-child {
  margin-top:auto!important; border-top:1px solid #ffffff22;
}
.optima-workbench .optima-sidebar .nav-item { display:block; width:100%; }
.optima-workbench .optima-sidebar .nav-link {
  display:flex; align-items:center; gap:11px; min-height:42px;
  padding:10px 12px!important; overflow:hidden; white-space:nowrap;
  color:#eae5f5!important; font-size:.83rem; font-weight:500;
  text-transform:none!important; text-decoration:none;
  background:transparent!important; border-radius:9px;
}
.optima-workbench .optima-sidebar .nav-link i {
  flex:0 0 20px; width:20px; margin-right:0!important;
  font-size:1.2rem; text-align:center;
}
.optima-workbench .optima-sidebar .nav-link:hover,
.optima-workbench .optima-sidebar .nav-link:focus-visible {
  background:#ffffff22!important; color:white!important;
}
.optima-workbench .optima-sidebar .nav-link.active,
.optima-workbench .optima-sidebar .nav-link.optima-current {
  color:white!important;
  background:linear-gradient(95deg,#7665b8,#564896)!important;
}
.optima-workbench .optima-sidebar .nav-link.bg-light,
.optima-workbench .optima-sidebar .nav-link.text-dark { color:#eae5f5!important; }
.optima-workbench .optima-sidebar .dropdown-toggle::after { margin-left:auto; }
.optima-workbench .optima-sidebar .dropdown-menu {
  position:static!important; inset:auto!important; transform:none!important;
  float:none!important; width:auto; min-width:0; max-height:min(45vh,420px);
  overflow-y:auto; margin:1px 0 8px 12px; padding:6px 4px 6px 10px;
  border:0; border-left:2px solid #8174ba; border-radius:0 8px 8px 0;
  background:#1c1a31!important; box-shadow:none;
}
.optima-workbench .optima-sidebar .dropdown-menu:not(.show) { display:none!important; }
.optima-workbench .optima-sidebar .dropdown-menu.show { display:block!important; }
.optima-workbench .optima-sidebar .dropdown-item {
  display:flex; align-items:center; min-height:34px; padding:7px 10px;
  color:#eae5f5; font-size:.8rem; white-space:normal; border-radius:6px;
}
.optima-workbench .optima-sidebar .dropdown-item:hover,
.optima-workbench .optima-sidebar .dropdown-item:focus-visible,
.optima-workbench .optima-sidebar .dropdown-item.optima-current {
  color:#fff; background:#554789;
}
.optima-workbench .optima-sidebar .dropdown-divider { border-color:#5b5376; }
.optima-workbench .optima-sidebar .dropdown-menu form button { color:#ffd5de!important; }
.optima-workbench .optima-sidebar #themeToggle {
  display:flex; align-items:center; justify-content:center;
  min-height:38px; margin:4px 12px 10px;
  border:1px solid #887dac; background:transparent!important;
  border-radius:8px; color:white!important;
}
.optima-workbench.optima-rail-collapsed .optima-sidebar-brand {
  justify-content:center; min-height:66px; padding:9px 5px;
}
.optima-workbench.optima-rail-collapsed .optima-brand-link { display:none; }
.optima-workbench.optima-rail-collapsed .optima-sidebar .navbar-nav { padding:10px 5px; }
.optima-workbench.optima-rail-collapsed .optima-sidebar .nav-link {
  justify-content:center; padding:10px 0!important; font-size:0;
}
.optima-workbench.optima-rail-collapsed .optima-sidebar .nav-link i { font-size:1.3rem; }
.optima-workbench.optima-rail-collapsed .optima-sidebar .dropdown-toggle::after,
.optima-workbench.optima-rail-collapsed .optima-sidebar .dropdown-menu,
.optima-workbench.optima-rail-collapsed #themeToggle .d-md-inline { display:none!important; }
.optima-workbench.optima-rail-collapsed #themeToggle { margin-inline:4px; padding:5px!important; }
.optima-workbench > #optimaMainContent {
  grid-column:2; grid-row:1; min-width:0; width:100%;
  max-width:100%; min-height:100vh; margin:0;
  padding:24px clamp(18px,2.5vw,38px)!important;
}
.optima-workbench .optima-mobile-bar,
.optima-workbench .optima-nav-scrim { display:none; }
.optima-workbench main .breadcrumb { margin-bottom:18px; font-size:.79rem; }
.optima-workbench main .breadcrumb a { color:var(--opt-workbench-action); }
.optima-workbench main h1, .optima-workbench main .h1 {
  font-weight:500; color:#29243e;
}
.optima-workbench main .card {
  border:1px solid var(--opt-workbench-border); border-radius:12px;
  box-shadow:0 4px 16px #20182f0a;
}
.optima-workbench main .card-header {
  padding:.8rem 1rem; color:#362d4e; background:#faf8fc;
  border-bottom:1px solid var(--opt-workbench-border); font-weight:500;
}
.optima-workbench main .form-control,
.optima-workbench main .form-select,
.optima-workbench main .select2-container .select2-selection {
  min-height:33px; border-radius:7px; border-color:#d8d1e2;
}
.optima-workbench :is(a,button,input,select,textarea,summary):focus-visible {
  outline:3px solid #b8a7ea; outline-offset:2px;
}
.optima-workbench main .form-control:focus,
.optima-workbench main .form-select:focus {
  border-color:var(--opt-primary); box-shadow:0 0 0 .2rem #8174ba30;
}
.optima-workbench main .btn { font-weight:500; border-radius:7px; }
.optima-workbench main .btn-primary {
  background:var(--opt-workbench-action);
  border-color:var(--opt-workbench-action); color:white;
}
.optima-workbench main .btn-primary:hover { background:#483979; border-color:#483979; }
.optima-workbench main .table-responsive {
  max-width:100%; border:1px solid var(--opt-workbench-border); border-radius:9px;
}
.optima-workbench main .table {
  margin-bottom:0; font-size:.83rem; font-variant-numeric:tabular-nums;
  --bs-table-striped-bg:#faf8fc; --bs-table-hover-bg:#f4effa;
}
.optima-workbench main .table th {
  color:#4e416a; background:#f1eef7;
  padding:.56rem .65rem; border-color:#e3deea;
  white-space:nowrap; font-weight:500;
}
.optima-workbench main .table td { padding:.5rem .65rem; border-color:#eeeaf3; }
.optima-workbench main .alert { border-radius:9px; }
html[data-bs-theme="dark"] { background:#151420; }
[data-bs-theme="dark"] body.optima-workbench { background:#151420; color:#edeaf6; }
[data-bs-theme="dark"] .optima-workbench main h1,
[data-bs-theme="dark"] .optima-workbench main .h1 { color:#edeaf6; }
[data-bs-theme="dark"] .optima-workbench main .card {
  background:#1c1e2d; border-color:#48435a; color:#edeaf6;
}
[data-bs-theme="dark"] .optima-workbench main .card-header {
  background:#26243a; border-color:#48435a; color:#edeaf6;
}
[data-bs-theme="dark"] .optima-workbench main .table th {
  color:#ded5f3; background:#2c2841; border-color:#48435a;
}
[data-bs-theme="dark"] .optima-workbench main .table td { border-color:#48435a; }
@media (max-width:991.98px) {
  body.optima-workbench { display:block; }
  .optima-workbench .optima-sidebar {
    position:fixed; left:0; top:0; bottom:0; width:min(320px,86vw);
    height:100dvh; transform:translateX(-103%);
    transition:transform .18s ease; z-index:1051;
  }
  .optima-workbench.optima-mobile-open .optima-sidebar { transform:translateX(0); }
  .optima-workbench .optima-rail-toggle { display:none; }
  .optima-workbench .optima-mobile-bar {
    display:flex; align-items:center; gap:14px;
    position:sticky; top:0; z-index:1025;
    min-height:62px; padding:8px 16px;
    background:white; border-bottom:1px solid var(--opt-workbench-border);
  }
  .optima-workbench .optima-mobile-toggle {
    display:grid; place-items:center; width:42px; height:42px;
    font-size:1.5rem; border:1px solid #ddd6e7; border-radius:8px;
    color:#36275e; background:white;
  }
  .optima-workbench .optima-mobile-brand img {
    width:162px; max-width:65vw; height:auto;
  }
  .optima-workbench .optima-nav-scrim:not([hidden]) {
    display:block; position:fixed; inset:0; z-index:1050;
    width:100%; height:100%; padding:0; border:0; background:#100d2099;
  }
  .optima-workbench > #optimaMainContent {
    min-height:calc(100vh - 62px); padding:18px 14px!important;
  }
  [data-bs-theme="dark"] .optima-workbench .optima-mobile-bar {
    background:#242435; border-color:#48435a;
  }
}
@media (prefers-reduced-motion:reduce) {
  .optima-workbench .optima-sidebar { transition:none; }
}
@media print {
  body.optima-workbench { display:block; background:white; }
  .optima-workbench .optima-sidebar, .optima-workbench .optima-mobile-bar,
  .optima-workbench .optima-nav-scrim { display:none!important; }
  .optima-workbench > #optimaMainContent { width:100%; padding:0!important; }
}


/* Button-driven accessibility enhancement. Base navigation is accessible
   when JavaScript is disabled, rather than hiding every business link. */
.optima-workbench .optima-rail-toggle { font-size:1.2rem; cursor:pointer; }
.optima-workbench.optima-rail-collapsed .optima-rail-toggle i { transform:rotate(180deg); }
.optima-workbench .optima-rail-toggle:focus-visible,
.optima-workbench .optima-mobile-toggle:focus-visible {
  outline:3px solid #c6b8f8; outline-offset:3px;
}
/* Collapsed links retain accessible names and a tooltip via title. */
.optima-workbench.optima-rail-collapsed .optima-sidebar .nav-link {
  position:relative; overflow:visible;
}
.optima-workbench.optima-rail-collapsed .optima-sidebar .nav-link:focus-visible {
  outline-offset:-2px;
}
.optima-workbench .optima-sidebar .dropdown-menu .dropdown-item:focus-visible {
  outline:2px solid #d6cafd; outline-offset:1px;
}
.optima-workbench .optima-sidebar .navbar-nav:last-child button#themeToggle {
  width:calc(100% - 24px);
}
.optima-workbench.optima-rail-collapsed .optima-sidebar .navbar-nav:last-child button#themeToggle {
  width:calc(100% - 8px);
}
.optima-workbench main .page-action-footer-space { max-width:100%; min-width:0; }
.optima-workbench main .selectable-container .list-group-item.active {
  border-left:3px solid #d6b5d4;
}
.optima-workbench main .nav-tabs .nav-link {
  color:#5b4d8d; font-weight:500;
}
.optima-workbench main .pagination .page-link {
  color:#5d4e9a;
}
.optima-workbench main .pagination .page-item.active .page-link {
  color:#fff; background:#5d4e9a; border-color:#5d4e9a;
}
.optima-workbench main :is(.table-responsive,.list-group,.selectable-container) {
  scrollbar-width:thin; scrollbar-color:#bcb2d0 transparent;
}
.optima-workbench main > section { min-width:0; }
.optima-workbench main :is(.col-md-3,.col-md-9,.col-md-12) { min-width:0; }
.optima-workbench main .border-primary { border-color:#d6c9ea!important; }
.optima-workbench main .btn-outline-primary {
  --bs-btn-color:#5d4e9a;
  --bs-btn-border-color:#a99ad0;
  --bs-btn-hover-bg:#5d4e9a;
  --bs-btn-hover-border-color:#5d4e9a;
  --bs-btn-hover-color:#fff;
}
.optima-workbench main .btn:focus-visible {
  box-shadow:0 0 0 .25rem #8174ba35;
}
@media (max-width:991.98px) {
  .optima-workbench .optima-sidebar { visibility:hidden; }
  .optima-workbench.optima-mobile-open .optima-sidebar {
    visibility:visible; transform:translateX(0);
  }
  .optima-workbench.optima-rail-collapsed .optima-sidebar .nav-link {
    justify-content:flex-start; padding:10px 12px!important;
    font-size:.83rem; overflow:hidden;
  }
  .optima-workbench.optima-rail-collapsed .optima-sidebar .nav-link i {
    font-size:1.2rem;
  }
  .optima-workbench.optima-rail-collapsed .optima-sidebar .dropdown-menu.show {
    display:block!important;
  }
  .optima-workbench.optima-rail-collapsed .optima-brand-link { display:flex; }
  .optima-workbench .optima-nav-scrim:not([hidden]) {
    display:block; position:fixed; inset:0; z-index:1050;
    width:100%; height:100%; background:#100d2099;
  }
}
@media print { .optima-workbench .optima-nav-scrim { display:none!important; } }


/* Screen-level workbench polish, without rewriting views or queries. */
.optima-workbench .optima-accounts-workbench > section > .border {
  border-color:var(--opt-workbench-border)!important;
  border-radius:13px!important;
  background:var(--bs-body-bg,#fff); box-shadow:0 4px 19px #20182f09;
}
.optima-workbench .optima-accounts-workbench > section > .border > strong:first-child {
  font-size:.93rem; font-weight:600; color:#4b3c78;
}
.optima-workbench .optima-accounts-workbench .list-group-item {
  margin-bottom:3px; border-radius:7px!important;
  border:1px solid transparent; font-size:.84rem;
}
.optima-workbench .optima-accounts-workbench .list-group-item.active {
  background:#eee9f8!important; border-color:#d4caea!important;
}
.optima-workbench .optima-accounts-workbench .list-group-item.active a {
  color:#4f3b87!important; font-weight:500;
}
.optima-workbench .optima-accounts-workbench .nav-tabs {
  gap:3px; flex-wrap:wrap; border-color:#e3ddeb;
}
.optima-workbench .optima-accounts-workbench .nav-tabs .nav-link {
  min-height:35px; border-radius:8px 8px 0 0;
}
.optima-workbench .optima-accounts-workbench .nav-tabs .nav-link.active {
  color:#4d3c88; background:var(--bs-body-bg,#fff);
}
.optima-workbench .optima-accounts-workbench .table-responsive {
  max-height:min(65vh,720px); overflow:auto;
}
.optima-workbench .optima-accounts-workbench .table th {
  position:sticky; top:0; z-index:1;
}
.optima-workbench .optima-accounts-workbench .form-control,
.optima-workbench .optima-accounts-workbench .form-select {
  min-width:0;
}
.optima-workbench .optima-accounts-workbench .pagination {
  flex-wrap:wrap; gap:3px;
}
.optima-workbench .optima-accounts-workbench h5 {
  color:#48396e; font-weight:600;
}
[data-bs-theme="dark"] .optima-workbench .optima-accounts-workbench > section > .border > strong:first-child,
[data-bs-theme="dark"] .optima-workbench .optima-accounts-workbench h5 { color:#c8b5ef; }
[data-bs-theme="dark"] .optima-workbench .optima-accounts-workbench .list-group-item.active {
  background:#3b3454!important; border-color:#73628f!important;
}
[data-bs-theme="dark"] .optima-workbench .optima-accounts-workbench .list-group-item.active a {
  color:#f3ecff!important;
}
/* Prevent the old top-bar sticky-offset from occupying the viewport on desktop. */
@media(min-width:992px) {
  .optima-workbench .rate-option-sticky-header { top:0; }
}


/* Optima 2.2 — shared finishing layer.
 * Loaded only by the Workbench base or the independent auth templates.
 * No permissions, queries or business state are inferred from appearance.
 */
body.optima-workbench {
  --opt-surface: var(--bs-body-bg, #fff);
  --opt-quiet-border: #e5dfed;
}
.optima-workbench .mt-2 { margin-top:.5rem!important; }
.optima-workbench .mt-3 { margin-top:1rem!important; }
.optima-workbench .mt-4 { margin-top:1.5rem!important; }
.optima-workbench .optima-mobile-bar .optima-mobile-toggle {
  flex:0 0 42px; display:grid; place-items:center; cursor:pointer;
}
/* Pop-ups that deliberately override navbar should get the whole viewport.
 * They must never render an empty 232px rail or a duplicate mobile bar. */
body.optima-workbench.optima-workbench-dialog {
  display:block; width:100%; min-height:100vh;
}
.optima-workbench.optima-workbench-dialog > #optimaMainContent {
  display:block; width:100%; max-width:none; min-height:100vh;
  padding:15px clamp(12px,2vw,24px)!important;
}
.optima-workbench.optima-workbench-dialog .optima-mobile-bar,
.optima-workbench.optima-workbench-dialog .optima-nav-scrim {
  display:none!important;
}
/* Mobile JS enhancement; keyboard users without JS retain full navigation. */
@media(max-width:991.98px) {
  body.optima-workbench.optima-mobile-open { overflow:hidden; }
  body.optima-workbench:not(.optima-js-nav):not(.optima-workbench-dialog) .optima-sidebar {
    position:relative; transform:none; visibility:visible;
    height:auto; width:100%; max-height:55vh; z-index:2;
  }
  body.optima-workbench:not(.optima-js-nav) .optima-sidebar-inner {
    max-height:55vh; overflow:auto;
  }
  body.optima-workbench:not(.optima-js-nav) .optima-mobile-bar {
    display:none!important;
  }
  .optima-workbench.optima-workbench-dialog > #optimaMainContent {
    padding:12px!important;
  }
}
/* Common cards and toolbars across underwriting, carrier, administration,
   security, reporting and the source-built lookup screens. */
.optima-workbench main :is(div,section).border.border-primary.rounded.p-3 {
  border-color:var(--opt-quiet-border)!important;
  border-radius:12px!important;
  background:var(--bs-body-bg, #fff);
  box-shadow:0 4px 16px rgba(34,27,52,.045);
}
.optima-workbench main .bg-primary {
  background:linear-gradient(90deg,#5d4e9a,#7563b2)!important;
  border-radius:8px;
}
.optima-workbench main .bg-primary :is(.form-control,.form-select) {
  background:var(--bs-body-bg,#fff);
}
.optima-workbench main .bg-primary .btn-light { color:#493b7c; }
.optima-workbench main .border.rounded.p-3 form :is(.row,.d-flex) {
  min-width:0;
}
.optima-workbench main .btn-group .btn {
  border-radius:7px;
}
.optima-workbench main .btn-group > .btn:not(:first-child) {
  margin-left:2px;
}
.optima-workbench main .form-label,
.optima-workbench main .col-form-label {
  font-size:.82rem; font-weight:500;
}
.optima-workbench main .form-control::placeholder { color:#89829b; }
.optima-workbench main .form-control:disabled,
.optima-workbench main .form-select:disabled {
  background:var(--bs-secondary-bg,#eae8ed);
}
.optima-workbench main .page-sticky-header {
  background:var(--bs-body-bg,#fff);
  z-index:1016; top:var(--optima-navbar-height,0px);
  border-bottom:1px solid var(--opt-quiet-border);
}
.optima-workbench main :is(.card,section,article,form) { min-width:0; }
.optima-workbench main .table-responsive {
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.optima-workbench main .table-responsive .table { min-width:max-content; width:100%; }
.optima-workbench main .table-responsive .table th { vertical-align:middle; }
.optima-workbench main .table-responsive .table td :is(input,select) { min-width:0; }
.optima-workbench main .form-control-sm,
.optima-workbench main .form-select-sm { font-size:.82rem; }
.optima-workbench main .list-group-item {
  border-color:#e6dfec;
}
.optima-workbench main .list-group-item-action:hover {
  background:#f6f2fc;
}
.optima-workbench main .page-link {
  background:var(--bs-body-bg,#fff); border-color:var(--opt-quiet-border);
}
.optima-workbench main .btn-primary:not(:disabled):active {
  background:#423472; border-color:#423472;
}
.optima-workbench main .btn-check:checked + .btn-outline-primary {
  color:#fff; background:#5d4e9a; border-color:#5d4e9a;
}
.optima-workbench main .modal-content {
  border:1px solid #e5dfed; border-radius:14px;
  box-shadow:0 22px 55px rgba(24,19,42,.17);
}
.optima-workbench main .modal-header {
  border-bottom-color:#e5dfed; background:#faf8fc;
}
.optima-workbench main .dropdown-menu {
  border-color:#e4daef; border-radius:9px;
}
.optima-workbench main .dropdown-item:focus-visible {
  outline:2px solid #8174ba; outline-offset:-2px;
}
.optima-workbench main .tab-content { opacity:1; }
.optima-workbench main .submission-action-footer {
  left:var(--opt-rail-width); background:var(--bs-body-bg,#fff);
  border-top-color:var(--opt-quiet-border);
  box-shadow:0 -6px 20px rgba(31,23,52,.08);
}
@media(max-width:991.98px) {
  .optima-workbench main .submission-action-footer { left:0; }
  .optima-workbench main .page-sticky-header { top:62px; }
}
@media(max-width:575.98px) {
  .optima-workbench main .btn-group { flex-wrap:wrap; gap:2px; }
  .optima-workbench main .btn-group > .btn { border-radius:7px!important; margin:0!important; }
}
[data-bs-theme="dark"] .optima-workbench {
  --opt-surface:#252538;
  --opt-quiet-border:#4a435d;
}
[data-bs-theme="dark"] .optima-workbench main :is(div,section).border.border-primary.rounded.p-3,
[data-bs-theme="dark"] .optima-workbench main .modal-content {
  background:#242638; border-color:#49435c!important;
}
[data-bs-theme="dark"] .optima-workbench main .modal-header {
  background:#2e2b44; border-color:#49435c;
}
[data-bs-theme="dark"] .optima-workbench main .list-group-item-action:hover {
  background:#38334e;
}
[data-bs-theme="dark"] .optima-workbench main .form-control::placeholder {
  color:#a9a0bb;
}
[data-bs-theme="dark"] .optima-workbench main .page-link {
  color:#c9b7f3; border-color:#4a435d;
}
/* Landing screen uses only existing routes and server permission tags. */
.optima-home { max-width:1440px; margin:0 auto; }
.optima-home-hero {
  display:grid; grid-template-columns:minmax(0,1.4fr) minmax(260px,.9fr);
  gap:20px; align-items:center; overflow:hidden;
  min-height:278px; padding:clamp(26px,4vw,48px);
  background:linear-gradient(116deg,#fefdfd 3%,#f6f2fd 66%,#efe9fa 100%);
  border:1px solid #e3ddec; border-radius:17px;
  box-shadow:0 12px 35px rgba(35,29,62,.055);
}
.optima-home-eyebrow {
  display:block; color:#68559f; font-size:.72rem;
  font-weight:700; letter-spacing:.125em;
}
.optima-home-intro h1 {
  font-size:clamp(1.75rem,3vw,2.5rem);
  line-height:1.12; font-weight:600; letter-spacing:-.025em;
  color:#29243f; margin:12px 0 12px;
}
.optima-home-intro p {
  max-width:42rem; font-size:1.02rem; color:#605b6f;
  margin:0 0 22px;
}
.optima-home-hero-actions { display:flex; flex-wrap:wrap; gap:10px; }
.optima-home-hero-actions .btn {
  display:inline-flex; align-items:center; gap:6px;
  min-height:41px; padding:9px 16px;
}
.optima-home-illustration {
  height:204px; border:1px solid #e4deea;
  border-radius:12px; overflow:hidden; background:#d8d3e5;
}
.optima-home-illustration img {
  display:block; width:100%; height:100%; object-fit:cover;
  object-position:50% 46%;
}
.optima-home-section-heading {
  display:flex; align-items:end; justify-content:space-between;
  gap:15px; flex-wrap:wrap; margin:29px 2px 17px;
}
.optima-home-section-heading h2 {
  font-size:1.37rem; font-weight:600; color:#29243f;
  margin:6px 0 0;
}
.optima-home-version {
  font-size:.78rem; color:#777084; padding:6px 11px;
  border:1px solid #e2dceb; border-radius:99px;
}
.optima-home-launch-grid {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.optima-home-panel {
  min-width:0; padding:21px 22px 17px;
  border:1px solid #e4dfeb; border-radius:14px;
  background:var(--bs-body-bg,#fff);
  box-shadow:0 5px 20px rgba(35,29,62,.04);
}
.optima-home-panel-icon {
  width:45px; height:45px; border-radius:12px; display:grid;
  place-items:center; font-size:1.35rem;
  color:#59468e; background:#ede7f9;
}
.optima-home-panel-icon-rose { color:#8f4f68; background:#f8e5ed; }
.optima-home-panel-icon-mist { color:#476680; background:#e5f0f9; }
.optima-home-panel-icon-slate { color:#52645a; background:#e7f2ed; }
.optima-home-panel h3 {
  margin:13px 0 6px; font-size:1.13rem;
  font-weight:600; color:#302841;
}
.optima-home-panel p {
  margin:0 0 15px; color:#696273; font-size:.87rem;
  min-height:2.5em;
}
.optima-home-links { display:flex; flex-direction:column; }
.optima-home-links a {
  display:flex; justify-content:space-between; align-items:center;
  gap:10px; min-height:40px; padding:8px 3px;
  color:#544381; text-decoration:none; font-weight:500;
  border-top:1px solid #f0eaf4;
}
.optima-home-links a i { flex:0 0 auto; }
.optima-home-links a:hover {
  color:#3e2e73; background:#f8f5fc;
  padding-left:8px; padding-right:8px; border-radius:5px;
}
.optima-home-links a:focus-visible {
  outline:2px solid #8174ba; outline-offset:2px;
}
.optima-home-footer {
  display:flex; justify-content:space-between; gap:12px;
  flex-wrap:wrap; margin:20px 2px 5px; color:#817a8b;
  font-size:.76rem;
}
.optima-home-summary {
  margin:22px 0 0; padding:22px; border:1px solid #e4dfeb;
  border-radius:14px; background:var(--bs-body-bg,#fff);
}
.optima-home-summary-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.optima-home-summary-heading h2 { font-size:1.3rem; color:#302841; margin:6px 0 0; }
.optima-home-summary-updated, .optima-home-summary-period { color:#696273; font-size:.8rem; }
.optima-home-summary-filter { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:18px 0 12px; }
.optima-home-summary-filter label { display:block; margin-bottom:5px; font-size:.82rem; font-weight:600; }
.optima-home-summary-filter .form-select, .optima-home-summary-filter .form-control { min-height:42px; font-size:.9rem; }
.optima-home-summary-dates { display:flex; gap:12px; flex-wrap:wrap; border:0; margin:0; padding:0; }
.optima-home-summary-dates[hidden] { display:none; }
.optima-home-metric-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap:12px; }
.optima-home-metric { min-width:0; padding:18px 15px; border:1px solid #e4dfeb; border-radius:11px; background:#faf8fe; }
.optima-home-metric h3 { min-height:2.6em; margin:0 0 12px; color:#514565; font-size:.87rem; font-weight:600; line-height:1.3; }
.optima-home-metric strong { display:block; color:#33264f; font-size:clamp(1.5rem,2.1vw,2rem); font-weight:650; line-height:1.15; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.optima-home-metric-premium strong { font-size:1.25rem; }
.optima-home-metric p { margin:10px 0 0; font-size:.78rem; line-height:1.45; color:#696273; }
.optima-home-metric p.optima-home-metric-incomplete { color:#8b3a23; font-weight:600; }
.optima-home-summary-definitions { margin:15px 0 0; font-size:.8rem; color:#696273; }
.optima-home-summary-definitions summary { color:#59468e; cursor:pointer; font-weight:600; }
.optima-home-summary-definitions p { margin:10px 0 0; max-width:90ch; }
@media(max-width:760px) {
  .optima-home-summary { padding:18px 15px; }
  .optima-home-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .optima-home-metric-premium { grid-column:1 / -1; }
  .optima-home-summary-filter > div, .optima-home-summary-dates { flex:1 1 100%; min-width:0; }
  .optima-home-summary-dates > div { flex:1 1 12rem; min-width:0; }
  .optima-home-metric h3 { min-height:0; }
}
[data-bs-theme="dark"] .optima-home-summary { border-color:#544768; background:#262638; }
[data-bs-theme="dark"] .optima-home-metric { border-color:#544768; background:#302a40; }
[data-bs-theme="dark"] .optima-home-metric strong { color:#f0eaf9; }
[data-bs-theme="dark"] .optima-home-summary-updated,
[data-bs-theme="dark"] .optima-home-summary-period,
[data-bs-theme="dark"] .optima-home-metric p,
[data-bs-theme="dark"] .optima-home-summary-definitions { color:#c5bcd0; }
[data-bs-theme="dark"] .optima-home-summary-definitions summary { color:#d3c1f7; }
[data-bs-theme="dark"] .optima-home-metric p.optima-home-metric-incomplete { color:#ffc9b5; }
@media(max-width:1200px) {
  .optima-home-hero { grid-template-columns:1fr 280px; }
}
@media(max-width:760px) {
  .optima-home-hero { display:block; padding:23px 20px; }
  .optima-home-illustration { height:136px; margin-top:20px; }
  .optima-home-launch-grid { grid-template-columns:1fr; }
  .optima-home-panel p { min-height:auto; }
}
[data-bs-theme="dark"] .optima-home-hero {
  background:linear-gradient(120deg,#252237,#332b4d);
  border-color:#544768;
}
[data-bs-theme="dark"] .optima-home :is(h1,h2,h3) { color:#f0eaf9; }
[data-bs-theme="dark"] .optima-home-intro p,
[data-bs-theme="dark"] .optima-home-panel p { color:#c5bcd0; }
[data-bs-theme="dark"] .optima-home-panel { border-color:#544768; background:#262638; }
[data-bs-theme="dark"] .optima-home-links a {
  color:#d3c1f7; border-color:#403951;
}
[data-bs-theme="dark"] .optima-home-links a:hover { background:#3b3153; color:#fff; }
[data-bs-theme="dark"] .optima-home-eyebrow { color:#c9b5f6; }
[data-bs-theme="dark"] .optima-home-version { color:#bbb0cc; border-color:#544768; }
/* Sign-in, MFA and Outlook connection share the same brandkit without
   altering authentication, MFA, password rules or identity provider flow. */
body.optima-auth-page {
  position:relative; min-height:100vh;
  font-family:"Roboto","Segoe UI",Arial,sans-serif;
  color:#2b2640;
}
body.optima-auth-page::before {
  content:""; position:fixed; inset:0; z-index:0;
  background:linear-gradient(132deg,rgba(23,19,44,.76),rgba(80,66,136,.48) 65%,rgba(53,38,84,.68));
  pointer-events:none;
}
body.optima-auth-page main { position:relative; z-index:1; }
.optima-auth-page .auth-wrapper .card,
.optima-auth-page .verify-card,
.optima-auth-page .connect-card {
  background:rgba(255,255,255,.96); border:1px solid rgba(255,255,255,.75)!important;
  border-radius:17px; box-shadow:0 20px 60px rgba(22,15,47,.28);
  backdrop-filter:blur(24px);
}
.optima-auth-page .optima-auth-heading {
  margin:15px 0 6px; font-size:1.46rem;
  font-weight:600; text-align:center; color:#2d2645;
}
.optima-auth-page .optima-auth-subtitle {
  margin:0 0 22px; text-align:center; font-size:.9rem; color:#70677b;
}
.optima-auth-page .form-label { color:#4f4660; font-weight:500; font-size:.85rem; }
.optima-auth-page .form-control {
  min-height:42px; border-color:#d6d0e2; border-radius:7px;
}
.optima-auth-page .input-group .form-control { border-radius:0; }
.optima-auth-page .input-group-text {
  border-color:#d6d0e2; color:#69558e; background:#f8f5fc!important;
}
.optima-auth-page .form-control:focus {
  border-color:#8174ba; box-shadow:0 0 0 .2rem rgba(129,116,186,.18);
}
.optima-auth-page .btn-primary {
  background:#5d4e9a; border-color:#5d4e9a;
  color:white; font-weight:500; border-radius:8px;
}
.optima-auth-page .btn-primary:hover { background:#473a79; border-color:#473a79; }
.optima-auth-page .input-group button#togglePassword {
  color:#554482; background:#f6f2fb; border:1px solid #d6d0e2;
}
.optima-auth-page .input-group button#togglePassword:hover { background:#eae3f7; }
.optima-auth-page :is(a,button,input,select):focus-visible {
  outline:3px solid #b7a6ed; outline-offset:2px;
}
.optima-auth-page .verify-icon { color:#554487!important; background:#ece7f8!important; }
.optima-auth-page .verify-code { letter-spacing:.25em; }
.optima-auth-page .btn-back { color:#544381; }
@media(max-width:575.98px) {
  .optima-auth-page .auth-wrapper .card,
  .optima-auth-page .verify-card,
  .optima-auth-page .connect-card { border-radius:12px; }
}
@media(prefers-reduced-motion:reduce) {
  .optima-workbench .optima-home-links a,
  .optima-auth-page * { transition:none!important; }
}


/* Consistent heading across real list, detail, administration and report pages. */
.optima-workbench .optima-screen-heading {
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
  padding:2px 2px 20px; margin:0 0 9px;
}
.optima-workbench .optima-screen-heading h1 {
  font-size:clamp(1.4rem,2vw,1.9rem); line-height:1.15;
  font-weight:600; color:#2b2444; letter-spacing:-.025em;
  margin:8px 0 0;
}
.optima-workbench .optima-screen-heading p {
  margin:7px 0 0; max-width:56rem;
  font-size:.88rem; color:#71697d;
}
.optima-workbench main .optima-screen-heading + section.row {
  margin-top:0;
}
.optima-workbench main .optima-screen-heading + .container-fluid {
  padding-inline:0;
}
.optima-workbench main .optima-screen-heading .optima-home-eyebrow {
  letter-spacing:.13em;
}
[data-bs-theme="dark"] .optima-workbench .optima-screen-heading h1 {
  color:#efe9f8;
}
[data-bs-theme="dark"] .optima-workbench .optima-screen-heading p {
  color:#bfb4cb;
}
/* Compact data screens prioritize scanability and retain native table scrolling. */
.optima-workbench main .table-responsive .table thead th > a {
  color:#4f3e81; font-weight:600; text-decoration:none;
}
.optima-workbench main .table-responsive .table thead th > a:hover {
  text-decoration:underline;
}
[data-bs-theme="dark"] .optima-workbench main .table-responsive .table thead th > a {
  color:#d1c2f6;
}
.optima-workbench main :is(.badge,.status-chip,.rounded-pill) {
  letter-spacing:.01em;
}
.optima-workbench main .table tr:focus-within {
  --bs-table-bg-state:#f6f0fd;
}
[data-bs-theme="dark"] .optima-workbench main .table tr:focus-within {
  --bs-table-bg-state:#363047;
}
@media(max-width:767.98px) {
  .optima-workbench .optima-screen-heading { padding-bottom:15px; }
  .optima-workbench .optima-screen-heading h1 { font-size:1.43rem; }
}


/* Original About/Splash route, redesigned independently of the new landing. */
.optima-splash-landing {
  display:grid; grid-template-columns:minmax(320px,.85fr) minmax(0,1.15fr);
  overflow:hidden; min-height:min(68vh,660px);
  border:1px solid #e2dbec; border-radius:17px;
  background:var(--bs-body-bg,#fff);
  box-shadow:0 12px 32px rgba(29,22,49,.065);
}
.optima-splash-brand {
  display:flex; flex-direction:column; justify-content:center; align-items:flex-start;
  gap:14px; padding:clamp(28px,5vw,58px);
}
.optima-splash-brand > img { max-width:min(100%,300px); height:auto; }
.optima-splash-brand h1 { font-size:clamp(1.6rem,2.7vw,2.3rem); margin:0; }
.optima-splash-brand > p { margin:0; color:var(--bs-secondary-color); }
.optima-splash-actions {
  display:flex; flex-wrap:wrap; align-items:center; gap:12px;
  margin-top:12px;
}
.optima-splash-actions p { margin:0; width:100%; }
.optima-splash-art {
  min-height:280px; overflow:hidden; background:#4b3c6b;
}
.optima-splash-art img {
  width:100%; height:100%; display:block; object-fit:cover;
  object-position:48% 50%;
}
[data-bs-theme="dark"] .optima-splash-landing { border-color:#4f4567; }
@media(max-width:767.98px) {
  .optima-splash-landing { display:flex; flex-direction:column; min-height:0; }
  .optima-splash-brand { padding:25px; }
  .optima-splash-art { min-height:170px; max-height:220px; }
}


/* Structural fallback when a popup overrides the Django navbar block.
 * Pure sibling selectors handle every current or future navbar-free route,
 * even before JS runs. No selector pseudo-class or dedicated popup script required. */
body.optima-workbench > #optimaMainContent {
  grid-column:1 / -1;
}
body.optima-workbench > .optima-sidebar ~ #optimaMainContent {
  grid-column:2;
}
@media(max-width:991.98px) {
  body.optima-workbench > .optima-mobile-bar {
    display:none;
  }
  body.optima-workbench > .optima-sidebar ~ .optima-mobile-bar {
    display:flex;
  }
}

/* Dark workbench contrast: Bootstrap paints stripes/hover with cell shadows.
   Override its table tokens as well as surfaces; a dark tbody alone cannot
   replace the light finishing layer's stripe. Light mode is unchanged. */
[data-bs-theme="dark"] body.optima-workbench {
  --opt-workbench-border:#4a435d;
  --opt-readable-link:#d1c2f6;
  --bs-link-color:#d1c2f6;
  --bs-link-color-rgb:209,194,246;
  --bs-link-hover-color:#eee7ff;
  --bs-link-hover-color-rgb:238,231,255;
}
[data-bs-theme="dark"] .optima-workbench main .table {
  --bs-table-color:#edeaf6;
  --bs-table-bg:#212529;
  --bs-table-striped-bg:#2c2a3d;
  --bs-table-striped-color:#edeaf6;
  --bs-table-hover-bg:#3b3454;
  --bs-table-hover-color:#fff;
  --bs-table-active-bg:#453963;
  --bs-table-active-color:#fff;
}
[data-bs-theme="dark"] .optima-workbench main .nav-tabs .nav-link,
[data-bs-theme="dark"] .optima-workbench main .breadcrumb a,
[data-bs-theme="dark"] .optima-workbench main .btn-outline-primary,
[data-bs-theme="dark"] .optima-workbench main .bg-primary .btn-outline-light {
  color:var(--opt-readable-link);
}
[data-bs-theme="dark"] .optima-workbench main .text-primary {
  color:var(--opt-readable-link)!important;
}
[data-bs-theme="dark"] .optima-workbench main .nav-tabs .nav-link.active {
  color:#fff; border-color:var(--opt-workbench-border);
}
[data-bs-theme="dark"] .optima-workbench main .btn-outline-primary:hover {
  color:#fff; background:#5d4e9a;
}
[data-bs-theme="dark"] .optima-workbench .optima-brand-link img,
[data-bs-theme="dark"] .optima-workbench .optima-mobile-brand img {
  /* These marks already have a white backing; inversion washes them out. */
  filter:none;
}

[data-bs-theme="dark"] .optima-workbench main .badge.text-danger {
  color:#ffb4be!important; border-color:#cf8192!important;
}
[data-bs-theme="dark"] .optima-workbench .optima-mobile-brand {
  display:inline-flex; padding:4px 6px; border-radius:6px; background:#fff;
}
/* Native file pickers stay readable in the shared dark document/editor theme. */
[data-bs-theme="dark"] .optima-workbench input[type="file"]::file-selector-button {
  color:#edeaf6; background-color:#34314a;
}

/* Maeve's whole-site contrast review: enabled small-text controls must remain
   readable on the actual table, selected-row and footer surfaces. */
[data-bs-theme="light"] body.optima-workbench {
  --bs-primary-rgb:84,67,129;
  --bs-link-color:#544381;
  --bs-link-color-rgb:84,67,129;
  --bs-link-hover-color:#403263;
  --bs-link-hover-color-rgb:64,50,99;
}
[data-bs-theme="light"] .optima-workbench main .list-group {
  --bs-list-group-active-color:#fff;
  --bs-list-group-active-bg:#5d4e9a;
  --bs-list-group-active-border-color:#5d4e9a;
}
[data-bs-theme="light"] .optima-workbench main .list-group-item.active a { color:#fff; }
[data-bs-theme="light"] .optima-workbench main .btn-outline-secondary {
  --bs-btn-color:#704248;
  --bs-btn-border-color:#97717a;
  --bs-btn-hover-color:#422b38;
  --bs-btn-hover-bg:#ead4da;
  --bs-btn-hover-border-color:#97717a;
  --bs-btn-active-color:#422b38;
  --bs-btn-active-bg:#ead4da;
  --bs-btn-active-border-color:#97717a;
}
[data-bs-theme="light"] .optima-workbench main .select2-selection__placeholder { color:#71687e; }
[data-bs-theme="dark"] .optima-workbench main .btn-outline-danger {
  --bs-btn-color:#ffb4be;
  --bs-btn-border-color:#cf8192;
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg:#9f263c;
  --bs-btn-hover-border-color:#cf8192;
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg:#9f263c;
  --bs-btn-active-border-color:#cf8192;
}
[data-bs-theme="dark"] .optima-workbench main .table-warning {
  --bs-table-bg:#483c2b;
  --bs-table-color:#fff0c9;
  --bs-table-striped-bg:#51432f;
  --bs-table-striped-color:#fff0c9;
  --bs-table-hover-bg:#605039;
  --bs-table-hover-color:#fff0c9;
  --bs-table-active-bg:#605039;
  --bs-table-active-color:#fff0c9;
}
[data-bs-theme="dark"] .optima-workbench main .table-warning .text-muted { color:#fff0c9!important; }

/* Account transaction toolbars wrap at larger text sizes without losing actions. */
.optima-accounts-workbench .bg-primary > form { min-width:0; max-width:100%; }
.optima-accounts-workbench .bg-primary .btn-group { flex-wrap:wrap; max-width:100%; }

/* Enlarged root units must fit inside the shared fixed-pixel page padding. */
@media(max-width:991.98px) {
  html:is([data-optima-font-size="112.5"], [data-optima-font-size="125"], [data-optima-font-size="150"]) .optima-workbench main .row {
    --bs-gutter-x:1rem;
  }
  html:is([data-optima-font-size="112.5"], [data-optima-font-size="125"], [data-optima-font-size="150"]) .optima-carriers-workbench > section {
    width:100%;
  }
}
html:is([data-optima-font-size="112.5"], [data-optima-font-size="125"], [data-optima-font-size="150"]) .optima-workbench main .bg-primary > form {
  min-width:0; max-width:100%;
}
html:is([data-optima-font-size="112.5"], [data-optima-font-size="125"], [data-optima-font-size="150"]) .optima-workbench main .bg-primary .btn-group {
  flex-wrap:wrap; max-width:100%;
}

/* Compact navigation previews overlay content without changing the saved rail. */
@media (min-width:992px) {
  .optima-workbench.optima-rail-collapsed.optima-rail-preview .optima-sidebar { width:var(--opt-rail-expanded); }
  .optima-workbench.optima-rail-preview .optima-sidebar-brand { justify-content:space-between; min-height:78px; padding:12px; }
  .optima-workbench.optima-rail-preview .optima-brand-link { display:flex; }
  .optima-workbench.optima-rail-preview .optima-sidebar .navbar-nav { padding:12px 8px; }
  .optima-workbench.optima-rail-preview .optima-sidebar .nav-link { justify-content:flex-start; padding:10px 12px!important; font-size:.83rem; }
  .optima-workbench.optima-rail-preview .optima-sidebar .dropdown-toggle::after { display:block!important; }
  .optima-workbench.optima-rail-preview .optima-sidebar .dropdown-menu.show { display:block!important; }
}
.optima-home-metric-ratios .optima-home-ratio { display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:8px 0; }
.optima-home-ratio > span { font-size:.82rem; color:var(--bs-body-color); }
.optima-home-metric-ratios .optima-home-ratio strong { font-size:1.35rem; }

@media (max-width:575.98px) {
  .optima-home-metric-ratios { grid-column:1 / -1; }
}

.optima-home-metric-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.optima-home-metric-heading h3 { min-width:0; flex:1; }
.optima-home-help { display:inline-flex; align-items:center; justify-content:center; flex:0 0 28px; width:28px; height:28px; padding:0; border:1px solid currentColor; border-radius:50%; background:transparent; color:var(--bs-body-color); font-size:1rem; }
.optima-home-help:focus-visible { outline:3px solid var(--opt-workbench-action); outline-offset:2px; }

.optima-home-tooltip .tooltip-inner { max-width:min(320px,calc(100vw - 24px)); text-align:left; }
