/* Global UI overrides (served from public/ for artisan serve).
 * Keep this file small and focused on "paper cuts" that affect many screens.
 */

/* -------------------------------------------------------------------------- */
/* Scrolling utility: allow scroll, hide scrollbar                             */
/* -------------------------------------------------------------------------- */
.dev-scrollbar-hidden {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}

.dev-scrollbar-hidden::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Horizontal tab/menu scrollers: allow swipe/scroll, hide scrollbar chrome */
.nav-tabs,
.nav-pills.compliance-hub__tabs,
.nav-pills.caeft-admin-subnav,
.app-tabs-list-wrapper {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar,
.nav-pills.compliance-hub__tabs::-webkit-scrollbar,
.nav-pills.caeft-admin-subnav::-webkit-scrollbar,
.app-tabs-list-wrapper::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* -------------------------------------------------------------------------- */
/* In-card horizontal tabs (API dashboard, matter file menu in card header)   */
/* -------------------------------------------------------------------------- */
.card > .card-header.pb-0 {
  background: transparent;
  border-bottom: none;
  padding-bottom: 0 !important;
}

.card > .card-header.pb-0 .matter-file-tabs {
  margin-bottom: 0;
}

.card > .card-header.pb-0 .matter-file-tabs .nav-link {
  background: rgba(0, 0, 0, 0.04) !important;
  box-shadow: none !important;
  color: #67748e !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px !important;
}

.card > .card-header.pb-0 .matter-file-tabs .nav-link:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #344767 !important;
  box-shadow: none !important;
}

.card > .card-header.pb-0 .matter-file-tabs .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
  box-shadow: none !important;
}

html.theme-dark .card > .card-header.pb-0 .matter-file-tabs .nav-link {
  color: rgba(229, 231, 235, 0.7) !important;
}

html.theme-dark .card > .card-header.pb-0 .matter-file-tabs .nav-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e5e7eb !important;
}

html.theme-dark .card > .card-header.pb-0 .matter-file-tabs .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
}

.matter-file-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.matter-file-context-meta {
  color: #67748e;
  font-size: 0.8125rem;
}

.matter-file-context-meta a {
  color: #344767;
  font-weight: 600;
  text-decoration: none;
}

.matter-file-context-meta a:hover {
  color: #00a862;
  text-decoration: underline;
}

.matter-file-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.matter-file-type-badge--client-file {
  background: rgba(0, 200, 117, 0.12);
  color: #007a49;
}

.matter-file-type-badge--subfile {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.matter-file-type-badge--inline {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.fm-tree-row--subfile .fm-tree-folder,
.fm-sidebar-node--subfile .fm-sidebar-folder .material-icons-round {
  color: #3b82f6;
}

.fm-tree-row--subfile .fm-tree-label,
.fm-sidebar-node--subfile .fm-sidebar-label {
  color: #2563eb;
}

html.theme-dark .matter-file-context-meta {
  color: rgba(229, 231, 235, 0.72);
}

html.theme-dark .matter-file-context-meta a {
  color: #e5e7eb;
}

html.theme-dark .matter-file-type-badge--client-file {
  background: rgba(0, 200, 117, 0.18);
  color: #86efac;
}

html.theme-dark .matter-file-type-badge--subfile {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

html.theme-dark .fm-tree-row--subfile .fm-tree-folder,
html.theme-dark .fm-sidebar-node--subfile .fm-sidebar-folder .material-icons-round,
html.theme-dark .fm-tree-row--subfile .fm-tree-label,
html.theme-dark .fm-sidebar-node--subfile .fm-sidebar-label {
  color: #93c5fd;
}

/* Organisation register tabs live in .card-header (same as matter-file-tabs / API) */
.card > .card-header.pb-0 .matter-file-tabs {
  width: 100%;
  max-width: 100%;
}

.card > .card-header.pb-0 .nav-scroll-host {
  width: 100%;
  max-width: 100%;
}

/* File manager embedded in organisation register card */
.card-body > .fm-shell {
  border: none;
  border-radius: 0;
  margin-left: -1rem;
  margin-right: -1rem;
  width: calc(100% + 2rem);
  max-width: none;
}

/* -------------------------------------------------------------------------- */
/* File manager / document manager (3-pane list + details)                    */
/* -------------------------------------------------------------------------- */
.fm-shell {
  background: #fff;
  border: 1px solid #e8e9ed;
  border-radius: 12px;
  overflow: hidden;
}

.fm-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f3;
  background: #fff;
}

.fm-toolbar .fm-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fm-toolbar .fm-search input {
  border-radius: 999px;
  border: 1px solid #e8e9ed;
  padding-left: 38px;
  height: 38px;
}

.fm-toolbar .fm-search .material-icons-round {
  position: absolute;
  margin-left: 14px;
  font-size: 18px;
  color: #676879;
}

.fm-toolbar .fm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.fm-pane {
  min-height: 520px;
}

.fm-sidebar {
  border-right: 1px solid #eef0f3;
  background: #fafbfc;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.fm-sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f3;
  background: #fff;
}

.fm-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #676879;
}

.fm-sidebar-tree {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px 0;
}

.fm-sidebar-root,
.fm-sidebar-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fm-sidebar-node.is-active > .fm-sidebar-row {
  background: rgba(0, 200, 117, 0.1);
}

.fm-sidebar-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 8px 4px 0;
  border-radius: 8px;
  margin: 0 6px;
}

.fm-sidebar-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.fm-sidebar-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 4px 8px 4px 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #323338;
}

.fm-sidebar-folder .material-icons-round {
  font-size: 18px;
  color: #00c875;
  flex: 0 0 auto;
}

.fm-sidebar-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
}

.fm-sidebar-label-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-sidebar-label .matter-file-type-badge--inline {
  flex: 0 0 auto;
}

.fm-sidebar-node--office-folder .fm-sidebar-folder .material-icons-round {
  color: #00c875;
}

.fm-row--draggable {
  cursor: grab;
}

.fm-row.is-dragging {
  opacity: 0.55;
}

.fm-sidebar-node.is-drop-target-active > .fm-sidebar-row {
  background: rgba(59, 130, 246, 0.14);
  outline: 1px dashed #3b82f6;
  outline-offset: -1px;
}

.fm-folder-kind-options {
  display: grid;
  gap: 10px;
}

.fm-folder-kind-option {
  display: block;
  margin: 0;
  cursor: pointer;
}

.fm-folder-kind-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fm-folder-kind-option-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e8e9ed;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fm-folder-kind-option input:checked + .fm-folder-kind-option-body {
  border-color: #00c875;
  box-shadow: 0 0 0 1px rgba(0, 200, 117, 0.25);
}

.fm-folder-kind-option-body .material-icons-round {
  font-size: 20px;
  color: #00c875;
  flex: 0 0 auto;
}

.fm-folder-kind-option:last-child .fm-folder-kind-option-body .material-icons-round {
  color: #3b82f6;
}

.fm-folder-kind-option-body strong {
  display: block;
  font-size: 14px;
  color: #323338;
}

.fm-folder-kind-option-body small {
  display: block;
  margin-top: 2px;
  color: #676879;
}

.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #eef0f3;
  background: #fff;
  min-height: 44px;
}

.fm-breadcrumb-up {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e8e9ed;
  border-radius: 8px;
  background: #fff;
  color: #676879;
  cursor: pointer;
}

.fm-breadcrumb-up:hover {
  background: #f6f7fb;
}

.fm-breadcrumb-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  color: #676879;
}

.fm-breadcrumb-segment {
  border: none;
  background: transparent;
  padding: 0;
  color: #00a862;
  font-weight: 600;
  cursor: pointer;
}

.fm-breadcrumb-segment:hover {
  text-decoration: underline;
}

.fm-breadcrumb-current {
  color: #323338;
  font-weight: 700;
}

.fm-breadcrumb-separator {
  color: #94a3b8;
}

.fm-dropzone.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

html.theme-dark .fm-sidebar {
  background: rgba(255, 255, 255, 0.02);
  border-right-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark .fm-sidebar-header,
html.theme-dark .fm-breadcrumb {
  background: #0f172a;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark .fm-sidebar-title,
html.theme-dark .fm-breadcrumb-path {
  color: rgba(229, 231, 235, 0.65);
}

html.theme-dark .fm-sidebar-folder {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark .fm-sidebar-folder .material-icons-round,
html.theme-dark .fm-breadcrumb-segment {
  color: #34d399;
}

html.theme-dark .fm-breadcrumb-current {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark .fm-sidebar-node.is-active > .fm-sidebar-row {
  background: rgba(52, 211, 153, 0.12);
}

html.theme-dark .fm-sidebar-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

html.theme-dark .fm-breadcrumb-up {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(229, 231, 235, 0.7);
}

.fm-list {
  padding: 0;
}

.fm-table {
  margin: 0;
}

.fm-table thead th {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.01em;
  color: #676879;
  background: #fff;
  border-bottom: 1px solid #eef0f3;
}

.fm-row {
  cursor: pointer;
}

.fm-row:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.fm-row.is-selected td {
  background: rgba(0, 200, 117, 0.08);
}

.fm-filecell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fm-fileicon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f7fb;
  color: #323338;
  flex: 0 0 auto;
}

.fm-fileicon .material-icons-round {
  font-size: 18px;
}

.fm-filename {
  font-weight: 600;
  color: #323338;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-filesub {
  font-size: 12px;
  color: #676879;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-details {
  border-left: 1px solid #eef0f3;
  background: #fff;
  padding: 16px;
}

.fm-details-header {
  margin-bottom: 12px;
}

.fm-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.fm-details .fm-preview {
  height: 160px;
  border-radius: 12px;
  border: 1px solid #eef0f3;
  background: #fbfbfd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.fm-details .fm-preview .material-icons-round {
  font-size: 42px;
  color: #94a3b8;
}

.fm-details .fm-preview-image,
.fm-details .fm-preview-pdf {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #fff;
}

.fm-details .fm-preview-pdf {
  pointer-events: none;
}

.fm-details h5 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  color: #323338;
}

.fm-muted {
  color: #676879;
  font-size: 13px;
}

.fm-kv {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #eef0f3;
}

.fm-kv:first-of-type {
  border-top: none;
}

.fm-kv .material-icons-round {
  font-size: 18px;
  color: #676879;
}

.fm-dropzone {
  border: 2px dashed rgba(148, 163, 184, 0.55);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  color: #676879;
  background-color: #fbfbfd;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.fm-dropzone.is-dragover {
  border-color: #323338;
  background-color: #f6f7fb;
  color: #323338;
}

.fm-upload-actions {
  display: flex;
  justify-content: flex-end;
}

.fm-tree-table .fm-tree-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.fm-tree-children > td {
  padding: 0 !important;
  border-top: none;
  background: #fafbfc;
}

.fm-tree-nested {
  margin: 0;
}

.fm-tree-nested .fm-tree-row td {
  border-top: 1px solid #eef0f3;
}

.fm-tree-nested .fm-tree-row:first-child td {
  border-top: none;
}

html.theme-dark .fm-tree-children > td {
  background: rgba(255, 255, 255, 0.02);
}

.fm-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #00c875;
  flex: 0 0 auto;
  cursor: pointer;
}

.fm-tree-toggle:hover {
  background: rgba(0, 200, 117, 0.08);
}

.fm-tree-toggle .material-icons-round {
  font-size: 18px;
}

.fm-tree-spacer {
  display: inline-block;
  width: 24px;
  flex: 0 0 auto;
}

.fm-tree-folder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: #00c875;
  flex: 0 0 auto;
}

.fm-tree-folder .material-icons-round {
  font-size: 18px;
}

.fm-tree-label {
  color: #00a862;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-tree-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #00a862;
  text-decoration: none;
}

.fm-tree-action:hover {
  color: #008f54;
}

.fm-context-menu {
  position: fixed;
  z-index: 1080;
  min-width: 190px;
  padding: 6px;
  border: 1px solid #e8e9ed;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.fm-context-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #323338;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.fm-context-menu-item:hover,
.fm-context-menu-item:focus {
  background: rgba(0, 200, 117, 0.08);
  outline: none;
}

html.theme-dark .fm-tree-label,
html.theme-dark .fm-tree-action {
  color: #34d399;
}

html.theme-dark .fm-tree-toggle,
html.theme-dark .fm-tree-folder {
  color: #34d399;
}

html.theme-dark .fm-context-menu {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html.theme-dark .fm-context-menu-item {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark .fm-context-menu-item:hover,
html.theme-dark .fm-context-menu-item:focus {
  background: rgba(52, 211, 153, 0.12);
}

html.theme-dark .fm-shell {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}

html.theme-dark .fm-toolbar,
html.theme-dark .fm-details {
  background: #0f172a;
}

html.theme-dark .fm-table thead th {
  background: #0f172a;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: rgba(229, 231, 235, 0.7);
}

html.theme-dark .fm-details {
  border-left-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark .fm-fileicon {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark .fm-filename {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark .fm-filesub,
html.theme-dark .fm-muted,
html.theme-dark .fm-kv .material-icons-round,
html.theme-dark .fm-toolbar .fm-search .material-icons-round {
  color: rgba(229, 231, 235, 0.65);
}

html.theme-dark .fm-dropzone {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.35);
}

html.theme-dark .fm-dropzone.is-dragover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(229, 231, 235, 0.35);
  color: rgba(229, 231, 235, 0.92);
}

/* -------------------------------------------------------------------------- */
/* Unified section tabs (API dashboard pill style)                            */
/* -------------------------------------------------------------------------- */
.caeft-section-tabs,
.compliance-module-nav,
.compliance-subnav {
  border-bottom: none !important;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding: 0;
  margin-bottom: 0;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
}

.caeft-section-tabs .nav-item,
.compliance-module-nav__link,
.compliance-subnav__link {
  flex-shrink: 0;
}

.caeft-section-tabs .nav-link,
.compliance-module-nav__link,
.compliance-subnav__link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
  color: #67748e !important;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.caeft-section-tabs .nav-link:hover,
.compliance-module-nav__link:hover,
.compliance-subnav__link:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #344767 !important;
  box-shadow: none !important;
}

.caeft-section-tabs .nav-link.active,
.compliance-module-nav__link.is-active,
.compliance-subnav__link.is-active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
  box-shadow: none !important;
}

html.theme-dark .caeft-section-tabs .nav-link,
html.theme-dark .compliance-module-nav__link,
html.theme-dark .compliance-subnav__link {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(229, 231, 235, 0.7) !important;
}

html.theme-dark .caeft-section-tabs .nav-link:hover,
html.theme-dark .compliance-module-nav__link:hover,
html.theme-dark .compliance-subnav__link:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #e5e7eb !important;
}

html.theme-dark .caeft-section-tabs .nav-link.active,
html.theme-dark .compliance-module-nav__link.is-active,
html.theme-dark .compliance-subnav__link.is-active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
}

/* -------------------------------------------------------------------------- */
/* Content tabs (nav-tabs) - unified pill style. Excludes app-tabs.           */
/* -------------------------------------------------------------------------- */
.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) {
  border-bottom: none !important;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding: 0;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-item {
  flex-shrink: 0;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link {
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
  color: #67748e !important;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #344767 !important;
  box-shadow: none !important;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
  box-shadow: none !important;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link .material-icons,
.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link .material-icons-round {
  color: currentColor;
  font-size: 1.1rem;
  vertical-align: middle;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link > .material-icons,
.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link > .material-icons-round,
.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link > .material-icons-outlined {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link > .material-icons-outlined {
  font-size: 1.1rem;
}

.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link.active .material-icons,
.nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link.active .material-icons-round {
  color: currentColor;
}

/* -------------------------------------------------------------------------- */
/* Horizontal scroll hints (tabs, pills, matter menu, compliance nav)         */
/* -------------------------------------------------------------------------- */

:root {
  --nav-scroll-indicator-bg-solid: rgba(255, 255, 255, 0.96);
  --nav-scroll-indicator-bg-transparent: rgba(255, 255, 255, 0);
  --nav-scroll-indicator-icon: rgba(0, 0, 0, 0.28);
}

html.theme-dark {
  --nav-scroll-indicator-bg-solid: rgba(15, 23, 42, 0.96);
  --nav-scroll-indicator-bg-transparent: rgba(15, 23, 42, 0);
  --nav-scroll-indicator-icon: rgba(229, 231, 235, 0.62);
}

.nav-pills.compliance-hub__tabs,
.nav-pills.caeft-admin-subnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  position: relative;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.nav-pills.compliance-hub__tabs .nav-item,
.nav-pills.caeft-admin-subnav .nav-item {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.nav-pills.compliance-hub__tabs .nav-link,
.nav-pills.caeft-admin-subnav .nav-link {
  white-space: nowrap;
}

.nav-scroll-host {
  position: relative;
  max-width: 100%;
  min-width: 0;
}

.nav-scroll-host::before,
.nav-scroll-host::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--nav-scroll-indicator-icon);
}

.nav-scroll-host::before {
  left: 0;
  content: "‹";
  background: linear-gradient(to right, var(--nav-scroll-indicator-bg-solid), var(--nav-scroll-indicator-bg-transparent));
}

.nav-scroll-host::after {
  right: 0;
  content: "›";
  background: linear-gradient(to left, var(--nav-scroll-indicator-bg-solid), var(--nav-scroll-indicator-bg-transparent));
}

.nav-scroll-host[data-scroll-left="true"]::before {
  opacity: 1;
}

.nav-scroll-host[data-scroll-right="true"]::after {
  opacity: 1;
}

.card > .card-header.pb-0 > .nav-scroll-host {
  margin-bottom: 0;
}

/* Content tabs - dark mode */
html.theme-dark .nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(229, 231, 235, 0.7) !important;
}

html.theme-dark .nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #e5e7eb !important;
}

html.theme-dark .nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
}

html.theme-dark .nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link .material-icons,
html.theme-dark .nav-tabs:not(#app-tabs-list):not(.app-tabs-list) .nav-link .material-icons-round {
  color: currentColor;
}

/* -------------------------------------------------------------------------- */
/* In-app tabs (open records as tabs)                                        */
/* -------------------------------------------------------------------------- */

.app-tabs-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
  min-height: 0;
}

.app-tabs-list-wrapper {
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  max-width: 100%;
}

.app-tabs-list {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem 0;
  min-width: min-content;
}

.app-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(52, 71, 103, 0.7);
  background: rgba(52, 71, 103, 0.06);
  border: 1px solid rgba(52, 71, 103, 0.12);
  border-radius: 0.5rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.app-tab-btn:hover {
  color: rgba(52, 71, 103, 0.9);
  background: rgba(52, 71, 103, 0.1);
  border-color: rgba(52, 71, 103, 0.2);
}

