body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Accent color placeholder, we'll wire from settings later */
.btn-primary {
  /* Bootstrap primary override if desired */
}

/* Accent color is defined dynamically in base.html from Settings.
   This is only a neutral fallback if that injection fails. */
:root {
  /* Accent */
  --accent-color: #7c3aed; /* fallback only; real value injected from base */
  --field-radius: 14px;
  --field-border-light: rgba(100, 116, 139, 0.42);
  --field-bg-light: #ffffff;
  --field-bg-light-hover: color-mix(in srgb, var(--accent-color) 4%, #ffffff 96%);
  --field-bg-light-focus: color-mix(in srgb, var(--accent-color) 7%, #ffffff 93%);
  --field-text-light: #1f2937;
  --field-placeholder-light: #6b7280;

  /* Surface system (desktop foundation) */
  --surface-bg: #f5f7fb;
  --surface-card: #ffffff;
  --surface-border: rgba(0, 0, 0, 0.08);

  /* Elevation shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.12);
  --card-drop-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);

  /* Radius system */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --accent-glow-shadow:
    0 0 0 2px var(--accent-color),
    0 0 70px color-mix(in srgb, var(--accent-color) 85%, transparent);
  --card-shell-ring-rest:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 20%, rgba(0, 0, 0, 0.08));
  --card-shell-glow-rest:
    0 0 16px color-mix(in srgb, var(--accent-color) 14%, transparent);
  --card-shell-ring-hover:
    0 0 0 3px color-mix(in srgb, var(--accent-color) 84%, transparent);
  --card-shell-glow-hover:
    0 0 58px color-mix(in srgb, var(--accent-color) 42%, transparent);
}

/* Light mode glow enhancement so spread is visible against white surfaces */
html:not(.dark-mode) {
  --accent-glow-shadow:
    0 0 0 2px var(--accent-color),
    0 0 110px color-mix(in srgb, var(--accent-color) 90%, transparent);
}

html.dark-mode {
  --surface-card: #111821;
  --surface-border: rgba(228, 236, 248, 0.2);
  --card-drop-shadow: 0 16px 44px rgba(0, 0, 0, 0.52);
  --card-shell-ring-rest:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 26%, rgba(255, 255, 255, 0.05));
  --card-shell-glow-rest:
    0 0 20px color-mix(in srgb, var(--accent-color) 20%, transparent);
  --card-shell-ring-hover:
    0 0 0 3px color-mix(in srgb, var(--accent-color) 88%, transparent);
  --card-shell-glow-hover:
    0 0 68px color-mix(in srgb, var(--accent-color) 50%, transparent);
}

/* -------------------------------------------------------------------------
   Workspace shell foundation
   ------------------------------------------------------------------------- */

:root {
  --workspace-shell-bg: #eef2f7;
  --workspace-topbar-height: 30px;
  --workspace-sticky-gap: 0.95rem;
  --workspace-sticky-gap-narrow: 0.55rem;
  --workspace-sidebar-width: 216px;
  --workspace-sidebar-collapsed-width: 88px;
  --workspace-shell-border: rgba(15, 23, 42, 0.08);
  --workspace-shell-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --workspace-sidebar-bg: #182339;
  --workspace-sidebar-fg: rgba(255, 255, 255, 0.92);
  --workspace-sidebar-muted: rgba(226, 232, 240, 0.62);
  --workspace-sidebar-active: color-mix(in srgb, var(--accent-color) 82%, #ffffff 18%);
  --workspace-topbar-bg: rgba(255, 255, 255, 0.92);
  --workspace-topbar-border: rgba(15, 23, 42, 0.08);
  --workspace-surface-bg: rgba(255, 255, 255, 0.92);
  --workspace-surface-alt: rgba(246, 248, 252, 0.96);
  --workspace-surface-muted: rgba(100, 116, 139, 0.72);
  --workspace-surface-strong: #172033;
  --workspace-row-hover: color-mix(in srgb, var(--accent-color) 10%, #ffffff 90%);
  --workspace-row-zebra: rgba(99, 102, 241, 0.04);
  --workspace-row-selected: color-mix(in srgb, var(--accent-color) 16%, #ffffff 84%);
  --workspace-row-border: rgba(148, 163, 184, 0.18);
  --workspace-hover-surface: color-mix(in srgb, var(--accent-color) 8%, #ffffff 92%);
  --workspace-hover-border: color-mix(in srgb, var(--accent-color) 38%, rgba(148, 163, 184, 0.3));
  --workspace-hover-shadow: 0 10px 24px color-mix(in srgb, var(--accent-color) 16%, transparent);
  --workspace-warning-border: #f59e0b;
  --workspace-warning-bg: rgba(245, 158, 11, 0.08);
  --workspace-danger-border: #ef4444;
  --workspace-danger-bg: rgba(239, 68, 68, 0.08);
  --workspace-success-border: #16a34a;
  --workspace-success-bg: rgba(22, 163, 74, 0.08);
  --workspace-radius-xl: 24px;
}

html.dark-mode {
  --workspace-shell-bg: #111827;
  --workspace-shell-border: rgba(255, 255, 255, 0.08);
  --workspace-shell-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  --workspace-sidebar-bg: #0d1629;
  --workspace-sidebar-fg: rgba(248, 250, 252, 0.94);
  --workspace-sidebar-muted: rgba(203, 213, 225, 0.62);
  --workspace-topbar-bg: rgba(17, 24, 39, 0.9);
  --workspace-topbar-border: rgba(255, 255, 255, 0.08);
  --workspace-surface-bg: rgba(17, 24, 39, 0.88);
  --workspace-surface-alt: rgba(23, 31, 48, 0.96);
  --workspace-surface-muted: rgba(203, 213, 225, 0.72);
  --workspace-surface-strong: #f8fafc;
  --workspace-row-hover: color-mix(in srgb, var(--accent-color) 12%, rgba(17, 24, 39, 0.94) 88%);
  --workspace-row-zebra: rgba(148, 163, 184, 0.06);
  --workspace-row-selected: color-mix(in srgb, var(--accent-color) 20%, rgba(17, 24, 39, 0.8) 80%);
  --workspace-row-border: rgba(255, 255, 255, 0.08);
  --workspace-hover-surface: color-mix(in srgb, var(--accent-color) 12%, rgba(17, 24, 39, 0.94) 88%);
  --workspace-hover-border: color-mix(in srgb, var(--accent-color) 48%, rgba(255, 255, 255, 0.12));
  --workspace-hover-shadow: 0 10px 28px color-mix(in srgb, var(--accent-color) 22%, transparent);
  --workspace-warning-bg: rgba(245, 158, 11, 0.14);
  --workspace-danger-bg: rgba(239, 68, 68, 0.14);
  --workspace-success-bg: rgba(22, 163, 74, 0.14);
}

.impact-body {
  min-height: 100vh;
  background: var(--workspace-shell-bg) !important;
  color: var(--workspace-surface-strong);
}

.workspace-shell {
  display: grid;
  grid-template-columns: var(--workspace-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent-color) 11%, transparent) 0%, transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--workspace-shell-bg) 92%, #ffffff 8%) 0%, var(--workspace-shell-bg) 100%);
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: auto;
  align-self: start;
  padding: 0.1rem 0.95rem 1.15rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--workspace-sidebar-bg) 95%, #22304b 5%) 0%, var(--workspace-sidebar-bg) 100%);
  color: var(--workspace-sidebar-fg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 1150;
  transition: width 220ms ease, transform 220ms ease, padding 220ms ease;
}

.workspace-sidebar,
.workspace-sidebar a,
.workspace-sidebar button,
.workspace-sidebar .workspace-nav-label,
.workspace-sidebar .workspace-nav-icon,
.workspace-sidebar .workspace-brand-link,
.workspace-sidebar .workspace-brand-meta,
.workspace-sidebar .workspace-sidebar-empty,
.workspace-sidebar .workspace-recent-claim-meta {
  color: var(--workspace-sidebar-fg) !important;
}

.workspace-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: calc(100vh - 2.3rem);
  height: auto;
}

.workspace-sidebar-brand {
  padding: 0 0.25rem 0.15rem;
}

.workspace-brand-link {
  display: flex;
  justify-content: center;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.workspace-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workspace-brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
}

.workspace-brand-meta {
  color: var(--workspace-sidebar-muted);
  font-size: 0.74rem;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workspace-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.workspace-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 1rem;
  color: var(--workspace-sidebar-fg);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 180ms ease;
}

html:not(.workspace-sidebar-collapsed) .workspace-nav {
  gap: 0.28rem;
}

html:not(.workspace-sidebar-collapsed) .workspace-nav-link {
  padding-top: 0.56rem;
  padding-bottom: 0.56rem;
}

.workspace-nav-link:hover,
.workspace-nav-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
  outline: none;
}

.workspace-nav-link.is-active {
  color: #ffffff;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 62%, rgba(255, 255, 255, 0.1)) 0%, color-mix(in srgb, var(--accent-color) 36%, rgba(255, 255, 255, 0.08)) 100%);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

.workspace-nav-icon {
  width: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.92;
  color: inherit;
}

.workspace-nav-label {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: inherit;
}

.workspace-sidebar-utility {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.7rem;
}

.workspace-sidebar-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.65rem;
}

.workspace-sidebar-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-sidebar-section-caret {
  transition: transform 150ms ease;
}

.workspace-sidebar-section-toggle[aria-expanded="false"] .workspace-sidebar-section-caret {
  transform: rotate(-90deg);
}

.workspace-sidebar-section-body {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.workspace-recent-claims-list {
  display: grid;
  gap: 0.45rem;
}

.workspace-recent-claim {
  display: grid;
  gap: 0.12rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  text-decoration: none;
  transition: background-color 150ms ease, transform 150ms ease;
}

.workspace-recent-claim:hover,
.workspace-recent-claim:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
  outline: none;
}

.workspace-recent-claim-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
}

.workspace-recent-claim-meta,
.workspace-sidebar-empty {
  color: var(--workspace-sidebar-muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.workspace-recent-claim-meta {
  color: rgba(255, 255, 255, 0.72);
}

.workspace-recent-claim:hover .workspace-recent-claim-name,
.workspace-recent-claim:hover .workspace-recent-claim-meta,
.workspace-recent-claim:focus-visible .workspace-recent-claim-name,
.workspace-recent-claim:focus-visible .workspace-recent-claim-meta {
  color: var(--accent-color);
}

.workspace-sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.7rem;
  display: grid;
  gap: 0.7rem;
}

.workspace-sidebar-theme {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  min-height: 2.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.workspace-sidebar-theme:hover,
.workspace-sidebar-theme:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in srgb, var(--accent-color) 44%, rgba(255, 255, 255, 0.12));
  color: #ffffff;
  outline: none;
  transform: translateX(2px);
}

.workspace-sidebar-theme-icon {
  position: relative;
  display: inline-block;
  width: 1.02rem;
  height: 1.02rem;
  flex: 0 0 1.02rem;
  border-radius: 999px;
  border: 1.7px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
  box-sizing: border-box;
  overflow: hidden;
}

.workspace-sidebar-theme-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.workspace-frame {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px) auto;
  gap: 0.55rem;
  align-items: center;
  min-height: 0;
  padding: 0.08rem 0.9rem;
  background: var(--workspace-topbar-bg);
  border-bottom: 1px solid var(--workspace-topbar-border);
  backdrop-filter: blur(16px);
}

.workspace-topbar-left,
.workspace-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.workspace-topbar-actions {
  justify-self: end;
  justify-content: flex-end;
}

.workspace-heading {
  min-width: 0;
}

.workspace-heading-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--workspace-surface-strong);
}

.workspace-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-width: 0;
  color: var(--workspace-surface-muted);
  font-size: 0.76rem;
}

.workspace-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.workspace-breadcrumbs a:hover {
  color: var(--accent-color);
}

.workspace-shell-toggle,
.workspace-icon-btn,
.workspace-logout-btn,
.workspace-topbar-primary {
  border: 1px solid var(--workspace-row-border);
  background: var(--workspace-surface-bg);
  color: var(--workspace-surface-strong);
  border-radius: 999px;
  padding: 0.2rem 0.66rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.workspace-shell-toggle:hover,
.workspace-icon-btn:hover,
.workspace-logout-btn:hover,
.workspace-topbar-primary:hover,
.workspace-shell-toggle:focus-visible,
.workspace-icon-btn:focus-visible,
.workspace-logout-btn:focus-visible,
.workspace-topbar-primary:focus-visible {
  border-color: var(--workspace-hover-border);
  background: var(--workspace-hover-surface);
  color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: var(--workspace-hover-shadow);
  outline: none;
}

.workspace-topbar-primary {
  background: color-mix(in srgb, var(--accent-color) 12%, var(--workspace-surface-bg) 88%);
  border-color: color-mix(in srgb, var(--accent-color) 24%, var(--workspace-row-border));
}

html:not(.dark-mode) #clarityChatToggle.workspace-icon-btn {
  border-width: 2px;
  border-color: var(--field-border-light);
}

.workspace-topbar-search {
  min-width: 0;
}

.workspace-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 1.72rem;
  padding: 0 0.55rem;
  border: 1px solid var(--workspace-row-border);
  border-radius: 0.82rem;
  background: var(--workspace-surface-bg);
  box-shadow: var(--shadow-sm);
}

.workspace-search:focus-within {
  border-color: color-mix(in srgb, var(--accent-color) 52%, var(--workspace-row-border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 12%, transparent), var(--shadow-sm);
}

.workspace-search-icon,
.workspace-search-shortcut {
  color: var(--workspace-surface-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.workspace-search-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--workspace-surface-strong);
  font-size: 0.8rem;
}

.workspace-search-input:focus {
  outline: none;
}

.workspace-search-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0.25rem;
  padding: 0.45rem;
  border: 1px solid var(--workspace-row-border);
  border-radius: 1rem;
  background: var(--workspace-surface-alt);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  z-index: 1200;
}

.workspace-search-result {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0.85rem;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
  text-align: left;
  color: inherit;
}

.workspace-search-result:hover,
.workspace-search-result:focus-visible,
.workspace-search-result.is-active {
  background: var(--workspace-row-hover);
  outline: none;
}

.workspace-search-result-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
  color: var(--accent-color);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace-search-result-copy {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.workspace-search-result-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.workspace-search-result-meta,
.workspace-search-empty {
  font-size: 0.76rem;
  color: var(--workspace-surface-muted);
}

.workspace-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.25rem;
}

.workspace-user-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-color) 22%, transparent);
  color: var(--accent-color);
  font-size: 0.74rem;
  font-weight: 700;
}

.workspace-user-meta {
  display: grid;
  gap: 0.08rem;
}

.workspace-user-name {
  font-size: 0.82rem;
  font-weight: 700;
}

.workspace-user-role {
  font-size: 0.72rem;
  color: var(--workspace-surface-muted);
}

.workspace-sidebar-user {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
}

.workspace-sidebar-user-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workspace-sidebar-user .workspace-user-avatar {
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent-color) 24%, rgba(255, 255, 255, 0.08));
  color: #ffffff;
}

.workspace-sidebar-user-meta {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.workspace-sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.workspace-sidebar-user-role {
  font-size: 0.74rem;
  color: var(--workspace-sidebar-muted);
  line-height: 1.2;
}

.workspace-sidebar-logout {
  margin: 0;
}

.workspace-sidebar-logout-btn {
  width: 100%;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: none;
}

.workspace-sidebar-logout-btn:hover,
.workspace-sidebar-logout-btn:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in srgb, var(--accent-color) 44%, rgba(255, 255, 255, 0.12));
  box-shadow: none;
}

.workspace-main {
  min-width: 0;
  min-height: calc(100vh - var(--workspace-topbar-height));
  padding: 0 1.35rem 1.35rem;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent-color) 8%, transparent) 0%, transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--workspace-shell-bg) 96%, transparent 4%) 0%, var(--workspace-shell-bg) 100%);
}

.workspace-pagebar {
  position: sticky;
  top: calc(var(--workspace-topbar-height) + var(--workspace-sticky-gap));
  z-index: 1090;
  margin: 0 -0.25rem;
  padding: 0.9rem 0.25rem 0.75rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--workspace-shell-bg) 94%, transparent 6%) 0%, color-mix(in srgb, var(--workspace-shell-bg) 72%, transparent 28%) 100%);
  backdrop-filter: blur(12px);
}

.workspace-pagebar:has(.claims-toolbar) {
  position: sticky;
  top: calc(var(--workspace-topbar-height) + var(--workspace-sticky-gap));
  z-index: 1095;
  margin: 0.35rem 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--workspace-row-border);
  border-radius: 1.35rem;
  background: var(--workspace-surface-bg);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1), var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html:not(.dark-mode) .workspace-pagebar:has(.claims-toolbar) {
  background: rgba(255, 255, 255, 0.76);
  border-color: color-mix(in srgb, var(--workspace-row-border) 82%, rgba(255, 255, 255, 0.5));
}

.workspace-pagebar:empty {
  display: none;
}

.workspace-surface,
.surface-card {
  background: var(--workspace-surface-bg);
  border: 1px solid var(--workspace-row-border);
  border-radius: var(--workspace-radius-xl);
  box-shadow: var(--workspace-shell-shadow);
}

.surface-card-header {
  padding: 1.1rem 1.25rem 0.95rem;
  border-bottom: 1px solid var(--workspace-row-border);
}

.surface-card-body {
  padding: 1.2rem 1.25rem 1.25rem;
}

.data-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.data-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.workspace-sidebar-collapsed .workspace-shell {
  grid-template-columns: var(--workspace-sidebar-collapsed-width) minmax(0, 1fr);
}

.workspace-sidebar-collapsed .workspace-sidebar {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.workspace-sidebar-collapsed .workspace-brand-copy,
.workspace-sidebar-collapsed .workspace-nav-label,
.workspace-sidebar-collapsed .workspace-sidebar-section {
  display: none;
}

.workspace-sidebar-collapsed .workspace-sidebar-brand {
  display: none;
}

.workspace-sidebar-collapsed .workspace-sidebar-theme-label {
  display: none;
}

.workspace-sidebar-collapsed .workspace-nav-link {
  justify-content: center;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.workspace-sidebar-collapsed .workspace-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  font-size: 1.55rem;
  line-height: 1;
  overflow: visible;
}

.workspace-sidebar-collapsed .workspace-sidebar-theme {
  width: 2.85rem;
  min-height: 2.85rem;
  justify-content: center;
  justify-self: center;
  padding: 0;
  border-radius: 0.95rem;
}

.workspace-sidebar-collapsed .workspace-sidebar-footer {
  justify-items: center;
}

.workspace-sidebar-collapsed .workspace-sidebar-user {
  width: 100%;
  padding: 0.55rem 0.45rem 0.5rem;
  gap: 0.45rem;
  justify-items: center;
}

.workspace-sidebar-collapsed .workspace-sidebar-user-main {
  justify-content: center;
}

.workspace-sidebar-collapsed .workspace-sidebar-user-meta {
  display: none;
}

.workspace-sidebar-collapsed .workspace-sidebar-logout-btn {
  width: auto;
  min-height: 2rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  border-radius: 999px;
}

@media (max-width: 1199.98px) {
  :root {
    --workspace-topbar-height: 60px;
  }

  .workspace-topbar {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
    grid-template-areas:
      "heading actions"
      "search search";
    min-height: auto;
    gap: 0.72rem;
    padding: 0.5rem 1rem;
  }

  .workspace-topbar-left {
    grid-area: heading;
  }

  .workspace-topbar-search {
    grid-area: search;
  }

  .workspace-topbar-actions {
    grid-area: actions;
    justify-content: flex-end;
  }
}

@media (max-width: 991.98px) {
  .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-sidebar {
    position: fixed;
    left: 0;
    width: min(82vw, 300px);
    transform: translateX(0);
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.22);
  }

  .workspace-sidebar-collapsed .workspace-sidebar {
    transform: translateX(-100%);
  }

  .workspace-sidebar-collapsed .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-sidebar-collapsed .workspace-brand-copy,
  .workspace-sidebar-collapsed .workspace-nav-label,
  .workspace-sidebar-collapsed .workspace-sidebar-section {
    display: initial;
  }

  .workspace-topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "heading"
      "search"
      "actions";
    gap: 0.85rem;
    min-height: auto;
    padding: 0.72rem 1rem;
  }

  .workspace-topbar-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .workspace-main {
    padding: 0 1rem 1rem;
  }

  .workspace-pagebar {
    top: calc(170px + var(--workspace-sticky-gap-narrow));
  }
}

/* -------------------------------------------------------------------------
   Shared workspace surface primitives
   ------------------------------------------------------------------------- */

.workspace-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.workspace-pill--neutral {
  color: var(--workspace-surface-muted);
  background: color-mix(in srgb, var(--workspace-surface-muted) 12%, transparent);
  border-color: color-mix(in srgb, var(--workspace-surface-muted) 22%, transparent);
}

.workspace-pill--success {
  color: var(--workspace-success-border);
  background: var(--workspace-success-bg);
  border-color: color-mix(in srgb, var(--workspace-success-border) 35%, transparent);
}

.workspace-pill--warning {
  color: #b45309;
  background: var(--workspace-warning-bg);
  border-color: color-mix(in srgb, var(--workspace-warning-border) 35%, transparent);
}

.workspace-pill--muted {
  color: var(--workspace-surface-muted);
  background: color-mix(in srgb, var(--workspace-surface-muted) 10%, transparent);
  border-color: color-mix(in srgb, var(--workspace-surface-muted) 18%, transparent);
}

.workspace-empty-state {
  min-height: 18rem;
  display: grid;
  place-content: center;
  gap: 0.55rem;
  text-align: center;
  color: var(--workspace-surface-muted);
}

.workspace-empty-state h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--workspace-surface-strong);
}

.workspace-empty-state p {
  margin: 0;
  max-width: 32rem;
}

.row-attention-warning,
.row-attention-danger {
  position: relative;
}

.row-attention-warning::before,
.row-attention-danger::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 999px;
}

.row-attention-warning::before {
  background: var(--workspace-warning-border);
}

.row-attention-danger::before {
  background: var(--workspace-danger-border);
}

.claims-save-success {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.28), 0 18px 40px rgba(22, 163, 74, 0.18);
}

.claims-save-fail {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.26), 0 18px 40px rgba(239, 68, 68, 0.18);
}

/* -------------------------------------------------------------------------
   Claims list workspace
   ------------------------------------------------------------------------- */

.claims-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: calc(100% - 2.625rem);
  margin-inline: auto;
}

.workspace-pagebar:has(.claims-toolbar) .claims-toolbar {
  width: 100%;
  margin-inline: 0;
}

.claims-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.claims-queue-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.claims-queue-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--workspace-row-border);
  background: var(--workspace-surface-bg);
  color: var(--workspace-surface-strong);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.claims-queue-tab:hover,
.claims-queue-tab:focus-visible {
  background: var(--workspace-hover-surface);
  border-color: color-mix(in srgb, var(--accent-color) 42%, var(--workspace-row-border));
  color: var(--accent-color);
  box-shadow: var(--workspace-hover-shadow);
  outline: none;
}

.claims-queue-tab.is-active {
  background: color-mix(in srgb, var(--accent-color) 14%, var(--workspace-surface-bg) 86%);
  color: var(--accent-color);
  border-color: color-mix(in srgb, var(--accent-color) 34%, var(--workspace-row-border));
}

.claims-toolbar-search,
.claims-toolbar-select {
  min-height: 2.45rem;
  border: 2px solid var(--field-border-light);
  border-radius: var(--field-radius);
  background: var(--field-bg-light);
  color: var(--field-text-light);
  padding: 0.5rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.claims-toolbar-search {
  min-width: 17rem;
}

.claims-toolbar-search:focus,
.claims-toolbar-select:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--field-bg-light-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 18%, transparent), var(--shadow-sm);
}

.claims-toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 0.95rem;
  border: 1px solid var(--workspace-row-border);
  background: var(--workspace-surface-bg);
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 600;
}

.claims-toolbar-clear {
  min-height: 2.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 0.95rem;
  border: 1px solid var(--workspace-row-border);
  background: transparent;
  color: var(--workspace-surface-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.claims-toolbar-clear:hover,
.claims-toolbar-clear:focus-visible {
  background: var(--workspace-hover-surface);
  color: var(--accent-color);
  border-color: color-mix(in srgb, var(--accent-color) 42%, var(--workspace-row-border));
  box-shadow: var(--workspace-hover-shadow);
  outline: none;
}

.claims-toolbar-toggle:hover,
.claims-toolbar-toggle:focus-visible {
  background: var(--workspace-hover-surface);
  border-color: color-mix(in srgb, var(--accent-color) 42%, var(--workspace-row-border));
  box-shadow: var(--workspace-hover-shadow);
  outline: none;
}

.claims-workspace {
  display: grid;
  gap: 1rem;
  min-height: 100%;
  min-width: 0;
}

.claims-surface {
  min-width: 0;
  max-width: 100%;
}

.claims-surface .surface-card-body {
  padding: 0;
  overflow: hidden;
  min-width: 0;
}

.claims-table-wrapper {
  overflow: auto;
  border-radius: inherit;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.claims-index-table {
  width: 100%;
  min-width: 50rem;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.claims-index-table .claims-col-date,
.claims-index-table .claims-col-status,
.claims-index-table .claims-col-due,
.claims-index-table .claims-col-activity,
.claims-index-table .claims-col-actions {
  width: 1%;
}

.claims-index-table .claims-col-primary {
  width: clamp(10rem, 18vw, 13rem);
}

.claims-index-table .claims-col-text {
  width: clamp(7rem, 11vw, 8.75rem);
}

.claims-index-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.6875rem 0.625rem 0.6375rem;
  background: var(--workspace-surface-alt);
  border-bottom: 1px solid var(--workspace-row-border);
  color: var(--workspace-surface-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
}

.claims-index-table thead th:first-child {
  border-top-left-radius: var(--workspace-radius-xl);
}

.claims-index-table thead th:last-child {
  border-top-right-radius: var(--workspace-radius-xl);
}

.claims-index-row {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.claims-index-row::before {
  display: none;
}

.claims-index-row:nth-child(even) {
  background: var(--workspace-row-zebra) !important;
}

.claims-index-row:hover {
  background: var(--workspace-row-hover) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 16%, transparent);
  outline: none !important;
}

html:not(.dark-mode) .form-control:hover,
html:not(.dark-mode) .form-select:hover,
html:not(.dark-mode) textarea:hover,
html:not(.dark-mode) input[type="text"]:hover,
html:not(.dark-mode) input[type="email"]:hover,
html:not(.dark-mode) input[type="tel"]:hover,
html:not(.dark-mode) input[type="number"]:hover,
html:not(.dark-mode) input[type="search"]:hover,
html:not(.dark-mode) input[type="date"]:hover,
html:not(.dark-mode) input[type="time"]:hover,
html:not(.dark-mode) input[type="datetime-local"]:hover,
html:not(.dark-mode) input[type="month"]:hover,
html:not(.dark-mode) input[type="week"]:hover,
html:not(.dark-mode) input[type="url"]:hover,
html:not(.dark-mode) input[type="password"]:hover,
html:not(.dark-mode) .ts-control:hover {
  border-color: color-mix(in srgb, var(--accent-color) 46%, rgba(70, 78, 90, 0.22)) !important;
  background: color-mix(in srgb, var(--accent-color) 7%, rgba(255, 255, 255, 0.96)) !important;
}

.claims-index-row.row-attention-warning {
  background:
    linear-gradient(90deg, var(--workspace-warning-bg) 0%, transparent 24%),
    var(--workspace-row-zebra) !important;
}

.claims-index-row.row-attention-danger {
  background:
    linear-gradient(90deg, var(--workspace-danger-bg) 0%, transparent 24%),
    var(--workspace-row-zebra) !important;
}

.claims-index-table td {
  position: relative;
  padding: 0.6875rem 0.625rem;
  border-bottom: 1px solid var(--workspace-row-border);
  vertical-align: top;
  color: var(--workspace-surface-strong);
  font-size: 0.88rem;
  text-align: left;
}

.claims-primary-cell {
  min-width: 0;
}

.claims-index-table td.claims-col-text {
  overflow-wrap: anywhere;
}

.claims-index-table td.claims-col-date,
.claims-index-table td.claims-col-status,
.claims-index-table td.claims-col-actions {
  white-space: nowrap;
}

.claims-index-table td.claims-col-due > :first-child,
.claims-index-table td.claims-col-activity > :first-child {
  white-space: nowrap;
}

.claims-primary-name {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.claims-primary-meta,
.claims-secondary-text {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: var(--workspace-surface-muted);
}

.claims-primary-link {
  color: var(--workspace-surface-strong);
  text-decoration: none;
  font-weight: 600;
}

.claims-primary-link:hover {
  color: var(--accent-color);
}

.claims-status-stack {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.claims-date-warning,
.claims-index-table td.claims-date-warning,
.claims-index-table td.claims-date-warning > :first-child,
.claims-index-table td.claims-date-warning > * {
  color: var(--workspace-warning-border) !important;
  font-weight: 700;
}

.claims-date-danger,
.claims-index-table td.claims-date-danger,
.claims-index-table td.claims-date-danger > :first-child,
.claims-index-table td.claims-date-danger > * {
  color: var(--workspace-danger-border) !important;
  font-weight: 700;
}

.claims-actions-col,
.claims-actions-cell {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}

.claims-index-row.row-attention-warning > td:first-child,
.claims-index-row.row-attention-danger > td:first-child {
  box-shadow: inset 4px 0 0 0 transparent;
}

.claims-index-row.row-attention-warning > td:first-child {
  box-shadow: inset 4px 0 0 0 var(--workspace-warning-border);
}

.claims-index-row.row-attention-danger > td:first-child {
  box-shadow: inset 4px 0 0 0 var(--workspace-danger-border);
}

.claims-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-wrap: nowrap;
}

.claims-row-menu {
  position: relative;
}

.claims-row-menu summary {
  list-style: none;
}

.claims-row-menu summary::-webkit-details-marker {
  display: none;
}

.claims-row-menu-trigger {
  min-height: 2rem;
  padding: 0.36rem 0.52rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 26%, var(--workspace-row-border));
  background: color-mix(in srgb, var(--accent-color) 8%, var(--workspace-surface-bg) 92%);
  color: var(--accent-color);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.claims-row-menu-trigger--secondary {
  border-color: var(--workspace-row-border);
  background: transparent;
  color: var(--workspace-surface-muted);
}

html:not(.dark-mode) .billing-table-surface .claims-row-menu-trigger--secondary {
  border-width: 2px;
  border-color: var(--field-border-light);
}

.claims-row-menu[open] .claims-row-menu-trigger {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 10%, transparent);
}

.claims-row-menu-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 13.5rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.4rem;
  border: 1px solid var(--workspace-row-border);
  border-radius: 1rem;
  background: var(--workspace-surface-alt);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  z-index: 8;
}

.claims-row-menu-popover.is-floating {
  position: fixed;
  top: var(--claims-row-menu-top, 0);
  left: var(--claims-row-menu-left, 0);
  right: auto;
  z-index: 4300;
}

.claims-row-menu-item {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 0;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--workspace-surface-strong);
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.claims-row-menu-item:hover,
.claims-row-menu-item:focus-visible {
  background: var(--workspace-row-hover);
  color: var(--accent-color);
  outline: none;
}

.claims-mobile-list {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.claims-mobile-card {
  position: relative;
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--workspace-row-border);
  border-radius: 1.1rem;
  background: var(--workspace-surface-bg);
  box-shadow: var(--shadow-sm);
}

.claims-mobile-card.row-attention-warning {
  background:
    linear-gradient(90deg, var(--workspace-warning-bg) 0%, transparent 38%),
    var(--workspace-surface-bg);
}

.claims-mobile-card.row-attention-danger {
  background:
    linear-gradient(90deg, var(--workspace-danger-bg) 0%, transparent 38%),
    var(--workspace-surface-bg);
}

.claims-mobile-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
}

.claims-mobile-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  font-size: 0.84rem;
}

.claims-mobile-card-grid > div {
  display: grid;
  gap: 0.12rem;
}

.claims-mobile-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--workspace-surface-muted);
}

.claims-mobile-card-actions {
  display: flex;
  gap: 0.55rem;
}

.claims-results-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.1rem 1.1rem;
  border-top: 1px solid var(--workspace-row-border);
  color: var(--workspace-surface-muted);
  font-size: 0.8rem;
}

@media (max-width: 991.98px) {
  .claims-toolbar {
    align-items: stretch;
  }

  .claims-toolbar-group {
    width: 100%;
  }

  .claims-toolbar-search {
    min-width: 0;
    flex: 1 1 100%;
  }

  .claims-mobile-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Day mode app canvas: medium gray behind white cards for stronger contrast */
html:not(.dark-mode) body.impact-body,
html:not(.dark-mode) .impact-main,
html:not(.dark-mode) #impactPageTransition {
  background-color: #c6cacf !important;
  background-image: none !important;
}

/* Dark mode app canvas: very dark gray (not pure black) for card contrast */
html.dark-mode body.impact-body,
html.dark-mode .impact-main,
html.dark-mode #impactPageTransition {
  background-color: #262a31 !important;
  background-image: none !important;
}

/* Navbar tab accent styling (light & dark) */
.navbar .nav-link {
  border: 2px solid transparent;
  border-radius: 999px; /* pill shape like action buttons */
  padding: 0.35rem 0.75rem;
  margin: 0 0.15rem;
  transition: 
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.22s ease,
    background 0.18s ease,
    transform 0.15s ease;
}

.navbar .nav-link.active {
  color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
}

.navbar .nav-link:hover {
  color: var(--accent-color) !important;
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
  box-shadow: var(--accent-glow-shadow);
  transform: translateY(-1px);
}

/* --------------------------------------------------
   Global Button System (Standardized across app)
   -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  vertical-align: middle;
  white-space: nowrap;
  border-radius: 999px !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.78rem; /* slightly smaller to match top-right toolbar buttons */
  letter-spacing: 0.02em;
  padding: 0.22rem 0.55rem; /* tighter button size */
  line-height: 1.1;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.22s ease,
    transform 0.12s ease;
}

/* Small buttons (table actions like Edit/Delete in rows) */
.btn-sm {
  font-size: 0.68rem !important;
  padding: 0.15rem 0.45rem !important;
  line-height: 1.05;
}

/* Toolbar buttons (Edit Claim etc.) */
.btn-toolbar {
  font-size: 0.8rem;
  padding: 0.24rem 0.6rem;
}

/* Standard action-row alignment helper */
.impact-action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.impact-action-row form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

/* Shared parent-card styling (core data edit/new pages) */
.impact-card.parent-card {
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(120,120,120,0.35);
  margin-left: 10px;
  margin-right: 10px;
  box-shadow: var(--card-drop-shadow);
  transition: box-shadow .18s ease, transform .12s ease, border-color .18s ease;
}

/* Keep desktop parent-card surfaces white in light mode, even on gray page canvas */
html:not(.dark-mode) .impact-card.parent-card {
  background: #ffffff !important;
}

html:not(.dark-mode) .impact-card.parent-card > .impact-card-header,
html:not(.dark-mode) .impact-card.parent-card > .impact-card-body {
  background: #ffffff !important;
}

html.dark-mode .impact-card.parent-card {
  background: #111821 !important;
  border: 3px solid rgba(255,255,255,0.12);
}

html.dark-mode .impact-card.parent-card > .impact-card-header,
html.dark-mode .impact-card.parent-card > .impact-card-body {
  background: #111821 !important;
}

.impact-card.parent-card:hover {
  border-color: var(--accent-color);
  box-shadow:
    0 0 0 1px var(--accent-color),
    0 0 30px rgba(0,200,255,0.45),
    var(--card-drop-shadow);
  transform: translateY(-1px);
}

html.dark-mode .impact-card.parent-card:hover {
  box-shadow:
    0 0 0 1px var(--accent-color),
    0 0 38px rgba(0,200,255,0.55),
    var(--card-drop-shadow);
}

.impact-card.parent-card .impact-card-body {
  padding: 1.1rem 1.35rem;
}

.impact-card.parent-card .impact-card-header {
  padding: .85rem 1.25rem;
}

.impact-card.parent-card .form-label {
  font-weight: 600;
}

/* Generic action button (Edit, View, etc.) */
.btn-outline-primary,
.btn-edit {
  background-color: #ffffff !important;
  color: var(--accent-color) !important;
  border: 2px solid var(--accent-color) !important;
}

.btn-outline-primary:hover,
.btn-edit:hover {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  border-color: var(--accent-color) !important;
  box-shadow: var(--accent-glow-shadow);
  transform: translateY(-1px);
}

/* Solid accent button (primary action) */
.btn-accent {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-color) !important;
}

.btn-accent:hover {
  background-color: #ffffff !important;
  color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  box-shadow: var(--accent-glow-shadow);
  transform: translateY(-1px);
}

/* Delete / destructive buttons */
.btn-outline-danger,
.btn-delete {
  background-color: transparent !important;
  color: #dc3545 !important;
  border: 2px solid #dc3545 !important;
}

.btn-outline-danger:hover,
.btn-delete:hover {
  background-color: #dc3545 !important;
  color: #ffffff !important;
  border-color: #dc3545 !important;
  box-shadow:
    0 0 0 2px rgba(220,53,69,0.55),
    0 0 60px rgba(220,53,69,0.75);
  transform: translateY(-1px);
}