.app-tab-btn.active {
  color: #000;
  background: var(--org-theme-primary, #00c875);
  border-color: var(--org-theme-primary, #00c875);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* In-app tab fetch pane loading spinner should follow org theme (not Bootstrap primary). */
.app-tab-loading .spinner-border {
  color: #00c875;
}

.app-tab-title {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: rgba(52, 71, 103, 0.5);
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.app-tab-close:hover {
  color: #344767;
  background: rgba(52, 71, 103, 0.1);
}

#app-tabs-content-wrapper {
  position: relative;
}

.shell-route-panes {
  position: relative;
  min-width: 0;
}

.shell-route-pane {
  display: none;
}

.shell-route-pane.shell-route-pane-active {
  display: block;
}

/* Top-of-viewport progress line while in-shell navigation fetches partial HTML (content stays visible). */
body.app-shell-nav-fetching::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2000;
  pointer-events: none;
  background: linear-gradient(90deg, #00c875 0%, #00a862 40%, #00c875 80%);
  background-size: 200% 100%;
  animation: app-shell-nav-fetch-shimmer 1s ease-in-out infinite;
}

@keyframes app-shell-nav-fetch-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

html.theme-dark body.app-shell-nav-fetching::before {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 40%, #22c55e 80%);
  background-size: 200% 100%;
}

.app-tabs-panes {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.app-tab-pane {
  display: none;
  position: absolute;
  inset: 0;
  min-height: 300px;
}

.app-tab-pane.active {
  display: block;
}

.app-tab-iframe {
  width: 100%;
  height: 100%;
  min-height: 60vh;
  border: none;
  border-radius: 0.5rem;
  background: #fff;
}

.app-tab-pane-fetch {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
  min-width: 0;
  background: transparent;
}

/* Constrain injected tab content, prevent horizontal overflow */
.app-tab-pane-fetch .app-tab-fragment {
  min-width: 0;
  max-width: 100%;
}

.app-tab-loading,
.app-tab-error {
  padding: 2rem;
  text-align: center;
  color: #64748b;
  min-height: 200px;
}

.app-tab-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.app-tab-error {
  color: #dc2626;
}

html.theme-dark .app-tab-pane-fetch {
  background: transparent;
}

html.theme-dark .app-tab-loading {
  color: #94a3b8;
}

html.theme-dark .app-tab-error {
  color: #f87171;
}

html.theme-dark .app-tab-btn {
  color: rgba(229, 231, 235, 0.7);
  background: rgba(229, 231, 235, 0.08);
  border-color: rgba(229, 231, 235, 0.12);
}

html.theme-dark .app-tab-btn:hover {
  color: rgba(229, 231, 235, 0.95);
  background: rgba(229, 231, 235, 0.12);
  border-color: rgba(229, 231, 235, 0.2);
}

html.theme-dark .app-tab-btn.active {
  color: #000;
  background: var(--org-theme-primary, #00c875);
  border-color: var(--org-theme-primary, #00c875);
}

html.theme-dark .app-tab-close {
  color: rgba(229, 231, 235, 0.5);
}

html.theme-dark .app-tab-close:hover {
  color: #e5e7eb;
  background: rgba(229, 231, 235, 0.1);
}

html.theme-dark .app-tab-iframe {
  background: #0f172a;
}



/* Ensure button content is vertically + horizontally centered everywhere. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.375rem;
}

/* Icons inside buttons should not shift baseline. */
.btn i,
.btn .material-icons,
.btn .material-icons-round,
.btn .material-icons-outlined {
  line-height: 1;
}

/* Top nav dropdown: fix caret alignment + white-on-white theme overrides. */
.top-nav-actions .dropdown-toggle::after {
  display: none !important;
}

/* Bootstrap dropdown toggles: show caret (Material theme only adds one on lg+). */
.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.top-nav-actions .dropdown-menu {
  background: #fff;
  color: #344767;
}

.top-nav-actions .dropdown-menu .dropdown-item,
.top-nav-actions .dropdown-menu .dropdown-item-text {
  color: #344767 !important;
}

/* -------------------------------------------------------------------------- */
/* Breadcrumbs + primary headings                                             */
/* -------------------------------------------------------------------------- */

/* Breadcrumbs in page content (non-tab screens) and optional navbar placement. */
.app-page-breadcrumbs .breadcrumb.app-breadcrumb,
.navbar-app-shell .breadcrumb.app-breadcrumb {
  font-size: 0.8125rem;
  line-height: 1.25;
  --bs-breadcrumb-divider-color: rgba(52, 71, 103, 0.35);
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item,
.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item::before,
.navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item,
.navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item::before {
  color: rgba(52, 71, 103, 0.55) !important;
}

.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item a,
.navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item a {
  color: rgba(52, 71, 103, 0.78) !important;
  text-decoration: none;
}

.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item a:hover,
.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item a:focus,
.navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item a:hover,
.navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item a:focus {
  color: #111827 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item.active,
.app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item.breadcrumb-item-active,
.navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item.active {
  color: #111827 !important;
}

html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb {
  --bs-breadcrumb-divider-color: rgba(229, 231, 235, 0.35);
}

html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item,
html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item::before,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item::before {
  color: rgba(229, 231, 235, 0.55) !important;
}

html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item a,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item a {
  color: rgba(229, 231, 235, 0.78) !important;
}

html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item a:hover,
html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item a:focus,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item a:hover,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item a:focus {
  color: #e5e7eb !important;
}

html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item.active,
html.theme-dark .app-page-breadcrumbs .breadcrumb.app-breadcrumb .breadcrumb-item.breadcrumb-item-active,
html.theme-dark .navbar-app-shell .breadcrumb.app-breadcrumb .breadcrumb-item.active {
  color: rgba(229, 231, 235, 0.92) !important;
}

/* Primary page heading: smaller + consistent across screens. */
.page-header-bar .page-heading.app-page-heading {
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0;
}

/* Content cards: hide redundant titles — breadcrumbs provide page context. */
.app-shell-content .card > .card-header :is(.card-title, h1, h2, h3, h4, h5, h6),
.dev-auth-shell .app-shell-content .card > .card-header :is(.card-title, h1, h2, h3, h4, h5, h6) {
  display: none !important;
}

/* Collapse card headers that only contained a title. */
.app-shell-content .card > .card-header:not(:has(
  .btn,
  a.btn,
  button:not(.btn-close),
  .alert,
  .nav,
  .matter-file-tabs,
  .caeft-section-tabs,
  .nav-scroll-host,
  form,
  input,
  select,
  textarea,
  [data-shell-create-modal],
  [data-card-header-content]
)),
.dev-auth-shell .app-shell-content .card > .card-header:not(:has(
  .btn,
  a.btn,
  button:not(.btn-close),
  .alert,
  .nav,
  .matter-file-tabs,
  .caeft-section-tabs,
  .nav-scroll-host,
  form,
  input,
  select,
  textarea,
  [data-shell-create-modal],
  [data-card-header-content]
)) {
  display: none !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Meaningful content titles inside card headers (e.g. note headlines). */
.app-shell-content .note-card-title,
.dev-auth-shell .app-shell-content .note-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

/* -------------------------------------------------------------------------- */
/* Auth (login)                                                               */
/* -------------------------------------------------------------------------- */

/* Auth theme toggle: larger moon/sun icon for visibility */
body.auth-login-screen [data-theme-toggle] [data-theme-icon],
.dev-auth-shell-body .position-fixed [data-theme-toggle] [data-theme-icon] {
  font-size: 1.5rem !important;
}

body.auth-login-screen .page-header {
  position: relative;
  justify-content: flex-start !important;
  padding: 0;
}

body.auth-login-screen {
  background: #faf7f2 !important;
}

html.theme-dark body.auth-login-screen {
  background: #0b1220 !important;
}

body.auth-login-screen .page-header::before,
body.auth-login-screen .page-header::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  pointer-events: none;
}

/* Soft background blobs (Headspace-like, but brand-neutral). */
body.auth-login-screen .page-header::before {
  width: 520px;
  height: 520px;
  left: -180px;
  bottom: -220px;
  background: rgba(59, 130, 246, 0.10);
}

body.auth-login-screen .page-header::after {
  width: 420px;
  height: 420px;
  right: -180px;
  top: -220px;
  background: rgba(34, 197, 94, 0.10);
}

body.auth-login-screen .auth-login__topbar {
  position: relative;
  z-index: 2;
}

body.auth-login-screen .auth-login__brand img,
body.caeft-wizard-screen .auth-login__brand img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
}

body.auth-login-screen .auth-login__brand-name,
body.caeft-wizard-screen .auth-login__brand-name {
  font-weight: 700;
  font-size: 1.375rem;
  color: #111827;
}

body.auth-login-screen .auth-login__toplink {
  color: rgba(17, 24, 39, 0.72);
  text-decoration: none;
  font-size: 0.875rem;
}

body.auth-login-screen .auth-login__toplink:hover,
body.auth-login-screen .auth-login__toplink:focus {
  color: #111827;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.auth-login-screen .auth-login__content {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2rem;
}

body.auth-login-screen .auth-login__card {
  width: min(520px, 100%);
  border-radius: 1.25rem;
  box-shadow: 0 18px 55px rgba(17, 24, 39, 0.12);
}

body.auth-login-screen .auth-login__title {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

body.auth-login-screen .auth-login__subtitle {
  color: rgba(17, 24, 39, 0.65);
}

body.auth-two-factor-screen .auth-2fa-challenge-tabs {
  border-bottom: none !important;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
  overflow: visible;
  padding: 0;
}

body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-item {
  flex: 1 1 0;
  min-width: 0;
}

body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-link {
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
  color: #67748e !important;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.25;
  padding: 0.625rem 0.75rem;
  text-align: center;
  text-transform: none;
  white-space: normal;
}

body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-link:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #344767 !important;
}

body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
}

html.theme-dark body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-link {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(243, 244, 246, 0.78) !important;
}

html.theme-dark body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #f3f4f6 !important;
}

html.theme-dark body.auth-two-factor-screen .auth-2fa-challenge-tabs .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
}

body.auth-login-screen .auth-login__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(17, 24, 39, 0.45);
  font-size: 0.875rem;
}

body.auth-login-screen .auth-login__divider::before,
body.auth-login-screen .auth-login__divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(148, 163, 184, 0.35);
}

body.auth-login-screen .auth-login__sso-btn,
body.auth-login-screen .auth-login__submit,
body.auth-login-screen .auth-login__bypass {
  border-radius: 999px;
  min-height: 44px;
}

body.auth-login-screen .auth-login__submit {
  font-weight: 600;
}

body.auth-login-screen .auth-login__pw-toggle {
  border-top-right-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

body.auth-login-screen .auth-login__forgot {
  font-size: 0.875rem;
  color: rgba(17, 24, 39, 0.72);
  text-decoration: none;
}

body.auth-login-screen .auth-login__forgot:hover,
body.auth-login-screen .auth-login__forgot:focus {
  color: #111827;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Dark mode */
html.theme-dark body.auth-login-screen .auth-login__brand-name,
html.theme-dark body.caeft-wizard-screen .auth-login__brand-name {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark body.auth-login-screen .auth-login__toplink {
  color: rgba(229, 231, 235, 0.72);
}

html.theme-dark body.auth-login-screen .auth-login__toplink:hover,
html.theme-dark body.auth-login-screen .auth-login__toplink:focus {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark body.auth-login-screen .auth-login__title {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark body.auth-login-screen .auth-login__subtitle {
  color: rgba(229, 231, 235, 0.65);
}

html.theme-dark body.auth-login-screen .auth-login__divider {
  color: rgba(229, 231, 235, 0.55);
}

html.theme-dark body.auth-login-screen .auth-login__divider::before,
html.theme-dark body.auth-login-screen .auth-login__divider::after {
  background: rgba(255, 255, 255, 0.12);
}

html.theme-dark body.auth-login-screen .auth-login__forgot {
  color: rgba(229, 231, 235, 0.75);
}

/* Register: same page background + blobs as login; wider card for the form */
body.auth-register-screen .auth-login__card--register {
  width: min(640px, 100%);
}

body.auth-register-screen .auth-login__submit {
  border-radius: 999px;
  min-height: 44px;
  font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* CaEFT wizard (onboarding + KYC) — matches auth-login look & feel           */
/* -------------------------------------------------------------------------- */

body.caeft-wizard-screen {
  background: #faf7f2 !important;
}

html.theme-dark body.caeft-wizard-screen {
  background: #0b1220 !important;
}

body.caeft-wizard-screen .auth-login__content {
  align-items: flex-start;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* Onboarding signup: centre wizard card vertically and horizontally */
body.caeft-wizard-screen--onboarding .auth-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.caeft-wizard-screen--onboarding .auth-login__content {
  flex: 1;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1rem;
  padding-bottom: 2rem;
  min-height: 0;
}

body.caeft-wizard-screen--onboarding .caeft-wizard__flash {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

body.caeft-wizard-screen--onboarding .law-firm-resolution-sign-pad {
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 0.5rem;
  background: #fff;
  width: 100%;
  max-width: 420px;
  height: 140px;
  touch-action: none;
  cursor: crosshair;
  display: block;
}

body.caeft-wizard-screen--onboarding .law-firm-resolution-preview {
  max-height: 420px;
  overflow: auto;
}

body.caeft-wizard-screen--onboarding .law-firm-resolution-layout .law-firm-resolution-preview-card {
  position: sticky;
  top: 1rem;
}

body.caeft-wizard-screen--onboarding .caeft-wizard {
  margin-left: auto;
  margin-right: auto;
}

body.caeft-wizard-screen--onboarding .caeft-wizard__card--wide {
  width: 100%;
  max-width: 100%;
}

body.caeft-wizard-screen--onboarding .page-header.min-vh-100 {
  min-height: 100vh !important;
}

body.caeft-wizard-screen--onboarding .caeft-wizard__panel {
  display: none;
}

body.caeft-wizard-screen--onboarding .caeft-wizard__panel.is-active {
  display: block;
}

body.caeft-wizard-screen--onboarding .onboarding-wizard__pw-append {
  border: 1px solid #d2d6da;
  border-radius: 0 0.5rem 0.5rem 0;
  background-color: #fff !important;
  margin-left: -10px;
  z-index: 10;
}

html.theme-dark body.caeft-wizard-screen--onboarding .onboarding-wizard__pw-append {
  border-color: rgba(255, 255, 255, 0.15);
  background-color: #0f172a !important;
}

body.caeft-wizard-screen .caeft-wizard {
  --caeft-wizard-track: #e2e8f0;
  --caeft-wizard-accent: #009103;
  --caeft-wizard-accent-soft: rgba(0, 145, 3, 0.12);
  width: min(920px, 100%);
  margin: 0 auto;
}

body.caeft-wizard-screen .caeft-wizard__card {
  border-radius: 1.25rem;
  box-shadow: 0 18px 55px rgba(17, 24, 39, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: hidden;
  background: #fff;
}

body.caeft-wizard-screen .caeft-wizard__card--wide {
  width: min(920px, 100%);
}

body.caeft-wizard-screen .caeft-wizard__card--register {
  width: min(640px, 100%);
}

body.caeft-wizard-screen .caeft-wizard__header {
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}

body.caeft-wizard-screen .caeft-wizard__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(17, 24, 39, 0.5);
  margin-bottom: 0.35rem;
}

body.caeft-wizard-screen .caeft-wizard__title {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  margin-bottom: 0.35rem;
}

body.caeft-wizard-screen .caeft-wizard__lead {
  font-size: 0.9375rem;
  color: rgba(17, 24, 39, 0.65);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

body.caeft-wizard-screen .caeft-wizard__progress {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(180deg, #fafbfb 0%, #fff 100%);
}

body.caeft-wizard-screen .caeft-wizard__progress-inner {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

body.caeft-wizard-screen .caeft-wizard__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 4.25rem;
}

body.caeft-wizard-screen .caeft-wizard__step-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  color: rgba(17, 24, 39, 0.45);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
}

body.caeft-wizard-screen .caeft-wizard__step.is-active .caeft-wizard__step-link {
  color: #111827;
}

body.caeft-wizard-screen .caeft-wizard__step.is-complete .caeft-wizard__step-link {
  color: var(--caeft-wizard-accent);
}

body.caeft-wizard-screen .caeft-wizard__step-bubble {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--caeft-wizard-track);
  background: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

body.caeft-wizard-screen .caeft-wizard__step-label {
  max-width: 5.5rem;
}

body.caeft-wizard-screen .caeft-wizard__step.is-complete .caeft-wizard__step-bubble {
  border-color: var(--caeft-wizard-accent);
  background: var(--caeft-wizard-accent-soft);
  color: var(--caeft-wizard-accent);
}

body.caeft-wizard-screen .caeft-wizard__step.is-complete .caeft-wizard__step-num {
  display: none;
}

body.caeft-wizard-screen .caeft-wizard__step.is-complete .caeft-wizard__step-bubble::after {
  content: '';
  display: block;
  width: 0.4rem;
  height: 0.65rem;
  border: solid var(--caeft-wizard-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

body.caeft-wizard-screen .caeft-wizard__step.is-active .caeft-wizard__step-bubble {
  border-color: var(--caeft-wizard-accent);
  background: linear-gradient(145deg, #00b805, var(--caeft-wizard-accent));
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 145, 3, 0.3);
}

body.caeft-wizard-screen .caeft-wizard__step.is-active .caeft-wizard__step-bubble::after {
  content: none;
}

body.caeft-wizard-screen .caeft-wizard__connector {
  flex: 1 1 1.25rem;
  min-width: 1rem;
  max-width: 3.5rem;
  height: 3px;
  border-radius: 2px;
  background: var(--caeft-wizard-track);
  margin-top: 1.05rem;
  list-style: none;
  position: relative;
  overflow: hidden;
}

body.caeft-wizard-screen .caeft-wizard__connector.is-complete {
  background: var(--caeft-wizard-accent);
}

body.caeft-wizard-screen .caeft-wizard__body {
  padding: 1.5rem 1.5rem 1.75rem;
}

@media (min-width: 768px) {
  body.caeft-wizard-screen .caeft-wizard__body {
    padding: 1.75rem 2rem 2rem;
  }

  body.caeft-wizard-screen .caeft-wizard__step-link {
    font-size: 0.75rem;
  }

  body.caeft-wizard-screen .caeft-wizard__step-label {
    max-width: 6.5rem;
  }
}

body.caeft-wizard-screen .caeft-wizard__step-heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111827;
  margin-bottom: 1rem;
}

body.caeft-wizard-screen .caeft-wizard__step-intro {
  font-size: 0.9375rem;
  color: rgba(17, 24, 39, 0.72);
  margin-bottom: 1.25rem;
}

body.caeft-wizard-screen .caeft-wizard__step-intro ul {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

body.caeft-wizard-screen .caeft-wizard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

body.caeft-wizard-screen .caeft-wizard__actions .btn-primary {
  border-radius: 999px;
  min-height: 44px;
  font-weight: 600;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

body.caeft-wizard-screen .caeft-wizard__actions .btn-secondary,
body.caeft-wizard-screen .caeft-wizard__actions .btn-outline-secondary {
  border-radius: 999px;
  min-height: 44px;
}

/* Soft UI alert gradients lose white text when Bootstrap subtle alert vars apply.
   Keep KYC/onboarding wizard status alerts readable on the solid Soft UI backgrounds. */
body.caeft-wizard-screen .alert.alert-success,
body.caeft-wizard-screen .alert.alert-danger,
body.caeft-wizard-screen .alert.alert-warning,
body.caeft-wizard-screen .alert.alert-info,
body.caeft-wizard-screen .alert.alert-primary {
  --bs-alert-color: #fff;
  --bs-alert-link-color: #fff;
  color: #fff !important;
  border: 0 !important;
}

body.caeft-wizard-screen .alert.alert-success *,
body.caeft-wizard-screen .alert.alert-danger *,
body.caeft-wizard-screen .alert.alert-warning *,
body.caeft-wizard-screen .alert.alert-info *,
body.caeft-wizard-screen .alert.alert-primary * {
  color: #fff !important;
}

body.caeft-wizard-screen .alert.alert-success {
  background-color: #43a047 !important;
  background-image: linear-gradient(195deg, #66bb6a 0%, #43a047 100%) !important;
}

body.caeft-wizard-screen .alert.alert-danger {
  background-color: #e53935 !important;
  background-image: linear-gradient(195deg, #ef5350 0%, #e53935 100%) !important;
}

body.caeft-wizard-screen .alert.alert-warning {
  background-color: #fb8c00 !important;
  background-image: linear-gradient(195deg, #ffa726 0%, #fb8c00 100%) !important;
}

body.caeft-wizard-screen .alert.alert-info {
  background-color: #1a73e8 !important;
  background-image: linear-gradient(195deg, #49a3f1 0%, #1a73e8 100%) !important;
}

body.caeft-wizard-screen .alert.alert-primary {
  background-color: #009205 !important;
  background-image: linear-gradient(195deg, #00c60e 0%, #009205 100%) !important;
}

body.caeft-wizard-screen .badge.bg-info,
body.caeft-wizard-screen .badge.bg-success,
body.caeft-wizard-screen .badge.bg-danger,
body.caeft-wizard-screen .badge.bg-primary,
body.caeft-wizard-screen .badge.bg-secondary {
  color: #fff !important;
}

body.caeft-wizard-screen .caeft-wizard__checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0;
  font-size: 0.9375rem;
  color: rgba(17, 24, 39, 0.8);
}

body.caeft-wizard-screen .caeft-wizard__checklist-icon {
  font-size: 1.25rem;
  color: var(--caeft-wizard-accent);
  flex-shrink: 0;
}

body.caeft-wizard-screen .caeft-wizard__status-card .card-body {
  padding: 2rem 1.5rem;
}

body.caeft-wizard-screen .caeft-wizard__status-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  background: var(--caeft-wizard-accent-soft);
  color: var(--caeft-wizard-accent);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__title,
html.theme-dark body.caeft-wizard-screen .caeft-wizard__step-heading {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__lead,
html.theme-dark body.caeft-wizard-screen .caeft-wizard__step-intro,
html.theme-dark body.caeft-wizard-screen .caeft-wizard__eyebrow {
  color: rgba(229, 231, 235, 0.65);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__progress {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__step-bubble {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.15);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__step.is-active .caeft-wizard__step-link {
  color: rgba(229, 231, 235, 0.92);
}

html.theme-dark body.caeft-wizard-screen .caeft-wizard__actions {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* Theme: dark mode (toggle via html.theme-dark). */
html.theme-dark {
  color-scheme: dark;
}

html.theme-dark body {
  background: #0b1220 !important;
  color: #e5e7eb;
}

html.theme-dark .bg-gray-200 {
  background-color: #0b1220 !important;
}

/* Many existing blades/components use bg-white; in dark mode treat it as a dark surface. */
html.theme-dark .bg-white {
  background-color: #0f172a !important;
}

/* Bootstrap light utilities: remap to muted dark surfaces. */
html.theme-dark .bg-light {
  background-color: #1f2937 !important;
  color: #e5e7eb;
}

html.theme-dark .form-control.bg-light,
html.theme-dark pre.bg-light,
html.theme-dark .form-select.bg-light {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #e5e7eb !important;
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .alert-light {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #e5e7eb !important;
}

html.theme-dark .table-light,
html.theme-dark .table > :not(caption) > * > .table-light {
  --bs-table-bg: #1f2937;
  --bs-table-color: #e5e7eb;
  background-color: #1f2937 !important;
  color: #e5e7eb !important;
}

html.theme-dark .border-light {
  border-color: rgba(148, 163, 184, 0.2) !important;
}

/* Generic Bootstrap accordion (consumer accordion has higher-specificity rules below). */
html.theme-dark .accordion-item {
  background-color: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .accordion-button {
  background-color: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

html.theme-dark .accordion-button:not(.collapsed) {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  box-shadow: none;
}

html.theme-dark .accordion-button::after {
  filter: invert(1) grayscale(1);
  opacity: 0.7;
}

html.theme-dark .accordion-body {
  background-color: #0f172a;
  color: #e5e7eb;
}

/* Auth password-toggle append groups use inline #FFF backgrounds. */
html.theme-dark .input-group-append[style*="background-color: #FFF"],
html.theme-dark .input-group-append[style*="background-color:#FFF"],
html.theme-dark .input-group-append[style*="background-color: #fff"],
html.theme-dark .input-group-append[style*="background-color:#fff"] {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
}

html.theme-dark .input-group-append[style*="background-color"] .btn-text {
  color: rgba(229, 231, 235, 0.86) !important;
}

/* Generic offcanvas fallback (ID-specific rules in dev-auth-shell.css). */
html.theme-dark .offcanvas {
  background-color: #111827 !important;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .offcanvas-header {
  border-bottom-color: rgba(148, 163, 184, 0.2);
  color: #e5e7eb;
}

html.theme-dark .offcanvas-title {
  color: #e5e7eb !important;
}

/* Material Dashboard built-in dark mode uses body.dark-version, but our nav uses bg-white + text-dark heavily. */
html.theme-dark body.dark-version .sidenav.bg-white {
  background: #1f283e !important;
}

html.theme-dark body.dark-version .sidenav.bg-white .navbar-nav .nav-link,
html.theme-dark body.dark-version .sidenav.bg-white .navbar-nav .nav-link .nav-link-text,
html.theme-dark body.dark-version .sidenav.bg-white .navbar-nav .nav-link .sidenav-normal,
html.theme-dark body.dark-version .sidenav.bg-white .navbar-nav .nav-link i,
html.theme-dark body.dark-version .sidenav.bg-white h6,
html.theme-dark body.dark-version .sidenav.bg-white .h6 {
  color: #e5e7eb !important;
}

html.theme-dark body.dark-version .sidenav.bg-white .collapse .nav-item .nav-link:not(.active) i,
html.theme-dark body.dark-version .sidenav.bg-white .collapse .nav-item h6,
html.theme-dark body.dark-version .sidenav.bg-white .collapse .nav-item .h6 {
  color: #e5e7eb !important;
}

html.theme-dark body.dark-version .sidenav.bg-white .collapse .nav-item .nav-link.active.text-dark i,
html.theme-dark body.dark-version .sidenav.bg-white .collapse .nav-item .nav-link.active.text-dark .nav-link-text {
  color: #e5e7eb !important;
}

/* -------------------------------------------------------------------------- */
/* Hard overrides: outline buttons in dark mode                                */
/* -------------------------------------------------------------------------- */
/* Some theme styles (and btn-outline vars) still yield dark text on dark UI.  */
/* Force final computed color for outline buttons in dark mode to be readable. */
html.theme-dark body.dark-version .btn[class*="btn-outline-"],
html.theme-dark body.dark-version a.btn[class*="btn-outline-"],
html.theme-dark body.dark-version button.btn[class*="btn-outline-"],
html.theme-dark body.dark-version span.btn[class*="btn-outline-"] {
  color: #e5e7eb !important;
}

/* Preserve semantic intent (still light enough for contrast). */
html.theme-dark body.dark-version .btn-outline-primary {
  color: #93c5fd !important;
}

html.theme-dark body.dark-version .btn-outline-success {
  color: #86efac !important;
}

html.theme-dark body.dark-version .btn-outline-danger {
  color: #fca5a5 !important;
}

html.theme-dark body.dark-version .btn-outline-warning {
  color: #fcd34d !important;
}

html.theme-dark body.dark-version .btn-outline-info {
  color: #67e8f9 !important;
}

/* Disabled outline buttons should look muted, but still readable. */
html.theme-dark body.dark-version .btn[class*="btn-outline-"].disabled,
html.theme-dark body.dark-version .btn[class*="btn-outline-"]:disabled {
  opacity: 0.7;
}

/* Typography + utility classes */
html.theme-dark,
html.theme-dark p,
html.theme-dark span,
html.theme-dark small,
html.theme-dark strong,
html.theme-dark li,
html.theme-dark dt,
html.theme-dark dd {
  color: #e5e7eb;
}

html.theme-dark .text-dark {
  color: #e5e7eb !important;
}

html.theme-dark .text-secondary,
html.theme-dark .text-muted,
html.theme-dark .opacity-5,
html.theme-dark .opacity-6,
html.theme-dark .opacity-7,
html.theme-dark .opacity-8 {
  color: rgba(229, 231, 235, 0.72) !important;
}

html.theme-dark a,
html.theme-dark a:hover {
  color: #e5e7eb;
}

html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark h4,
html.theme-dark h5,
html.theme-dark h6,
html.theme-dark .h1,
html.theme-dark .h2,
html.theme-dark .h3,
html.theme-dark .h4,
html.theme-dark .h5,
html.theme-dark .h6,
html.theme-dark .page-heading,
html.theme-dark .card-title,
html.theme-dark .breadcrumb,
html.theme-dark .breadcrumb-item,
html.theme-dark .breadcrumb-item a {
  color: #e5e7eb !important;
}

html.theme-dark .navbar,
html.theme-dark .navbar-app-shell {
  background: #0f172a !important;
}

/* Bootstrap nav variables (prevents hover/active from reverting to dark palette) */
html.theme-dark .navbar,
html.theme-dark .sidenav {
  --bs-nav-link-color: rgba(229, 231, 235, 0.86);
  --bs-nav-link-hover-color: #e5e7eb;
  --bs-navbar-color: rgba(229, 231, 235, 0.86);
  --bs-navbar-hover-color: #e5e7eb;
  --bs-navbar-active-color: #e5e7eb;
}

html.theme-dark .card {
  --bs-card-bg: #1e293b;
  --bs-card-border-width: 1px;
  --bs-card-border-color: rgba(148, 163, 184, 0.18);
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

/* bg-white on cards must not collapse to the page background in dark mode */
html.theme-dark .card.bg-white {
  background-color: #1e293b !important;
}

/*
 * Outline buttons on dark cards: marketing pages and cookie consent often have html.theme-dark
 * without body.dark-version, so the dark-version outline overrides below do not apply.
 */
html.theme-dark .card .btn[class*="btn-outline-"],
html.theme-dark .card a.btn[class*="btn-outline-"],
html.theme-dark .card button.btn[class*="btn-outline-"],
html.theme-dark .card span.btn[class*="btn-outline-"] {
  color: #e5e7eb !important;
  border-color: rgba(229, 231, 235, 0.45) !important;
}

html.theme-dark .card .btn-outline-secondary:hover,
html.theme-dark .card .btn-outline-secondary:focus,
html.theme-dark .card .btn-outline-primary:hover,
html.theme-dark .card .btn-outline-primary:focus {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(229, 231, 235, 0.55) !important;
}

html.theme-dark .card .btn[class*="btn-outline-"].disabled,
html.theme-dark .card .btn[class*="btn-outline-"]:disabled {
  opacity: 0.65;
}

html.theme-dark .card .card-header {
  background: transparent;
}

html.theme-dark .card-header,
html.theme-dark .card-footer {
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .sidenav {
  background: #0f172a !important;
}

html.theme-dark .sidenav .nav-item h6.text-muted {
  color: rgba(148, 163, 184, 0.7) !important;
}

html.theme-dark .app-shell .text-dark,
html.theme-dark .dev-auth-shell .text-dark {
  color: #e5e7eb !important;
}

html.theme-dark .app-shell a,
html.theme-dark .dev-auth-shell a {
  color: inherit;
}

/* Forms */
html.theme-dark label,
html.theme-dark .form-label,
html.theme-dark .col-form-label,
html.theme-dark .form-check-label,
html.theme-dark .input-group-text,
html.theme-dark .form-text {
  color: rgba(229, 231, 235, 0.86) !important;
}

/* -------------------------------------------------------------------------- */
/* Forms: Material Design "filled" field style (global)                        */
/* -------------------------------------------------------------------------- */
/*
 * Goal: a consistent filled-field look across the whole app without rewriting
 * Blade views. We style Bootstrap's .form-control/.form-select directly and
 * keep explicit exclusions for pill/search inputs that have their own design.
 */
:root {
  /* Material filled fields typically use a subtle radius and an underline, not a full border. */
  --md-filled-radius: 4px;
  --md-filled-bg: rgba(0, 0, 0, 0.06);
  --md-filled-bg-hover: rgba(0, 0, 0, 0.09);
  --md-filled-bg-focus: rgba(0, 0, 0, 0.06);
  --md-filled-underline: rgba(0, 0, 0, 0.42);
  --md-filled-underline-focus: var(--org-theme-primary, #00c875);
  --md-filled-error: rgba(239, 68, 68, 0.9);
  --md-select-indicator: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  --md-select-indicator-position: right 0.75rem center;
  --md-select-indicator-size: 16px 12px;
  --md-select-indicator-padding-end: 2.25rem;
}

html.theme-dark {
  --md-filled-bg: rgba(255, 255, 255, 0.08);
  --md-filled-bg-hover: rgba(255, 255, 255, 0.12);
  --md-filled-bg-focus: rgba(255, 255, 255, 0.08);
  --md-filled-underline: rgba(255, 255, 255, 0.55);
  --md-filled-underline-focus: var(--org-theme-primary, #22c55e);
  --md-select-indicator: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e5e7eb' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Native selects and Bootstrap form-select: always show a dropdown chevron. */
select:not([multiple]):not([size]),
.form-select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: var(--md-select-indicator-padding-end);
  background-image: var(--md-select-indicator);
  background-repeat: no-repeat;
  background-position: var(--md-select-indicator-position);
  background-size: var(--md-select-indicator-size);
}

.form-select-sm:not([multiple]):not([size]),
select.form-select-sm:not([multiple]):not([size]) {
  padding-right: 1.75rem;
  background-position: right 0.5rem center;
}

/* Apply filled style broadly, but exclude special “pill” inputs and native file pickers. */
.form-control:not(.global-search-input):not(.dataTable-input):not([type="file"]),
.form-select,
textarea.form-control {
  border-radius: var(--md-filled-radius) var(--md-filled-radius) 0 0;
  border: none;
  border-bottom: 1px solid var(--md-filled-underline);
  background-color: var(--md-filled-bg);
  transition: background-color 120ms ease, border-bottom-color 120ms ease;
}

/* Some screens use Bootstrap .border-0 on inputs; re-apply filled borders. */
.form-control.border-0:not(.global-search-input):not(.dataTable-input):not([type="file"]),
.form-select.border-0:not(.dataTable-input),
textarea.form-control.border-0 {
  border: none !important;
  border-bottom: 1px solid var(--md-filled-underline) !important;
}

/* Many blades use Material Dashboard wrappers; keep them from forcing outlines. */
.input-group.input-group-outline .form-control,
.input-group.input-group-outline .form-select,
.input-group.input-group-outline textarea.form-control {
  border-radius: var(--md-filled-radius) !important;
}

.form-control:not(.global-search-input):not(.dataTable-input):not([type="file"]):hover,
.form-select:hover,
textarea.form-control:hover {
  background-color: var(--md-filled-bg-hover);
}

.form-control:not(.global-search-input):not(.dataTable-input):not([type="file"]):focus,
.form-select:focus,
textarea.form-control:focus {
  background-color: var(--md-filled-bg-focus);
  border-bottom-color: var(--md-filled-underline-focus);
  outline: none;
}

/* Keep the chevron visible when filled selects change state. */
select:not([multiple]):not([size]):hover,
select:not([multiple]):not([size]):focus,
.form-select:not([multiple]):not([size]):hover,
.form-select:not([multiple]):not([size]):focus {
  background-image: var(--md-select-indicator);
  background-repeat: no-repeat;
  background-position: var(--md-select-indicator-position);
  background-size: var(--md-select-indicator-size);
}

.form-select-sm:not([multiple]):not([size]):hover,
.form-select-sm:not([multiple]):not([size]):focus,
select.form-select-sm:not([multiple]):not([size]):hover,
select.form-select-sm:not([multiple]):not([size]):focus {
  background-position: right 0.5rem center;
}

/* Disabled should still feel “filled”, but muted. */
.form-control:disabled,
.form-select:disabled,
textarea.form-control:disabled,
.form-control[readonly] {
  opacity: 0.75;
  cursor: not-allowed;
}

/* Placeholder tone (avoid “too loud” in filled state). */
.form-control::placeholder,
textarea.form-control::placeholder {
  color: rgba(52, 71, 103, 0.55);
}
html.theme-dark .form-control::placeholder,
html.theme-dark textarea.form-control::placeholder {
  color: rgba(229, 231, 235, 0.6);
}

/* Validation: make invalid state look like Material error underline. */
.form-control.is-invalid,
.form-select.is-invalid,
textarea.form-control.is-invalid {
  border-bottom-color: var(--md-filled-error);
}

.invalid-feedback {
  margin-top: 0.35rem;
}

/* -------------------------------------------------------------------------- */
/* File inputs: native picker (Choose file / No file chosen)                   */
/* -------------------------------------------------------------------------- */
/*
 * File inputs use a pseudo-button whose negative margins must match padding.
 * Global filled-field rules and app-shell padding overrides otherwise clip text.
 */
.form-control[type="file"] {
  --md-file-padding-y: 0.5rem;
  --md-file-padding-x: 0.75rem;
  --md-file-button-bg: rgba(0, 0, 0, 0.06);
  --md-file-button-bg-hover: rgba(0, 0, 0, 0.1);
  display: block;
  width: 100%;
  min-height: calc(1.5em + (var(--md-file-padding-y) * 2) + 2px);
  padding: var(--md-file-padding-y) var(--md-file-padding-x);
  line-height: 1.5;
  border-radius: var(--md-filled-radius);
  border: none;
  border-bottom: 1px solid var(--md-filled-underline);
  background: var(--md-filled-bg);
  overflow: visible;
  transition: background-color 120ms ease, border-bottom-color 120ms ease;
}

.form-control[type="file"]:hover {
  background: var(--md-filled-bg-hover);
}

.form-control[type="file"]:focus {
  background: var(--md-filled-bg-focus);
  border-bottom-color: var(--md-filled-underline-focus);
  outline: none;
  box-shadow: none;
}

.form-control[type="file"]::file-selector-button,
.form-control[type="file"]::-webkit-file-upload-button {
  padding: 0.375rem 0.75rem;
  margin: calc(-1 * var(--md-file-padding-y)) calc(-1 * var(--md-file-padding-x));
  margin-inline-end: var(--md-file-padding-x);
  border: none;
  border-inline-end: 1px solid var(--md-filled-underline);
  border-radius: var(--md-filled-radius) 0 0 0;
  background: var(--md-file-button-bg);
  color: inherit;
  font: inherit;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 120ms ease;
}

.form-control[type="file"]:hover::file-selector-button,
.form-control[type="file"]:hover::-webkit-file-upload-button {
  background: var(--md-file-button-bg-hover);
}

.form-control[type="file"].form-control-sm,
.input-group-sm > .form-control[type="file"]:not(.form-control-lg) {
  --md-file-padding-y: 0.35rem;
  --md-file-padding-x: 0.65rem;
  font-size: 0.875rem;
  min-height: calc(1.5em + (var(--md-file-padding-y) * 2) + 2px);
}

.form-control[type="file"].form-control-sm::file-selector-button,
.form-control[type="file"].form-control-sm::-webkit-file-upload-button,
.input-group-sm > .form-control[type="file"]:not(.form-control-lg)::file-selector-button,
.input-group-sm > .form-control[type="file"]:not(.form-control-lg)::-webkit-file-upload-button {
  padding: 0.25rem 0.65rem;
}

.form-control[type="file"].form-control-lg {
  --md-file-padding-y: 0.65rem;
  --md-file-padding-x: 1rem;
  font-size: 1.125rem;
  min-height: calc(1.5em + (var(--md-file-padding-y) * 2) + 2px);
}

.form-control[type="file"].form-control-lg::file-selector-button,
.form-control[type="file"].form-control-lg::-webkit-file-upload-button {
  padding: 0.5rem 1rem;
}

.form-control[type="file"].is-invalid {
  border-bottom-color: var(--md-filled-error);
}

html.theme-dark .form-control[type="file"] {
  --md-file-button-bg: rgba(255, 255, 255, 0.1);
  --md-file-button-bg-hover: rgba(255, 255, 255, 0.16);
  background-color: var(--md-filled-bg);
  border-bottom-color: var(--md-filled-underline);
  color: #e5e7eb;
}

html.theme-dark .form-control[type="file"]:focus {
  background-color: var(--md-filled-bg-focus);
  border-bottom-color: var(--md-filled-underline-focus);
  box-shadow: none;
}

/* Checkbox / radio groups: add a consistent invalid container style. */
.form-choice-group {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.02);
}

html.theme-dark .form-choice-group {
  background: rgba(255, 255, 255, 0.04);
}

.form-choice-group.is-invalid {
  border-left: 3px solid var(--md-filled-error);
}

.form-choice-group.is-invalid .form-check-label,
.form-choice-group.is-invalid label {
  color: color-mix(in srgb, var(--md-filled-error) 55%, currentColor);
}

.permission-choice-item {
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.permission-choice-item:has(.form-check-input:checked) {
  border-color: color-mix(in srgb, var(--md-primary, #0d6efd) 35%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--md-primary, #0d6efd) 12%, transparent);
}

html.theme-dark .permission-choice-item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.permission-choice-label {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  cursor: pointer;
}

.permission-choice-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #323338;
  line-height: 1.3;
}

.permission-choice-description {
  font-size: 0.8125rem;
  color: #676879;
  line-height: 1.35;
  font-weight: 400;
}

html.theme-dark .permission-choice-title {
  color: #f5f6f8;
}

html.theme-dark .permission-choice-description {
  color: #a8abb6;
}

/* -------------------------------------------------------------------------- */
/* Checkboxes + radios: Material-like styling (global)                         */
/* -------------------------------------------------------------------------- */
:root {
  --md-choice-size: 18px;
  --md-choice-border: rgba(0, 0, 0, 0.42);
  --md-choice-bg: transparent;
  --md-choice-checked: var(--org-theme-primary, #00c875);
  --md-switch-width: 2.75rem;
  --md-switch-height: 1.375rem;
  --md-switch-knob: 1.125rem;
  --md-switch-track-off: rgba(0, 0, 0, 0.26);
  --md-switch-track-on: var(--md-choice-checked);
  --md-switch-padding: 0.5rem;
}

html.theme-dark {
  --md-choice-border: rgba(255, 255, 255, 0.62);
  --md-switch-track-off: rgba(255, 255, 255, 0.3);
}

/* Prefer styling via Bootstrap's .form-check-input when present (not switches). */
.form-check:not(.form-switch) .form-check-input {
  width: var(--md-choice-size);
  height: var(--md-choice-size);
  margin-top: 0.25rem;
  border: 2px solid var(--md-choice-border);
  background-color: var(--md-choice-bg);
  cursor: pointer;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"] {
  border-radius: 2px;
}

.form-check:not(.form-switch) .form-check-input[type="radio"] {
  border-radius: 999px;
}

.form-check:not(.form-switch) .form-check-input:focus {
  border-color: var(--md-choice-checked);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--md-choice-checked) 22%, transparent);
}

.form-check:not(.form-switch) .form-check-input:checked {
  background-color: var(--md-choice-checked);
  border-color: var(--md-choice-checked);
}

.form-check:not(.form-switch) .form-check-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modern pill toggles (Bootstrap .form-switch). */
.form-switch {
  padding-left: calc(var(--md-switch-width) + var(--md-switch-padding));
  min-height: var(--md-switch-height);
}

.form-switch.form-check-reverse {
  padding-right: calc(var(--md-switch-width) + var(--md-switch-padding));
  padding-left: 0;
}

.form-switch .form-check-input {
  width: var(--md-switch-width);
  height: var(--md-switch-height);
  margin-top: 0;
  margin-left: calc((var(--md-switch-width) + var(--md-switch-padding)) * -1);
  border: none;
  border-radius: 999px;
  background-color: var(--md-switch-track-off);
  background-image: none !important;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.form-switch.form-check-reverse .form-check-input {
  margin-right: calc((var(--md-switch-width) + var(--md-switch-padding)) * -1);
  margin-left: 0;
}

.form-switch .form-check-input::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: var(--md-switch-knob);
  height: var(--md-switch-knob);
  border-radius: 50%;
  background-color: #fff;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transform: translateY(-50%) translateX(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-switch .form-check-input:checked {
  background-color: var(--md-switch-track-on);
  border-color: transparent;
}

.form-switch .form-check-input:checked::after {
  transform: translateY(-50%) translateX(calc(var(--md-switch-width) - var(--md-switch-knob) - 4px));
  border-color: transparent;
}

.form-switch .form-check-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--md-switch-track-on) 22%, transparent);
}

.form-switch .form-check-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-switch .form-check-label {
  cursor: pointer;
}

/* Many legacy blades use raw <input type="checkbox"> without .form-check-input. */
input[type="checkbox"]:not(.form-check-input):not(.dtcc-button):not([role="switch"]),
input[type="radio"]:not(.form-check-input) {
  width: var(--md-choice-size);
  height: var(--md-choice-size);
  accent-color: var(--md-choice-checked);
}

/* Group invalid state: tint the checkbox/radio border if possible. */
.form-choice-group.is-invalid .form-check-input {
  border-color: var(--md-filled-error);
}
.form-choice-group.is-invalid .form-check-input:checked {
  background-color: var(--md-filled-error);
  border-color: var(--md-filled-error);
}

/* -------------------------------------------------------------------------- */
/* Auth (login/signup): use same filled styling as app forms                   */
/* -------------------------------------------------------------------------- */
body.auth-login-screen .input-group.input-group-outline,
body.auth-login-screen .input-group.input-group-static,
body.auth-register-screen .input-group.input-group-outline,
body.auth-register-screen .input-group.input-group-static {
  background: transparent;
}

/*
 * Material Dashboard "outline" inputs draw the green box via:
 * - border on the input
 * - inset box-shadows on `.form-label + .form-control` when `.is-focused` / `.is-filled`
 * - label pseudo-elements (`.form-label:before/:after`) that render the top border
 *
 * For auth screens we want a MUI-filled-like underline only, so fully neutralize
 * the outline machinery and let the global filled-field rules apply.
 */
body.auth-login-screen .input-group.input-group-outline .form-control,
body.auth-login-screen .input-group.input-group-static .form-control,
body.auth-register-screen .input-group.input-group-outline .form-control,
body.auth-register-screen .input-group.input-group-static .form-control {
  border: none !important;
  border-bottom: 1px solid var(--md-filled-underline) !important;
  border-radius: var(--md-filled-radius) var(--md-filled-radius) 0 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

body.auth-login-screen .input-group.input-group-outline.is-focused .form-label + .form-control,
body.auth-login-screen .input-group.input-group-outline.is-filled .form-label + .form-control,
body.auth-register-screen .input-group.input-group-outline.is-focused .form-label + .form-control,
body.auth-register-screen .input-group.input-group-outline.is-filled .form-label + .form-control {
  border-color: transparent !important;
  border-top-color: transparent !important;
  box-shadow: none !important;
}

body.auth-login-screen .input-group.input-group-outline .form-label::before,
body.auth-login-screen .input-group.input-group-outline .form-label::after,
body.auth-register-screen .input-group.input-group-outline .form-label::before,
body.auth-register-screen .input-group.input-group-outline .form-label::after {
  border-top-color: transparent !important;
  box-shadow: none !important;
}

body.auth-login-screen .input-group.input-group-outline.is-focused .form-label,
body.auth-register-screen .input-group.input-group-outline.is-focused .form-label {
  color: rgba(52, 71, 103, 0.75) !important;
}

html.theme-dark body.auth-login-screen .input-group.input-group-outline.is-focused .form-label,
html.theme-dark body.auth-register-screen .input-group.input-group-outline.is-focused .form-label {
  color: rgba(229, 231, 235, 0.85) !important;
}

/* Password "eye" append currently has hard inline borders/background — normalize it. */
body.auth-login-screen .input-group-append,
body.auth-register-screen .input-group-append {
  border: none !important;
  border-bottom: 1px solid var(--md-filled-underline) !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin-left: 0 !important;
}

body.auth-login-screen .input-group-append .btn,
body.auth-register-screen .input-group-append .btn {
  color: rgba(52, 71, 103, 0.75);
}

html.theme-dark body.auth-login-screen .input-group-append,
html.theme-dark body.auth-register-screen .input-group-append {
  border-bottom-color: var(--md-filled-underline) !important;
}

html.theme-dark body.auth-login-screen .input-group-append .btn,
html.theme-dark body.auth-register-screen .input-group-append .btn {
  color: rgba(229, 231, 235, 0.85);
}

/* Exclusions: keep these existing components as-is. */
.dataTables_wrapper .dataTables_filter input,
.dataTable-wrapper .dataTable-search .dataTable-input {
  border-radius: 999px !important;
  border-bottom-width: 1px !important;
  background: inherit !important;
}

html.theme-dark .top-nav-actions .dropdown-menu {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

html.theme-dark .top-nav-actions .dropdown-menu .dropdown-item,
html.theme-dark .top-nav-actions .dropdown-menu .dropdown-item-text {
  color: #e5e7eb !important;
}

html.theme-dark .dropdown-divider {
  border-top-color: rgba(148, 163, 184, 0.25);
}

html.theme-dark .form-control:not([type="file"]),
html.theme-dark .form-select {
  background-color: #111827;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark .form-control:not([type="file"]):focus,
html.theme-dark .form-select:focus {
  background-color: #111827;
  border-color: rgba(147, 197, 253, 0.55);
  color: #e5e7eb;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.18);
}

html.theme-dark .form-control:not([type="file"])::placeholder {
  color: rgba(229, 231, 235, 0.6);
}

/* Tables */
html.theme-dark .table {
  color: #e5e7eb;
}

html.theme-dark .table th,
html.theme-dark .table td {
  color: inherit;
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .dataTables_wrapper,
html.theme-dark .dataTables_info,
html.theme-dark .dataTables_paginate {
  color: rgba(229, 231, 235, 0.8) !important;
}

/* DataTables native pagination: next/prev buttons follow light/dark mode */
html.theme-dark .dataTables_paginate .paginate_button {
  color: rgba(229, 231, 235, 0.9) !important;
  background-color: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

html.theme-dark .dataTables_paginate .paginate_button:hover {
  color: #e5e7eb !important;
  background-color: rgba(51, 65, 85, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

html.theme-dark .dataTables_paginate .paginate_button.current,
html.theme-dark .dataTables_paginate .paginate_button.current:hover {
  color: #fff !important;
  background-color: rgba(59, 130, 246, 0.5) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
}

html.theme-dark .dataTables_paginate .paginate_button.disabled,
html.theme-dark .dataTables_paginate .paginate_button.disabled:hover,
html.theme-dark .dataTables_paginate .paginate_button.disabled:active {
  color: rgba(148, 163, 184, 0.5) !important;
  background-color: transparent !important;
  border-color: transparent !important;
}

/* Bootstrap pagination (Laravel links, etc.): follow light/dark mode */
html.theme-dark .pagination .page-link {
  background-color: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.25);
  color: rgba(229, 231, 235, 0.9);
}

html.theme-dark .pagination .page-link:hover {
  background-color: rgba(51, 65, 85, 0.8);
  border-color: rgba(148, 163, 184, 0.35);
  color: #e5e7eb;
}

html.theme-dark .pagination .page-item.active .page-link {
  background-color: rgba(59, 130, 246, 0.5);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
}

html.theme-dark .pagination .page-item.disabled .page-link {
  background-color: transparent;
  border-color: rgba(148, 163, 184, 0.25);
  color: rgba(148, 163, 184, 0.5);
}

/* -------------------------------------------------------------------------- */
/* DataTables: modernise search input                                         */
/* -------------------------------------------------------------------------- */
/* jQuery DataTables (Bootstrap 5 integration) */
.dataTables_wrapper .dataTables_filter {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dataTables_wrapper .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: rgba(52, 71, 103, 0.8);
  font-size: 0.875rem;
  position: relative;
}

.dataTables_wrapper .dataTables_filter label::before {
  content: "search";
  font-family: "Material Icons";
  font-size: 18px;
  line-height: 1;
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(52, 71, 103, 0.55);
  pointer-events: none;
}

.dataTables_wrapper .dataTables_filter input {
  width: 260px;
  max-width: 65vw;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  color: #111827;
  padding: 0.4rem 0.9rem 0.4rem 2.25rem;
  transition: box-shadow 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
  color: rgba(52, 71, 103, 0.55);
}

.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.14);
}

/* simple-datatables (used by some dashboard tables) */
.dataTable-wrapper .dataTable-search .dataTable-input {
  width: 260px;
  max-width: 65vw;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  color: #111827;
  padding: 0.4rem 0.9rem;
  transition: box-shadow 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.dataTable-wrapper .dataTable-search .dataTable-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.14);
}

/* Dark mode */
html.theme-dark .dataTables_wrapper .dataTables_filter label {
  color: rgba(229, 231, 235, 0.75);
}

html.theme-dark .dataTables_wrapper .dataTables_filter label::before {
  color: rgba(229, 231, 235, 0.55);
}

html.theme-dark .dataTables_wrapper .dataTables_filter input {
  background-color: #111827;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark .dataTables_wrapper .dataTables_filter input::placeholder {
  color: rgba(229, 231, 235, 0.6);
}

html.theme-dark .dataTables_wrapper .dataTables_filter input:focus {
  border-color: rgba(147, 197, 253, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.18);
}

html.theme-dark .dataTable-wrapper .dataTable-search .dataTable-input {
  background-color: #111827;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark .dataTable-wrapper .dataTable-search .dataTable-input:focus {
  border-color: rgba(147, 197, 253, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.18);
}

/* Modals (Bootstrap) */
html.theme-dark .modal-content {
  background: #0f172a;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .modal-header,
html.theme-dark .modal-footer {
  border-color: rgba(148, 163, 184, 0.2);
}

/* SweetAlert2 */
html.theme-dark .swal2-popup {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

html.theme-dark .swal2-title,
html.theme-dark .swal2-html-container {
  color: #e5e7eb !important;
}

/* List groups (used in notifications screens) */
html.theme-dark .list-group-item {
  background-color: #0f172a !important;
  color: #e5e7eb !important;
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .list-group-item .text-muted,
html.theme-dark .list-group-item .text-secondary {
  color: rgba(229, 231, 235, 0.72) !important;
}

/* Dropdown hover states */
html.theme-dark .dropdown-menu .dropdown-item:hover,
html.theme-dark .dropdown-menu .dropdown-item:focus {
  background-color: rgba(148, 163, 184, 0.12);
  color: #e5e7eb !important;
}

/* Navigation: hover + active states (sidenav + navbars) */
html.theme-dark .sidenav .nav-link,
html.theme-dark .navbar-nav .nav-link {
  color: rgba(229, 231, 235, 0.86) !important;
}

html.theme-dark .sidenav .nav-link:hover,
html.theme-dark .navbar-nav .nav-link:hover,
html.theme-dark .sidenav .nav-link:focus,
html.theme-dark .navbar-nav .nav-link:focus {
  background-color: rgba(148, 163, 184, 0.12) !important;
  color: #e5e7eb !important;
}

html.theme-dark .sidenav .nav-link.active,
html.theme-dark .navbar-nav .nav-link.active,
html.theme-dark .sidenav .nav-item.active > .nav-link,
html.theme-dark .navbar-nav .nav-item.active > .nav-link {
  background-color: rgba(59, 130, 246, 0.18) !important;
  color: #e5e7eb !important;
}

html.theme-dark .sidenav .nav-link.active i,
html.theme-dark .navbar-nav .nav-link.active i,
html.theme-dark .sidenav .nav-link:hover i,
html.theme-dark .navbar-nav .nav-link:hover i {
  color: inherit !important;
}

html.theme-dark .sidenav .nav-link .nav-link-text,
html.theme-dark .sidenav .nav-link .sidenav-normal,
html.theme-dark .sidenav .nav-link .sidenav-mini-icon,
html.theme-dark .sidenav .nav-link span {
  color: inherit !important;
}

html.theme-dark .sidenav .nav-link svg {
  fill: currentColor !important;
}

/* Buttons: outline variants should remain readable in dark mode */
html.theme-dark .btn[class*="btn-outline-"] {
  box-shadow: none;
}

/* Override Bootstrap button variables (most robust, avoids dark text via CSS vars) */
html.theme-dark .btn-outline-primary {
  --bs-btn-color: #93c5fd;
  --bs-btn-border-color: rgba(147, 197, 253, 0.55);
  --bs-btn-hover-color: #e5e7eb;
  --bs-btn-hover-bg: rgba(59, 130, 246, 0.25);
  --bs-btn-hover-border-color: rgba(147, 197, 253, 0.7);
  --bs-btn-active-color: #e5e7eb;
  --bs-btn-active-bg: rgba(59, 130, 246, 0.35);
  --bs-btn-active-border-color: rgba(147, 197, 253, 0.8);
}

html.theme-dark .btn-outline-secondary {
  --bs-btn-color: rgba(229, 231, 235, 0.92);
  --bs-btn-border-color: rgba(148, 163, 184, 0.45);
  --bs-btn-hover-color: #e5e7eb;
  --bs-btn-hover-bg: rgba(148, 163, 184, 0.16);
  --bs-btn-hover-border-color: rgba(148, 163, 184, 0.6);
  --bs-btn-active-color: #e5e7eb;
  --bs-btn-active-bg: rgba(148, 163, 184, 0.22);
  --bs-btn-active-border-color: rgba(148, 163, 184, 0.75);
}

html.theme-dark .btn-outline-success {
  --bs-btn-color: #86efac;
  --bs-btn-border-color: rgba(134, 239, 172, 0.5);
  --bs-btn-hover-color: #e5e7eb;
  --bs-btn-hover-bg: rgba(34, 197, 94, 0.22);
  --bs-btn-hover-border-color: rgba(134, 239, 172, 0.65);
  --bs-btn-active-color: #e5e7eb;
  --bs-btn-active-bg: rgba(34, 197, 94, 0.3);
  --bs-btn-active-border-color: rgba(134, 239, 172, 0.75);
}

html.theme-dark .btn-outline-danger {
  --bs-btn-color: #fca5a5;
  --bs-btn-border-color: rgba(252, 165, 165, 0.55);
  --bs-btn-hover-color: #e5e7eb;
  --bs-btn-hover-bg: rgba(239, 68, 68, 0.22);
  --bs-btn-hover-border-color: rgba(252, 165, 165, 0.7);
  --bs-btn-active-color: #e5e7eb;
  --bs-btn-active-bg: rgba(239, 68, 68, 0.3);
  --bs-btn-active-border-color: rgba(252, 165, 165, 0.78);
}

html.theme-dark .btn-outline-warning {
  --bs-btn-color: #fcd34d;
  --bs-btn-border-color: rgba(252, 211, 77, 0.55);
  --bs-btn-hover-color: #0b1220;
  --bs-btn-hover-bg: rgba(252, 211, 77, 0.9);
  --bs-btn-hover-border-color: rgba(252, 211, 77, 0.9);
  --bs-btn-active-color: #0b1220;
  --bs-btn-active-bg: rgba(252, 211, 77, 0.95);
  --bs-btn-active-border-color: rgba(252, 211, 77, 0.95);
}

html.theme-dark .btn-outline-info {
  --bs-btn-color: #67e8f9;
  --bs-btn-border-color: rgba(103, 232, 249, 0.55);
  --bs-btn-hover-color: #0b1220;
  --bs-btn-hover-bg: rgba(103, 232, 249, 0.9);
  --bs-btn-hover-border-color: rgba(103, 232, 249, 0.9);
  --bs-btn-active-color: #0b1220;
  --bs-btn-active-bg: rgba(103, 232, 249, 0.95);
  --bs-btn-active-border-color: rgba(103, 232, 249, 0.95);
}

html.theme-dark .btn-outline-light,
html.theme-dark .btn-outline-dark {
  --bs-btn-color: #e5e7eb;
  --bs-btn-border-color: rgba(229, 231, 235, 0.4);
  --bs-btn-hover-color: #0b1220;
  --bs-btn-hover-bg: rgba(229, 231, 235, 0.9);
  --bs-btn-hover-border-color: rgba(229, 231, 235, 0.9);
  --bs-btn-active-color: #0b1220;
  --bs-btn-active-bg: rgba(229, 231, 235, 0.95);
  --bs-btn-active-border-color: rgba(229, 231, 235, 0.95);
}

/* Last-resort: some theme rules force .text-dark on links/buttons */
html.theme-dark .btn.text-dark,
html.theme-dark .btn[class*="btn-outline-"].text-dark,
html.theme-dark .sidenav .nav-link.text-dark,
html.theme-dark .sidenav .nav-link.text-dark:hover,
html.theme-dark .sidenav .nav-link.text-dark:focus,
html.theme-dark .sidenav .nav-link.text-dark.active {
  color: #e5e7eb !important;
}

/* White sidenav keeps dark active text in light and dark UI modes */
.sidenav.bg-white .navbar-nav .nav-link.active,
.sidenav.bg-white .navbar-nav .nav-link.active .sidenav-normal,
.sidenav.bg-white .navbar-nav .nav-link.active .nav-link-text,
.sidenav.bg-white .navbar-nav .nav-link.active span,
.sidenav.bg-white .nav .nav-link.active,
.sidenav.bg-white .nav .nav-link.active .sidenav-normal,
.navbar-vertical.bg-white .navbar-nav > .nav-item .nav-link.active,
.navbar-vertical.bg-white .navbar-nav .nav-link.active,
body.app-shell .sidenav.bg-white .nav-link.active,
body.dark-version .sidenav.bg-white .navbar-nav .nav-link.active,
body.dark-version .sidenav.bg-white .navbar-nav .nav-link.active.text-dark,
body.dark-version .sidenav.bg-white .nav .nav-link.active.text-dark,
body.dark-version .sidenav.bg-white .nav .nav-link.active.text-dark .sidenav-normal,
html.theme-dark .sidenav.bg-white .nav-link.text-dark.active,
html.theme-dark .sidenav.bg-white .nav-link.active,
html.theme-dark .sidenav.bg-white .nav .nav-link.active .sidenav-normal {
  color: #1e1e1e !important;
}

.sidenav.bg-white .navbar-nav .nav-link.active i,
.sidenav.bg-white .nav .nav-link.active i,
body.dark-version .sidenav.bg-white .nav .nav-link.active.text-dark i,
html.theme-dark .sidenav.bg-white .nav-link.active i {
  color: #1e1e1e !important;
}

/* Add breathing room below authenticated screens. */
.app-shell-content {
  padding-bottom: 50px !important;
}

/* -------------------------------------------------------------------------- */
/* Consistent table and form container sizing                                 */
/* -------------------------------------------------------------------------- */
/* All main content cards (tables, forms) use col-12 for full-width consistency.
 * This ensures table containers and edit/form containers match in size. */
.app-shell-content .row > .col-12 > .card {
  width: 100%;
}

/* -------------------------------------------------------------------------- */
/* Uniform button sizing in authenticated content areas                       */
/* -------------------------------------------------------------------------- */
/* One standard size for page actions, card headers, forms, and modals.
 * Mixed btn / btn-sm usage across screens made controls feel inconsistent. */
:is(.app-shell-content, .dev-auth-shell .app-shell-content, .modal) :is(.btn, .btn.btn-sm):not(.btn-link):not(.btn-close):not(.btn-icon-only):not(.btn-lg) {
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-font-size: 0.8125rem;
  --bs-btn-line-height: 1.25;
  --bs-btn-border-radius: 0.375rem;
  padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
  font-size: var(--bs-btn-font-size);
  line-height: var(--bs-btn-line-height);
  min-height: 2.125rem;
}

/* Keep data-grid and table row actions compact. */
:is(.app-shell-content, .dev-auth-shell .app-shell-content, .modal) :is(.MuiDataGrid-root, table) .btn:not(.btn-link):not(.btn-close) {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.625rem;
  --bs-btn-font-size: 0.75rem;
  --bs-btn-line-height: 1.25;
  padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
  font-size: var(--bs-btn-font-size);
  line-height: var(--bs-btn-line-height);
  min-height: auto;
}

/* -------------------------------------------------------------------------- */
/* Snackbar / toast notifications (success, error, warning, info)            */
/* -------------------------------------------------------------------------- */
#snackbar-container .toast {
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#snackbar-container .snackbar-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

#snackbar-container .snackbar-title {
  display: block;
  font-size: 0.875rem;
}

#snackbar-container .snackbar-message {
  font-size: 0.8125rem;
  opacity: 0.9;
}

#snackbar-container .snackbar-success {
  border-left: 4px solid #22c55e;
}

#snackbar-container .snackbar-success .snackbar-icon {
  color: #22c55e;
}

#snackbar-container .snackbar-error {
  border-left: 4px solid #ef4444;
}

#snackbar-container .snackbar-error .snackbar-icon {
  color: #ef4444;
}

#snackbar-container .snackbar-warning {
  border-left: 4px solid #f59e0b;
}

#snackbar-container .snackbar-warning .snackbar-icon {
  color: #f59e0b;
}

#snackbar-container .snackbar-info {
  border-left: 4px solid #3b82f6;
}

#snackbar-container .snackbar-info .snackbar-icon {
  color: #3b82f6;
}

/* Dark mode snackbar */
html.theme-dark #snackbar-container .toast {
  background-color: #1f2937;
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark #snackbar-container .snackbar-success {
  border-left-color: #22c55e;
}

html.theme-dark #snackbar-container .snackbar-error {
  border-left-color: #ef4444;
}

html.theme-dark #snackbar-container .snackbar-warning {
  border-left-color: #f59e0b;
}

html.theme-dark #snackbar-container .snackbar-info {
  border-left-color: #3b82f6;
}

/* -------------------------------------------------------------------------- */
/* Global search - white rounded search bar                                   */
/* -------------------------------------------------------------------------- */
.global-search-wrapper {
  width: 220px;
}
@media (min-width: 576px) {
  .global-search-wrapper {
    width: 260px;
  }
}
.global-search-input-group {
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: var(--md-filled-bg);
  border: none;
  border-bottom: 1px solid var(--md-filled-underline);
  box-shadow: none;
}
.global-search-input-group:focus-within {
  border-bottom-color: var(--md-filled-underline-focus);
  box-shadow: none;
}
.global-search-input-group .input-group-text {
  border: none;
  border-right: none;
  border-radius: 4px 0 0 0;
  background: transparent;
  color: rgba(52, 71, 103, 0.7);
}
.global-search-input-group .form-control {
  border: none;
  border-radius: 0 4px 0 0;
  min-width: 0;
  background: transparent;
  color: #1e293b;
}
.global-search-input-group .form-control::placeholder {
  color: #94a3b8;
}
.global-search-input-group .form-control:focus {
  box-shadow: none;
  background: transparent;
}
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 280px;
  max-height: 360px;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 1060;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.global-search-dropdown[hidden] {
  display: none !important;
}
.global-search-results {
  overflow-y: auto;
  max-height: 320px;
}
.global-search-loading,
.global-search-empty {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}
.global-search-group {
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.075));
}
.global-search-group:last-child {
  border-bottom: none;
}
.global-search-group-label {
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg, #f8f9fa);
}
.global-search-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--bs-body-color);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.global-search-item:hover {
  background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.04));
  color: var(--bs-body-color);
}
.global-search-item-title {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
}
.global-search-item-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-top: 0.125rem;
}

/* Dark theme */
html.theme-dark .global-search-input-group {
  border-bottom-color: var(--md-filled-underline);
  background: var(--md-filled-bg);
}
html.theme-dark .global-search-input-group .input-group-text {
  color: rgba(229, 231, 235, 0.75);
}
html.theme-dark .global-search-dropdown {
  background: var(--bs-dark);
  border-color: rgba(255, 255, 255, 0.2);
}
html.theme-dark .global-search-group-label {
  background: rgba(255, 255, 255, 0.05);
}
html.theme-dark .global-search-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* -------------------------------------------------------------------------- */
/* Per-column DataTable filters (main app)                                    */
/* -------------------------------------------------------------------------- */

.dev-dt-filter-btn {
  color: rgba(52, 71, 103, 0.7) !important;
  font-size: 1rem;
}
.dev-dt-filter-btn:hover {
  color: rgba(52, 71, 103, 0.95) !important;
}
.dev-dt-filter-dropdown {
  margin-left: 0.25rem;
  vertical-align: middle;
}
.dev-dt-th-label {
  vertical-align: middle;
}
.dev-dt-filter-menu.dropdown-menu {
  min-width: 220px;
}
.dev-dt-has-filter .dev-dt-filter-btn {
  color: var(--bs-primary) !important;
}

/* DataTables header filter menus must not be clipped by cards. */
.dev-dt-card-overflow {
  overflow: visible !important;
}
.dev-dt-card-overflow .card-body {
  overflow: visible !important;
}

/* -------------------------------------------------------------------------- */
/* DataTables ColumnControl: header buttons                                   */
/* -------------------------------------------------------------------------- */

/* ColumnControl uses .dtcc-button with child spans (icon/text/state). In the table header,
   we want compact icon buttons (but keep the text for screen readers). */
table.dataTable thead th .dt-column-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* DataTables horizontal scroll: keep headers on one line and allow X-scroll. */
div.dataTables_wrapper {
  max-width: 100%;
}

div.dataTables_wrapper .dataTables_scrollBody {
  overflow-x: auto !important;
}

/* Ensure the scrolling header doesn’t wrap its contents. */
div.dataTables_wrapper .dataTables_scrollHead table.dataTable thead th,
div.dataTables_wrapper .dataTables_scrollBody table.dataTable thead th {
  white-space: nowrap;
}

/* ColumnControl dropdown popover (More...) needs an opaque surface + proper stacking context. */
.dtcc-dropdown {
  z-index: 3000;
}

.dtcc-dropdown,
.dtcc-dropdown-liner {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.5rem;
}

html.theme-dark .dtcc-dropdown,
html.theme-dark .dtcc-dropdown-liner {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.25);
}

table.dataTable thead th .dtcc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  margin-left: 0.15rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(52, 71, 103, 0.75);
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

/* Hide ColumnControl label text (icon-only everywhere). */
.dtcc-button-text {
  display: none !important;
}

table.dataTable thead th .dtcc-button:hover {
  background: rgba(52, 71, 103, 0.08);
  color: rgba(52, 71, 103, 0.95);
}

table.dataTable thead th .dtcc-button:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.14);
}

/* SVG icons should sit nicely and not affect header height. */
table.dataTable thead th .dtcc-button-icon,
table.dataTable thead th .dtcc-button-state,
table.dataTable thead th .dtcc-button-extra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

table.dataTable thead th .dtcc-button svg {
  width: 16px;
  height: 16px;
}

html.theme-dark table.dataTable thead th .dtcc-button {
  color: rgba(229, 231, 235, 0.75);
}

html.theme-dark table.dataTable thead th .dtcc-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(229, 231, 235, 0.92);
}

/* If our JS normalization is present, these match the same visual spec. */
table.dataTable thead th .dev-dt-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  margin-left: 0.15rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(52, 71, 103, 0.75);
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

table.dataTable thead th .dev-dt-cc-btn:hover {
  background: rgba(52, 71, 103, 0.08);
  color: rgba(52, 71, 103, 0.95);
}

table.dataTable thead th .dev-dt-cc-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.14);
}

table.dataTable thead th .dev-dt-cc-btn .material-icons-round {
  font-size: 1.05rem;
}

html.theme-dark table.dataTable thead th .dev-dt-cc-btn {
  color: rgba(229, 231, 235, 0.75);
}

html.theme-dark table.dataTable thead th .dev-dt-cc-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(229, 231, 235, 0.92);
}

/* -------------------------------------------------------------------------- */
/* Page loading bar (top bar during navigation, replaces overlay)             */
/* -------------------------------------------------------------------------- */

.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99999;
  overflow: hidden;
  background: transparent;
}

.page-loading-bar[hidden] {
  display: none !important;
}

.page-loading-bar-fill {
  height: 100%;
  width: 0;
  background: var(--bs-primary, #00c875);
  transition: width 0.2s ease-out;
}

/* -------------------------------------------------------------------------- */
/* Time tracker widget (top-right, start/stop + quick add)                    */
/* -------------------------------------------------------------------------- */

.time-tracker-widget {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

/* Mobile UX: show time tracker as a compact icon in the header icon row. */
@media (max-width: 991.98px) {
  .time-tracker-widget {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }

  .time-tracker-idle,
  .time-tracker-active {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    gap: 0.25rem !important;
  }

  .time-tracker-btn {
    padding: 0.25rem !important;
    gap: 0 !important;
  }

  .time-tracker-btn span {
    display: none !important;
  }

  .time-tracker-btn .material-icons-round {
    font-size: 1.25rem !important;
  }

  .time-tracker-elapsed,
  .time-tracker-context {
    display: none;
  }

  /* Keep the mobile widget as a single icon: idle => Start, active => Stop. */
  .time-tracker-btn-manual {
    display: none !important;
  }

  .time-tracker-btn-billable {
    display: none !important;
  }
}

.time-tracker-idle,
.time-tracker-active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.time-tracker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #344767;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.time-tracker-btn:hover {
  background: rgba(52, 71, 103, 0.08);
  color: #344767;
}

.time-tracker-btn .material-icons-round {
  font-size: 1.1rem;
}

.time-tracker-btn-start {
  color: #00c875;
}

.time-tracker-btn-start:hover {
  background: rgba(0, 200, 117, 0.12);
  color: #00a860;
}

.time-tracker-btn-stop {
  color: #ef4444;
}

.time-tracker-btn-stop:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.time-tracker-btn-billable.time-tracker-billable-on {
  color: #00c875;
}

.time-tracker-btn-billable.time-tracker-billable-on:hover {
  background: rgba(0, 200, 117, 0.12);
  color: #00a860;
}

.time-tracker-btn-billable.time-tracker-billable-off {
  color: #94a3b8;
  opacity: 0.7;
}

.time-tracker-btn-billable.time-tracker-billable-off:hover {
  background: rgba(148, 163, 184, 0.15);
  opacity: 1;
}

.time-tracker-elapsed {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #344767;
  min-width: 3.5rem;
}

.time-tracker-context {
  font-size: 0.75rem;
  color: #64748b;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-tracker-form-fields .form-label {
  font-weight: 500;
}

#time-tracker-start-offcanvas.offcanvas,
#time-tracker-add-offcanvas.offcanvas {
  width: 100%;
  max-width: 480px;
}

#time-tracker-start-offcanvas .offcanvas-body,
#time-tracker-add-offcanvas .offcanvas-body {
  overflow-x: hidden;
}

#time-tracker-add-offcanvas .datetime-select-fields > .d-flex {
  flex-direction: column !important;
}

.datetime-select-fields > .d-flex {
  align-items: stretch;
}

.datetime-select-fields input[type="date"] {
  width: 100%;
  min-width: 0;
}

.datetime-select-fields .d-flex.gap-2.align-items-center {
  width: 100%;
  flex-shrink: 0;
}

.datetime-select-fields [data-time-hour],
.datetime-select-fields [data-time-minute] {
  flex: 1 1 0;
  min-width: 4.5rem;
  max-width: 6rem;
  padding-left: 0.65rem;
  text-align: center;
}

#time-tracker-add-offcanvas .datetime-select-fields input[type="date"] {
  width: 100%;
  min-width: 0;
}

#time-tracker-add-offcanvas .datetime-select-fields .d-flex.gap-2.align-items-center {
  width: 100%;
}