/* Primary button = white fill + accent border/text */
.btn-primary,
.btn-primary:visited {
  background-color: #ffffff !important;
  color: var(--accent-color) !important;
  border: 2px solid var(--accent-color) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-color) !important;
}

/* Accent button: solid accent background, white text */
.btn-accent,
.btn-accent:visited {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-color) !important;
}

.btn-accent:hover,
.btn-accent:focus {
  background-color: #ffffff !important;
  color: var(--accent-color) !important;
  border: 2px solid var(--accent-color) !important;
}

/* Outline primary matches same visual style */
.btn-outline-primary {
  background-color: #ffffff !important;
  color: var(--accent-color) !important;
  border: 2px solid var(--accent-color) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-color) !important;
}

/* Secondary outline uses same weight/shape as primary pills */
.btn-outline-secondary,
.btn-outline-secondary:visited {
  background-color: transparent !important;
  color: #6c757d !important;
  border: 2px solid color-mix(in srgb, #6c757d 82%, #ffffff 18%) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: color-mix(in srgb, var(--accent-color) 8%, transparent) !important;
  color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  box-shadow: var(--accent-glow-shadow);
  transform: translateY(-1px);
}

/* Print layout tuning for report and invoice previews */
@media print {
  body {
    background: #ffffff !important;
  }

  /* Hide navigation, alerts, and buttons when printing/creating PDF */
  nav.navbar,
  .navbar,
  .navbar * ,
  .alert,
  .no-print,
  .btn {
    display: none !important;
  }

  /* Main printable containers */
  .report-print-page,
  .invoice-print-page {
    margin: 0;
    padding: 0.75in 0.75in;
    width: 100%;
  }

  /* Avoid awkward page breaks around headings */
  .report-print-page h1,
  .report-print-page h2,
  .report-print-page h3,
  .invoice-print-page h1,
  .invoice-print-page h2,
  .invoice-print-page h3 {
    page-break-after: avoid;
  }

  /* Try to keep section blocks together */
  .report-print-page .section,
  .invoice-print-page .section {
    page-break-inside: avoid;
  }
}

/* Universal scroll-area styling */
.scroll-area {
  max-height: 260px;
  overflow-y: scroll !important; /* force persistent scrollbar */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #c1c1c1 #f1f1f1; /* Firefox: thumb + track */
}

/* Chrome/Safari scrollbar styling */
.scroll-area::-webkit-scrollbar {
  width: 10px;
}

.scroll-area::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 5px;
  border: 2px solid #f1f1f1;
}

.scroll-area::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

html.dark-mode .scroll-area {
  scrollbar-color: #555 #1e1e1e;
}

html.dark-mode .scroll-area::-webkit-scrollbar-track {
  background: #1e1e1e;
}

html.dark-mode .scroll-area::-webkit-scrollbar-thumb {
  background: #555;
  border: 2px solid #1e1e1e;
}

/* --------------------------------------------- */
/* Reusable table scroll helpers (all themes)    */
/* --------------------------------------------- */

/* Compact table scroll area (e.g., billable items) */
.table-scroll-compact {
  max-height: 12rem;            /* roughly ~5 rows depending on content */
  overflow-y: auto;
}

/* Taller table scroll area (e.g., long claim/report lists) */
.table-scroll-tall {
  max-height: 20rem;
  overflow-y: auto;
}

/* Make sure scrollbars are visible and thin like other scroll areas */
.table-scroll-compact,
.table-scroll-tall {
  scrollbar-width: thin;              /* Firefox */
}

.table-scroll-compact::-webkit-scrollbar,
.table-scroll-tall::-webkit-scrollbar {
  width: 10px;
}

.table-scroll-compact::-webkit-scrollbar-track,
.table-scroll-tall::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.table-scroll-compact::-webkit-scrollbar-thumb,
.table-scroll-tall::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 5px;
  border: 2px solid #f1f1f1;
}

html.dark-mode .table-scroll-compact::-webkit-scrollbar-track,
html.dark-mode .table-scroll-tall::-webkit-scrollbar-track {
  background: #1e1e1e;
}

html.dark-mode .table-scroll-compact::-webkit-scrollbar-thumb,
html.dark-mode .table-scroll-tall::-webkit-scrollbar-thumb {
  background: #555;
  border: 2px solid #1e1e1e;
}


/* -------------------------------------------------------------------------
   Global table layout polish (striping + hover + padding)
   ------------------------------------------------------------------------- */

/* --------------------------------------------------
   Stronger table striping + hover contrast
   -------------------------------------------------- */

/* Light mode striping (more visible) */
html:not(.dark-mode) table tbody tr:nth-child(even) {
  background-color: #eef2f8;
}

/* Light mode hover (clearly distinct from stripe) */
html:not(.dark-mode) table tbody tr:hover {
  background-color: #f8fbff !important;
  outline: 2px solid var(--accent-color) !important;
  outline-offset: -3px;
}

/* Dark mode striping (clear separation) */
html.dark-mode table tbody tr:nth-child(even) {
  background-color: #242424;
}

/* Dark mode hover (brighter than stripe) */
html.dark-mode table tbody tr:hover {
  background-color: #2a2a2a !important;
  outline: 2px solid var(--accent-color) !important;
  outline-offset: -3px;
}


/* Increase vertical padding for readability */
table tbody tr td,
table tbody tr th {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* -------------------------------------------------------------------------
   Modern table link styling (remove default blue hyperlink look)
   ------------------------------------------------------------------------- */

/* Base table link appearance (light + dark) */
table a {
  color: inherit !important;          /* match surrounding text */
  text-decoration: none !important;   /* remove underline */
  font-weight: 500;                   /* slightly emphasized */
  transition: color 0.15s ease, opacity 0.15s ease;
}

/* Hover state: subtle accent shift */
table a:hover {
  color: var(--accent-color) !important;
  text-decoration: none !important;
  opacity: 0.9;
}

/* Dark mode table links should also inherit base text color */

/* ---------------------- */
/* Dark Mode Theme Layer  */
/* ---------------------- */

html.dark-mode body {
  background-color: #121212 !important;
  color: #e5e5e5 !important;
}

/* Card component: always strong border, rounded, no bleed */
.card {
  border-width: 3px !important;
  border-style: solid !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden; /* prevents inner glow bleed */
}

html.dark-mode .card {
  background-color: #1e1e1e !important;
  color: #e5e5e5 !important;
  border-color: #333 !important;
  border-width: 3px !important;
  border-style: solid !important;
}


html.dark-mode .card-body {
  background-color: #1e1e1e !important;
}

.card-body {
  padding: 1rem !important; /* ensures inner content spacing from border */
}

/* -------------------------------------------------------------------------
   Dark mode: Claim Summary text visibility fix
   Ensure all text inside summary cards renders white
   ------------------------------------------------------------------------- */
html.dark-mode .card,
html.dark-mode .card-body,
html.dark-mode .card-body * {
  color: #f1f1f1 !important;
}

/* Ensure all accordion shells and collapse areas are dark in dark mode */
html.dark-mode .accordion,
html.dark-mode .accordion-item,
html.dark-mode .accordion-collapse,
html.dark-mode .accordion-body,
html.dark-mode .collapse,
html.dark-mode .collapse.show {
  background-color: #1e1e1e !important;
  color: #e5e5e5 !important;
  border-color: #333 !important;
}

html.dark-mode .navbar,
html.dark-mode nav.navbar {
  background-color: #1f1f1f !important;
  border-bottom: 1px solid #333 !important;
}

html.dark-mode .navbar a,
html.dark-mode .navbar-brand,
html.dark-mode .nav-link {
  color: #e5e5e5 !important;
}

/* Dark-mode styling for collapsible section headers on Claim Detail, etc. */
html.dark-mode [data-bs-toggle="collapse"],
html.dark-mode .accordion-button,
html.dark-mode .accordion-header {
  background-color: #1e1e1e !important;
  color: #e5e5e5 !important;
  border-color: #333 !important;
}

html.dark-mode [data-bs-toggle="collapse"]:hover,
html.dark-mode .accordion-button:hover {
  background-color: #262626 !important;
}

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="url"],
input[type="password"] {
  border: 2px solid var(--field-border-light) !important;
  border-radius: var(--field-radius) !important;
  background-color: var(--field-bg-light) !important;
  color: var(--field-text-light) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease !important;
}

/* -------------------------------------------------------------------------
   Light mode: force readable inputs (prevents OS-level dark scheme overrides)
   ------------------------------------------------------------------------- */
html:not(.dark-mode) .form-control,
html:not(.dark-mode) .form-select,
html:not(.dark-mode) textarea,
html:not(.dark-mode) select,
html:not(.dark-mode) input[type="text"],
html:not(.dark-mode) input[type="email"],
html:not(.dark-mode) input[type="tel"],
html:not(.dark-mode) input[type="number"],
html:not(.dark-mode) input[type="search"],
html:not(.dark-mode) input[type="date"],
html:not(.dark-mode) input[type="time"],
html:not(.dark-mode) input[type="datetime-local"],
html:not(.dark-mode) input[type="month"],
html:not(.dark-mode) input[type="week"],
html:not(.dark-mode) input[type="url"],
html:not(.dark-mode) input[type="password"] {
  background-color: var(--field-bg-light) !important;
  color: var(--field-text-light) !important;
}

html:not(.dark-mode) .form-control::placeholder,
html:not(.dark-mode) input::placeholder,
html:not(.dark-mode) textarea::placeholder {
  color: var(--field-placeholder-light) !important;
  opacity: 1;
}

html:not(.dark-mode) .form-control:focus,
html:not(.dark-mode) .form-select:focus,
html:not(.dark-mode) textarea:focus,
html:not(.dark-mode) select:focus,
html:not(.dark-mode) input[type="text"]:focus,
html:not(.dark-mode) input[type="email"]:focus,
html:not(.dark-mode) input[type="tel"]:focus,
html:not(.dark-mode) input[type="number"]:focus,
html:not(.dark-mode) input[type="search"]:focus,
html:not(.dark-mode) input[type="date"]:focus,
html:not(.dark-mode) input[type="time"]:focus,
html:not(.dark-mode) input[type="datetime-local"]:focus,
html:not(.dark-mode) input[type="month"]:focus,
html:not(.dark-mode) input[type="week"]:focus,
html:not(.dark-mode) input[type="url"]:focus,
html:not(.dark-mode) input[type="password"]:focus {
  background-color: var(--field-bg-light-focus) !important;
  color: var(--field-text-light) !important;
  border: 2px solid var(--accent-color) !important;
}

html:not(.dark-mode) .form-control:hover,
html:not(.dark-mode) .form-select:hover,
html:not(.dark-mode) textarea:hover,
html:not(.dark-mode) input[type="text"]:hover,
html:not(.dark-mode) input[type="email"]:hover,
html:not(.dark-mode) input[type="tel"]:hover,
html:not(.dark-mode) input[type="number"]:hover,
html:not(.dark-mode) input[type="search"]:hover,
html:not(.dark-mode) input[type="date"]:hover,
html:not(.dark-mode) input[type="time"]:hover,
html:not(.dark-mode) input[type="datetime-local"]:hover,
html:not(.dark-mode) input[type="month"]:hover,
html:not(.dark-mode) input[type="week"]:hover,
html:not(.dark-mode) input[type="url"]:hover,
html:not(.dark-mode) input[type="password"]:hover {
  background-color: var(--field-bg-light-hover) !important;
  border-color: color-mix(in srgb, var(--accent-color) 26%, var(--field-border-light)) !important;
}

/* -------------------------------------------------------------------------
   Dark mode: form controls (inputs, selects, textareas)
   ------------------------------------------------------------------------- */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
  color-scheme: dark;
}

html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode input[type="text"],
html.dark-mode input[type="email"],
html.dark-mode input[type="tel"],
html.dark-mode input[type="number"],
html.dark-mode input[type="search"],
html.dark-mode input[type="date"],
html.dark-mode textarea,
html.dark-mode select {
  background-color: #1e1e1e !important;
  color: #f1f1f1 !important;
  border-color: #525a66 !important;
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus,
html.dark-mode textarea:focus,
html.dark-mode select:focus,
html.dark-mode input:focus {
  background-color: #1e1e1e !important;
  color: #f1f1f1 !important;
  border: 2px solid var(--accent-color) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 24%, transparent);
}

/* Option styling support varies by OS/browser, but helps where supported */
html.dark-mode select option {
  background-color: #1e1e1e;
  color: #f1f1f1;
}

html.dark-mode ::placeholder {
  color: rgba(241, 241, 241, 0.55);
}

/* Dark-mode placeholders */
html.dark-mode .form-control::placeholder,
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder,
html.dark-mode select::placeholder {
  color: #aaaaaa !important;
  opacity: 1; /* ensure consistent visibility */
}

html.dark-mode .form-control:focus,
html.dark-mode input:focus,
html.dark-mode textarea:focus,
html.dark-mode select:focus {
  background-color: var(--field-bg-dark-focus) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-color) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 24%, transparent) !important;
}

html.dark-mode .table {
  color: #e5e5e5 !important;
}

html.dark-mode .table th,
html.dark-mode .table td {
  background-color: #1e1e1e !important;
  border-color: #333 !important;
}

html.dark-mode .table thead th {
  background-color: #262626 !important;
  color: #e5e5e5 !important;
}

/* Stronger dark-mode overrides for all table text and borders */
html.dark-mode table,
html.dark-mode .table,
html.dark-mode table th,
html.dark-mode table td,
html.dark-mode .table th,
html.dark-mode .table td {
  color: #f1f1f1 !important;
  border-color: #444 !important;
}

html.dark-mode .table-hover tbody tr:hover {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
}

html.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: #1a1a1a !important;
}

html.dark-mode .table-striped tbody tr:nth-of-type(even) {
  background-color: #222 !important;
}

html.dark-mode .btn-primary,
html.dark-mode .btn-outline-primary {
  background-color: #1e1e1e !important;
  color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
}

html.dark-mode .btn-primary:hover,
html.dark-mode .btn-outline-primary:hover {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
}

html.dark-mode .btn-outline-secondary {
  background-color: transparent !important;
  color: #b9c0c8 !important;
  border-color: rgba(185, 192, 200, 0.82) !important;
}

html.dark-mode .btn-outline-secondary:hover {
  background-color: color-mix(in srgb, var(--accent-color) 14%, transparent) !important;
  color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
}

/* Dark mode delete buttons should remain outline until hover */
html.dark-mode .btn-outline-danger,
html.dark-mode .btn-delete {
  background-color: transparent !important;
  color: #ff6b7a !important;
  border-color: #ff6b7a !important;
}

html.dark-mode .btn-outline-danger:hover,
html.dark-mode .btn-delete:hover {
  background-color: #ff6b7a !important;
  color: #ffffff !important;
  border-color: #ff6b7a !important;
}

/* Extra dark-mode overrides for Bootstrap utility classes */
html.dark-mode .bg-light,
html.dark-mode .bg-white,
html.dark-mode .table-light,
html.dark-mode .card-header,
html.dark-mode .card-footer,
html.dark-mode .card-body,
html.dark-mode .accordion-item {
  background-color: #1e1e1e !important;
  color: #e5e5e5 !important;
}

html.dark-mode .text-dark {
  color: #e5e5e5 !important;
}

html.dark-mode .text-muted {
  color: #aaaaaa !important;
}

html.dark-mode .badge.bg-light,
html.dark-mode .badge.bg-white {
  background-color: #333 !important;
  color: #f0f0f0 !important;
}

html.dark-mode .list-group-item {
  background-color: #1e1e1e !important;
  color: #e5e5e5 !important;
  border-color: #333 !important;
}

html.dark-mode .alert {
  background-color: #1e1e1e !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}

/* Global hyperlink styling (modern, no default blue) */
html:not(.dark-mode) body a:not(.nav-link):not(.navbar-brand) {
  color: #111111 !important;   /* near-black in light mode */
  text-decoration: none !important;
}

html:not(.dark-mode) body a:not(.nav-link):not(.navbar-brand):not(.btn):hover {
  color: var(--accent-color) !important;
  text-decoration: none !important;
}

html.dark-mode body a:not(.nav-link):not(.navbar-brand) {
  color: #f1f1f1 !important;  /* white in dark mode */
  text-decoration: none !important;
}

/* Deterministic invoice reference badge (same invoice color everywhere) */
.invoice-ref-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff !important;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none !important;
  transition: filter 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.invoice-ref-badge:hover,
.invoice-ref-badge:focus-visible {
  color: #ffffff !important;
  filter: brightness(0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.38),
    0 8px 20px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

html.dark-mode .invoice-ref-badge {
  border-color: rgba(255, 255, 255, 0.44);
}

html.dark-mode .invoice-ref-badge:hover,
html.dark-mode .invoice-ref-badge:focus-visible {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.52),
    0 10px 22px rgba(0, 0, 0, 0.55);
}

html.dark-mode body a:not(.nav-link):not(.navbar-brand):not(.btn):hover {
  color: var(--accent-color) !important;  /* accent on hover */
  text-decoration: none !important;
}

/* Ensure table links still shift to accent on hover in dark mode */
html.dark-mode table a:hover {
  color: var(--accent-color) !important;
}

/* Preserve accent color for active nav item in dark mode */
html.dark-mode .navbar .nav-link.active,
html.dark-mode .nav-link.active {
  color: var(--accent-color) !important;
  border-bottom-color: var(--accent-color) !important;
}

/* -------------------------------------------------- */
/* Accordion arrow uses currentColor so it follows accent variable */
/* -------------------------------------------------- */
.accordion-button::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 5 8 12 15 5'/%3E%3C/svg%3E") !important;
  color: var(--accent-color) !important;
  transform: rotate(0deg);
}

/* When the accordion is open, Bootstrap rotates the arrow.
   We maintain that behavior but retain accent color. */
.accordion-button:not(.collapsed)::after {
  transform: rotate(180deg);
}

/* -------------------------------------------------------------------------
   Checkbox visual styling (light & dark mode)

   Bootstrap checkboxes can look “unchecked” in light mode if our global input
   styling overrides their checked background. Force the checked state to use
   the accent color and a visible checkmark in BOTH themes.
   ------------------------------------------------------------------------- */

/* Base checkbox appearance */
.form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--accent-color) !important;
  background-color: #ffffff !important;
}

/* Checked state (light + dark) */
.form-check-input:checked {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
}

/* Ensure the checkmark is visible (Bootstrap uses a background-image SVG) */
.form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3 6-7'/%3e%3c/svg%3e") !important;
}

/* Form switches: keep a visible slider thumb in both themes */
.form-switch .form-check-input {
  width: 2rem !important;
  min-width: 2rem !important;
  height: 1.05rem !important;
  border-radius: 2rem !important;
  border: 1px solid rgba(89, 99, 113, 0.45) !important;
  background-color: #d3d8e0 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3ccircle cx='8' cy='8' r='6.5' fill='%23646f80'/%3e%3c/svg%3e") !important;
  background-position: left center !important;
  background-repeat: no-repeat !important;
  background-size: 1rem 1rem !important;
  padding: 0 !important;
}

.form-switch .form-check-input:checked {
  border-color: var(--accent-color) !important;
  background-color: var(--accent-color) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3ccircle cx='8' cy='8' r='6.5' fill='%23ffffff'/%3e%3c/svg%3e") !important;
  background-position: right center !important;
}

/* Focus ring uses accent */
.form-check-input:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.08) !important;
}

html.dark-mode .form-check-input {
  background-color: #1e1e1e !important;
}

html.dark-mode .form-switch .form-check-input {
  border-color: rgba(222, 231, 245, 0.34) !important;
  background-color: rgba(210, 220, 236, 0.22) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3ccircle cx='8' cy='8' r='6.5' fill='%23c7d0dd'/%3e%3c/svg%3e") !important;
}

html.dark-mode .form-switch .form-check-input:checked {
  border-color: var(--accent-color) !important;
  background-color: var(--accent-color) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3ccircle cx='8' cy='8' r='6.5' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

html.dark-mode .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.12) !important;
}

/* -------------------------------------------------------------------------
   Checkbox clickability fixes (Report Edit: Treating Providers + Barriers)

   We have a few scroll/card layouts where an overlay (or stacking context)
   can unintentionally intercept pointer events. These rules ensure checkbox
   inputs/labels remain clickable.
   ------------------------------------------------------------------------- */

/* Ensure checkbox rows remain interactive even inside scroll/positioned cards */
.form-check,
.form-check-input,
.form-check-label {
  pointer-events: auto;
}

/* Give the actual checkbox a small stacking priority so it isn't "under" an overlay */
.form-check-input {
  position: relative;
  z-index: 2;
}

/* Make sure labels are also clickable */
.form-check-label {
  position: relative;
  z-index: 1;
  cursor: pointer;
}

/* If a container was accidentally given pointer-events: none elsewhere, override it */
.scroll-area,
.card,
.card-body {
  pointer-events: auto;
}

/* --------------------------------------------------
   HARD OVERRIDE: ensure checkbox interactivity
   -------------------------------------------------- */

/* Never allow parent containers to swallow clicks */
.card *,
.card-body *,
.scroll-area *,
.accordion *,
.accordion-body * {
  pointer-events: auto !important;
}

/* Explicit checkbox + label behavior */
input[type="checkbox"] {
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
}

label,
.form-check-label {
  cursor: pointer;
  pointer-events: auto !important;
}

/* Prevent accordion arrows or headers from overlaying form controls */
.accordion-button::after {
  pointer-events: none !important;
}

/* -------------------------------------------------------------------------
   Success message box styling (roll-forward + flash success)

   Spec:
   - Border: 10px solid accent color (both themes)
   - Light: white interior + black text
   - Dark: black interior + white text
   ------------------------------------------------------------------------- */

/* Light mode */
html:not(.dark-mode) .alert.alert-success {
  background-color: #ffffff !important;
  color: #111111 !important;
  border: 10px solid var(--accent-color) !important;
}

/* Dark mode */
html.dark-mode .alert.alert-success {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 10px solid var(--accent-color) !important;
}

/* Links inside success alerts should follow the alert foreground color */
html:not(.dark-mode) .alert.alert-success a {
  color: #111111 !important;
  text-decoration: underline;
}

html.dark-mode .alert.alert-success a {
  color: #ffffff !important;
  text-decoration: underline;
}

/* Ensure close button is visible in dark mode */
html.dark-mode .alert.alert-success .btn-close {
  filter: invert(1) grayscale(1);
  opacity: 0.9;
}

/* Keep the close button visible against white background too */
html:not(.dark-mode) .alert.alert-success .btn-close {
  opacity: 0.85;
}
/* -------------------------------------------------------------------------
   Light mode: accordion/section headers should be white fill
   ------------------------------------------------------------------------- */
html:not(.dark-mode) .accordion-button,
html:not(.dark-mode) .accordion-button:not(.collapsed),
html:not(.dark-mode) .accordion-header {
  background-color: #ffffff !important;
  color: #111111 !important;
}

/* Keep borders clean in light mode */
html:not(.dark-mode) .accordion-item {
  border-color: #d0d0d0 !important;
}

/* Hover state: subtle light gray */
html:not(.dark-mode) .accordion-button:hover {
  background-color: #f6f6f6 !important;
}

/* Remove Bootstrap focus glow; use accent border instead */
html:not(.dark-mode) .accordion-button:focus {
  box-shadow: none !important;
  border-color: var(--accent-color) !important;
}

/* -------------------------------------------------------------------------
   Accordion / expandable sections: stronger outer border
   ------------------------------------------------------------------------- */
.accordion-item {
  border: 5px solid #000000 !important;
  border-radius: 0.5rem;
  overflow: hidden; /* prevents inner card/glow bleed into borders */
}

/* Keep adjacent items spaced so borders don't visually merge */
.accordion-item + .accordion-item {
  margin-top: 0.75rem;
}

/* -------------------------------------------------------------------------
   Flatpickr (date picker) dark-mode visibility

   Mobile billables uses Flatpickr on a dark UI. Ensure the typed date text
   and calendar UI remain readable when dark mode is enabled.
   ------------------------------------------------------------------------- */

html.dark-mode .flatpickr-input,
html.dark-mode input.flatpickr-input,
html.dark-mode input.flatpickr-input[readonly] {
  background-color: var(--field-bg-dark) !important;
  color: var(--field-text-dark) !important;
  border-color: var(--field-border-dark) !important;
}

html.dark-mode .flatpickr-calendar {
  background: #1e1e1e !important;
  color: #f1f1f1 !important;
  border-color: #333 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55) !important;
}

html.dark-mode .flatpickr-months,
html.dark-mode .flatpickr-month,
html.dark-mode .flatpickr-current-month,
html.dark-mode .flatpickr-weekdays,
html.dark-mode .flatpickr-weekday {
  background: #1e1e1e !important;
  color: #f1f1f1 !important;
}

html.dark-mode .flatpickr-day {
  color: #f1f1f1 !important;
}

html.dark-mode .flatpickr-day:hover,
html.dark-mode .flatpickr-day:focus {
  background: #2a2a2a !important;
  border-color: #2a2a2a !important;
}

html.dark-mode .flatpickr-day.selected,
html.dark-mode .flatpickr-day.startRange,
html.dark-mode .flatpickr-day.endRange,
html.dark-mode .flatpickr-day.selected:hover,
html.dark-mode .flatpickr-day.startRange:hover,
html.dark-mode .flatpickr-day.endRange:hover {
  background: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: #ffffff !important;
}

html.dark-mode .flatpickr-day.today {
  border-color: var(--accent-color) !important;
}

html.dark-mode .flatpickr-time,
html.dark-mode .flatpickr-time input,
html.dark-mode .flatpickr-time .flatpickr-am-pm {
  background: #1e1e1e !important;
  color: #f1f1f1 !important;
  border-color: #333 !important;
}



/* =====================================================
   Page Sub‑Navigation Bar (Standardized Page Toolbar)
   Appears below the main navbar and above page content
   ===================================================== */

.impact-subnav {
  position: sticky;
  top: calc(var(--workspace-topbar-height) + var(--workspace-sticky-gap));
  z-index: 1020;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;

  padding: 0.75rem 1rem;
  /* Bleed through container-fluid gutters so the subnav reaches window edges */
  margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  margin-bottom: 1rem;

  background: var(--surface-card);
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);

  box-shadow: none;

  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.impact-subnav,
.claim-detail-page .claim-page-header,
.workspace-pagebar:has(.claims-toolbar),
.claim-detail-page .claim-section-rail {
  border: 1px solid var(--accent-color) !important;
}

/* When the page scrolls slightly, give the bar stronger elevation */
.impact-subnav.scrolled {
  box-shadow: var(--shadow-md);
}

/* Subnav control grouping */
.impact-subnav-left,
.impact-subnav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

/* Search field styling inside subnav */
.impact-subnav-search {
  width: 320px;
  max-width: 420px;
}

/* Dark mode adjustments */
html.dark-mode .impact-subnav {
  background: #1e1e1e;
  border: 1px solid var(--accent-color) !important;
}

/* ==============================
   Claims List – True Card Mode
   ============================== */

.claims-card-wrapper {
  background: transparent;
  padding: 2rem 2.25rem;
  border-radius: var(--radius-lg);
  max-width: 1200px;
  margin: 0 auto;
  overflow: visible;
}

.claims-card-header {
  margin-bottom: 1rem;
}

.claims-card-body {
  padding: 0.5rem 0;
}

.claims-card-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  overflow: visible;
}

/* Claims list page: denser, more horizontal info hash */
.claims-list-page .claims-card-wrapper {
  padding: 0.85rem 1.15rem;
  max-width: 1260px;
}

.claims-list-page .claims-card-list {
  gap: 12px;
}

.claims-list-page .claim-card {
  padding: 0.85rem 1.05rem;
}

.claims-list-page .claim-card-main {
  gap: 0.75rem;
  align-items: center;
}

.claims-list-page .claim-card-left {
  gap: 0.12rem;
  min-width: 0;
}

.claims-list-page .claim-card-personal {
  margin-top: 0;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.claims-list-page .claim-card-meta {
  font-size: 0.8rem;
}

.claims-list-page .claim-card-right {
  flex: 0 0 auto;
  align-items: stretch;
}

.claims-list-page .claim-card-status {
  justify-content: flex-end;
}

.claims-list-page .claim-info-hash {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 0.85rem;
  font-size: 0.76rem;
  width: auto;
}

.claims-list-page .info-cell {
  line-height: 1.08;
  min-width: 6.1rem;
}

.claims-list-page .claim-card-launchpad {
  margin-top: calc(0.45rem + 5px);
  padding-top: 0.42rem;
}

.claims-list-page .launchpad-actions {
  gap: 0.35rem 0.45rem;
}

@media (max-width: 1200px) {
  .claims-list-page .claim-info-hash {
    grid-template-columns: repeat(3, minmax(112px, 1fr));
  }
}

@media (max-width: 992px) {
  .claims-list-page .claim-card-main {
    flex-direction: column;
    align-items: stretch;
  }

  .claims-list-page .claim-info-hash {
    grid-template-columns: repeat(2, minmax(128px, 1fr));
  }
}

.claim-card {
  position: relative;
  z-index: 1;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 20%, rgba(0, 0, 0, 0.08)),
    0 0 16px color-mix(in srgb, var(--accent-color) 14%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.26s ease, box-shadow 0.32s ease, border-color 0.28s ease;
  padding: 1.5rem 2rem;
  overflow: visible;
}

.claim-card:hover {
  transform: translateY(-3px);
  box-shadow:
    var(--accent-glow-shadow),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
  border-color: var(--accent-color);
  cursor: pointer;
  z-index: 2;
}

/* Elevated state when launchpad overlay is open */
.claim-card-expanded {
  transform: translateY(-6px);
  box-shadow:
    var(--accent-glow-shadow),
    0 26px 70px rgba(0, 0, 0, 0.25) !important;
  border-color: var(--accent-color);
}

/* Claim edit cards: subtle accent edge ring at rest (same treatment as claim list cards) */
.claim-edit-wrap .impact-card.parent-card {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 20%, rgba(0, 0, 0, 0.08)),
    0 0 16px color-mix(in srgb, var(--accent-color) 14%, transparent),
    var(--card-drop-shadow);
}

html.dark-mode .claim-edit-wrap .impact-card.parent-card {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 24%, rgba(255, 255, 255, 0.05)),
    0 0 18px color-mix(in srgb, var(--accent-color) 18%, transparent),
    var(--card-drop-shadow);
}

@keyframes accentGlowPulse {
  0% {
    box-shadow:
      0 0 0 2px var(--accent-color),
      0 0 50px color-mix(in srgb, var(--accent-color) 70%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 4px var(--accent-color),
      0 0 120px color-mix(in srgb, var(--accent-color) 100%, transparent);
  }
  100% {
    box-shadow:
      0 0 0 2px var(--accent-color),
      0 0 50px color-mix(in srgb, var(--accent-color) 70%, transparent);
  }
}

/* ================================
   SYSTEM-WIDE ACCENT GLOW (Unified Light + Dark)
   Applies automatically to interactive elevation
   ================================ */

/* (Already set above in main :root) */

/* Buttons */
.btn:hover,
.btn:focus-visible {
  box-shadow: var(--accent-glow-shadow) !important;
  animation: none !important;
}

/* Cards (hover + expanded) */
.claim-card:hover {
  box-shadow:
    var(--accent-glow-shadow),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
}

.claim-card-expanded {
  box-shadow:
    var(--accent-glow-shadow),
    0 26px 70px rgba(0, 0, 0, 0.25) !important;
}

/* Overlay modal */
.claim-overlay-card {
  box-shadow:
    var(--accent-glow-shadow),
    0 40px 120px rgba(0, 0, 0, 0.35) !important;
}

/* Success alerts */
.alert.alert-success {
  box-shadow: var(--accent-glow-shadow) !important;
  animation: accentGlowPulse 1.8s ease-in-out 2;
}

.claim-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.claim-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.claim-card-claim-number {
  font-weight: 600;
  font-size: 1.05rem;
}

.claim-card-claimant {
  font-size: 0.95rem;
  opacity: 0.9;
}

.claim-card-meta {
  font-size: 0.85rem;
  opacity: 0.65;
}

.meta-label {
  font-weight: 500;
}

.meta-sep {
  margin: 0 0.4rem;
}

.claim-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  text-align: right;
}

/* Core-data entity list cards (carrier/employer/provider) */
.entity-card {
  padding: 0.62rem 0.9rem;
}

.entity-list-page .claims-card-wrapper {
  padding: 0.8rem 1rem;
}

.entity-list-page .claims-card-list {
  gap: 10px;
}

.entity-card .claim-card-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
}

.entity-card .claim-card-left {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.entity-card .claim-card-claim-number {
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.15;
}

.entity-card .claim-card-right {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
  text-align: left;
}

.entity-card .impact-action-row {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  margin-left: 0;
  margin-bottom: 0 !important;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.entity-card .claim-card-status {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: block;
  overflow: visible;
}

.entity-card .claim-info-hash {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.16rem 0.9rem;
  font-size: 0.76rem;
  opacity: 0.82;
  text-align: left;
  align-items: start;
  overflow: visible;
}

/* 6+ fields (provider/employer): keep it to two rows by using 3 columns */
.entity-card .claim-info-hash:has(.info-cell:nth-child(6)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entity-card .info-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.28rem;
  line-height: 1.15;
  min-width: 0;
  overflow: visible;
}

.entity-card .info-title {
  white-space: nowrap;
  font-size: 0.7rem;
  opacity: 0.68;
  letter-spacing: 0.02em;
}

.entity-card .info-title::after {
  content: ":";
}

.entity-card .info-value {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 992px) {
  .entity-card .claim-card-main {
    flex-direction: column;
    align-items: stretch;
  }

  .entity-card .claim-card-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .entity-card .claim-card-status {
    display: block;
  }

  .entity-card .impact-action-row {
    margin-left: 0;
    justify-self: auto;
    justify-content: flex-start;
  }

  .entity-card .claim-info-hash {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: flex-start;
    gap: 0.28rem 0.7rem;
    overflow: visible;
  }

  .entity-card .info-value {
    max-width: none;
  }
}

/* Billing list cards (condensed but info-rich) */
.billing-list-page .claims-card-wrapper {
  padding: 0.9rem 1.2rem;
}

.billing-list-page .claims-card-list {
  gap: 14px;
}

.billing-summary-wrap {
  margin-bottom: 0.35rem;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 0.65rem;
}

.billing-summary-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  box-shadow: var(--card-drop-shadow);
  padding: 0.55rem 0.75rem;
}

.billing-summary-card-wide {
  grid-column: span 1;
}

html.dark-mode .billing-summary-card {
  background: #161b24;
  border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode .billing-summary-card .small,
html.dark-mode .billing-summary-card .text-muted {
  color: #9fa9b7 !important;
}

html.dark-mode .billing-summary-card .fw-semibold {
  color: #ecf2fb;
}

html.dark-mode .billing-summary-card .text-danger {
  color: #ff6b76 !important;
}

html.dark-mode .billing-summary-card .text-success {
  color: #47d18c !important;
}

.billing-card {
  padding: 0.95rem 1.15rem;
}

.billing-card .claim-card-main {
  gap: 0.95rem;
  align-items: center;
}

.billing-card .claim-card-left {
  min-width: 290px;
  gap: 0.22rem;
}

.billing-card .claim-card-right {
  flex: 1;
  align-items: stretch;
}

.billing-card .claim-card-status {
  justify-content: flex-end;
}

.billing-card .claim-info-hash {
  width: 100%;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 0.34rem 0.8rem;
}

.billing-card .info-cell {
  align-items: flex-start;
  text-align: left;
}

html.dark-mode .billing-card .claim-info-hash {
  opacity: 0.95;
}

html.dark-mode .billing-card .info-title {
  opacity: 0.75;
}

html.dark-mode .billing-card .info-value {
  opacity: 1;
}

/* Invoice detail cards + line-item sub-cards */
.invoice-detail-wrapper {
  max-width: 1320px;
}

.invoice-detail-page .invoice-detail-card {
  margin-left: 0;
  margin-right: 0;
}

.invoice-detail-page .invoice-info-hash {
  width: 100%;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.55rem 1rem;
  text-align: left;
}

.invoice-detail-page .invoice-info-hash .info-cell {
  align-items: flex-start;
}

.invoice-detail-page .invoice-financial-hash {
  width: 100%;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.35rem 0.9rem;
  text-align: left;
  opacity: 0.82;
}

.invoice-detail-page .invoice-financial-hash .info-cell {
  align-items: flex-start;
}

.invoice-line-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.invoice-line-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) minmax(150px, 1fr) minmax(150px, 1fr);
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.invoice-line-controls #invoice-line-search {
  width: 100%;
}

.invoice-line-controls #invoice-line-activity-filter,
.invoice-line-controls #invoice-line-sort {
  width: 100%;
  min-width: 0;
}

.invoice-line-item-card {
  position: relative;
  z-index: 0;
  overflow: visible;
  cursor: pointer;
  border-radius: 14px;
  border: 2px solid rgba(120, 120, 120, 0.28);
  margin: 5px;
  background: color-mix(in srgb, var(--surface-card) 96%, transparent);
  box-shadow: var(--shadow-sm);
  padding: 0.42rem 0.52rem;
  font-size: 0.82rem;
  transition: border-color 0.18s ease, box-shadow 0.22s ease, transform 0.12s ease;
}