html.theme-dark .time-tracker-idle,
html.theme-dark .time-tracker-active {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark .time-tracker-btn {
  color: #e5e7eb;
}

html.theme-dark .time-tracker-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.theme-dark .time-tracker-elapsed {
  color: #e5e7eb;
}

html.theme-dark .time-tracker-context {
  color: rgba(229, 231, 235, 0.7);
}


/* -------------------------------------------------------------------------- */
/* Flat design: remove ALL shadow effects globally                            */
/* -------------------------------------------------------------------------- */
:root {
  --bs-box-shadow: none;
  --bs-box-shadow-sm: none;
  --bs-box-shadow-lg: none;
}

/* -------------------------------------------------------------------------- */
/* CaEFT AI chat (fixed CaEFT brand green — not organisation theme)           */
/* -------------------------------------------------------------------------- */

.caeft-ai-page {
  --caeft-ai-brand: #00c875;
  --caeft-ai-brand-hover: #00b368;
  --caeft-ai-brand-muted: rgba(0, 200, 117, 0.12);
  --caeft-ai-brand-dark: #22c55e;
  min-height: calc(100vh - 14rem);
}

.caeft-ai-page > .row {
  min-height: calc(100vh - 14rem);
}

.caeft-ai-page > .row > [class*="col-"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.caeft-ai-panel.h-100 {
  flex: 1 1 auto;
  min-height: 0;
}

.caeft-ai-chat-body {
  min-height: 0;
}

body.app-shell .caeft-ai-page .btn-primary,
body.app-shell .caeft-ai-page .btn.bg-gradient-primary,
body.app-shell .caeft-ai-page .caeft-ai-send,
body.app-shell .caeft-ai-page #caeftAiNewConversation,
body.app-shell .caeft-ai-page #caeftAiWelcomeNew {
  background-color: var(--caeft-ai-brand) !important;
  border-color: var(--caeft-ai-brand) !important;
  background-image: none !important;
  color: #fff !important;
}

body.app-shell .caeft-ai-page .btn-primary:hover,
body.app-shell .caeft-ai-page .btn-primary:focus,
body.app-shell .caeft-ai-page .btn.bg-gradient-primary:hover,
body.app-shell .caeft-ai-page .btn.bg-gradient-primary:focus,
body.app-shell .caeft-ai-page .caeft-ai-send:hover,
body.app-shell .caeft-ai-page .caeft-ai-send:focus,
body.app-shell .caeft-ai-page #caeftAiNewConversation:hover,
body.app-shell .caeft-ai-page #caeftAiWelcomeNew:hover {
  background-color: var(--caeft-ai-brand-hover) !important;
  border-color: var(--caeft-ai-brand-hover) !important;
  color: #fff !important;
}