.invoice-line-item-card:hover,
.invoice-line-item-card:focus-within {
  z-index: 1;
  border-color: var(--accent-color) !important;
  box-shadow:
    0 0 0 2px var(--accent-color),
    0 0 44px rgba(0, 200, 255, 0.45),
    var(--card-drop-shadow) !important;
  transform: translateY(-1px);
}

.invoice-line-item-locked {
  opacity: 0.9;
}

.invoice-line-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1 1 auto;
  min-width: 0;
}

.invoice-line-item-top {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(110px, 0.75fr) minmax(156px, 0.95fr);
  gap: 0.34rem 0.44rem;
  align-items: end;
  min-width: 0;
}

.invoice-line-item-block {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 0.28rem;
  align-items: start;
  min-width: 0;
  margin-top: 0;
}

.invoice-inline-group {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0.24rem;
  align-items: center;
  min-width: 0;
}

.invoice-inline-label {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1.1;
  margin-bottom: 0;
  white-space: nowrap;
  text-align: right;
  padding-right: 0.04rem;
}

/* Line-item label alignment tuning */
.invoice-inline-group-activity .invoice-inline-label {
  text-align: left;
  padding-right: 0;
}

.invoice-line-item-block .invoice-inline-label {
  text-align: left;
  padding-right: 0;
}

.invoice-inline-static {
  border-radius: 8px;
  border: 1px solid rgba(120, 120, 120, 0.22);
  padding: 0.12rem 0.3rem;
  min-height: 1.55rem;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--surface-card) 98%, transparent);
  font-size: 0.78rem;
}

.invoice-inline-static-notes {
  white-space: pre-wrap;
  word-break: break-word;
  align-items: flex-start;
  min-height: 2.2rem;
}

.invoice-inline-select,
.invoice-inline-input,
.invoice-inline-textarea {
  border-radius: 8px !important;
  border: 1px solid rgba(60, 70, 84, 0.22) !important;
  background: transparent !important;
  min-height: 1.55rem;
  padding-top: 0.06rem;
  padding-bottom: 0.06rem;
  font-size: 0.78rem !important;
  line-height: 1.2;
}

.invoice-inline-select {
  width: 100%;
  min-width: 0;
}

.invoice-inline-group-activity .invoice-inline-select {
  max-width: 160px;
}

.invoice-inline-input {
  width: 100%;
  min-width: 0;
}

.invoice-inline-date {
  width: 100%;
}

.invoice-inline-textarea {
  width: 100%;
  min-height: 1.55rem;
  resize: none;
}

.invoice-inline-description {
  min-height: 1.5rem;
  max-height: 14rem;
  overflow-y: hidden;
  resize: none;
}

.invoice-inline-notes {
  min-height: 4.1rem;
  resize: vertical;
  max-height: 26rem;
  overflow-y: hidden;
}

.invoice-line-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 6.25rem;
  flex-shrink: 0;
}

.invoice-line-item-actions-bottom {
  width: 100%;
  min-width: 0;
  margin-top: 0.02rem;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}

.invoice-detail-card:has(.invoice-line-item-card:hover),
.invoice-detail-card:has(.invoice-line-item-card:focus-within) {
  border-color: var(--accent-color) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent-color) 72%, transparent),
    0 0 44px color-mix(in srgb, var(--accent-color) 38%, transparent),
    var(--card-drop-shadow) !important;
}

html.dark-mode .invoice-line-item-card {
  background: #161b24;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

html.dark-mode .invoice-line-item-card:hover,
html.dark-mode .invoice-line-item-card:focus-within {
  box-shadow:
    0 0 0 2px var(--accent-color),
    0 0 54px rgba(0, 200, 255, 0.55),
    var(--card-drop-shadow) !important;
}

html.dark-mode .invoice-inline-select,
html.dark-mode .invoice-inline-input,
html.dark-mode .invoice-inline-textarea {
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #e7edf6 !important;
}

html.dark-mode .invoice-inline-select option,
html.dark-mode .invoice-inline-select optgroup {
  background-color: #151b24 !important;
  color: #e7edf6 !important;
}

html.dark-mode .invoice-inline-static {
  border-color: rgba(255, 255, 255, 0.16);
  background: #121722;
  color: #e7edf6;
}

@media (max-width: 1200px) {
  .invoice-detail-page .invoice-info-hash {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .invoice-detail-page .invoice-financial-hash {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 768px) {
  .invoice-line-item-card {
    padding: 0.5rem;
  }

  .invoice-line-item-top {
    grid-template-columns: 1fr;
  }

  .invoice-inline-group {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .invoice-line-item-block {
    grid-template-columns: 1fr;
    gap: 0.14rem;
  }

  .invoice-line-item-block .invoice-inline-label {
    text-align: left;
    padding-right: 0;
  }

  .invoice-line-controls {
    grid-template-columns: 1fr;
  }

  .invoice-line-controls #invoice-line-search,
  .invoice-line-controls #invoice-line-activity-filter,
  .invoice-line-controls #invoice-line-sort {
    width: 100%;
    min-width: 0;
  }

  .invoice-line-item-actions {
    min-width: 0;
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
  }

  .invoice-detail-page .invoice-info-hash,
  .invoice-detail-page .invoice-financial-hash {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .billing-summary-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .billing-card .claim-info-hash {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 992px) {
  .billing-card .claim-card-main {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-card .claim-card-left {
    min-width: 0;
  }

  .billing-card .claim-info-hash {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .billing-summary-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 640px) {
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }
}


.claim-card-status,
.claim-card-billing,
.claim-card-next-report {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* -----------------------------------------
   Claim Card – Status Hash Grid (Meta Style)
   ----------------------------------------- */

.claim-info-hash {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0.65rem 2.25rem;
  font-size: 0.82rem;
  opacity: 0.75;
  text-align: right;
}

.info-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.info-title {
  font-weight: 500;
  opacity: 0.6;
}

.info-value {
  font-weight: 500;
  opacity: 0.9;
}

/* -----------------------------------------
   Claim Sticky Summary
   Condensed header summary for claim/report workspaces
   ----------------------------------------- */

.claim-sticky-summary {
  min-width: 0;
}

.claim-sticky-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.62rem 0.9rem;
  min-width: 0;
}

.claim-sticky-summary-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.46rem;
}

.claim-sticky-summary-item {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.claim-sticky-summary-item--span-2 {
  grid-column: span 2;
}

.claim-sticky-summary-item--span-3 {
  grid-column: span 3;
}

.claim-sticky-summary-label {
  color: var(--workspace-surface-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.claim-sticky-summary-value {
  min-width: 0;
  color: var(--workspace-surface-strong);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.claim-sticky-summary-value[data-claim-summary-field="providers"] {
  white-space: pre-line;
}

.claim-page-summary {
  min-width: 0;
}

.claim-page-summary .claim-sticky-summary-grid {
  gap: 0.48rem 0.82rem;
}

.claim-page-summary .claim-sticky-summary-column {
  gap: 0.48rem;
}

.claim-page-summary .claim-sticky-summary-item {
  gap: 0.1rem;
}

.claim-page-summary .claim-sticky-summary-label {
  font-size: 0.6rem;
}

.claim-page-summary .claim-sticky-summary-value {
  font-size: 0.76rem;
  line-height: 1.16;
}

@media (max-width: 1399.98px) {
  .claim-sticky-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .claim-sticky-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .claim-sticky-summary-column {
    gap: 0.42rem;
  }

  .claim-sticky-summary-item--span-2,
  .claim-sticky-summary-item--span-3 {
    grid-column: span 2;
  }
}

@media (max-width: 575.98px) {
  .claim-sticky-summary-grid {
    grid-template-columns: 1fr;
  }

  .claim-sticky-summary-column {
    gap: 0.38rem;
  }

  .claim-sticky-summary-item,
  .claim-sticky-summary-item--span-2,
  .claim-sticky-summary-item--span-3 {
    grid-column: auto;
  }
}

/* Dark mode refinement */
html.dark-mode .claim-info-hash {
  opacity: 0.85;
}

html.dark-mode .info-title {
  opacity: 0.55;
}

html.dark-mode .info-value {
  opacity: 0.95;
}

/* -----------------------------------------
   Claim Card – Save Success Pulse
   Brief 0.5s green breathe animation when data saves
   Overrides all other card glows
   ----------------------------------------- */

@keyframes claimSavePulse {
  0% {
    box-shadow:
      0 0 0 2px rgba(40,167,69,0.6),
      0 0 25px rgba(40,167,69,0.45),
      0 12px 28px rgba(0,0,0,0.12) !important;
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(40,167,69,0.95),
      0 0 140px rgba(40,167,69,0.9),
      0 18px 40px rgba(0,0,0,0.18) !important;
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(40,167,69,0.6),
      0 0 25px rgba(40,167,69,0.45),
      0 12px 28px rgba(0,0,0,0.12) !important;
  }
}

  .claim-card.claim-save-success,
  .claim-card.impact-flash-success,
  .launchpad-btn.impact-flash-success {
  animation: claimSavePulse 0.6s ease-in-out 1 !important;
  border-color: rgba(40,167,69,0.95) !important;
  will-change: box-shadow;
}

  .claim-card.impact-flash-success,
  .launchpad-btn.impact-flash-success,
  .claim-card.impact-flash-success:hover,
  .claim-card.impact-flash-success.claim-card-expanded,
  .claim-card.impact-flash-success.claim-urgency-past-due,
  .claim-card.impact-flash-success.claim-urgency-due-soon {
  animation: claimSavePulse 0.6s ease-in-out 1 !important;
  box-shadow:
    0 0 0 3px rgba(40,167,69,0.95),
    0 0 140px rgba(40,167,69,0.9),
    0 18px 40px rgba(0,0,0,0.18) !important;
}

.launchpad-btn.impact-flash-fail {
  animation: claimSavePulse 0.6s ease-in-out 1 !important;
  border-color: rgba(220,53,69,0.95) !important;
  box-shadow:
    0 0 0 3px rgba(220,53,69,0.95),
    0 0 120px rgba(220,53,69,0.85) !important;
}

/* Ensure save pulse suppresses other glow states while active */
.claim-card.claim-save-success:hover,
.claim-card.impact-flash-success:hover,
.claim-card.claim-save-success.claim-card-expanded,
.claim-card.impact-flash-success.claim-card-expanded,
.claim-card.claim-save-success.claim-urgency-past-due,
.claim-card.impact-flash-success.claim-urgency-past-due,
.claim-card.claim-save-success.claim-urgency-due-soon,
.claim-card.impact-flash-success.claim-urgency-due-soon {
  animation: claimSavePulse 0.5s ease-in-out 1 !important;
  box-shadow:
    0 0 0 3px rgba(40,167,69,0.85),
    0 0 90px rgba(40,167,69,0.75),
    0 18px 40px rgba(0,0,0,0.18) !important;
}

/* -----------------------------------------
   Claim Card – Urgency Glow States
   Subtle by default. Hover highlight dominates.
   ----------------------------------------- */

/* Template‑driven urgency classes (used by claims_list.html) */
.claim-card.claim-urgency-past-due {
  box-shadow:
    0 0 0 3px rgba(220, 53, 69, 0.72),
    0 0 22px rgba(220, 53, 69, 0.46),
    0 0 72px rgba(220, 53, 69, 0.42),
    0 18px 38px rgba(0, 0, 0, 0.16) !important;
  animation: pastDuePulse 4.5s ease-in-out infinite;
}

/* Hover lift for past-due cards should stay red (not accent) */
.claim-card.claim-urgency-past-due:hover,
.claim-card.claim-urgency-past-due.claim-card-expanded {
  animation: none !important;
  box-shadow:
    0 0 0 3px rgba(220, 53, 69, 0.82),
    0 0 28px rgba(220, 53, 69, 0.56),
    0 0 88px rgba(220, 53, 69, 0.48),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
  border-color: rgba(220, 53, 69, 0.92);
}

.claim-card.claim-urgency-due-soon {
  box-shadow:
    0 0 0 3px rgba(255, 193, 7, 0.72),
    0 0 20px rgba(255, 193, 7, 0.44),
    0 0 68px rgba(255, 193, 7, 0.40),
    0 18px 38px rgba(0, 0, 0, 0.16) !important;
}

/* Hover lift for due-soon cards should stay yellow (not accent) */
.claim-card.claim-urgency-due-soon:hover,
.claim-card.claim-urgency-due-soon.claim-card-expanded {
  box-shadow:
    0 0 0 3px rgba(255, 193, 7, 0.84),
    0 0 26px rgba(255, 193, 7, 0.54),
    0 0 82px rgba(255, 193, 7, 0.46),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
  border-color: rgba(255, 193, 7, 0.94);
}

@keyframes pastDuePulse {
  0% {
    box-shadow:
      0 0 0 3px rgba(220, 53, 69, 0.62),
      0 0 18px rgba(220, 53, 69, 0.40),
      0 0 56px rgba(220, 53, 69, 0.32),
      0 18px 38px rgba(0, 0, 0, 0.16);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(220, 53, 69, 0.90),
      0 0 30px rgba(220, 53, 69, 0.66),
      0 0 106px rgba(220, 53, 69, 0.60),
      0 22px 46px rgba(0, 0, 0, 0.20);
  }
  100% {
    box-shadow:
      0 0 0 3px rgba(220, 53, 69, 0.62),
      0 0 18px rgba(220, 53, 69, 0.40),
      0 0 56px rgba(220, 53, 69, 0.32),
      0 18px 38px rgba(0, 0, 0, 0.16);
  }
}

/* Dark mode adjustments for template classes */
html.dark-mode .claim-card.claim-urgency-past-due {
  box-shadow:
    0 0 0 3px rgba(255, 99, 132, 0.78),
    0 0 24px rgba(255, 99, 132, 0.58),
    0 0 78px rgba(255, 99, 132, 0.52),
    0 18px 48px rgba(0, 0, 0, 0.78) !important;
}

html.dark-mode .claim-card.claim-urgency-due-soon {
  box-shadow:
    0 0 0 3px rgba(255, 214, 10, 0.78),
    0 0 22px rgba(255, 214, 10, 0.56),
    0 0 74px rgba(255, 214, 10, 0.50),
    0 18px 48px rgba(0, 0, 0, 0.78) !important;
}

/* Past Due – subtle red outer glow */
.claim-card:has(.claim-info-hash--past) {
  box-shadow:
    0 0 0 3px rgba(220, 53, 69, 0.72),
    0 0 22px rgba(220, 53, 69, 0.46),
    0 0 72px rgba(220, 53, 69, 0.42),
    0 18px 38px rgba(0, 0, 0, 0.16);
}

/* Due Soon – subtle yellow outer glow */
.claim-card:has(.claim-info-hash--soon) {
  box-shadow:
    0 0 0 3px rgba(255, 193, 7, 0.72),
    0 0 20px rgba(255, 193, 7, 0.44),
    0 0 68px rgba(255, 193, 7, 0.40),
    0 18px 38px rgba(0, 0, 0, 0.16);
}

/* Non-urgency cards use accent hover */
.claim-card:not(.claim-urgency-past-due):not(.claim-urgency-due-soon):hover,
.claim-card-expanded:not(.claim-urgency-past-due):not(.claim-urgency-due-soon) {
  box-shadow:
    var(--accent-glow-shadow),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
}

/* Urgency fallback selectors (for hash-driven urgency) keep urgency color on hover */
.claim-card:has(.claim-info-hash--past):hover,
.claim-card:has(.claim-info-hash--past).claim-card-expanded {
  box-shadow:
    0 0 0 3px rgba(220, 53, 69, 0.82),
    0 0 28px rgba(220, 53, 69, 0.56),
    0 0 88px rgba(220, 53, 69, 0.48),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
  border-color: rgba(220, 53, 69, 0.92);
}

.claim-card:has(.claim-info-hash--soon):hover,
.claim-card:has(.claim-info-hash--soon).claim-card-expanded {
  box-shadow:
    0 0 0 3px rgba(255, 193, 7, 0.84),
    0 0 26px rgba(255, 193, 7, 0.54),
    0 0 82px rgba(255, 193, 7, 0.46),
    0 22px 60px rgba(0, 0, 0, 0.20) !important;
  border-color: rgba(255, 193, 7, 0.94);
}

/* Dark mode tuning (slightly brighter for contrast) */
html.dark-mode .claim-card:has(.claim-info-hash--past) {
  box-shadow:
    0 0 0 3px rgba(255, 99, 132, 0.78),
    0 0 24px rgba(255, 99, 132, 0.58),
    0 0 78px rgba(255, 99, 132, 0.52),
    0 18px 48px rgba(0, 0, 0, 0.78);
}

html.dark-mode .claim-card:has(.claim-info-hash--soon) {
  box-shadow:
    0 0 0 3px rgba(255, 214, 10, 0.78),
    0 0 22px rgba(255, 214, 10, 0.56),
    0 0 74px rgba(255, 214, 10, 0.50),
    0 18px 48px rgba(0, 0, 0, 0.78);
}

/* Claims list: Next Report date inherits urgency color without changing typography */
.claims-list-page .claim-info-hash[data-urgency="none"] > .info-cell:last-child .info-value {
  color: #198754;
}

.claims-list-page .claim-info-hash[data-urgency="soon"] > .info-cell:last-child .info-value {
  color: #c98a00;
}

.claims-list-page .claim-info-hash[data-urgency="past"] > .info-cell:last-child .info-value {
  color: #dc3545;
}

html.dark-mode .claims-list-page .claim-info-hash[data-urgency="none"] > .info-cell:last-child .info-value {
  color: #47d18c;
}

html.dark-mode .claims-list-page .claim-info-hash[data-urgency="soon"] > .info-cell:last-child .info-value {
  color: #ffd54a;
}

html.dark-mode .claims-list-page .claim-info-hash[data-urgency="past"] > .info-cell:last-child .info-value {
  color: #ff7b86;
}

/* Dark mode adjustments */
html.dark-mode .claims-card-wrapper {
  background: transparent;
}

html.dark-mode .claim-card {
  background: #1e1e1e;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 24%, rgba(255, 255, 255, 0.05)),
    0 0 18px color-mix(in srgb, var(--accent-color) 18%, transparent),
    0 16px 44px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Remove any legacy table styling from affecting new layout */
#claims-table table,
#claims-table thead,
#claims-table tbody,
#claims-table tr,
#claims-table td,
#claims-table th {
  all: unset;
}

/* -----------------------------------------
   Claim Card – Personal + Launchpad Layout
   ----------------------------------------- */

.claim-card-personal {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 0.25rem;
}

.claim-card-personal div {
  display: flex;
  gap: 0.35rem;
}

.billing-amount {
  font-weight: 600;
  opacity: 0.85;
}

.claim-card-launchpad {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
}

.launchpad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
}

.launchpad-btn {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  color: inherit;
  text-decoration: none !important;
  transition: 
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.28s ease,
    transform 0.18s ease;
}

.launchpad-btn:hover {
  border-color: var(--accent-color);
  box-shadow: var(--accent-glow-shadow);
  transform: translateY(-2px);
  color: inherit !important;
  text-decoration: none !important;
}

.launchpad-btn:focus-visible,
.launchpad-btn:active {
  color: inherit !important;
  text-decoration: none !important;
}

/* Anchor variant parity: prevent link-specific hover/visited coloring on "Invoices" */
.launchpad-actions a.launchpad-btn,
.launchpad-actions a.launchpad-btn:link,
.launchpad-actions a.launchpad-btn:visited,
.launchpad-actions a.launchpad-btn:hover,
.launchpad-actions a.launchpad-btn:focus-visible,
.launchpad-actions a.launchpad-btn:active {
  color: inherit !important;
  text-decoration: none !important;
}

/* =====================================================
   Launchpad Report Dropdown Menu (Claims List)
   Modern floating menu replacing native dropdown
   ===================================================== */

.launchpad-dropdown {
  position: relative;
  display: inline-block;
  z-index: 3000;
}

.launchpad-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: none;
  flex-direction: column;
  min-width: 170px;
  padding: 6px;

  background: var(--surface-card);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);

  box-shadow:
    0 18px 55px rgba(0,0,0,0.22),
    0 0 0 1px rgba(0,0,0,0.04);

  z-index: 4000;
}

.launchpad-menu.show {
  display: flex;
}

.launchpad-menu form {
  margin: 0;
}

.launchpad-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;

  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  text-align: left;

  border-radius: 8px;
  cursor: pointer;

  transition: background 0.15s ease, color 0.15s ease;
}

.launchpad-menu-item:hover {
  background: color-mix(in srgb, var(--accent-color) 20%, transparent);
  color: inherit;
}

/* Dark mode tuning */
html.dark-mode .launchpad-menu {
  background: #1e1e1e;
  border-color: #3a3a3a;

  box-shadow:
    0 22px 70px rgba(0,0,0,0.9),
    0 0 0 1px rgba(255,255,255,0.04);
}

/* Dark mode adjustments for launchpad */

html.dark-mode .claim-card-launchpad {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html.dark-mode .launchpad-btn {
  border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode .launchpad-btn:hover {
  border-color: var(--accent-color);
}

/* ==========================================
   Bootstrap Modal Layering
   Keep modals above sticky app header/dock.
   ========================================== */

.modal-backdrop {
  z-index: 5000 !important;
}

.modal {
  z-index: 5010 !important;
}

/* ==========================================
   Claim Overlay – Floating Modal Mode
   ========================================== */

.claim-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.claim-overlay.d-none {
  display: none;
}

/* Backdrop */
.claim-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 400ms ease;
}

.claim-overlay.overlay-visible .claim-overlay-backdrop {
  opacity: 1;
}

/* Modal Card */
.claim-overlay-card {
  position: relative;
  width: 760px;
  max-width: 92vw;
  max-height: 80vh;
  overflow: visible;
  overflow-y: auto;
  border-radius: 22px;
  background: var(--surface-card);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.35),
    0 0 0 2px var(--accent-color),
    0 0 60px color-mix(in srgb, var(--accent-color) 55%, transparent);
  border: 2px solid var(--accent-color);
  padding: 1.5rem 1.75rem;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 400ms ease, transform 400ms ease;
}

.claim-overlay.overlay-visible .claim-overlay-card {
  opacity: 1;
  transform: translateY(0);
  animation: accentGlowPulse 3.2s ease-in-out infinite;
}

.claim-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.05rem;
}

/* Overlay close button styling */
.claim-overlay-header .btn-close {
  filter: none;
  opacity: 0.75;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.claim-overlay-header .btn-close:hover {
  opacity: 1;
  transform: scale(1.05);
  background-color: var(--accent-color);
  border-radius: 50%;
  filter: invert(1);
}

/* Dark mode close button correction */
html.dark-mode .claim-overlay-header .btn-close {
  filter: invert(1) brightness(1.2);
  opacity: 0.85;
}

html.dark-mode .claim-overlay-header .btn-close:hover {
  filter: none;
  background-color: var(--accent-color);
  border-radius: 50%;
  opacity: 1;
}

.claim-overlay-body {
  margin-top: 0.5rem;
}

/* Dark mode adjustments */
html.dark-mode .claim-overlay-card {
  background: #1e1e1e;
}


body.overlay-open {
  overflow: hidden;
}
/* ==========================================
   Form Select Modern Accent Styling
   Remove Bootstrap blue highlight
   ========================================== */

/* Remove default Bootstrap focus ring */
.form-select:focus,
.form-control:focus,
select:focus,
input:focus,
textarea:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* Accent-based focus border (light + dark handled via existing border rules) */
.form-select:focus,
.form-control:focus {
  border: 2px solid var(--accent-color) !important;
}

/* Remove blue active background inside dropdowns (where supported) */
select option:checked {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
}

/* Hover state inside dropdown (supported browsers only) */
select option:hover {
  background-color: color-mix(in srgb, var(--accent-color) 30%, transparent);
}

/* Ensure selects visually match inputs */
.form-select {
  border-radius: var(--field-radius) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Subtle accent glow on focus for consistency with cards */
.form-select:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 20%, transparent) !important;
}

/* Dark mode select polish */
html.dark-mode .form-select {
  background-color: #1e1e1e !important;
  color: #f1f1f1 !important;
  border-color: #525a66 !important;
}

html.dark-mode select option:checked {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
}
/* ==========================================
   Launchpad Form Inputs (Overlay Forms)
   ========================================== */

.launchpad-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  border-radius: var(--field-radius);
  border: 2px solid var(--field-border-light);
  background-color: var(--field-bg-light);
  color: var(--field-text-light);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.launchpad-input:hover {
  border-color: color-mix(in srgb, var(--accent-color) 26%, var(--field-border-light));
  background-color: var(--field-bg-light-hover);
}

.launchpad-input:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: var(--field-bg-light-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 20%, transparent);
}

.launchpad-input[type="date"],
.launchpad-input[type="number"],
.launchpad-input select {
  height: 42px;
}

.launchpad-input textarea {
  min-height: 70px;
  resize: vertical;
}

/* Dark mode support */
html.dark-mode .launchpad-input {
  background-color: var(--field-bg-dark) !important;
  color: var(--field-text-dark) !important;
  border-color: var(--field-border-dark) !important;
}

html.dark-mode .launchpad-input:hover {
  background-color: var(--field-bg-dark-hover) !important;
}

html.dark-mode .launchpad-input:focus {
  background-color: var(--field-bg-dark-focus) !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 24%, transparent) !important;
}

/* ==========================================
   Tom Select – Modern System Styling
   Matches Launchpad / Card Aesthetic
   ========================================== */

/* Base control */
.ts-control {
  border-radius: var(--field-radius) !important;
  border: 2px solid var(--field-border-light) !important;
  background: var(--field-bg-light) !important;
  padding: 0.45rem 0.75rem !important;
  min-height: 42px !important;
  box-shadow: none !important;
  transition: border-color 0.18s ease, box-shadow 0.22s ease;
}

.ts-control:hover {
  border-color: color-mix(in srgb, var(--accent-color) 26%, var(--field-border-light)) !important;
  background: var(--field-bg-light-hover) !important;
}

/* Remove bootstrap look */
.ts-control input {
  background: transparent !important;
}

/* Focus state */
.ts-control.focus {
  border-color: var(--accent-color) !important;
  background: var(--field-bg-light-focus) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent-color) 20%, transparent) !important;
}