body.app-shell .caeft-ai-page .badge.bg-success,
body.app-shell .caeft-ai-page .bg-success.badge {
  background-color: var(--caeft-ai-brand) !important;
  border-color: var(--caeft-ai-brand) !important;
  color: #fff !important;
}

.caeft-ai-page .text-primary,
.caeft-ai-page .spinner-border.text-primary {
  color: var(--caeft-ai-brand) !important;
}

.caeft-ai-panel {
  border: 1px solid #e8e9ed;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.caeft-ai-panel-header {
  background-color: #fff;
  border-bottom: 1px solid #e8e9ed;
}

.caeft-ai-conversation-scroll {
  max-height: calc(100vh - 16rem);
  overflow-y: auto;
}

.caeft-ai-conversation-item {
  border: none;
  border-bottom: 1px solid #e8e9ed;
  padding: 0.875rem 1rem;
  text-align: left;
}

.caeft-ai-conversation-item.active {
  background-color: var(--caeft-ai-brand-muted);
  border-left: 3px solid var(--caeft-ai-brand);
  color: #323338 !important;
}

.caeft-ai-conversation-item.active .text-muted {
  color: #676879 !important;
}

.caeft-ai-conversation-item:hover:not(.active) {
  background-color: #f6f7fb;
}

.caeft-ai-conversation-item-busy .fw-semibold::after {
  content: '…';
  margin-left: 0.25rem;
  opacity: 0.7;
}

.caeft-ai-thread {
  min-height: 280px;
  max-height: calc(100vh - 22rem);
  overflow-y: auto;
  padding: 0.5rem 0.25rem;
}

.caeft-ai-message {
  max-width: 85%;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
}

.caeft-ai-message-meta {
  font-size: 0.75rem;
  color: #676879;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.caeft-ai-message-meta > span:first-child {
  user-select: none;
}

.caeft-ai-message-meta .caeft-ai-copy-btn,
.caeft-ai-message-meta .caeft-ai-download-btn {
  color: inherit;
  opacity: 0.7;
  line-height: 1;
  min-width: auto;
}

.caeft-ai-message-meta .caeft-ai-copy-btn:hover,
.caeft-ai-message-meta .caeft-ai-download-btn:hover {
  opacity: 1;
  color: var(--caeft-ai-brand);
}

.caeft-ai-message-user {
  margin-left: auto;
  background: var(--caeft-ai-brand);
  color: #fff;
}

.caeft-ai-message-user .caeft-ai-message-meta {
  color: rgba(255, 255, 255, 0.85);
}

.caeft-ai-message-assistant {
  margin-right: auto;
  background: #f6f7fb;
  border: 1px solid #e8e9ed;
  color: #323338;
}

.caeft-ai-message-assistant .caeft-ai-message-body :is(h3, h4, h5) {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #323338;
}