/* Dropdown */
.ts-dropdown {
  border-radius: var(--field-radius) !important;
  border: 2px solid var(--field-border-light) !important;
  background: var(--field-bg-light) !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.18) !important;
  padding: 0.4rem 0 !important;
}

/* Options */
.ts-dropdown .option {
  padding: 0.5rem 0.9rem !important;
  font-size: 0.9rem;
  transition: background 0.15s ease;
}

/* Hovered option */
.ts-dropdown .option.active {
  background: color-mix(in srgb, var(--accent-color) 18%, transparent) !important;
}

/* Selected option */
.ts-dropdown .option.selected {
  background: var(--accent-color) !important;
  color: #ffffff !important;
}

/* Multi-select remove button */
.ts-control .remove {
  color: var(--accent-color) !important;
}

/* =======================
   Dark Mode Support
   ======================= */

html.dark-mode .ts-control {
  background: var(--field-bg-dark) !important;
  border-color: var(--field-border-dark) !important;
  color: var(--field-text-dark) !important;
}

html.dark-mode .ts-control:hover {
  background: var(--field-bg-dark-hover) !important;
}

html.dark-mode .ts-dropdown {
  background: #1e1e1e !important;
  border-color: var(--field-border-dark) !important;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.9) !important;
}

html.dark-mode .ts-dropdown .option {
  color: #f1f1f1 !important;
}

html.dark-mode .ts-dropdown .option.active {
  background: color-mix(in srgb, var(--accent-color) 25%, transparent) !important;
}

html.dark-mode .ts-dropdown .option.selected {
  background: var(--accent-color) !important;
  color: #ffffff !important;
}
/* =====================================================
   Tom Select Width Stabilization (Fix Shift on Select)
   Ensures dropdown does not resize or shift in overlays
   ===================================================== */

/* Wrapper must always occupy full width */
.ts-wrapper {
  width: 100% !important;
}

/* Control must not shrink or grow after selection */
.ts-control {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Prevent internal input from affecting layout */
.ts-control input {
  width: 100% !important;
}

/* Ensure overlay form keeps select aligned */
.claim-overlay-card .ts-wrapper,
.claim-overlay-card .ts-control {
  width: 100% !important;
}

/* Remove margin shifts introduced by resets */
.ts-wrapper.single .ts-control {
  margin: 0 !important;
}

/* Dropdown width matches control */
.ts-dropdown {
  width: 100% !important;
  box-sizing: border-box !important;
}
/* =====================================================
   Global Perimeter Flash Feedback System
   Replaces most alert popups with subtle screen feedback
   ===================================================== */

body {
  position: relative;
}

/* Base animation */
@keyframes perimeterFlashSuccess {
  0% {
    box-shadow: inset 0 0 0 0 rgba(40, 167, 69, 0);
  }
  40% {
    box-shadow: inset 0 0 0 6px rgba(40, 167, 69, 0.95);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

@keyframes perimeterFlashFail {
  0% {
    box-shadow: inset 0 0 0 0 rgba(220, 53, 69, 0);
  }
  40% {
    box-shadow: inset 0 0 0 6px rgba(220, 53, 69, 0.95);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

@keyframes perimeterFlashWarn {
  0% {
    box-shadow: inset 0 0 0 0 rgba(255, 193, 7, 0);
  }
  40% {
    box-shadow: inset 0 0 0 6px rgba(255, 193, 7, 0.95);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

/* Trigger classes applied to <body> */
body.impact-flash-success {
  animation: perimeterFlashSuccess 0.9s ease-out !important;
}

body.impact-flash-fail {
  animation: perimeterFlashFail 1s ease-out !important;
}

body.impact-flash-warning {
  animation: perimeterFlashWarn 1s ease-out !important;
}

/* Dark mode slightly brighter for visibility */
html.dark-mode body.impact-flash-success {
  animation: perimeterFlashSuccess 0.9s ease-out !important;
}

html.dark-mode body.impact-flash-fail {
  animation: perimeterFlashFail 1s ease-out !important;
}

html.dark-mode body.impact-flash-warning {
  animation: perimeterFlashWarn 1s ease-out !important;
}
/* =====================================================
   Claim Detail Page Layout
   Structural grid and card layout for claim detail view
   ===================================================== */

.claim-detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr; /* 33 / 66 layout */
  gap: 1.25rem;
  align-items: start;
}

/* Left column (overview, invoices, reports, documents, activity) */
.claim-left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Right column (billables) */
.claim-right-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Billable card container */
.billables-card {
  position: relative;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 3px solid #d0d0d0;
  box-shadow: var(--shadow-md);
  padding: 0.75rem 0.9rem;
  transition: none; /* large cards remain static */
}

/* Scroll region for billable items */
.billables-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* Individual billable item card (future card layout support) */
.billable-item-card {
  border: 3px solid rgba(0,0,0,0.18);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.55rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s ease,
    box-shadow 0.24s ease,
    border-color 0.22s ease;
}

.billable-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent-color) 55%, transparent),
    0 0 55px color-mix(in srgb, var(--accent-color) 45%, transparent),
    var(--shadow-md);
}

/* -----------------------------------------
   Billable Item – Inline Edit Save Flash
   Brief green glow when description/notes save
   ----------------------------------------- */

.billable-item-card.billable-save-flash {
  animation: billableSaveFlash 1.05s ease;
}

@keyframes billableSaveFlash {
  0% {
    box-shadow:
      0 0 0 0 rgba(40,167,69,0),
      var(--shadow-sm);
  }

  45% {
    box-shadow:
      0 0 0 4px rgba(40,167,69,0.95),
      0 0 240px rgba(40,167,69,0.85),
      var(--shadow-md);
    border-color: rgba(40,167,69,0.95);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(40,167,69,0),
      var(--shadow-sm);
  }
}

/* Billable notes preview block */
.billable-notes-preview {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 0.25rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

/* Sticky filter bar for billables */
.billables-filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-card);
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}

/* Claim summary label/value formatting */
.claim-summary-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.65;
  letter-spacing: 0.03em;
}

.claim-summary-value {
  font-size: 0.92rem;
  font-weight: 500;
}

/* Highlight animation used when jumping to rows or sections */
.ai-jump-highlight {
  animation: aiJumpHighlight 1.1s ease;
  scroll-margin-top: 5rem;
}

@keyframes aiJumpHighlight {
  0% {
    box-shadow: 0 0 0 2px var(--accent-color);
  }
  50% {
    box-shadow: 0 0 0 4px var(--accent-color);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.table tr.ai-jump-highlight > td,
.table tr.ai-jump-highlight > th {
  animation: aiJumpHighlightCell 1.1s ease;
}

@keyframes aiJumpHighlightCell {
  0% {
    background-color: color-mix(in srgb, var(--accent-color) 18%, transparent);
  }
  50% {
    background-color: color-mix(in srgb, var(--accent-color) 28%, transparent);
  }
  100% {
    background-color: transparent;
  }
}

.impact-search-mark {
  background: color-mix(in srgb, var(--accent-color) 34%, transparent);
  color: inherit;
  padding: 0 0.14rem;
  border-radius: 0.22rem;
}

.impact-search-hit {
  border-color: color-mix(in srgb, var(--accent-color) 78%, transparent) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent-color) 30%, transparent),
    0 0 18px color-mix(in srgb, var(--accent-color) 22%, transparent) !important;
}

/* Dark mode adjustments */
html.dark-mode .billable-item-card {
  background: #1e1e1e;
  border: 1px solid color-mix(in srgb, var(--accent-color) 42%, rgba(255, 255, 255, 0.16));
}

/* Standard large claim detail cards (left column + billables container) */
.claim-left-column .card,
.claim-right-column > .card,
.billables-card {
  background: var(--surface-card);
  border: 1px solid color-mix(in srgb, var(--accent-color) 36%, rgba(0, 0, 0, 0.14)) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 18%, transparent),
    0 0 14px color-mix(in srgb, var(--accent-color) 12%, transparent),
    var(--shadow-md);
  overflow: visible;
  transition: none; /* large cards remain static */
}

/* Match billable-item hover behavior: accent border highlight */
.claim-left-column .card:hover,
.claim-right-column > .card:hover,
.billables-card:hover,
.billables-card:has(.billable-item-card:hover) {
  border-color: var(--accent-color) !important;
  box-shadow:
    var(--accent-glow-shadow),
    var(--shadow-md);
}

html.dark-mode .claim-left-column .card,
html.dark-mode .claim-right-column > .card,
html.dark-mode .billables-card {
  background: #1e1e1e;
  border: 1px solid color-mix(in srgb, var(--accent-color) 44%, rgba(255, 255, 255, 0.14)) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 22%, transparent),
    0 0 16px color-mix(in srgb, var(--accent-color) 14%, transparent),
    var(--shadow-md);
}

/* Ensure card headers respect the rounded card system */
.claim-left-column .card-header,
.claim-right-column .card-header {
  border-top-left-radius: var(--radius-lg) !important;
  border-top-right-radius: var(--radius-lg) !important;
}
/* --------------------------------------------------
   Dark mode hover accent border (Claim Detail cards)
   Ensures accent border highlight works in dark mode
-------------------------------------------------- */

html.dark-mode .claim-left-column .card:hover,
html.dark-mode .claim-right-column > .card:hover,
html.dark-mode .billables-card:hover,
html.dark-mode .billables-card:has(.billable-item-card:hover) {
  border-color: var(--accent-color) !important;
}

/* Billable item cards also highlight border in dark mode */
html.dark-mode .billable-item-card:hover {
  border-color: var(--accent-color) !important;
}

/* --------------------------------------------------
   Unified Field Focus Glow (All pages)
   Uses Settings accent color for inputs/selects/date pickers
-------------------------------------------------- */

:root {
  --field-focus-bg: color-mix(in srgb, var(--accent-color) 8%, transparent);
  --field-focus-ring:
    0 0 0 3px color-mix(in srgb, var(--accent-color) 52%, transparent),
    0 0 34px color-mix(in srgb, var(--accent-color) 36%, transparent);
}

html.dark-mode {
  --field-focus-bg: color-mix(in srgb, var(--accent-color) 14%, transparent);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
select:focus,
input[type="date"]:focus,
input[type="time"]:focus,
.flatpickr-input:focus,
.flatpickr-input.active,
input.flatpickr-input:focus,
input.flatpickr-input[readonly]:focus {
  border-color: var(--accent-color) !important;
  background-color: var(--field-focus-bg) !important;
  box-shadow: var(--field-focus-ring) !important;
  outline: none !important;
}

.ts-wrapper.focus .ts-control,
.ts-control.focus {
  border-color: var(--accent-color) !important;
  box-shadow: var(--field-focus-ring) !important;
}

.autosave-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.94);
  color: #293241;
  font-size: 0.875rem;
  line-height: 1.45;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.autosave-soft-lock-banner {
  border-color: rgba(255, 193, 7, 0.72);
  background: linear-gradient(135deg, rgba(255, 252, 242, 0.98), rgba(255, 245, 214, 0.95));
  color: #6f5200;
  box-shadow:
    0 0 0 2px rgba(255, 193, 7, 0.22),
    0 0 28px rgba(255, 193, 7, 0.24),
    0 16px 34px rgba(15, 23, 42, 0.12);
}