.caeft-ai-message-assistant .caeft-ai-message-body pre {
  background: #1a2035;
  color: #f8f9fa;
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
}

.caeft-ai-message-assistant .caeft-ai-message-body :is(ol, ul) {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.35rem;
}

.caeft-ai-message-assistant .caeft-ai-message-body li {
  margin-bottom: 0.35rem;
}

.caeft-ai-message-assistant .caeft-ai-message-body blockquote {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--caeft-ai-brand);
  background: rgba(0, 0, 0, 0.03);
  color: #5f6368;
}

.caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table {
  width: 100%;
  margin: 0.75rem 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table th,
.caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table td {
  border: 1px solid #e8e9ed;
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table thead th {
  background: #eef0f4;
  font-weight: 600;
}

.caeft-ai-header-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  min-width: 0;
}

.caeft-ai-header-brand {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: auto;
}

.caeft-ai-header-brand small {
  display: block;
  white-space: nowrap;
}

.caeft-ai-toolbar {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
  .caeft-ai-header-row {
    flex-wrap: wrap;
  }

  .caeft-ai-toolbar {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

.caeft-ai-select-label {
  cursor: pointer;
}

.caeft-ai-select-label--locked {
  cursor: not-allowed;
}

.caeft-ai-mode-select,
.caeft-ai-matter-select {
  width: auto;
  min-width: 7.5rem;
  max-width: 11rem;
}

.caeft-ai-matter-select--locked,
.caeft-ai-matter-select:disabled {
  cursor: not-allowed;
}

.caeft-ai-message-assistant .caeft-ai-copy-btn,
.caeft-ai-message-assistant .caeft-ai-download-btn {
  color: #5f6368;
}

.caeft-ai-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f6f7fb;
  border: 1px solid #e8e9ed;
  border-radius: 8px;
}

.caeft-ai-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.75rem;
  line-height: 1.4;
  vertical-align: middle;
}

.caeft-ai-attachment-chip .material-icons-round {
  font-size: 14px;
}

.caeft-ai-message-attachments,
#caeftAiAttachmentsList {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

#caeftAiAttachmentsList {
  margin-top: 0.65rem;
}

#caeftAiAttachmentsList .caeft-ai-attachment-chip {
  background: #fff;
  border-color: #e8e9ed;
  color: #323338;
}

.caeft-ai-attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.15rem;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  line-height: 1;
}

.caeft-ai-attachment-remove:hover {
  opacity: 1;
}

.caeft-ai-attachment-remove .material-icons-round {
  font-size: 14px;
}

.caeft-ai-input {
  border: none;
  background: transparent;
  resize: none;
  box-shadow: none !important;
}

.caeft-ai-input:focus {
  background: transparent;
}

.caeft-ai-send {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.caeft-ai-attach,
.caeft-ai-expand {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.caeft-ai-chat-body.caeft-ai-composer-expanded .caeft-ai-thread,
.caeft-ai-chat-body.caeft-ai-composer-expanded #caeftAiThinking,
.caeft-ai-chat-body.caeft-ai-composer-expanded #caeftAiCountdown {
  display: none !important;
}

.caeft-ai-chat-body.caeft-ai-composer-expanded {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.caeft-ai-chat-body.caeft-ai-composer-expanded .caeft-ai-composer {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.caeft-ai-chat-body.caeft-ai-composer-expanded .caeft-ai-composer-inner {
  flex: 1 1 0;
  align-items: stretch;
  min-height: 0;
}

.caeft-ai-chat-body.caeft-ai-composer-expanded .caeft-ai-input {
  flex: 1 1 0;
  min-height: 8rem;
  overflow-y: auto;
}

.caeft-ai-thinking {
  color: #676879;
}

.caeft-ai-countdown {
  color: #676879;
}

html.theme-dark .caeft-ai-panel,
html.theme-dark body.dark-version .caeft-ai-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background-color: #1a2035;
}

html.theme-dark .caeft-ai-panel-header,
html.theme-dark body.dark-version .caeft-ai-panel-header {
  background-color: #1a2035;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark .caeft-ai-conversation-item,
html.theme-dark body.dark-version .caeft-ai-conversation-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

html.theme-dark .caeft-ai-conversation-item.active,
html.theme-dark body.dark-version .caeft-ai-conversation-item.active {
  background-color: color-mix(in srgb, var(--caeft-ai-brand-dark) 22%, #1a2035);
  border-left-color: var(--caeft-ai-brand-dark);
}

html.theme-dark .caeft-ai-page,
html.theme-dark body.dark-version .caeft-ai-page {
  --caeft-ai-brand: #22c55e;
  --caeft-ai-brand-hover: #16a34a;
  --caeft-ai-brand-muted: rgba(34, 197, 94, 0.18);
}

html.theme-dark body.app-shell .caeft-ai-page .btn-primary,
html.theme-dark body.app-shell .caeft-ai-page .caeft-ai-send,
html.theme-dark body.app-shell .caeft-ai-page #caeftAiNewConversation,
html.theme-dark body.app-shell .caeft-ai-page #caeftAiWelcomeNew {
  background-color: var(--caeft-ai-brand) !important;
  border-color: var(--caeft-ai-brand) !important;
}

html.theme-dark .caeft-ai-message-assistant,
html.theme-dark body.dark-version .caeft-ai-message-assistant {
  background: #1f2937 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #e5e7eb !important;
}

html.theme-dark .caeft-ai-message-assistant .caeft-ai-message-meta,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-message-meta {
  color: rgba(229, 231, 235, 0.65) !important;
}

html.theme-dark .caeft-ai-message-assistant .caeft-ai-message-body :is(h3, h4, h5, p, li),
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-message-body :is(h3, h4, h5, p, li) {
  color: #e5e7eb !important;
}

html.theme-dark .caeft-ai-message-assistant .caeft-ai-message-body blockquote,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-message-body blockquote {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(229, 231, 235, 0.85) !important;
}

html.theme-dark .caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table th,
html.theme-dark .caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table td,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table th,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table td {
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #e5e7eb !important;
}

html.theme-dark .caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table thead th,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-message-body .caeft-ai-table thead th {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f3f4f6 !important;
}

html.theme-dark .caeft-ai-message-assistant .caeft-ai-copy-btn,
html.theme-dark .caeft-ai-message-assistant .caeft-ai-download-btn,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-copy-btn,
html.theme-dark body.dark-version .caeft-ai-message-assistant .caeft-ai-download-btn {
  color: rgba(229, 231, 235, 0.7) !important;
}

html.theme-dark .support-message-staff,
html.theme-dark body.dark-version .support-message-staff {
  background: #1f2937 !important;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e5e7eb !important;
}

html.theme-dark .support-message-staff .text-muted,
html.theme-dark body.dark-version .support-message-staff .text-muted {
  color: rgba(229, 231, 235, 0.65) !important;
}

html.theme-dark .caeft-ai-composer-inner,
html.theme-dark body.dark-version .caeft-ai-composer-inner {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Law firm onboarding wizard (in-app — mirrors signup wizard styles) */
.law-firm-onboarding-wizard.caeft-wizard {
  --caeft-wizard-track: #e2e8f0;
  --caeft-wizard-accent: #009103;
  --caeft-wizard-accent-soft: rgba(0, 145, 3, 0.12);
}

.law-firm-onboarding-wizard .caeft-wizard__progress {
  padding: 1rem 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  margin-bottom: 0;
}

.law-firm-onboarding-wizard .caeft-wizard__progress-inner {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.law-firm-onboarding-wizard .caeft-wizard__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 4.25rem;
  list-style: none;
  cursor: pointer;
}

.law-firm-onboarding-wizard .caeft-wizard__step-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  color: rgba(17, 24, 39, 0.45);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
}

.law-firm-onboarding-wizard .caeft-wizard__step.is-active .caeft-wizard__step-link {
  color: #111827;
}

.law-firm-onboarding-wizard .caeft-wizard__step.is-complete .caeft-wizard__step-link {
  color: var(--caeft-wizard-accent);
}

.law-firm-onboarding-wizard .caeft-wizard__step-bubble {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--caeft-wizard-track);
  background: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
}

.law-firm-onboarding-wizard .caeft-wizard__step-label {
  max-width: 5.5rem;
}

.law-firm-onboarding-wizard .caeft-wizard__step.is-complete .caeft-wizard__step-bubble {
  border-color: var(--caeft-wizard-accent);
  background: var(--caeft-wizard-accent-soft);
  color: var(--caeft-wizard-accent);
}

.law-firm-onboarding-wizard .caeft-wizard__step.is-complete .caeft-wizard__step-num {
  display: none;
}

.law-firm-onboarding-wizard .caeft-wizard__step.is-complete .caeft-wizard__step-bubble::after {
  content: '';
  display: block;
  width: 0.4rem;
  height: 0.65rem;
  border: solid var(--caeft-wizard-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.law-firm-onboarding-wizard .caeft-wizard__step.is-active .caeft-wizard__step-bubble {
  border-color: var(--caeft-wizard-accent);
  background: linear-gradient(145deg, #00b805, var(--caeft-wizard-accent));
  color: #fff;
}

.law-firm-onboarding-wizard .caeft-wizard__connector {
  flex: 1 1 1.25rem;
  min-width: 1rem;
  max-width: 3.5rem;
  height: 3px;
  border-radius: 2px;
  background: var(--caeft-wizard-track);
  margin-top: 1.05rem;
  list-style: none;
}

.law-firm-onboarding-wizard .caeft-wizard__connector.is-complete {
  background: var(--caeft-wizard-accent);
}

.law-firm-onboarding-wizard__panel {
  display: none;
}

.law-firm-onboarding-wizard__panel.is-active {
  display: block;
}

html.theme-dark .law-firm-onboarding-wizard .caeft-wizard__step-link {
  color: rgba(229, 231, 235, 0.55);
}

html.theme-dark .law-firm-onboarding-wizard .caeft-wizard__step.is-active .caeft-wizard__step-link {
  color: #e5e7eb;
}

html.theme-dark .law-firm-onboarding-wizard .caeft-wizard__step-bubble {
  background: #1a2035;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Compliance / ATMS hub */
.compliance-hub__tabs .nav-link {
  border-radius: 0.5rem;
  font-weight: 600;
  color: #67748e;
  border: 1px solid transparent;
  background: transparent;
}

.compliance-hub__tabs .nav-link:hover {
  color: #344767;
  background: rgba(0, 145, 3, 0.06);
}

.compliance-hub__tabs .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
  border-color: transparent !important;
}

.compliance-hub__pane {
  display: none;
}

.compliance-hub__pane.is-active {
  display: block;
}

.compliance-hub__alert-actions summary {
  cursor: pointer;
  list-style: none;
}

.compliance-hub__alert-actions summary::-webkit-details-marker {
  display: none;
}

html.theme-dark .compliance-hub__tabs .nav-link {
  color: rgba(229, 231, 235, 0.75);
}

html.theme-dark .compliance-hub__tabs .nav-link.active {
  background: var(--org-theme-primary, #00c875) !important;
  color: #000 !important;
}

*,
*::before,
*::after {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}



/* =============================================================================
   CaEFT role dashboardst-dashboard to avoid Bootstrap / Material Dashboard conflicts.
 *
 * Also bundled in public/css/ui-overrides.css. Dockerfile must copy this file after
 * the webpack assets stage (see COPY public/css/caeft-dashboard.css in Dockerfile).
 */

html body .caeft-dashboard {
    --caeft-navy: #1a1a2e;
    --caeft-navy-deep: #12121f;
    --caeft-primary: #00c60e;
    --caeft-primary-dark: #009205;
    --caeft-primary-pale: #e8f9e9;
    --caeft-gold: #c4981e;
    --caeft-gray-50: #fafaf9;
    --caeft-gray-100: #f0efec;
    --caeft-gray-200: #e4e2dd;
    --caeft-gray-300: #c8c5be;
    --caeft-gray-400: #9e9a91;
    --caeft-gray-500: #6e6a61;
    --caeft-gray-700: #3d3a33;
    --caeft-green: #2e7d32;
    --caeft-green-bg: #e8f5e9;
    --caeft-amber: #f57f17;
    --caeft-amber-bg: #fff8e1;
    --caeft-red: #c62828;
    --caeft-red-bg: #ffebee;
    --caeft-radius: 12px;
    --caeft-radius-sm: 8px;
    --caeft-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --caeft-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);

    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--caeft-gray-700);
}

html body .caeft-dashboard *,
html body .caeft-dashboard *::before,
html body .caeft-dashboard *::after {
    box-sizing: border-box;
}

html body .caeft-dashboard h1,
html body .caeft-dashboard h2,
html body .caeft-dashboard .caeft-dash-title {
    font-family: 'DM Serif Display', Georgia, serif;
    color: var(--caeft-navy);
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

html body .caeft-dashboard .caeft-dash-title.h4 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0;
}

html body .caeft-dashboard h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

/* Header */
html body .caeft-dashboard .caeft-dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

html body .caeft-dashboard .caeft-dash-header p {
    color: var(--caeft-gray-500);
    font-size: 0.875rem;
    margin: 0.35rem 0 0;
    max-width: 42rem;
    line-height: 1.45;
}

html body .caeft-dashboard .caeft-dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Buttons (not Bootstrap .btn) */
html body .caeft-dashboard a.caeft-btn,
html body .caeft-dashboard span.caeft-btn,
html body .caeft-dashboard button.caeft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: var(--caeft-radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    border: 1px solid var(--caeft-gray-200);
    background: #fff;
    color: var(--caeft-navy);
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

html body .caeft-dashboard a.caeft-btn:hover,
html body .caeft-dashboard a.caeft-btn:focus {
    border-color: var(--caeft-primary);
    color: var(--caeft-primary-dark);
    background: #fff;
    text-decoration: none;
}

html body .caeft-dashboard a.caeft-btn-primary,
html body .caeft-dashboard span.caeft-btn-primary {
    background: var(--caeft-navy);
    border-color: var(--caeft-navy);
    color: #fff;
}

html body .caeft-dashboard a.caeft-btn-primary:hover,
html body .caeft-dashboard a.caeft-btn-primary:focus {
    background: var(--caeft-primary-dark);
    border-color: var(--caeft-primary-dark);
    color: #fff;
}

html body .caeft-dashboard a.caeft-btn-gold,
html body .caeft-dashboard span.caeft-btn-gold {
    background: var(--caeft-primary);
    border-color: var(--caeft-primary);
    color: #fff;
}

html body .caeft-dashboard a.caeft-btn-gold:hover,
html body .caeft-dashboard a.caeft-btn-gold:focus {
    background: var(--caeft-primary-dark);
    border-color: var(--caeft-primary-dark);
    color: #fff;
}

/* Health banner */
html body .caeft-dashboard .caeft-health-banner {
    background: linear-gradient(135deg, var(--caeft-navy) 0%, var(--caeft-primary-dark) 55%, var(--caeft-primary) 100%);
    border-radius: var(--caeft-radius);
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    box-shadow: var(--caeft-shadow-md);
    position: relative;
    overflow: hidden;
}

html body .caeft-dashboard .caeft-health-banner::after {
    content: '';
    position: absolute;
    right: -2rem;
    top: -2rem;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    background: rgba(0, 198, 14, 0.12);
    pointer-events: none;
}

html body .caeft-dashboard .caeft-health-score {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    border: 3px solid var(--caeft-primary);
    background: rgba(0, 198, 14, 0.15);
}

html body .caeft-dashboard .caeft-health-score .val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

html body .caeft-dashboard .caeft-health-score .lbl {
    font-size: 0.625rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

html body .caeft-dashboard .caeft-health-body {
    flex: 1;
    min-width: 200px;
    z-index: 1;
}

html body .caeft-dashboard .caeft-health-body h2 {
    color: #fff;
    font-size: 1.125rem;
    font-family: 'DM Serif Display', Georgia, serif;
    margin: 0 0 0.35rem;
    font-weight: 400;
}

html body .caeft-dashboard .caeft-health-body p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8125rem;
    margin: 0;
    line-height: 1.4;
}

html body .caeft-dashboard .caeft-health-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.85rem;
}

html body .caeft-dashboard .caeft-health-stat .hs-val {
    color: #7dff85;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

html body .caeft-dashboard .caeft-health-stat .hs-lbl {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.6875rem;
}

/* KPI strip */
html body .caeft-dashboard .caeft-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

html body .caeft-dashboard a.caeft-kpi-card {
    background: #fff;
    border: 1px solid var(--caeft-gray-100);
    border-radius: var(--caeft-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--caeft-shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

html body .caeft-dashboard a.caeft-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--caeft-shadow-md);
    color: inherit;
}

html body .caeft-dashboard .caeft-kpi-card .k-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--caeft-gray-500);
}

html body .caeft-dashboard .caeft-kpi-card .k-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--caeft-navy);
    margin: 0.25rem 0;
    line-height: 1.1;
}

html body .caeft-dashboard .caeft-kpi-card .k-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--caeft-gray-400);
}

html body .caeft-dashboard .caeft-kpi-card .k-icon {
    float: right;
    color: var(--caeft-gray-300);
    font-size: 1.35rem;
    line-height: 1;
}

/* Panels */
html body .caeft-dashboard .caeft-panel {
    background: #fff;
    border: 1px solid var(--caeft-gray-100);
    border-radius: var(--caeft-radius);
    box-shadow: var(--caeft-shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

html body .caeft-dashboard .caeft-panel.h-100 {
    height: 100%;
}

html body .caeft-dashboard .caeft-panel-header {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--caeft-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: #fff;
}

html body .caeft-dashboard .caeft-panel-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    color: var(--caeft-navy);
    flex: 1 1 auto;
    min-width: 0;
}

html body .caeft-dashboard .caeft-panel-header .hint {
    font-size: 0.75rem;
    color: var(--caeft-gray-400);
    margin-right: auto;
}

html body .caeft-dashboard .caeft-panel-body {
    padding: 0.25rem 1.15rem 0.85rem;
    background: #fff;
}

html body .caeft-dashboard .caeft-panel-body.px-0 {
    padding-left: 0;
    padding-right: 0;
}

html body .caeft-dashboard .caeft-panel-body.px-0 .caeft-table th:first-child,
html body .caeft-dashboard .caeft-panel-body.px-0 .caeft-table td:first-child {
    padding-left: 1.15rem;
}

html body .caeft-dashboard .caeft-panel-body.px-0 .caeft-table th:last-child,
html body .caeft-dashboard .caeft-panel-body.px-0 .caeft-table td:last-child {
    padding-right: 1.15rem;
}

/* Queue rows */
html body .caeft-dashboard a.caeft-queue-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--caeft-gray-100);
    text-decoration: none;
    color: inherit;
    background: transparent;
}

html body .caeft-dashboard a.caeft-queue-row:last-child {
    border-bottom: none;
}

html body .caeft-dashboard a.caeft-queue-row:hover {
    color: inherit;
    background: rgba(0, 198, 14, 0.04);
}

html body .caeft-dashboard a.caeft-queue-row:hover .caeft-queue-title {
    color: var(--caeft-primary-dark);
}

html body .caeft-dashboard .caeft-queue-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--caeft-navy);
}

html body .caeft-dashboard .caeft-queue-sub {
    font-size: 0.75rem;
    color: var(--caeft-gray-500);
    margin-top: 0.15rem;
}

/* Badges */
html body .caeft-dashboard .caeft-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.3;
}

html body .caeft-dashboard .caeft-badge-urgent {
    background: var(--caeft-red-bg);
    color: var(--caeft-red);
}

html body .caeft-dashboard .caeft-badge-warning {
    background: var(--caeft-amber-bg);
    color: var(--caeft-amber);
}

html body .caeft-dashboard .caeft-badge-info {
    background: var(--caeft-primary-pale);
    color: var(--caeft-primary-dark);
}

html body .caeft-dashboard .caeft-badge-neutral {
    background: var(--caeft-gray-100);
    color: var(--caeft-gray-500);
}

html body .caeft-dashboard .caeft-badge-success {
    background: var(--caeft-green-bg);
    color: var(--caeft-green);
}

/* Tables */
html body .caeft-dashboard table.caeft-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    font-size: 0.8125rem;
    --bs-table-bg: transparent;
    --bs-table-color: var(--caeft-gray-700);
}

html body .caeft-dashboard table.caeft-table thead th {
    text-align: left;
    padding: 0.55rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--caeft-gray-500);
    background: var(--caeft-gray-50);
    border-bottom: 1px solid var(--caeft-gray-200);
    vertical-align: middle;
}

html body .caeft-dashboard table.caeft-table tbody td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--caeft-gray-100);
    vertical-align: top;
    background: transparent;
    color: var(--caeft-gray-700);
}

html body .caeft-dashboard table.caeft-table tbody tr:last-child td {
    border-bottom: none;
}

html body .caeft-dashboard table.caeft-table tbody tr:hover td {
    background: rgba(0, 198, 14, 0.04);
}

html body .caeft-dashboard table.caeft-table strong {
    color: var(--caeft-navy);
    font-weight: 700;
}

/* Onboarding */
html body .caeft-dashboard .caeft-onboarding {
    border: 2px solid var(--caeft-navy);
    border-radius: var(--caeft-radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--caeft-shadow-md);
    background: #fff;
}

html body .caeft-dashboard .caeft-onboarding .caeft-panel-header {
    background: var(--caeft-navy);
    border-bottom: none;
}

html body .caeft-dashboard .caeft-onboarding .caeft-panel-header h3 {
    color: #fff;
    font-family: 'DM Serif Display', Georgia, serif;
}

html body .caeft-dashboard .caeft-onboarding .caeft-panel-body {
    background: #fff;
}

/* Activity */
html body .caeft-dashboard .caeft-activity-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--caeft-gray-100);
}

html body .caeft-dashboard .caeft-activity-item:last-child {
    border-bottom: none;
}

html body .caeft-dashboard .caeft-activity-icon {
    color: var(--caeft-gray-400);
    flex-shrink: 0;
}

html body .caeft-dashboard .caeft-activity-icon .material-icons-round {
    font-size: 1.15rem;
    line-height: 1;
}

/* Secondary panels grid (prevents Quick links dropping below) */
html body .caeft-dashboard .caeft-masonry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 992px) {
    html body .caeft-dashboard .caeft-masonry {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (min-width: 1400px) {
    html body .caeft-dashboard .caeft-masonry {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

html body .caeft-dashboard .caeft-masonry-item {
    margin: 0;
}

html body .caeft-dashboard .caeft-masonry-item .caeft-panel {
    margin-bottom: 0;
}

/* Quick links — column masonry so tiles wrap instead of one stretched row */
html body .caeft-dashboard .caeft-quick-masonry {
    column-gap: 0.65rem;
    column-count: 2;
}

@media (min-width: 480px) {
    html body .caeft-dashboard .caeft-quick-masonry {
        column-count: 3;
    }
}

@media (min-width: 992px) {
    html body .caeft-dashboard .caeft-quick-masonry {
        column-count: 2;
    }
}

html body .caeft-dashboard a.caeft-quick-link {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    display: inline-flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.85rem;
    border: 1px solid var(--caeft-gray-200);
    border-radius: var(--caeft-radius-sm);
    text-decoration: none;
    color: var(--caeft-navy);
    transition: all 0.12s ease;
    background: var(--caeft-gray-50);
}

html body .caeft-dashboard a.caeft-quick-link:hover {
    border-color: var(--caeft-primary);
    background: var(--caeft-primary-pale);
    color: var(--caeft-navy);
}

html body .caeft-dashboard .caeft-quick-link .ql-label {
    font-size: 0.75rem;
    font-weight: 600;
}

html body .caeft-dashboard .caeft-quick-link .ql-count {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--caeft-primary-dark);
}

/* Layout grids */
html body .caeft-dashboard .caeft-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

html body .caeft-dashboard .caeft-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

@media (min-width: 992px) {
    html body .caeft-dashboard .caeft-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    html body .caeft-dashboard .caeft-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Weekly calendar grid (dashboard schedule) */
html body .caeft-dashboard .caeft-schedule-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem;
    border-radius: 999px;
    background: var(--caeft-gray-100);
    flex: 0 0 auto;
}

html body .caeft-dashboard .caeft-schedule-view-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--caeft-gray-500);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

html body .caeft-dashboard .caeft-schedule-view-btn:hover,
html body .caeft-dashboard .caeft-schedule-view-btn:focus {
    color: var(--caeft-navy);
    outline: none;
}

html body .caeft-dashboard .caeft-schedule-view-btn.is-active {
    background: #fff;
    color: var(--caeft-navy);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

html body .caeft-dashboard .caeft-week-grid {
    width: 100%;
}

html body .caeft-dashboard .caeft-week-row {
    display: grid;
    border-bottom: 1px solid var(--caeft-gray-100);
}

html body .caeft-dashboard .caeft-week-grid[data-schedule-view="today"] .caeft-week-row {
    grid-template-columns: 5.25rem minmax(0, 1fr);
}

html body .caeft-dashboard .caeft-week-grid[data-schedule-view="3day"] .caeft-week-row {
    grid-template-columns: 5.25rem repeat(3, minmax(0, 1fr));
}

html body .caeft-dashboard .caeft-week-grid[data-schedule-view="5day"] .caeft-week-row {
    grid-template-columns: 5.25rem repeat(5, minmax(0, 1fr));
}

html body .caeft-dashboard .caeft-week-grid[data-schedule-view="today"] [data-day-index]:not([data-day-index="0"]) {
    display: none;
}

html body .caeft-dashboard .caeft-week-grid[data-schedule-view="3day"] [data-day-index]:not([data-day-index="0"]):not([data-day-index="1"]):not([data-day-index="2"]) {
    display: none;
}

html body .caeft-dashboard .caeft-week-row:last-child {
    border-bottom: none;
}

html body .caeft-dashboard .caeft-week-cell {
    padding: 0.45rem 0.5rem;
    min-height: 2.15rem;
}

html body .caeft-dashboard .caeft-week-corner {
    background: var(--caeft-gray-50);
    border-right: 1px solid var(--caeft-gray-200);
}

html body .caeft-dashboard .caeft-week-day {
    background: var(--caeft-gray-50);
    border-right: 1px solid var(--caeft-gray-200);
    text-align: center;
}

html body .caeft-dashboard .caeft-week-day.is-today {
    background: var(--caeft-primary-pale);
}

html body .caeft-dashboard .caeft-week-day .caeft-week-day-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--caeft-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

html body .caeft-dashboard .caeft-week-day .caeft-week-day-num {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--caeft-navy);
    margin-top: 0.1rem;
}

html body .caeft-dashboard .caeft-week-day.is-today .caeft-week-day-num {
    color: var(--caeft-primary-dark);
}

html body .caeft-dashboard .caeft-week-time {
    border-right: 1px solid var(--caeft-gray-200);
    color: var(--caeft-gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    background: #fff;
}

html body .caeft-dashboard .caeft-week-slot {
    border-right: 1px solid var(--caeft-gray-100);
    background: #fff;
    position: relative;
    min-height: 3.25rem;
}

html body .caeft-dashboard .caeft-week-slot-link {
    display: block;
    position: absolute;
    inset: 0;
}

html body .caeft-dashboard .caeft-week-slot-link:hover {
    background: var(--caeft-primary-pale);
}

html body .caeft-dashboard .caeft-schedule-event {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.3rem 0.4rem;
    margin-bottom: 0;
    border: 0;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    white-space: normal;
    cursor: pointer;
    min-height: calc(100% - 0.15rem);
    height: calc(100% - 0.15rem);
}

html body .caeft-dashboard .caeft-schedule-event-time {
    display: block;
    font-size: 0.65rem;
    line-height: 1.2;
    opacity: 0.95;
}

html body .caeft-dashboard .caeft-schedule-event-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Match main calendar legend: info=reminder, warning=due, primary=same-day/range */
html body .caeft-dashboard .caeft-schedule-event--reminder {
    background-color: #1A73E8;
    background-image: linear-gradient(195deg, #49a3f1 0%, #1A73E8 100%);
}

html body .caeft-dashboard .caeft-schedule-event--due {
    background-color: #FB8C00;
    background-image: linear-gradient(195deg, #FFA726 0%, #FB8C00 100%);
}

html body .caeft-dashboard .caeft-schedule-event--both,
html body .caeft-dashboard .caeft-schedule-event--range {
    background-color: #00C60E;
    background-image: linear-gradient(195deg, #00C60E 0%, #009205 100%);
}

html body .caeft-dashboard .caeft-schedule-event--continuation {
    min-height: 100%;
    height: 100%;
    border-radius: 0 0 0.375rem 0.375rem;
    margin-top: -0.05rem;
}

html body .caeft-dashboard .caeft-schedule-event--continuation .caeft-schedule-event-title {
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

html body .caeft-dashboard .caeft-schedule-event:hover {
    color: #fff;
}

html body .caeft-dashboard .caeft-schedule-event--reminder:hover {
    background-color: #1669d3;
    background-image: linear-gradient(195deg, #3b97ee 0%, #1669d3 100%);
}

html body .caeft-dashboard .caeft-schedule-event--due:hover {
    background-color: #e07f00;
    background-image: linear-gradient(195deg, #ff9800 0%, #e07f00 100%);
}

html body .caeft-dashboard .caeft-schedule-event--both:hover,
html body .caeft-dashboard .caeft-schedule-event--range:hover {
    background-color: #009205;
    background-image: linear-gradient(195deg, #00d911 0%, #007a04 100%);
}

/* Login attention / priority popup — self-contained so rows stay styled inside Bootstrap modals. */
html body .modal-content.caeft-attention-popup,
html body .caeft-attention-popup {
    --caeft-navy: #1a1a2e;
    --caeft-primary-dark: #009205;
    --caeft-primary-pale: #e8f9e9;
    --caeft-gray-100: #f0efec;
    --caeft-gray-400: #9e9a91;
    --caeft-gray-500: #6e6a61;
    --caeft-gray-700: #3d3a33;
    --caeft-red: #c62828;
    --caeft-red-bg: #ffebee;
    --caeft-amber: #f57f17;
    --caeft-amber-bg: #fff8e1;
    --caeft-radius: 12px;
    --caeft-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);

    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--caeft-gray-700);
    background: #fff;
    border: 1px solid var(--caeft-gray-100);
    border-radius: var(--caeft-radius);
    box-shadow: var(--caeft-shadow);
    overflow: hidden;
}

html body .caeft-attention-popup .modal-header {
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--caeft-gray-100);
    background: #fff;
}

html body .caeft-attention-popup .modal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--caeft-navy);
}

html body .caeft-attention-popup .modal-footer {
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--caeft-gray-100);
    background: #fff;
}

html body .caeft-attention-popup .modal-body {
    background: #fff;
}

html body .caeft-attention-popup-subtitle {
    font-size: 0.8125rem;
    color: var(--caeft-gray-500);
    margin-top: 0.15rem;
}

html body .caeft-attention-popup a.caeft-queue-row,
html body .caeft-attention-popup-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--caeft-gray-100);
    text-decoration: none;
    color: inherit;
    background: transparent;
}

html body .caeft-attention-popup a.caeft-queue-row:last-child,
html body .caeft-attention-popup-row:last-child {
    border-bottom: none;
}

html body .caeft-attention-popup a.caeft-queue-row:hover {
    color: inherit;
    background: rgba(0, 198, 14, 0.04);
}

html body .caeft-attention-popup a.caeft-queue-row:hover .caeft-queue-title {
    color: var(--caeft-primary-dark);
}

html body .caeft-attention-popup .caeft-queue-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--caeft-navy);
}