.autosave-conflict-banner {
  border-color: rgba(220, 53, 69, 0.76);
  background: linear-gradient(135deg, rgba(255, 246, 248, 0.98), rgba(255, 230, 235, 0.96));
  color: #8a1830;
  box-shadow:
    0 0 0 2px rgba(220, 53, 69, 0.22),
    0 0 32px rgba(220, 53, 69, 0.24),
    0 18px 38px rgba(15, 23, 42, 0.14);
}

html.dark-mode .autosave-banner {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(21, 26, 33, 0.92);
  color: #eef2f7;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

html.dark-mode .autosave-soft-lock-banner {
  border-color: rgba(255, 214, 10, 0.72);
  background: linear-gradient(135deg, rgba(57, 45, 8, 0.96), rgba(42, 34, 8, 0.92));
  color: #ffe08a;
  box-shadow:
    0 0 0 2px rgba(255, 214, 10, 0.24),
    0 0 32px rgba(255, 214, 10, 0.26),
    0 18px 40px rgba(0, 0, 0, 0.5);
}

html.dark-mode .autosave-conflict-banner {
  border-color: rgba(255, 123, 134, 0.76);
  background: linear-gradient(135deg, rgba(70, 20, 31, 0.96), rgba(52, 16, 26, 0.92));
  color: #ffb5bf;
  box-shadow:
    0 0 0 2px rgba(255, 123, 134, 0.24),
    0 0 36px rgba(255, 123, 134, 0.28),
    0 18px 42px rgba(0, 0, 0, 0.54);
}

/* Parent card glow while editing any field inside */
.impact-card.parent-card:focus-within,
.impact-card:focus-within,
.card:focus-within,
.billable-item-card:focus-within,
.claim-card:focus-within {
  border-color: var(--accent-color) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent-color) 72%, transparent),
    0 0 44px color-mix(in srgb, var(--accent-color) 38%, transparent),
    var(--card-drop-shadow) !important;
}

/* Generic autosave success pulse for parent cards */
.impact-card.parent-card.billable-save-flash,
.impact-card.billable-save-flash,
.card.billable-save-flash {
  animation: reportSaveFlashGlobal 1.1s ease-in-out 1;
}

@keyframes reportSaveFlashGlobal {
  0% {
    box-shadow:
      0 0 0 0 rgba(40,200,120,0),
      0 0 0 0 rgba(40,200,120,0);
  }
  45% {
    box-shadow:
      0 0 0 2px rgba(40,200,120,.78),
      0 0 44px rgba(40,200,120,.56);
    border-color: rgba(40,200,120,.9);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(40,200,120,0),
      0 0 0 0 rgba(40,200,120,0);
  }
}

/* --------------------------------------------------
   Core Data Inline Fields (Carrier/Employer/Provider)
   Billable-style low-noise fields: text-first, highlight on edit
-------------------------------------------------- */

.carrier-inline-autosave .form-control,
.carrier-inline-autosave .form-select,
.employer-inline-autosave .form-control,
.employer-inline-autosave .form-select,
.provider-inline-autosave .form-control,
.provider-inline-autosave .form-select,
.claim-inline-autosave .form-control,
.claim-inline-autosave .form-select,
.carrier-new-autosave .form-control,
.carrier-new-autosave .form-select,
.employer-new-autosave .form-control,
.employer-new-autosave .form-select,
.provider-new-autosave .form-control,
.provider-new-autosave .form-select,
.claim-new-autosave .form-control,
.claim-new-autosave .form-select {
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 6px !important;
  padding: 2px 4px !important;
}

/* Light mode: keep a very subtle field affordance */
html:not(.dark-mode) .carrier-inline-autosave .form-control,
html:not(.dark-mode) .carrier-inline-autosave .form-select,
html:not(.dark-mode) .employer-inline-autosave .form-control,
html:not(.dark-mode) .employer-inline-autosave .form-select,
html:not(.dark-mode) .provider-inline-autosave .form-control,
html:not(.dark-mode) .provider-inline-autosave .form-select,
html:not(.dark-mode) .claim-inline-autosave .form-control,
html:not(.dark-mode) .claim-inline-autosave .form-select,
html:not(.dark-mode) .carrier-new-autosave .form-control,
html:not(.dark-mode) .carrier-new-autosave .form-select,
html:not(.dark-mode) .employer-new-autosave .form-control,
html:not(.dark-mode) .employer-new-autosave .form-select,
html:not(.dark-mode) .provider-new-autosave .form-control,
html:not(.dark-mode) .provider-new-autosave .form-select,
html:not(.dark-mode) .claim-new-autosave .form-control,
html:not(.dark-mode) .claim-new-autosave .form-select {
  background: rgba(108, 117, 125, 0.10) !important;
  border-color: rgba(60, 70, 84, 0.16) !important;
}

.carrier-inline-autosave .form-control:hover,
.carrier-inline-autosave .form-select:hover,
.employer-inline-autosave .form-control:hover,
.employer-inline-autosave .form-select:hover,
.provider-inline-autosave .form-control:hover,
.provider-inline-autosave .form-select:hover,
.claim-inline-autosave .form-control:hover,
.claim-inline-autosave .form-select:hover,
.carrier-new-autosave .form-control:hover,
.carrier-new-autosave .form-select:hover,
.employer-new-autosave .form-control:hover,
.employer-new-autosave .form-select:hover,
.provider-new-autosave .form-control:hover,
.provider-new-autosave .form-select:hover,
.claim-new-autosave .form-control:hover,
.claim-new-autosave .form-select:hover {
  background: color-mix(in srgb, var(--accent-color) 4%, transparent) !important;
}

.carrier-inline-autosave .form-control:focus,
.carrier-inline-autosave .form-select:focus,
.employer-inline-autosave .form-control:focus,
.employer-inline-autosave .form-select:focus,
.provider-inline-autosave .form-control:focus,
.provider-inline-autosave .form-select:focus,
.claim-inline-autosave .form-control:focus,
.claim-inline-autosave .form-select:focus,
.carrier-new-autosave .form-control:focus,
.carrier-new-autosave .form-select:focus,
.employer-new-autosave .form-control:focus,
.employer-new-autosave .form-select:focus,
.provider-new-autosave .form-control:focus,
.provider-new-autosave .form-select:focus,
.claim-new-autosave .form-control:focus,
.claim-new-autosave .form-select:focus {
  border-color: transparent !important;
  background: color-mix(in srgb, var(--accent-color) 12%, transparent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color) 55%, transparent) !important;
}

/* Select dropdown list colors across light/dark modes */
html:not(.dark-mode) .carrier-inline-autosave .form-select option,
html:not(.dark-mode) .employer-inline-autosave .form-select option,
html:not(.dark-mode) .provider-inline-autosave .form-select option,
html:not(.dark-mode) .claim-inline-autosave .form-select option,
html:not(.dark-mode) .carrier-new-autosave .form-select option,
html:not(.dark-mode) .employer-new-autosave .form-select option,
html:not(.dark-mode) .provider-new-autosave .form-select option,
html:not(.dark-mode) .claim-new-autosave .form-select option {
  background-color: #ffffff !important;
  color: #1f2733 !important;
}

html.dark-mode .carrier-inline-autosave .form-select option,
html.dark-mode .carrier-inline-autosave .form-select optgroup,
html.dark-mode .employer-inline-autosave .form-select option,
html.dark-mode .employer-inline-autosave .form-select optgroup,
html.dark-mode .provider-inline-autosave .form-select option,
html.dark-mode .provider-inline-autosave .form-select optgroup,
html.dark-mode .claim-inline-autosave .form-select option,
html.dark-mode .claim-inline-autosave .form-select optgroup,
html.dark-mode .carrier-new-autosave .form-select option,
html.dark-mode .carrier-new-autosave .form-select optgroup,
html.dark-mode .employer-new-autosave .form-select option,
html.dark-mode .employer-new-autosave .form-select optgroup,
html.dark-mode .provider-new-autosave .form-select option,
html.dark-mode .provider-new-autosave .form-select optgroup,
html.dark-mode .claim-new-autosave .form-select option,
html.dark-mode .claim-new-autosave .form-select optgroup {
  background-color: #151b24 !important;
  color: #e7edf6 !important;
}

/* Contact sub-cards: shared hover illumination */
.entity-contact-card {
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .22s ease, transform .12s ease;
}

.entity-contact-card:hover {
  border-color: var(--accent-color) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent-color) 66%, transparent),
    0 0 28px color-mix(in srgb, var(--accent-color) 34%, transparent),
    var(--card-drop-shadow);
  transform: translateY(-1px);
}

/* Dark mode fixes for contact sub-cards */
html.dark-mode .entity-contact-card {
  background: color-mix(in srgb, #0f141a 92%, transparent) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

html.dark-mode .entity-contact-card .form-label,
html.dark-mode .entity-contact-card .text-muted,
html.dark-mode .entity-contact-card .small {
  color: #d7dde6 !important;
}

/* =====================================================
   Settings Section Shell (Route-Per-Section)
   ===================================================== */

.settings-shell {
  max-width: 1500px;
  padding: 1rem 0.65rem 1.6rem;
}

/* Keep settings shell cards white in day mode (do not inherit page canvas gray) */
html:not(.dark-mode) .settings-header-card,
html:not(.dark-mode) .settings-nav-card {
  background: #ffffff;
}

html:not(.dark-mode) .settings-header-card .impact-card-header,
html:not(.dark-mode) .settings-nav-card .impact-card-body {
  background: #ffffff;
}

/* Keep settings shell cards unified in dark mode too (top + left match main cards) */
html.dark-mode .settings-header-card,
html.dark-mode .settings-nav-card {
  background: color-mix(in srgb, #111821 95%, transparent);
}

html.dark-mode .settings-header-card .impact-card-header,
html.dark-mode .settings-nav-card .impact-card-body {
  background: color-mix(in srgb, #111821 91%, transparent);
}

.settings-header-card .impact-card-header {
  padding: 0.95rem 1.25rem;
}

.settings-active-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--accent-color) 70%, transparent);
  color: var(--accent-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.settings-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-nav-wrap {
  position: sticky;
  top: calc(var(--workspace-topbar-height) + 1rem);
  align-self: start;
}

.settings-nav-card .impact-card-body {
  padding: 0.7rem;
}

.settings-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.settings-nav-link {
  display: block;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(90, 98, 110, 0.28);
  background: color-mix(in srgb, var(--surface-card) 93%, transparent);
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color .18s ease, box-shadow .22s ease, transform .12s ease, background .18s ease;
}

.settings-nav-link:hover {
  color: inherit;
  border-color: var(--accent-color);
  box-shadow: var(--accent-glow-shadow);
  transform: translateY(-1px);
}

.settings-nav-link.active {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 52%, transparent),
    0 0 18px color-mix(in srgb, var(--accent-color) 28%, transparent);
}

.settings-content-panel {
  min-width: 0;
  animation: settingsPageIn .24s ease both;
}

.settings-section-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.settings-form,
.settings-content-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-card {
  background: var(--surface-card);
  border: 2px solid rgba(90, 98, 110, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-drop-shadow);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .22s ease, transform .12s ease;
  animation: settingsCardIn .22s ease both;
}

.settings-card:hover,
.settings-card:focus-within {
  border-color: var(--accent-color);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 58%, transparent),
    0 0 28px color-mix(in srgb, var(--accent-color) 33%, transparent),
    var(--card-drop-shadow);
  transform: translateY(-1px);
}

.settings-card-header {
  padding: 0.76rem 1rem;
  border-bottom: 1px solid rgba(90, 98, 110, 0.22);
  background: color-mix(in srgb, var(--surface-card) 95%, rgba(128, 128, 128, 0.04));
}

.settings-card-body {
  padding: 1rem 1.05rem;
}

.settings-token-panel {
  padding: 0.75rem;
  border: 1px solid rgba(90, 98, 110, 0.24);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-card) 92%, rgba(128, 128, 128, 0.08));
}

.settings-preview-media img {
  display: block;
  max-height: 66px;
  max-width: 100%;
  border-radius: 8px;
}

.settings-preview-media-signature img {
  max-height: 84px;
}

.settings-savebar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.68rem 0.75rem;
  border: 1px solid rgba(90, 98, 110, 0.24);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-card) 90%, rgba(255, 255, 255, 0.35));
  backdrop-filter: blur(5px);
}

.settings-savebar--top {
  top: calc(var(--workspace-topbar-height) + 0.65rem);
  bottom: auto;
  z-index: 20;
}

#clarityInteractionFilters .btn.is-active {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 12%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 40%, transparent),
    0 0 12px color-mix(in srgb, var(--accent-color) 26%, transparent);
}

.settings-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5f6876;
  border-bottom-width: 1px;
}

.settings-row-inactive {
  opacity: 0.75;
}

.settings-content-panel .form-control,
.settings-content-panel .form-select,
.settings-content-panel textarea,
.settings-content-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  border: 2px solid var(--field-border-light) !important;
  border-radius: var(--field-radius) !important;
  background: var(--field-bg-light) !important;
  color: var(--field-text-light) !important;
}

.settings-content-panel input[type="file"] {
  border: 1px dashed rgba(70, 78, 90, 0.28) !important;
  border-radius: 10px !important;
  background: rgba(108, 117, 125, 0.05) !important;
}

.settings-content-panel .form-control:hover,
.settings-content-panel .form-select:hover,
.settings-content-panel textarea:hover,
.settings-content-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover {
  border-color: color-mix(in srgb, var(--accent-color) 32%, var(--field-border-light)) !important;
  background: var(--field-bg-light-hover) !important;
}

.settings-content-panel .form-control:focus,
.settings-content-panel .form-select:focus,
.settings-content-panel textarea:focus,
.settings-content-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
  border-color: var(--accent-color) !important;
  background: var(--field-bg-light-focus) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 20%, transparent) !important;
}

@keyframes settingsPageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes settingsCardIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.dark-mode .settings-active-pill {
  border-color: color-mix(in srgb, var(--accent-color) 75%, transparent);
  background: color-mix(in srgb, var(--accent-color) 15%, transparent);
}

html.dark-mode .settings-nav-link {
  border-color: rgba(228, 236, 248, 0.22);
  background: color-mix(in srgb, #151b24 94%, transparent);
  color: #e1e7f0;
}

html.dark-mode .settings-nav-link:hover {
  color: #f0f4fb;
}

html.dark-mode .settings-card {
  border-color: rgba(228, 236, 248, 0.2);
  background: color-mix(in srgb, #111821 95%, transparent);
}

html.dark-mode .settings-card-header {
  border-bottom-color: rgba(228, 236, 248, 0.16);
  background: color-mix(in srgb, #111821 91%, transparent);
}

html.dark-mode .settings-token-panel {
  border-color: rgba(228, 236, 248, 0.2);
  background: color-mix(in srgb, #151d28 88%, transparent);
}

html.dark-mode .settings-savebar {
  border-color: rgba(228, 236, 248, 0.2);
  background: color-mix(in srgb, #101722 90%, transparent);
}

html.dark-mode #clarityInteractionFilters .btn.is-active {
  color: #f2f6ff;
  border-color: color-mix(in srgb, var(--accent-color) 78%, rgba(228, 236, 248, 0.35));
  background: color-mix(in srgb, var(--accent-color) 22%, #101722);
}

html.dark-mode .settings-table thead th {
  color: #aeb8c9;
}

html.dark-mode .settings-content-panel .form-control,
html.dark-mode .settings-content-panel .form-select,
html.dark-mode .settings-content-panel textarea,
html.dark-mode .settings-content-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  background: var(--field-bg-dark) !important;
  border-color: var(--field-border-dark) !important;
  color: var(--field-text-dark) !important;
}

html.dark-mode .settings-content-panel input[type="file"] {
  background: color-mix(in srgb, #151d28 88%, transparent) !important;
  border-color: rgba(228, 236, 248, 0.28) !important;
}

html.dark-mode .settings-content-panel .form-control:hover,
html.dark-mode .settings-content-panel .form-select:hover,
html.dark-mode .settings-content-panel textarea:hover,
html.dark-mode .settings-content-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover {
  border-color: color-mix(in srgb, var(--accent-color) 42%, var(--field-border-dark)) !important;
  background: var(--field-bg-dark-hover) !important;
}

html.dark-mode .settings-content-panel .form-control:focus,
html.dark-mode .settings-content-panel .form-select:focus,
html.dark-mode .settings-content-panel textarea:focus,
html.dark-mode .settings-content-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
  border-color: var(--accent-color) !important;
  background: var(--field-bg-dark-focus) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 24%, transparent) !important;
}

.settings-pagebar-wrap,
.forms-pagebar-wrap,
.analysis-pagebar-wrap {
  position: sticky;
  top: calc(var(--workspace-topbar-height) + var(--workspace-sticky-gap));
  z-index: 34;
  padding: 0.7rem 0.65rem 0;
}

.settings-pagebar-wrap {
  max-width: 1500px;
  margin: 0 auto;
}

.forms-pagebar-wrap {
  max-width: 1360px;
  margin: 0 auto;
}

.analysis-pagebar-wrap {
  max-width: 100%;
}

.settings-pagebar,
.forms-pagebar,
.analysis-pagebar {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  border: 1px solid color-mix(in srgb, var(--accent-color) 42%, var(--surface-border));
  border-radius: 1.35rem;
  background: color-mix(in srgb, var(--surface-card) 90%, rgba(255, 255, 255, 0.34));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 8%, transparent),
    0 16px 38px rgba(15, 23, 42, 0.12);
}

.settings-pagebar .impact-subnav-inner,
.forms-pagebar .impact-subnav-inner,
.analysis-pagebar .impact-subnav-inner {
  min-height: auto;
  padding: 0.95rem 1.15rem;
}

.settings-pagebar-copy,
.forms-pagebar-copy,
.analysis-pagebar-copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.settings-pagebar-copy h1,
.forms-pagebar-copy h1,
.analysis-pagebar-copy h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.settings-pagebar-copy p,
.forms-pagebar-copy p,
.analysis-pagebar-copy p {
  margin: 0;
  font-size: 0.84rem;
  color: #677386;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.settings-summary-tile,
.settings-mini-tile {
  border: 1px solid rgba(90, 98, 110, 0.18);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: color-mix(in srgb, var(--surface-card) 96%, rgba(128, 128, 128, 0.04));
}

.settings-summary-label,
.settings-mini-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8693a7;
}

.settings-summary-value,
.settings-mini-value {
  margin-top: 0.35rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #192230;
}

.settings-summary-value--danger {
  color: #c63f3f;
}

.settings-summary-value--warning {
  color: #b46907;
}

.settings-summary-value--success {
  color: #118a4b;
}

.settings-toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.settings-toolbar-inline > * {
  min-width: 0;
}

.settings-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
}

.settings-filter-grid .settings-form-field--span-2 {
  grid-column: span 2;
}

.settings-filter-grid .settings-form-field--span-3 {
  grid-column: span 3;
}

.settings-filter-grid .settings-form-field--span-6 {
  grid-column: 1 / -1;
}

.settings-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-form-field label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a8597;
}