html body .caeft-attention-popup .caeft-queue-sub {
    font-size: 0.75rem;
    color: var(--caeft-gray-500);
    margin-top: 0.15rem;
}

html body .caeft-attention-popup .caeft-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.3;
}

html body .caeft-attention-popup .caeft-badge-urgent {
    background: var(--caeft-red-bg);
    color: var(--caeft-red);
}

html body .caeft-attention-popup .caeft-badge-warning {
    background: var(--caeft-amber-bg);
    color: var(--caeft-amber);
}

html body .caeft-attention-popup .caeft-badge-info {
    background: var(--caeft-primary-pale);
    color: var(--caeft-primary-dark);
}

html.theme-dark body .modal-content.caeft-attention-popup,
html.theme-dark body .caeft-attention-popup {
    --caeft-navy: #e8edf5;
    --caeft-primary-pale: rgba(0, 198, 14, 0.15);
    --caeft-gray-100: #2a3048;
    --caeft-gray-400: #94a3b8;
    --caeft-gray-500: #cbd5e1;
    --caeft-gray-700: #e2e8f0;
    --caeft-red-bg: rgba(198, 40, 40, 0.2);
    --caeft-amber-bg: rgba(245, 127, 23, 0.2);
    background: #1e2234;
    border-color: #2a3048;
    color: var(--caeft-gray-700);
}

html.theme-dark body .caeft-attention-popup .modal-header,
html.theme-dark body .caeft-attention-popup .modal-footer,
html.theme-dark body .caeft-attention-popup .modal-body {
    background: #1e2234;
    border-color: #2a3048;
}

html.theme-dark body .caeft-attention-popup .modal-title {
    color: var(--caeft-navy);
}

html.theme-dark body .caeft-attention-popup a.caeft-queue-row:hover {
    background: rgba(0, 198, 14, 0.08);
}

html body .caeft-dashboard .caeft-week-slot:last-child {
    border-right: none;
}

html body .caeft-dashboard .caeft-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--caeft-gray-400);
    font-size: 0.875rem;
}

html body .caeft-dashboard .mb-3 {
    margin-bottom: 1rem;
}

/* Dark theme */
html.theme-dark body .caeft-dashboard {
    --caeft-navy: #e8edf5;
    --caeft-gray-50: #1e2234;
    --caeft-gray-100: #2a3048;
    --caeft-gray-200: #3d4563;
    --caeft-gray-300: #64748b;
    --caeft-gray-400: #94a3b8;
    --caeft-gray-500: #cbd5e1;
    --caeft-gray-700: #e2e8f0;
    --caeft-primary-pale: rgba(0, 198, 14, 0.15);
    color: var(--caeft-gray-700);
}

html.theme-dark body .caeft-dashboard .caeft-panel,
html.theme-dark body .caeft-dashboard .caeft-panel-header,
html.theme-dark body .caeft-dashboard .caeft-panel-body,
html.theme-dark body .caeft-dashboard a.caeft-kpi-card,
html.theme-dark body .caeft-dashboard .caeft-onboarding,
html.theme-dark body .caeft-dashboard .caeft-onboarding .caeft-panel-body {
    background: #1e2234;
    border-color: #2a3048;
}

html.theme-dark body .caeft-dashboard a.caeft-btn {
    background: #252b42;
    border-color: #3d4563;
    color: #e2e8f0;
}

html.theme-dark body .caeft-dashboard a.caeft-quick-link {
    background: #252b42;
    border-color: #3d4563;
    color: #e2e8f0;
}

html.theme-dark body .caeft-dashboard table.caeft-table thead th {
    background: #252b42;
    color: var(--caeft-gray-500);
    border-color: #3d4563;
}

html.theme-dark body .caeft-dashboard table.caeft-table tbody td {
    border-color: #2a3048;
    color: var(--caeft-gray-700);
}

html.theme-dark body .caeft-dashboard table.caeft-table strong {
    color: #f1f5f9;
}

html.theme-dark body .caeft-dashboard .caeft-onboarding .caeft-panel-header {
    background: var(--caeft-navy-deep, #12121f);
}

html.theme-dark body .caeft-dashboard .caeft-onboarding .caeft-panel-header h3 {
    color: #fff;
}

/* Restore elevation when parent bundle strips box-shadow (ui-overrides global reset). */
html body .caeft-dashboard .caeft-health-banner,
html body .caeft-dashboard .caeft-panel,
html body .caeft-dashboard a.caeft-kpi-card,
html body .caeft-dashboard .caeft-onboarding {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

html body .caeft-dashboard .caeft-health-banner,
html body .caeft-dashboard a.caeft-kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

html body .caeft-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f8f9fa;
    color: #344767;
    font-size: 0.8125rem;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

html body .caeft-tag-pill-static {
    cursor: default;
}

html body .caeft-tag-pill-compact {
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
}

html body .caeft-tag-pill-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

html body .caeft-tag-pill:has(.caeft-tag-pill-input:checked) {
    border-color: var(--bs-primary, #e91e63);
    background: rgba(233, 30, 99, 0.08);
    color: #344767;
}

html body .caeft-tag-pill-label {
    font-weight: 600;
}

html body .caeft-tag-pill-meta,
html body .caeft-tag-pill-action {
    font-size: 0.75rem;
    font-weight: 500;
}

html body .caeft-tag-pill-action {
    color: var(--bs-primary, #e91e63);
    text-decoration: none;
}

html body .caeft-tag-pill-action:hover {
    text-decoration: underline;
}

/* User form: firms field as searchable multi-select with removable tags */
html body .user-organisation-select + .select2-container,
html body select[data-user-organisation-select] + .select2-container {
    width: 100% !important;
}

html body .select2-container--bootstrap .select2-selection--multiple {
    min-height: 2.5rem;
    border: 1px solid #d2d6da;
    border-radius: 0.375rem;
    padding: 0.25rem 0.35rem;
}

html body .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.15rem 0.25rem 0.15rem 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(233, 30, 99, 0.35);
    background: rgba(233, 30, 99, 0.08);
    color: #344767;
    font-size: 0.8125rem;
    font-weight: 600;
}

html body .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove {
    color: #8392ab;
    margin-right: 0;
    font-weight: 700;
}

html body .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #344767;
}

html body .select2-container--bootstrap.select2-container--focus .select2-selection,
html body .select2-container--bootstrap.select2-container--open .select2-selection {
    border-color: var(--bs-primary, #e91e63);
    box-shadow: 0 0 0 0.15rem rgba(233, 30, 99, 0.15);
}

/* -------------------------------------------------------------------------- */
/* Detail pages: grouped read-only data (KYC assess, client info, payments)   */
/* -------------------------------------------------------------------------- */
html body .caeft-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

html body .caeft-detail-section {
    background: #fff;
    border: 1px solid #e8e9ed;
    border-radius: 12px;
    overflow: hidden;
}

html body .caeft-detail-section__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eef0f3;
    background: #fafbfc;
}

html body .caeft-detail-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #344767;
}

html body .caeft-detail-section__icon {
    font-size: 1.125rem;
    color: #67748e;
}

html body .caeft-detail-section__subtitle {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #67748e;
}

html body .caeft-detail-section__body {
    padding: 1.25rem;
}

html body .caeft-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.875rem;
}

html body .caeft-detail-grid--2 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

html body .caeft-detail-field {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 0.75rem 0.875rem;
    background: #fff;
    min-height: 100%;
}

html body .caeft-detail-field--wide {
    grid-column: 1 / -1;
}

html body .caeft-detail-field__label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8392ab;
    margin-bottom: 0.35rem;
}

html body .caeft-detail-field__value {
    font-size: 0.9375rem;
    color: #344767;
    line-height: 1.45;
    word-break: break-word;
}

html body .caeft-detail-field__value p:last-child {
    margin-bottom: 0;
}

html body .caeft-detail-field__hint {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #67748e;
}

html body .caeft-detail-subsection {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #eef0f3;
}

html body .caeft-detail-subsection__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #67748e;
    margin-bottom: 0.75rem;
}

html body .caeft-detail-actions {
    padding: 1rem 1.25rem;
    border: 1px solid #e8e9ed;
    border-radius: 12px;
    background: #fafbfc;
}

html body .caeft-detail-address-card {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    background: #fcfcfd;
    height: 100%;
}

html body .caeft-detail-address-card__title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8392ab;
    margin-bottom: 0.5rem;
}

html body .caeft-detail-documents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

html body .caeft-detail-documents__group-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #67748e;
    margin-bottom: 0.75rem;
}

html.theme-dark html body .caeft-detail-section,
html.theme-dark body .caeft-detail-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark html body .caeft-detail-section__header,
html.theme-dark body .caeft-detail-section__header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark html body .caeft-detail-section__title,
html.theme-dark body .caeft-detail-section__title,
html.theme-dark html body .caeft-detail-field__value,
html.theme-dark body .caeft-detail-field__value {
    color: #e5e7eb;
}

html.theme-dark html body .caeft-detail-field,
html.theme-dark body .caeft-detail-field,
html.theme-dark html body .caeft-detail-address-card,
html.theme-dark body .caeft-detail-address-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark html body .caeft-detail-actions,
html.theme-dark body .caeft-detail-actions {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.caeft-section-tabs .nav-link {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.consumer-closed-matters .table tbody tr {
  color: var(--bs-secondary-color, #6c757d);
}

.consumer-closed-matters .table tbody tr .btn {
  opacity: 0.85;
}

html body .consumer-information-accordion,
html body .company-information-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

html body .consumer-information-accordion .accordion-item,
html body .company-information-accordion .accordion-item {
  border: 1px solid #e8e9ed;
  border-radius: 12px;
  overflow: hidden;
}

html body .consumer-information-accordion .accordion-button,
html body .company-information-accordion .accordion-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #344767;
  background: #fafbfc;
  box-shadow: none;
  padding: 1rem 1.25rem;
}

html body .consumer-information-accordion .accordion-button::after,
html body .company-information-accordion .accordion-button::after {
  display: none;
}

html body .consumer-information-accordion .consumer-accordion__label,
html body .company-information-accordion .company-accordion__label {
  flex: 1;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 600;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
}

html body .consumer-information-accordion .consumer-accordion__indicator,
html body .company-information-accordion .company-accordion__indicator {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: #67748e;
  transition: transform 0.2s ease;
}

html body .consumer-information-accordion .accordion-button:not(.collapsed) .consumer-accordion__indicator,
html body .company-information-accordion .accordion-button:not(.collapsed) .company-accordion__indicator {
  transform: rotate(180deg);
}

html body .consumer-information-accordion .accordion-button:not(.collapsed),
html body .company-information-accordion .accordion-button:not(.collapsed) {
  color: #344767;
  background: #f0f2f5;
}

html body .consumer-information-accordion .accordion-body,
html body .company-information-accordion .accordion-body {
  padding: 1.25rem;
  background: #fff;
}

html body .consumer-information-accordion .caeft-detail-stack {
  gap: 1rem;
}

html.theme-dark html body .consumer-information-accordion .accordion-item,
html.theme-dark html body .company-information-accordion .accordion-item {
  border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark html body .consumer-information-accordion .accordion-button,
html.theme-dark html body .company-information-accordion .accordion-button {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
}

html.theme-dark html body .consumer-information-accordion .accordion-button:not(.collapsed),
html.theme-dark html body .company-information-accordion .accordion-button:not(.collapsed) {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.06);
}

html.theme-dark html body .consumer-information-accordion .accordion-body,
html.theme-dark html body .company-information-accordion .accordion-body {
  background: #0f172a;
  color: #e5e7eb;
}

/* caeft-tag-pill dark mode */
html.theme-dark html body .caeft-tag-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark html body .caeft-tag-pill:has(.caeft-tag-pill-input:checked) {
  background: rgba(233, 30, 99, 0.15);
  color: #e5e7eb;
}

/* Select2 dark mode */
html.theme-dark html body .select2-container--bootstrap .select2-selection--multiple {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark html body .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
  background: rgba(233, 30, 99, 0.15);
  border-color: rgba(233, 30, 99, 0.35);
  color: #e5e7eb;
}

html.theme-dark html body .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove {
  color: rgba(229, 231, 235, 0.7);
}

html.theme-dark html body .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #e5e7eb;
}

html.theme-dark .select2-dropdown {
  background-color: #1f2937;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark .select2-container--bootstrap .select2-results__option {
  color: #e5e7eb;
}

html.theme-dark .select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

html.theme-dark .select2-container--bootstrap .select2-search--dropdown .select2-search__field {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

/* System purge page */
.purge-select-table th:first-child,
.purge-select-table td:first-child {
  width: 72px;
  min-width: 72px;
  text-align: center;
  vertical-align: middle;
}

.purge-select-table .purge-select-checkbox {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  cursor: pointer;
  border: 2px solid #6c757d;
  background-color: #fff;
  flex-shrink: 0;
}

.purge-select-table .purge-select-checkbox:checked {
  background-color: #dc3545;
  border-color: #dc3545;
}

.purge-select-table .purge-select-checkbox:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.purge-select-table tbody tr.purge-row-selectable {
  cursor: pointer;
}

.purge-select-table tbody tr.purge-row-selected {
  background-color: rgba(220, 53, 69, 0.08);
}

.purge-select-table tbody tr.purge-row-selectable:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.purge-select-table tbody tr.purge-row-selected:hover {
  background-color: rgba(220, 53, 69, 0.12);
}

.purge-selection-toolbar {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.purge-selection-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dee2e6;
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
}

.purge-selection-count-badge.has-selection {
  border-color: #dc3545;
  color: #dc3545;
  background: rgba(220, 53, 69, 0.06);
}

html.theme-dark .purge-select-table .purge-select-checkbox {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.4);
}

html.theme-dark .purge-select-table tbody tr.purge-row-selectable:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

html.theme-dark .purge-selection-toolbar {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .purge-selection-count-badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.theme-dark .purge-selection-count-badge.has-selection {
  border-color: #dc3545;
  color: #f87171;
  background: rgba(220, 53, 69, 0.12);
}

/* Reminder calendar view presets: selected tab must stay readable on theme primary. */
.app-shell-content .card-header .btn-group > .btn.btn-primary,
.app-shell-content .card-header .btn-group > a.btn.btn-primary {
  color: #fff !important;
}

/* Sanlam Multi Data partner portal (wizard-aligned chrome) */
body.smd-portal-screen .smd-portal__brand-divider {
  display: inline-block;
  width: 1px;
  height: 1.1rem;
  background: rgba(148, 163, 184, 0.55);
  margin: 0 0.15rem 0 0.35rem;
}

body.smd-portal-screen .smd-portal__brand-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #475569;
}

body.smd-portal-screen .smd-portal__user {
  color: #64748b;
}

html.theme-dark body.smd-portal-screen .smd-portal__brand-label,
html.theme-dark body.smd-portal-screen .smd-portal__user {
  color: rgba(229, 231, 235, 0.7);
}

html.theme-dark body.smd-portal-screen .smd-portal__brand-divider {
  background: rgba(148, 163, 184, 0.35);
}

body.smd-portal-screen .caeft-wizard__card {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* Soft UI alert/badge gradients are overridden later by Bootstrap subtle vars.
   Force the Solid Soft UI look on the SMD portal so flashes and status pills read clearly. */
body.smd-portal-screen .alert.alert-success,
body.smd-portal-screen .alert.alert-danger,
body.smd-portal-screen .alert.alert-warning,
body.smd-portal-screen .alert.alert-info,
body.smd-portal-screen .alert.alert-secondary,
body.smd-portal-screen .alert.alert-primary {
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body.smd-portal-screen .alert.alert-success {
  background-color: #43a047 !important;
  background-image: linear-gradient(195deg, #66bb6a 0%, #43a047 100%) !important;
}

body.smd-portal-screen .alert.alert-danger {
  background-color: #e53935 !important;
  background-image: linear-gradient(195deg, #ef5350 0%, #e53935 100%) !important;
}

body.smd-portal-screen .alert.alert-warning {
  background-color: #fb8c00 !important;
  background-image: linear-gradient(195deg, #ffa726 0%, #fb8c00 100%) !important;
}

body.smd-portal-screen .alert.alert-info {
  background-color: #1a73e8 !important;
  background-image: linear-gradient(195deg, #49a3f1 0%, #1a73e8 100%) !important;
}

body.smd-portal-screen .alert.alert-secondary {
  background-color: #495361 !important;
  background-image: linear-gradient(195deg, #747b8a 0%, #495361 100%) !important;
}

body.smd-portal-screen .alert.alert-primary {
  background-color: #009205 !important;
  background-image: linear-gradient(195deg, #00c60e 0%, #009205 100%) !important;
}

body.smd-portal-screen .badge.bg-gradient-success,
body.smd-portal-screen .badge.bg-gradient-danger,
body.smd-portal-screen .badge.bg-gradient-warning,
body.smd-portal-screen .badge.bg-gradient-info,
body.smd-portal-screen .badge.bg-gradient-secondary,
body.smd-portal-screen .badge.bg-gradient-primary {
  color: #fff !important;
  border: 0;
}

body.smd-portal-screen .badge.bg-gradient-success {
  background-color: #43a047 !important;
  background-image: linear-gradient(195deg, #66bb6a 0%, #43a047 100%) !important;
}

body.smd-portal-screen .badge.bg-gradient-danger {
  background-color: #e53935 !important;
  background-image: linear-gradient(195deg, #ef5350 0%, #e53935 100%) !important;
}

body.smd-portal-screen .badge.bg-gradient-warning {
  background-color: #fb8c00 !important;
  background-image: linear-gradient(195deg, #ffa726 0%, #fb8c00 100%) !important;
}

body.smd-portal-screen .badge.bg-gradient-info {
  background-color: #1a73e8 !important;
  background-image: linear-gradient(195deg, #49a3f1 0%, #1a73e8 100%) !important;
}

body.smd-portal-screen .badge.bg-gradient-secondary {
  background-color: #495361 !important;
  background-image: linear-gradient(195deg, #747b8a 0%, #495361 100%) !important;
}

body.smd-portal-screen .badge.bg-gradient-primary {
  background-color: #009205 !important;
  background-image: linear-gradient(195deg, #00c60e 0%, #009205 100%) !important;
}