.settings-table-surface .settings-card-body {
  padding: 0;
}

.settings-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(90, 98, 110, 0.14);
}

.settings-table-wrap {
  overflow-x: auto;
}

.settings-data-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-data-table thead th {
  padding: 0.8rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8490a3;
  border-bottom: 1px solid rgba(90, 98, 110, 0.14);
  background: color-mix(in srgb, var(--surface-card) 97%, rgba(128, 128, 128, 0.05));
}

.settings-data-table tbody td {
  padding: 0.95rem 1rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(90, 98, 110, 0.1);
}

.settings-data-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-card) 98%, rgba(128, 128, 128, 0.035));
}

html:not(.dark-mode) .settings-data-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-color) 8%, #eef3fb);
}

html.dark-mode .settings-data-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-color) 14%, #17202b);
}

.settings-user-card {
  border: 1px solid rgba(90, 98, 110, 0.16);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-card) 98%, rgba(128, 128, 128, 0.03));
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-user-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-user-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.settings-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.settings-permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.settings-permission-card {
  border: 1px solid rgba(90, 98, 110, 0.16);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: color-mix(in srgb, var(--surface-card) 97%, rgba(128, 128, 128, 0.04));
}

.settings-permission-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.82rem;
  color: #6e798b;
}

.settings-empty-state {
  padding: 1rem;
  border: 1px dashed rgba(90, 98, 110, 0.24);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-card) 97%, rgba(128, 128, 128, 0.03));
  color: #6f7a8d;
  font-size: 0.86rem;
}

.forms-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1rem 0.75rem 1.6rem;
}

.forms-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forms-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.forms-surface {
  border: 1px solid rgba(90, 98, 110, 0.18);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--card-drop-shadow);
  overflow: hidden;
}

.forms-surface--overflow-visible {
  overflow: visible;
}

.forms-surface-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(90, 98, 110, 0.14);
  background: color-mix(in srgb, var(--surface-card) 97%, rgba(128, 128, 128, 0.04));
}

.forms-surface-body {
  padding: 1rem;
}

.forms-template-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.forms-template-link {
  display: block;
  padding: 1rem;
  border: 1px solid rgba(90, 98, 110, 0.16);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-card) 98%, rgba(128, 128, 128, 0.03));
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .22s ease, transform .12s ease, background .18s ease;
}

.forms-template-link:hover,
.forms-template-link:focus-visible {
  color: inherit;
  border-color: color-mix(in srgb, var(--accent-color) 42%, var(--surface-border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 22%, transparent),
    0 16px 32px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.forms-live-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(90, 98, 110, 0.18);
  border-radius: 16px;
  background: var(--surface-card);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.forms-live-results .list-group-item {
  border-left: 0;
  border-right: 0;
}

.forms-results-table-wrap {
  overflow-x: auto;
}

.forms-results-table {
  width: 100%;
  border-collapse: collapse;
}

.forms-results-table thead th {
  padding: 0.8rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8692a5;
  border-bottom: 1px solid rgba(90, 98, 110, 0.14);
}

.forms-results-table tbody td {
  padding: 0.9rem 0.95rem;
  border-bottom: 1px solid rgba(90, 98, 110, 0.1);
}

html:not(.dark-mode) .forms-results-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-color) 8%, #eef3fb);
}

html.dark-mode .forms-results-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-color) 14%, #17202b);
}

.analysis-dashboard-shell {
  padding-top: 1rem;
}

html.dark-mode .settings-pagebar,
html.dark-mode .forms-pagebar,
html.dark-mode .analysis-pagebar {
  background: color-mix(in srgb, #111821 90%, transparent);
}

html.dark-mode .settings-pagebar-copy p,
html.dark-mode .forms-pagebar-copy p,
html.dark-mode .analysis-pagebar-copy p,
html.dark-mode .settings-note-row,
html.dark-mode .settings-empty-state,
html.dark-mode .settings-summary-label,
html.dark-mode .settings-mini-label,
html.dark-mode .settings-form-field label,
html.dark-mode .settings-data-table thead th {
  color: #9aa7bc;
}

html.dark-mode .settings-summary-value,
html.dark-mode .settings-mini-value {
  color: #eff4fb;
}

html.dark-mode .settings-summary-tile,
html.dark-mode .settings-mini-tile,
html.dark-mode .settings-user-card,
html.dark-mode .settings-permission-card,
html.dark-mode .forms-surface,
html.dark-mode .forms-template-link,
html.dark-mode .forms-live-results {
  border-color: rgba(228, 236, 248, 0.18);
  background: color-mix(in srgb, #111821 95%, transparent);
}

html.dark-mode .forms-surface-head,
html.dark-mode .settings-table-toolbar {
  border-bottom-color: rgba(228, 236, 248, 0.12);
  background: color-mix(in srgb, #151d28 84%, transparent);
}

@media (max-width: 1200px) {
  .settings-summary-grid,
  .settings-user-meta,
  .settings-permission-grid,
  .settings-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forms-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .settings-pagebar .impact-subnav-inner,
  .forms-pagebar .impact-subnav-inner,
  .analysis-pagebar .impact-subnav-inner {
    padding: 0.85rem 0.95rem;
  }

  .settings-summary-grid,
  .settings-user-meta,
  .settings-permission-grid,
  .settings-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-nav-wrap {
    position: static;
  }

  .settings-nav-links {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .settings-nav-link {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-content-panel,
  .settings-card {
    animation: none !important;
  }
}

/* =====================================================
   Unified Card Chrome (Reports / Invoices / Core Lists /
   Reporting / Settings / Analytics / Previews)
   ===================================================== */

.impact-card.parent-card,
.settings-card,
.billing-summary-card,
.dashboard-container .dashboard-card,
.reporting-dashboard-page .dashboard-card.dashboard-card,
.invoice-detail-page .invoice-line-item-card,
.email-preview-shell .signature-preview-card {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--surface-border) !important;
  background: var(--surface-card) !important;
  box-shadow:
    var(--card-shell-ring-rest),
    var(--card-shell-glow-rest),
    var(--card-drop-shadow) !important;
  transition:
    border-color .18s ease,
    box-shadow .22s ease,
    transform .12s ease;
}

.impact-card.parent-card > .impact-card-header,
.impact-card.parent-card > .impact-card-body,
.settings-card-header,
.settings-card-body,
.settings-header-card .impact-card-header,
.settings-nav-card .impact-card-header,
.settings-nav-card .impact-card-body {
  background: var(--surface-card) !important;
}

.impact-card.parent-card:hover,
.impact-card.parent-card:focus-within,
.settings-card:hover,
.settings-card:focus-within,
.billing-summary-card:hover,
.billing-summary-card:focus-within,
.dashboard-container .dashboard-card:hover,
.dashboard-container .dashboard-card:focus-within,
.reporting-dashboard-page .dashboard-card.dashboard-card:hover,
.reporting-dashboard-page .dashboard-card.dashboard-card:focus-within,
.invoice-detail-page .invoice-line-item-card:hover,
.invoice-detail-page .invoice-line-item-card:focus-within,
.email-preview-shell .signature-preview-card:hover,
.email-preview-shell .signature-preview-card:focus-within {
  border-color: var(--accent-color) !important;
  box-shadow:
    var(--card-shell-ring-hover),
    var(--card-shell-glow-hover),
    var(--card-drop-shadow) !important;
  transform: translateY(-1px);
}

/* =====================================================
   Dark-Mode Field Contrast Lift
   Make text-entry surfaces lighter than card backgrounds
   ===================================================== */
html.dark-mode {
  --field-bg-dark: rgba(255, 255, 255, 0.08);
  --field-bg-dark-hover: rgba(255, 255, 255, 0.10);
  --field-bg-dark-focus: rgba(255, 255, 255, 0.12);
  --field-border-dark: rgba(255, 255, 255, 0.18);
  --field-text-dark: #f1f1f1;
}

html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode textarea,
html.dark-mode input[type="text"],
html.dark-mode input[type="email"],
html.dark-mode input[type="tel"],
html.dark-mode input[type="number"],
html.dark-mode input[type="search"],
html.dark-mode input[type="date"],
html.dark-mode input[type="time"],
html.dark-mode input[type="datetime-local"],
html.dark-mode input[type="month"],
html.dark-mode input[type="week"],
html.dark-mode input[type="url"],
html.dark-mode input[type="password"],
html.dark-mode .ts-control {
  background-color: var(--field-bg-dark) !important;
  border-color: var(--field-border-dark) !important;
  color: var(--field-text-dark) !important;
}

html.dark-mode .form-control:hover,
html.dark-mode .form-select:hover,
html.dark-mode textarea:hover,
html.dark-mode input[type="text"]:hover,
html.dark-mode input[type="email"]:hover,
html.dark-mode input[type="tel"]:hover,
html.dark-mode input[type="number"]:hover,
html.dark-mode input[type="search"]:hover,
html.dark-mode input[type="date"]:hover,
html.dark-mode input[type="time"]:hover,
html.dark-mode input[type="datetime-local"]:hover,
html.dark-mode input[type="month"]:hover,
html.dark-mode input[type="week"]:hover,
html.dark-mode input[type="url"]:hover,
html.dark-mode input[type="password"]:hover,
html.dark-mode .ts-control:hover {
  background-color: var(--field-bg-dark-hover) !important;
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus,
html.dark-mode textarea:focus,
html.dark-mode input[type="text"]:focus,
html.dark-mode input[type="email"]:focus,
html.dark-mode input[type="tel"]:focus,
html.dark-mode input[type="number"]:focus,
html.dark-mode input[type="search"]:focus,
html.dark-mode input[type="date"]:focus,
html.dark-mode input[type="time"]:focus,
html.dark-mode input[type="datetime-local"]:focus,
html.dark-mode input[type="month"]:focus,
html.dark-mode input[type="week"]:focus,
html.dark-mode input[type="url"]:focus,
html.dark-mode input[type="password"]:focus,
html.dark-mode .ts-control.focus,
html.dark-mode .ts-wrapper.focus .ts-control {
  background-color: var(--field-bg-dark-focus) !important;
  border-color: var(--accent-color) !important;
}

/* =====================================================
   Reference/Admin workspace system
   ===================================================== */
.reference-workspace {
  display: grid;
  gap: 1rem;
  min-height: 100%;
}

.reference-table-surface .surface-card-body,
.reference-detail-surface .surface-card-body,
.reference-contacts-surface .surface-card-body,
.reference-form-surface .surface-card-body {
  padding: 0;
  overflow: hidden;
}

.reference-table-wrapper {
  overflow: auto;
  border-radius: inherit;
}

.reference-index-table {
  width: 100%;
  min-width: 54rem;
  table-layout: auto;
}

.reference-index-table .reference-col-phone,
.reference-index-table .reference-col-count,
.reference-index-table .reference-col-actions {
  width: 1%;
  white-space: nowrap;
}

.reference-index-table .reference-col-primary {
  width: clamp(10.5rem, 22vw, 15rem);
}

.reference-index-table .reference-col-text,
.reference-index-table .reference-col-organization,
.reference-index-table .reference-col-email {
  width: clamp(8rem, 16vw, 11rem);
}

.reference-index-table .reference-col-location,
.reference-index-table .reference-col-specialty {
  width: clamp(7rem, 14vw, 9rem);
}

.reference-index-table td.reference-col-text,
.reference-index-table td.reference-col-organization,
.reference-index-table td.reference-col-email,
.reference-index-table td.reference-col-location,
.reference-index-table td.reference-col-specialty {
  overflow-wrap: anywhere;
}

.reference-index-table .claims-primary-meta {
  margin-top: 0.26rem;
}

.reference-primary-link {
  color: inherit;
  text-decoration: none;
}

.reference-primary-link:hover,
.reference-primary-link:focus-visible {
  color: var(--accent-color);
}

.reference-subline {
  margin-top: 0.18rem;
  color: var(--workspace-surface-muted);
  font-size: 0.76rem;
  line-height: 1.28;
}

.reference-toolbar-count {
  color: var(--workspace-surface-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.reference-detail-header-bar {
  position: sticky;
  top: calc(var(--workspace-topbar-height, 60px) + var(--workspace-sticky-gap, 0.95rem));
  z-index: 1030;
  margin-bottom: 1rem;
  padding-top: 0.55rem;
}

.reference-detail-header-bar .impact-subnav {
  position: static;
  width: auto;
  margin-bottom: 0;
  margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  border-radius: 1.1rem;
  background: color-mix(in srgb, var(--workspace-surface-bg) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html.dark-mode .reference-detail-header-bar .impact-subnav {
  background: color-mix(in srgb, var(--workspace-surface-bg) 88%, transparent);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
}

.reference-detail-header-bar .impact-subnav-inner {
  max-width: 1360px;
  margin: 0 auto;
}

.reference-detail-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.reference-status-cluster {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-height: 2.15rem;
}

.reference-status-label {
  color: var(--workspace-surface-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reference-status-pill,
.reference-status-meta {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.36rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--workspace-row-border);
  background: color-mix(in srgb, var(--workspace-surface-bg) 94%, transparent);
  color: var(--workspace-surface-muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
}

.reference-status-pill {
  color: color-mix(in srgb, var(--accent-color) 82%, #111827);
  border-color: color-mix(in srgb, var(--accent-color) 34%, var(--workspace-row-border));
  background: color-mix(in srgb, var(--accent-color) 10%, var(--workspace-surface-bg) 90%);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  font-weight: 700;
}

.reference-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 0.45rem 2rem;
}

.reference-detail-stack {
  display: grid;
  gap: 1rem;
}

.reference-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.reference-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.reference-definition-section {
  padding: 1.1rem 1.2rem;
  border-right: 1px solid var(--workspace-row-border);
}

.reference-definition-section:last-child {
  border-right: 0;
}

.reference-definition-title {
  margin-bottom: 0.75rem;
  color: var(--workspace-surface-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reference-definition-list {
  display: grid;
  gap: 0.58rem;
}

.reference-definition-row {
  display: flex;
  justify-content: space-between;
  gap: 0.95rem;
  align-items: flex-start;
}

.reference-definition-row dt {
  color: var(--workspace-surface-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.reference-definition-row dd {
  margin: 0;
  color: var(--workspace-surface-strong);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: right;
}

.reference-definition-row dd.reference-definition-notes {
  white-space: pre-wrap;
  text-align: left;
}

.reference-contact-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.reference-contact-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.82rem 1rem;
  border-bottom: 1px solid var(--workspace-row-border);
  background: color-mix(in srgb, var(--workspace-surface-bg) 96%, transparent);
  color: var(--workspace-surface-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.reference-contact-table tbody tr {
  background: transparent;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.reference-contact-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--workspace-surface-bg) 97%, var(--workspace-row-hover-bg) 3%);
}

html:not(.dark-mode) .reference-contact-table tbody tr:hover {
  background: color-mix(in srgb, var(--workspace-row-hover-bg) 78%, #eef4ff 22%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 16%, transparent);
}

html.dark-mode .reference-contact-table tbody tr:hover {
  background: var(--workspace-row-hover-bg);
}

.reference-contact-table td {
  padding: 0.82rem 1rem;
  border-bottom: 1px solid var(--workspace-row-border);
  color: var(--workspace-surface-strong);
  font-size: 0.86rem;
  vertical-align: top;
}

.reference-contact-table td:last-child,
.reference-contact-table th:last-child {
  text-align: right;
}

.reference-contact-note {
  display: inline-block;
  max-width: 22rem;
  color: var(--workspace-surface-muted);
  font-size: 0.8rem;
  line-height: 1.34;
}

.reference-empty-state {
  padding: 1.05rem 1.2rem;
  color: var(--workspace-surface-muted);
  font-size: 0.86rem;
}

.reference-form-shell {
  padding: 1.1rem 1.2rem 1.2rem;
}

.reference-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.reference-form-field {
  display: grid;
  gap: 0.42rem;
}

.reference-form-field label {
  color: var(--workspace-surface-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reference-form-field--span-2 { grid-column: span 2; }
.reference-form-field--span-3 { grid-column: span 3; }
.reference-form-field--span-4 { grid-column: span 4; }
.reference-form-field--span-5 { grid-column: span 5; }
.reference-form-field--span-6 { grid-column: span 6; }
.reference-form-field--span-8 { grid-column: span 8; }
.reference-form-field--span-12 { grid-column: 1 / -1; }

.reference-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.reference-editor-surface .surface-card-body {
  padding: 1.1rem 1.2rem 1.2rem;
}

.reference-inline-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.reference-inline-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  flex-wrap: wrap;
}

.reference-inline-toolbar .surface-card-title {
  margin-right: auto;
}

.reference-inline-toolbar .js-contact-search {
  width: min(320px, 52vw);
}

.reference-inline-note {
  margin-bottom: 1rem;
  color: var(--workspace-surface-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.reference-inline-contact-list {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.2rem 1.2rem;
}

.reference-inline-contact-card {
  border: 1px solid var(--workspace-row-border);
  border-radius: 1rem;
  padding: 0.85rem 0.95rem;
  background: color-mix(in srgb, var(--workspace-surface-bg) 97%, transparent);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

html:not(.dark-mode) .reference-inline-contact-card:hover {
  background: color-mix(in srgb, var(--workspace-row-hover-bg) 78%, #eef4ff 22%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 16%, transparent);
}

html.dark-mode .reference-inline-contact-card:hover {
  background: var(--workspace-row-hover-bg);
}

.reference-inline-contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.55rem 0.85rem;
  align-items: end;
}

.reference-inline-contact-grid .reference-form-field {
  gap: 0.22rem;
}

.reference-inline-contact-grid .form-control,
.reference-inline-contact-grid .form-select {
  min-height: 1.9rem;
  padding-top: 0.14rem;
  padding-bottom: 0.14rem;
}

.reference-inline-contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

@media (max-width: 1100px) {
  .reference-definition-grid {
    grid-template-columns: 1fr;
  }

  .reference-definition-section {
    border-right: 0;
    border-bottom: 1px solid var(--workspace-row-border);
  }

  .reference-definition-section:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 900px) {
  .reference-detail-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .reference-form-field--span-2,
  .reference-form-field--span-3,
  .reference-form-field--span-4,
  .reference-form-field--span-5,
  .reference-form-field--span-6,
  .reference-form-field--span-8 {
    grid-column: span 12;
  }

  .reference-inline-toolbar .js-contact-search {
    width: 100%;
  }
}
