/* Final app UI layer.
   Loaded after legacy CSS so the redesign is deterministic without deleting
   older selectors that may still protect route-specific behavior. */
:root,
html[data-theme="dark"] {
  --app-bg: #060913;
  --app-bg-2: #0b1020;
  --app-surface: rgba(18, 25, 43, 0.94);
  --app-surface-2: rgba(25, 34, 56, 0.96);
  --app-surface-3: rgba(34, 45, 72, 0.96);
  --app-inset: #080d1a;
  --app-text: #f8fbff;
  --app-text-2: #d9e3f4;
  --app-muted: #9aa9c2;
  --app-border: rgba(129, 156, 205, 0.24);
  --app-border-2: rgba(139, 169, 223, 0.38);
  --app-primary: #7c9cff;
  --app-primary-strong: #9bb5ff;
  --app-secondary: #22d3ee;
  --app-violet: #a78bfa;
  --app-success: #34d399;
  --app-warning: #fbbf24;
  --app-danger: #fb7185;
  --app-focus: rgba(124, 156, 255, 0.42);
  --app-shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.22);
  --app-shadow-md: 0 18px 48px rgba(0, 0, 0, 0.32);
  --app-radius-md: 14px;
  --app-radius-lg: 18px;
  --app-radius-xl: 24px;
  --app-radius-pill: 999px;
  --app-fast: 140ms;
  --app-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --surface-page: var(--app-bg);
  --surface-1: var(--app-surface);
  --surface-2: var(--app-surface-2);
  --surface-3: var(--app-surface-3);
  --surface-inset: var(--app-inset);
  --text-primary: var(--app-text);
  --text-secondary: var(--app-text-2);
  --text-muted: var(--app-muted);
  --border-default: var(--app-border);
  --border-strong: var(--app-border-2);
  --accent-solid: var(--app-primary);
  --accent-solid-hover: var(--app-primary-strong);
  --bg: var(--surface-page);
  --panel: var(--surface-1);
  --panel-2: var(--surface-2);
  --border: var(--border-default);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --accent: var(--accent-solid);
}

html[data-theme="light"] {
  --app-bg: #eef4fb;
  --app-bg-2: #f8fbff;
  --app-surface: rgba(255, 255, 255, 0.96);
  --app-surface-2: #ffffff;
  --app-surface-3: #edf4ff;
  --app-inset: #f4f8fd;
  --app-text: #101828;
  --app-text-2: #26344c;
  --app-muted: #56657c;
  --app-border: rgba(71, 94, 132, 0.2);
  --app-border-2: rgba(71, 94, 132, 0.34);
  --app-primary: #2563eb;
  --app-primary-strong: #1d4ed8;
  --app-secondary: #0891b2;
  --app-violet: #7c3aed;
  --app-success: #059669;
  --app-warning: #b45309;
  --app-danger: #dc2626;
  --app-focus: rgba(37, 99, 235, 0.26);
  --app-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
  --app-shadow-md: 0 18px 46px rgba(15, 23, 42, 0.12);
  --surface-page: var(--app-bg);
  --surface-1: var(--app-surface);
  --surface-2: var(--app-surface-2);
  --surface-3: var(--app-surface-3);
  --surface-inset: var(--app-inset);
  --text-primary: var(--app-text);
  --text-secondary: var(--app-text-2);
  --text-muted: var(--app-muted);
  --border-default: var(--app-border);
  --border-strong: var(--app-border-2);
  --accent-solid: var(--app-primary);
  --accent-solid-hover: var(--app-primary-strong);
  --bg: var(--surface-page);
  --panel: var(--surface-1);
  --panel-2: var(--surface-2);
  --border: var(--border-default);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --accent: var(--accent-solid);
}

body {
  color: var(--app-text) !important;
  background:
    radial-gradient(circle at 12% -12%, rgba(124, 156, 255, 0.18), transparent 34%),
    radial-gradient(circle at 84% 4%, rgba(34, 211, 238, 0.1), transparent 28%),
    linear-gradient(135deg, var(--app-bg) 0%, var(--app-bg-2) 52%, var(--app-bg) 100%) !important;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 4% 0%, rgba(37, 99, 235, 0.14), transparent 30%),
    radial-gradient(circle at 96% 2%, rgba(8, 145, 178, 0.12), transparent 30%),
    linear-gradient(135deg, #eef4fb 0%, #f8fbff 50%, #edf4fb 100%) !important;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--app-focus) !important;
  outline-offset: 2px;
}

.page {
  width: min(100%, 1720px) !important;
  max-width: none !important;
  padding: clamp(20px, 2vw, 34px) !important;
}

h1 {
  color: var(--app-text) !important;
  font-size: clamp(38px, 5vw, 74px) !important;
  font-weight: 940 !important;
  letter-spacing: -0.045em !important;
  line-height: 0.95 !important;
}

h2 {
  color: var(--app-text) !important;
  font-weight: 900 !important;
  letter-spacing: -0.025em !important;
}

.subtext,
.subtitle,
.page-description,
.result-meta,
.datetime-cell-time,
.control-help,
.field-help-wide {
  color: var(--app-muted) !important;
}

.card,
.table-card,
.controls-card,
.scheduler-ops-card,
.scheduler-table-card,
.profile-section-card,
.saved-scans-card,
.saved-scans-table-card,
.application-view-card,
.intelligence-card,
.decision-card,
.modal-card,
.profile-dropdown,
.notification-dropdown {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-xl) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--app-surface) !important;
  box-shadow: var(--app-shadow-md) !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .table-card,
html[data-theme="light"] .controls-card,
html[data-theme="light"] .scheduler-ops-card,
html[data-theme="light"] .scheduler-table-card,
html[data-theme="light"] .profile-section-card,
html[data-theme="light"] .saved-scans-card,
html[data-theme="light"] .saved-scans-table-card,
html[data-theme="light"] .application-view-card,
html[data-theme="light"] .intelligence-card,
html[data-theme="light"] .decision-card,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .profile-dropdown,
html[data-theme="light"] .notification-dropdown {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.96)),
    var(--app-surface) !important;
}

button,
.btn,
.ghost-btn,
.app-shell-primary-link,
.application-pagination-btn,
.planning-pagination-btn,
.job-apply-btn,
.apply-btn,
.planning-tailoring-btn,
.theme-toggle-btn,
.profile-avatar-btn,
.notification-btn {
  border-radius: var(--app-radius-md) !important;
  border: 1px solid var(--app-border-2) !important;
  font-weight: 850 !important;
  transition:
    transform var(--app-fast) var(--app-ease),
    box-shadow var(--app-fast) var(--app-ease),
    background var(--app-fast) var(--app-ease),
    border-color var(--app-fast) var(--app-ease),
    color var(--app-fast) var(--app-ease) !important;
}

button,
.app-shell-primary-link {
  background: linear-gradient(135deg, var(--app-primary), var(--app-violet)) !important;
  color: #ffffff !important;
}

.ghost-btn,
.application-pagination-btn,
.planning-pagination-btn,
.theme-toggle-btn,
.profile-avatar-btn,
.notification-btn,
.job-apply-btn,
.apply-btn,
.planning-tailoring-btn {
  background: var(--app-surface-2) !important;
  color: var(--app-text) !important;
}

button:not(:disabled):hover,
.ghost-btn:not(:disabled):hover,
.job-apply-btn:not(:disabled):hover,
.apply-btn:not(:disabled):hover,
.planning-tailoring-btn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--app-primary) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: 0.58 !important;
  transform: none !important;
  box-shadow: none !important;
}

input,
select,
textarea,
.multi-select-trigger {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-md) !important;
  background: var(--app-inset) !important;
  color: var(--app-text) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--app-muted) !important;
  opacity: 0.9;
}

input:focus,
select:focus,
textarea:focus,
.multi-select.is-open .multi-select-trigger {
  border-color: var(--app-primary) !important;
  box-shadow: 0 0 0 4px var(--app-focus) !important;
}

.app-shell {
  width: var(--app-shell-width, 268px) !important;
  padding: 24px 18px !important;
  border-right: 1px solid var(--app-border) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 156, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(11, 16, 32, 0.96), rgba(8, 13, 26, 0.98)) !important;
}

html[data-theme="light"] .app-shell {
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(250, 253, 255, 0.98), rgba(244, 249, 255, 0.98)) !important;
}

.app-shell-brand-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 0 !important;
  min-height: 118px !important;
  margin: 0 0 30px !important;
  padding: 8px 54px 18px 4px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.app-shell-brand {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 246px !important;
  height: 98px !important;
  min-width: 0 !important;
  overflow: visible !important;
  text-decoration: none !important;
}

.app-shell-brand::before,
.app-shell-brand::after {
  content: none !important;
  display: none !important;
}

.app-shell-brand-logo {
  display: block !important;
  width: 246px !important;
  max-width: 246px !important;
  height: 98px !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.app-shell ~ .page {
  margin-left: var(--app-shell-width, 268px) !important;
  padding-top: 104px !important;
}

body.app-shell-collapsed .app-shell ~ .page {
  margin-left: var(--app-shell-collapsed-width, 68px) !important;
}

.app-shell-nav {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.app-shell-nav-link {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  min-height: 52px !important;
  padding: 0 18px !important;
  border: 1px solid transparent !important;
  border-radius: 16px !important;
  color: var(--app-muted) !important;
  font-size: 17px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-shell-nav-link:hover,
.app-shell-nav-link.active,
.app-shell-nav-link[aria-current="page"] {
  border-color: rgba(96, 165, 250, 0.24) !important;
  background: rgba(96, 165, 250, 0.1) !important;
  color: var(--app-text) !important;
}

.app-shell-nav-link.active::before,
.app-shell-nav-link[aria-current="page"]::before {
  content: "" !important;
  position: absolute !important;
  left: -18px !important;
  top: 10px !important;
  bottom: 10px !important;
  width: 4px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #2563eb, #06b6d4) !important;
}

.app-shell-nav-short {
  display: none !important;
}

.app-shell-nav-label {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.app-shell-top-right {
  position: fixed !important;
  top: 18px !important;
  right: 22px !important;
  z-index: 80 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: max-content !important;
  max-width: min(760px, calc(100vw - var(--app-shell-width, 268px) - 56px)) !important;
  padding: 8px !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-pill) !important;
  background: rgba(9, 14, 28, 0.78) !important;
  backdrop-filter: blur(18px);
  box-shadow: var(--app-shadow-md) !important;
}

html[data-theme="light"] .app-shell-top-right {
  background: rgba(255, 255, 255, 0.86) !important;
}

.notification-btn,
.theme-toggle-btn,
.app-shell-primary-link,
.app-shell-top-right .profile-avatar-btn {
  min-height: 48px !important;
}

.notification-btn,
.app-shell-top-right .profile-avatar-btn {
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  border-radius: var(--app-radius-pill) !important;
}

.theme-toggle-btn,
.app-shell-primary-link {
  border-radius: var(--app-radius-pill) !important;
}

.app-shell-primary-link {
  min-width: 178px !important;
  padding: 0 24px !important;
  text-decoration: none !important;
}

/* Profile popover owner: account identity, menu actions, and logout. */
.profile-menu-shell {
  position: relative !important;
  flex: 0 0 auto !important;
}

.profile-dropdown {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  right: 0 !important;
  z-index: 1000 !important;
  display: grid !important;
  width: min(420px, calc(100vw - 28px)) !important;
  max-width: calc(100vw - 28px) !important;
  padding: 14px !important;
  gap: 12px !important;
  border: 1px solid rgba(129, 156, 205, 0.28) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(124, 156, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(18, 25, 43, 0.98), rgba(11, 16, 32, 0.98)) !important;
  color: var(--app-text) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34) !important;
  transform-origin: top right !important;
}

.profile-dropdown.hidden {
  display: none !important;
}

html[data-theme="light"] .profile-dropdown {
  border-color: rgba(71, 94, 132, 0.2) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  color: #101828 !important;
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.14) !important;
}

.profile-dropdown::before {
  content: "" !important;
  position: absolute !important;
  top: -7px !important;
  right: 22px !important;
  width: 14px !important;
  height: 14px !important;
  border-top: 1px solid rgba(129, 156, 205, 0.28) !important;
  border-left: 1px solid rgba(129, 156, 205, 0.28) !important;
  background: #12192b !important;
  transform: rotate(45deg) !important;
}

html[data-theme="light"] .profile-dropdown::before {
  border-color: rgba(71, 94, 132, 0.2) !important;
  background: #ffffff !important;
}

.profile-dropdown-identity {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px !important;
  border: 1px solid rgba(129, 156, 205, 0.24) !important;
  border-radius: 18px !important;
  background: rgba(25, 34, 56, 0.72) !important;
}

html[data-theme="light"] .profile-dropdown-identity {
  border-color: rgba(37, 99, 235, 0.14) !important;
  background: linear-gradient(135deg, #eff6ff, #ecfeff) !important;
}

.profile-dropdown-avatar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 52px !important;
  height: 52px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, var(--app-primary), var(--app-secondary)) !important;
  color: #ffffff !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24) !important;
}

.profile-dropdown-identity-copy {
  display: grid !important;
  min-width: 0 !important;
  gap: 2px !important;
}

.profile-dropdown-name {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  color: var(--app-text) !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.profile-dropdown-email {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  color: var(--app-muted) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-theme="light"] .profile-dropdown-name {
  color: #101828 !important;
}

html[data-theme="light"] .profile-dropdown-email {
  color: #56657c !important;
}

.profile-dropdown-actions {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  gap: 10px !important;
}

.profile-dropdown-nav-btn {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 20px !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 76px !important;
  padding: 12px !important;
  border: 1px solid rgba(129, 156, 205, 0.22) !important;
  border-radius: 18px !important;
  background: rgba(15, 23, 42, 0.36) !important;
  color: var(--app-text) !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] .profile-dropdown-nav-btn {
  border-color: rgba(71, 94, 132, 0.18) !important;
  background: #ffffff !important;
  color: #101828 !important;
}

.profile-dropdown-nav-btn:hover,
.profile-dropdown-nav-btn:focus-visible {
  border-color: rgba(34, 211, 238, 0.44) !important;
  background: rgba(30, 41, 59, 0.72) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="light"] .profile-dropdown-nav-btn:hover,
html[data-theme="light"] .profile-dropdown-nav-btn:focus-visible {
  border-color: rgba(37, 99, 235, 0.28) !important;
  background: #f8fbff !important;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08) !important;
}

.profile-dropdown-nav-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  color: #0f172a !important;
}

.profile-dropdown-nav-icon--scans {
  background: linear-gradient(135deg, #dbeafe, #cffafe) !important;
}

.profile-dropdown-nav-icon--profile {
  background: linear-gradient(135deg, #dcfce7, #e0f2fe) !important;
}

.profile-dropdown-nav-icon img {
  width: 22px !important;
  height: 22px !important;
  opacity: 0.86 !important;
}

.profile-dropdown-nav-copy {
  display: grid !important;
  min-width: 0 !important;
  gap: 3px !important;
}

.profile-dropdown-nav-title {
  display: block !important;
  overflow: hidden !important;
  color: var(--app-text) !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.profile-dropdown-nav-subtitle {
  display: block !important;
  overflow: hidden !important;
  color: var(--app-muted) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-theme="light"] .profile-dropdown-nav-title {
  color: #101828 !important;
}

html[data-theme="light"] .profile-dropdown-nav-subtitle {
  color: #56657c !important;
}

.profile-dropdown-nav-arrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  color: var(--app-secondary) !important;
  font-size: 30px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
}

.profile-dropdown-danger-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 52px !important;
  width: 100% !important;
  padding: 0 18px !important;
  border: 1px solid rgba(251, 113, 133, 0.24) !important;
  border-radius: 16px !important;
  background: rgba(251, 113, 133, 0.12) !important;
  color: #fecdd3 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .profile-dropdown-danger-btn {
  border-color: rgba(220, 38, 38, 0.18) !important;
  background: #fff7f7 !important;
  color: #b91c1c !important;
}

.profile-dropdown-danger-btn:hover:not(:disabled),
.profile-dropdown-danger-btn:focus-visible {
  border-color: rgba(251, 113, 133, 0.42) !important;
  background: rgba(251, 113, 133, 0.18) !important;
  transform: translateY(-1px) !important;
}

html[data-theme="light"] .profile-dropdown-danger-btn:hover:not(:disabled),
html[data-theme="light"] .profile-dropdown-danger-btn:focus-visible {
  background: #fee2e2 !important;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  padding: 22px !important;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--app-primary), var(--app-secondary));
}

.stat-value {
  color: var(--app-text) !important;
  font-size: clamp(34px, 3vw, 48px) !important;
  font-weight: 940 !important;
  letter-spacing: -0.045em;
}

.stat-label,
.control-group label {
  color: var(--app-muted) !important;
  font-size: 12px !important;
  font-weight: 860 !important;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-toolbar,
.controls-row,
.application-filter-grid,
.filters-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px !important;
  align-items: end !important;
}

.dashboard-toolbar-left,
.dashboard-toolbar-left--executive,
.dashboard-toolbar-left--planning {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px !important;
}

.dashboard-toolbar-right,
.dashboard-toolbar-actions,
.button-group {
  display: flex !important;
  justify-content: flex-end;
  gap: 10px !important;
}

.binary-toggle {
  padding: 5px !important;
  border: 1px solid var(--app-border) !important;
  border-radius: 16px !important;
  background: var(--app-inset) !important;
}

.binary-toggle-option input:checked + span {
  background: linear-gradient(135deg, var(--app-primary), var(--app-violet)) !important;
  color: #ffffff !important;
}

.pipeline-run-meta:not(#schedulerOpsMeta) {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px !important;
  padding: 9px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-pill);
  background: rgba(124, 156, 255, 0.1);
  color: var(--app-muted) !important;
}

.application-table-header,
.planning-table-header,
.scheduler-table-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin-bottom: 18px !important;
}

.application-table-header-right,
.planning-table-header-right,
.application-pagination-inline,
.planning-pagination-inline,
.application-pagination-actions,
.planning-pagination-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap,
.saved-scans-table-wrap,
.scheduler-attached-table-wrap {
  overflow: auto;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-xl) !important;
  background: var(--app-surface-2) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.table-wrap table,
.saved-scans-table-wrap table,
#queueTable,
#planningTable,
#decisionsTable,
#applicationTable,
#schedulerTable {
  width: 100%;
  min-width: max-content;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.table-wrap thead th,
.saved-scans-table-wrap thead th,
#queueTable thead th,
#planningTable thead th,
#decisionsTable thead th,
#applicationTable thead th,
#schedulerTable thead th {
  height: 54px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--app-border) !important;
  background:
    linear-gradient(180deg, rgba(124, 156, 255, 0.16), rgba(124, 156, 255, 0.08)),
    var(--app-surface-3) !important;
  color: var(--app-text-2) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .table-wrap thead th,
html[data-theme="light"] .saved-scans-table-wrap thead th,
html[data-theme="light"] #queueTable thead th,
html[data-theme="light"] #planningTable thead th,
html[data-theme="light"] #decisionsTable thead th,
html[data-theme="light"] #applicationTable thead th,
html[data-theme="light"] #schedulerTable thead th {
  background: linear-gradient(180deg, #f7fbff 0%, #eaf2ff 100%) !important;
  color: #243247 !important;
}

.resizable-col-content,
.resizable-col-label,
.sort-header-btn,
.sort-header-label,
.sort-header-indicator,
th .resizable-col-content,
th .resizable-col-label,
th .sort-header-btn,
th .sort-header-label {
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.resizable-col-label,
.sort-header-label {
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 930 !important;
  letter-spacing: 0.045em !important;
  text-transform: uppercase;
}

.table-wrap tbody td,
.saved-scans-table-wrap tbody td,
#queueTable tbody td,
#planningTable tbody td,
#decisionsTable tbody td,
#applicationTable tbody td,
#schedulerTable tbody td {
  padding: 18px !important;
  border-bottom: 1px solid rgba(129, 156, 205, 0.16) !important;
  background: rgba(255, 255, 255, 0.015) !important;
  color: var(--app-text) !important;
  font-weight: 620;
}

.table-wrap tbody tr:nth-child(even) td,
.saved-scans-table-wrap tbody tr:nth-child(even) td {
  background: rgba(124, 156, 255, 0.035) !important;
}

.table-wrap tbody tr:hover td,
.saved-scans-table-wrap tbody tr:hover td {
  background: rgba(124, 156, 255, 0.11) !important;
}

html[data-theme="light"] .table-wrap tbody td,
html[data-theme="light"] .saved-scans-table-wrap tbody td,
html[data-theme="light"] #queueTable tbody td,
html[data-theme="light"] #planningTable tbody td,
html[data-theme="light"] #decisionsTable tbody td,
html[data-theme="light"] #applicationTable tbody td,
html[data-theme="light"] #schedulerTable tbody td {
  background: #ffffff !important;
  color: #172033 !important;
}

html[data-theme="light"] .table-wrap tbody tr:nth-child(even) td,
html[data-theme="light"] .saved-scans-table-wrap tbody tr:nth-child(even) td {
  background: #f6f9fd !important;
}

html[data-theme="light"] .table-wrap tbody tr:hover td,
html[data-theme="light"] .saved-scans-table-wrap tbody tr:hover td {
  background: #eef6ff !important;
}

.sticky-apply-col,
.apply-cell {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 130px;
  text-align: center;
  background: var(--app-surface-2) !important;
  box-shadow: -1px 0 0 var(--app-border) !important;
}

html[data-theme="light"] .sticky-apply-col,
html[data-theme="light"] .apply-cell {
  background: #ffffff !important;
}

.application-tabs,
.scheduler-tab-row {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-inset);
}

.application-tab,
.scheduler-tab-btn {
  min-height: 40px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--app-muted) !important;
  font-weight: 860;
}

.application-tab.active,
.scheduler-tab-btn.active,
.scheduler-tab-btn.is-active {
  background: linear-gradient(135deg, var(--app-primary), var(--app-violet)) !important;
  color: #ffffff !important;
}

.resume-delete-btn::before,
.saved-scan-delete-btn::before {
  content: "";
  width: 19px;
  height: 19px;
  background-color: currentColor;
  -webkit-mask: url("/static/media/discard_img.svg") center / contain no-repeat;
  mask: url("/static/media/discard_img.svg") center / contain no-repeat;
}

@media (max-width: 980px) {
  .app-shell ~ .page,
  body.app-shell-collapsed .app-shell ~ .page {
    margin-left: 0 !important;
    padding-top: 112px !important;
  }

  .app-shell-top-right {
    right: 14px !important;
    max-width: calc(100vw - 72px) !important;
  }

  .dashboard-toolbar,
  .controls-row,
  .application-filter-grid,
  .filters-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-toolbar-right,
  .dashboard-toolbar-actions,
  .button-group,
  .application-table-header-right,
  .planning-table-header-right {
    justify-content: flex-start;
  }

  .application-table-header,
  .planning-table-header,
  .scheduler-table-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

@media (max-width: 680px) {
  .theme-toggle-label,
  .app-shell-primary-link-label {
    display: none !important;
  }

  .app-shell-primary-link {
    min-width: 50px !important;
    width: 50px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}

/* Responsive and accessibility guardrails. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.page,
.card,
.table-card,
.controls-card,
.profile-section-card,
.scan-workspace-page,
.tailoring-workspace-page {
  min-width: 0;
}

.page-header,
.section-header,
.application-table-header,
.planning-table-header,
.scheduler-table-header {
  min-width: 0;
}

.page-header-main,
.page-header > div:first-child,
.application-table-header h2,
.planning-table-header h2,
.scheduler-table-title-wrap,
.resume-name,
.job-link,
.title-cell a,
.cell-stack,
.resume-option-block {
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto !important;
  overscroll-behavior-x: contain;
}

button,
.ghost-btn,
.app-shell-primary-link,
.job-apply-btn,
.apply-btn,
.planning-tailoring-btn,
.application-pagination-btn,
.planning-pagination-btn {
  white-space: nowrap;
}

.notification-dropdown,
.profile-dropdown,
.modal-card {
  max-width: calc(100vw - 28px) !important;
}

.modal-backdrop:not(.hidden) {
  display: grid !important;
}

button:focus-visible,
.ghost-btn:focus-visible,
.app-shell-primary-link:focus-visible,
.app-shell-nav-link:focus-visible,
.multi-select-trigger:focus-visible,
.binary-toggle-option input:focus-visible + span,
.application-tab:focus-visible,
.scheduler-tab-btn:focus-visible,
.saved-scan-open-link:focus-visible,
.saved-scan-delete-btn:focus-visible,
.resume-delete-btn:focus-visible {
  outline: 3px solid var(--app-focus) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--app-focus) !important;
}

.table-wrap-loading-overlay {
  background: rgba(6, 9, 19, 0.72) !important;
  backdrop-filter: blur(8px);
}

html[data-theme="light"] .table-wrap-loading-overlay {
  background: rgba(248, 251, 255, 0.74) !important;
}

.loading-state,
.notification-empty,
.resume-empty-state,
.saved-scans-empty-cell,
.tailoring-empty-state {
  color: var(--app-muted) !important;
}

@media (max-width: 1180px) {
  .app-shell-top-right {
    max-width: min(680px, calc(100vw - 92px)) !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ui_redesign_v21: compact page controls/cards and scheduler polish. */
body .app-shell ~ .page,
body.app-shell-collapsed .app-shell ~ .page {
  padding-top: 16px !important;
}

body .app-shell ~ .page > .page-header,
body.app-shell-collapsed .app-shell ~ .page > .page-header,
body .page > .page-header {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 40px !important;
  margin: 0 0 12px !important;
  padding: 0 min(620px, calc(max(0px, 100vw - var(--app-shell-collapsed-width, 68px) - 640px))) 0 0 !important;
  text-align: left !important;
}

body .page > .page-header > div:first-child,
body .page > .page-header .page-header-main {
  width: 100% !important;
  max-width: min(760px, 100%) !important;
  margin: 0 !important;
  text-align: left !important;
}

body .page > .page-header h1,
body .scan-workspace-page.page > .page-header h1,
body .scan-workspace-page.page > .page-header .scan-workspace-header-copy h1,
body .tailoring-workspace-page.page > .page-header h1 {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: clamp(26px, 2vw, 34px) !important;
  font-weight: 900 !important;
  line-height: 1.04 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body .page > .page-header p,
body .page > .page-header .subtext {
  margin-top: 5px !important;
  font-size: clamp(12px, 0.85vw, 14px) !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

body .controls-card,
body .filters-card,
body .table-card,
body .scheduler-table-card,
body .saved-scans-card,
body .profile-card,
body .card {
  border-radius: 14px !important;
}

body .controls-card,
body .filters-card {
  padding: 18px 20px !important;
}

body .stats-grid {
  gap: 14px !important;
}

body .stat-card {
  min-height: 104px !important;
  padding: 18px 20px !important;
  border-radius: 14px !important;
}

body .stat-label {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

body .stat-value,
body .stat-card-value {
  font-size: clamp(30px, 3vw, 52px) !important;
  line-height: 0.95 !important;
}

body .control-group {
  gap: 6px !important;
}

body .control-group label {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

body .control-group input,
body .control-group select,
body .control-group textarea {
  min-height: 38px !important;
  padding: 8px 12px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
}

body button,
body .ghost-btn,
body .btn-sm {
  min-height: 34px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
}

html[data-theme="light"] body .scheduler-page {
  background:
    linear-gradient(135deg, rgba(191, 219, 254, 0.86) 0%, rgba(236, 254, 255, 0.82) 46%, rgba(248, 250, 252, 0.96) 100%),
    #edf7ff !important;
}

body .scheduler-page .page-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  padding-right: min(520px, calc(max(0px, 100vw - var(--app-shell-collapsed-width, 68px) - 760px))) !important;
}

body .scheduler-page .header-actions {
  justify-self: end !important;
  align-self: center !important;
}

body .scheduler-page #refreshSchedulerSummaryBtn {
  border: 1px solid #0891b2 !important;
  background: #06b6d4 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(6, 182, 212, 0.22) !important;
}

html[data-theme="light"] body .scheduler-page .scheduler-table-card {
  background: #ffffff !important;
}

html[data-theme="light"] body .scheduler-page .scheduler-table-tabs {
  border-color: #bae6fd !important;
  background: #e0f2fe !important;
}

/* Scheduler ops terminal overrides: underline tabs, table refresh, solid status. */
body .scheduler-page .page-header {
  display: block !important;
  padding-right: 0 !important;
}

body .scheduler-page .scheduler-table-tabs,
body .scheduler-page .scheduler-tab-row {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .scheduler-page .scheduler-tab-row {
  display: inline-flex !important;
  gap: 24px !important;
}

body .scheduler-page .scheduler-tab-btn {
  position: relative !important;
  min-height: 44px !important;
  padding: 0 2px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

body .scheduler-page .scheduler-tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

body .scheduler-page .scheduler-tab-btn:hover {
  color: #1d4ed8 !important;
  transform: none !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-tab-btn.active,
body .scheduler-page .scheduler-tab-btn.is-active {
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-tab-btn.active::after,
body .scheduler-page .scheduler-tab-btn.is-active::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
}

body .scheduler-page .scheduler-table-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

body .scheduler-page .scheduler-table-header-right {
  justify-self: end !important;
  min-width: 0 !important;
}

body .scheduler-page #refreshSchedulerSummaryBtn {
  min-width: 118px !important;
}

body .scheduler-page .scheduler-run-badge {
  min-width: 94px !important;
  border: 0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-run-badge--success {
  background: #16a34a !important;
  color: #ffffff !important;
}

body .scheduler-page .scheduler-run-badge--danger {
  background: #dc2626 !important;
  color: #ffffff !important;
}

body .scheduler-page .scheduler-run-badge--muted {
  background: #64748b !important;
  color: #ffffff !important;
}

body .scheduler-page .page-header {
  display: block !important;
  padding-right: 0 !important;
}

body .scheduler-page .scheduler-table-tabs {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .scheduler-page .scheduler-tab-row {
  display: inline-flex !important;
  gap: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .scheduler-page .scheduler-tab-btn {
  position: relative !important;
  min-height: 44px !important;
  padding: 0 2px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

body .scheduler-page .scheduler-tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

body .scheduler-page .scheduler-tab-btn:hover {
  color: #1d4ed8 !important;
  transform: none !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-tab-btn.active,
body .scheduler-page .scheduler-tab-btn.is-active {
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-tab-btn.active::after,
body .scheduler-page .scheduler-tab-btn.is-active::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
}

body .scheduler-page .scheduler-table-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

body .scheduler-page .scheduler-table-header-right {
  justify-self: end !important;
  min-width: 0 !important;
}

body .scheduler-page #refreshSchedulerSummaryBtn {
  min-width: 118px !important;
}

body .scheduler-page .scheduler-run-badge {
  min-width: 94px !important;
  border: 0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-run-badge--success {
  background: #16a34a !important;
  color: #ffffff !important;
}

body .scheduler-page .scheduler-run-badge--danger {
  background: #dc2626 !important;
  color: #ffffff !important;
}

body .scheduler-page .scheduler-run-badge--muted {
  background: #64748b !important;
  color: #ffffff !important;
}

/* Dropdown and application tab polish. */
body .controls-card,
body .control-group,
body .dashboard-toolbar,
body .dashboard-toolbar-left,
body .dashboard-toolbar-right {
  overflow: visible !important;
}

body .controls-card {
  position: relative !important;
  z-index: 20 !important;
}

body .controls-card:has(.multi-select.is-open),
body .control-group:has(.multi-select.is-open) {
  z-index: 220 !important;
}

body .multi-select {
  position: relative !important;
  min-width: min(260px, 100%) !important;
  isolation: isolate !important;
}

body .multi-select.is-open {
  z-index: 5000 !important;
}

body .multi-select-trigger {
  min-height: 46px !important;
  padding: 10px 14px !important;
  border-radius: 13px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.96)),
    var(--app-surface) !important;
  color: var(--app-text) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

body .multi-select-trigger-label {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body .multi-select-trigger-icon {
  display: inline-grid !important;
  place-items: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: #eaf2ff !important;
  color: #2563eb !important;
}

body .multi-select-menu {
  left: 0 !important;
  right: auto !important;
  width: max(100%, min(360px, calc(100vw - 48px))) !important;
  max-width: calc(100vw - 48px) !important;
  max-height: min(360px, calc(100vh - 160px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  gap: 6px !important;
  padding: 8px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.76) inset !important;
  z-index: 5000 !important;
}

body .multi-select-option {
  min-height: 44px !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 9px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body .multi-select-option:hover {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
  transform: none !important;
  box-shadow: none !important;
}

body .multi-select-option.is-selected {
  border-color: #93c5fd !important;
  background: #dbeafe !important;
  color: #1e3a8a !important;
}

body .multi-select-option-check {
  display: inline-grid !important;
  place-items: center !important;
  width: 22px !important;
  height: 22px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: transparent !important;
  font-size: 12px !important;
}

body .multi-select-option.is-selected .multi-select-option-check {
  border-color: #2563eb !important;
  background: #2563eb !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

body .multi-select-option-label {
  min-width: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.18 !important;
}

body .application-tabs {
  display: inline-flex !important;
  gap: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .application-tab {
  position: relative !important;
  min-height: 44px !important;
  padding: 0 2px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

body .application-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

body .application-tab:hover {
  color: #1d4ed8 !important;
  transform: none !important;
  box-shadow: none !important;
}

body .application-tab.active {
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body .application-tab.active::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
}

/* Scheduler ops final tab/header/status overrides. */
body .scheduler-page .page-header {
  display: block !important;
  padding-right: 0 !important;
}

body .scheduler-page .scheduler-table-tabs,
body .scheduler-page .scheduler-tab-row {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .scheduler-page .scheduler-tab-row {
  display: inline-flex !important;
  gap: 24px !important;
}

body .scheduler-page .scheduler-tab-btn {
  position: relative !important;
  min-height: 44px !important;
  padding: 0 2px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

body .scheduler-page .scheduler-tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

body .scheduler-page .scheduler-tab-btn:hover {
  color: #1d4ed8 !important;
  transform: none !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-tab-btn.active,
body .scheduler-page .scheduler-tab-btn.is-active {
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-tab-btn.active::after,
body .scheduler-page .scheduler-tab-btn.is-active::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
}

body .scheduler-page .scheduler-table-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

body .scheduler-page .scheduler-table-header-right {
  justify-self: end !important;
  min-width: 0 !important;
}

body .scheduler-page #refreshSchedulerSummaryBtn {
  min-width: 118px !important;
}

body .scheduler-page .scheduler-run-badge {
  min-width: 94px !important;
  border: 0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body .scheduler-page .scheduler-run-badge--success {
  background: #16a34a !important;
  color: #ffffff !important;
}

body .scheduler-page .scheduler-run-badge--danger {
  background: #dc2626 !important;
  color: #ffffff !important;
}

body .scheduler-page .scheduler-run-badge--muted {
  background: #64748b !important;
  color: #ffffff !important;
}

/* ui_redesign_v20: final compact title owner for every page header. */
body .app-shell ~ .page > .page-header,
body.app-shell-collapsed .app-shell ~ .page > .page-header,
body .page > .page-header {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 46px !important;
  margin: 0 0 14px !important;
  padding: 0 min(620px, calc(max(0px, 100vw - var(--app-shell-collapsed-width, 68px) - 640px))) 0 0 !important;
  text-align: left !important;
}

body .page > .page-header > div:first-child,
body .page > .page-header .page-header-main {
  width: 100% !important;
  max-width: min(760px, 100%) !important;
  margin: 0 !important;
  text-align: left !important;
}

body .page > .page-header h1,
body .scan-workspace-page.page > .page-header h1,
body .scan-workspace-page.page > .page-header .scan-workspace-header-copy h1,
body .tailoring-workspace-page.page > .page-header h1 {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: clamp(28px, 2.35vw, 38px) !important;
  font-weight: 900 !important;
  line-height: 1.04 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body .page > .page-header p,
body .page > .page-header .subtext {
  margin-top: 6px !important;
  font-size: clamp(13px, 0.95vw, 16px) !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

@media (max-width: 760px) {
  h1 {
    font-size: clamp(34px, 12vw, 52px) !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .header-actions,
  .dashboard-toolbar-actions,
  .application-pagination-inline,
  .planning-pagination-inline,
  .application-pagination-actions,
  .planning-pagination-actions {
    width: 100%;
  }

  .header-actions > *,
  .dashboard-toolbar-actions > *,
  .button-group > * {
    flex: 1 1 auto;
  }

  .app-shell-top-right {
    top: 10px !important;
    right: 10px !important;
    max-width: calc(100vw - 64px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* UI stabilization pass: keep operational data visible while async refreshes run. */
body {
  overflow-x: hidden;
}

.page,
.app-shell ~ .page,
body.app-shell-collapsed .app-shell ~ .page {
  width: auto !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.app-shell-top-right {
  position: absolute !important;
}

.table-wrap.table-wrap--loading {
  min-height: 240px;
  overflow-x: auto !important;
  overflow-y: auto !important;
}

.table-wrap.table-wrap--loading table {
  visibility: visible !important;
  opacity: 1 !important;
}

.table-wrap-loading-overlay,
.table-wrap-loading-overlay.hidden,
.table-wrap:not(.table-wrap--loading) .table-wrap-loading-overlay,
.table-wrap.table-wrap--loading .table-wrap-loading-overlay {
  display: none !important;
}

.table-wrap.table-wrap--loading .table-wrap-loading-overlay {
  display: none !important;
  place-items: start center;
  padding-top: clamp(34px, 8vh, 90px);
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 9, 19, 0.18), rgba(6, 9, 19, 0.05)) !important;
  backdrop-filter: blur(2px);
}

html[data-theme="light"] .table-wrap.table-wrap--loading .table-wrap-loading-overlay {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.42), rgba(248, 251, 255, 0.08)) !important;
}

.table-wrap-loading-overlay .loading-state {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-pill);
  background: var(--app-surface-2);
  color: var(--app-text) !important;
  box-shadow: var(--app-shadow-md);
}

html[data-theme="light"] .table-wrap-loading-overlay .loading-state {
  background: #ffffff;
  color: #111827 !important;
}

.table-wrap thead,
.table-wrap tbody,
.table-wrap tr,
.table-wrap th,
.table-wrap td {
  visibility: visible !important;
  opacity: 1 !important;
}

.table-wrap thead th,
#queueTable thead th,
#planningTable thead th,
#decisionsTable thead th,
#applicationTable thead th,
#schedulerTable thead th {
  min-width: 112px;
  vertical-align: middle;
}

.resizable-col-content,
.sort-header-btn,
th .resizable-col-content,
th .sort-header-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 32px !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
}

.resizable-col-label,
.sort-header-label,
.sort-header-indicator {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
}

.sort-header-indicator {
  flex: 0 0 auto;
  color: var(--app-muted) !important;
}

.table-wrap tbody td,
#planningTable tbody td,
#queueTable tbody td,
#decisionsTable tbody td,
#applicationTable tbody td,
#schedulerTable tbody td {
  min-width: 104px;
  line-height: 1.35;
  vertical-align: middle;
}

#planningTable td.title-cell,
#queueTable td.title-cell,
#applicationTable td.title-cell,
#decisionsTable td.reason-cell,
#planningTable td.reason-cell {
  min-width: 240px;
}

#planningTable tbody td *,
#queueTable tbody td *,
#decisionsTable tbody td *,
#applicationTable tbody td *,
#schedulerTable tbody td * {
  visibility: visible !important;
}

html[data-theme="light"] .table-wrap tbody td,
html[data-theme="light"] #planningTable tbody td,
html[data-theme="light"] #queueTable tbody td,
html[data-theme="light"] #decisionsTable tbody td,
html[data-theme="light"] #applicationTable tbody td,
html[data-theme="light"] #schedulerTable tbody td {
  background: #ffffff !important;
  color: #111827 !important;
}

html[data-theme="light"] .table-wrap tbody tr:nth-child(even) td,
html[data-theme="light"] #planningTable tbody tr:nth-child(even) td,
html[data-theme="light"] #queueTable tbody tr:nth-child(even) td,
html[data-theme="light"] #decisionsTable tbody tr:nth-child(even) td,
html[data-theme="light"] #applicationTable tbody tr:nth-child(even) td,
html[data-theme="light"] #schedulerTable tbody tr:nth-child(even) td {
  background: #f7faff !important;
}

html[data-theme="light"] .table-wrap tbody tr:hover td,
html[data-theme="light"] #planningTable tbody tr:hover td,
html[data-theme="light"] #queueTable tbody tr:hover td,
html[data-theme="light"] #decisionsTable tbody tr:hover td,
html[data-theme="light"] #applicationTable tbody tr:hover td,
html[data-theme="light"] #schedulerTable tbody tr:hover td {
  background: #eef6ff !important;
}

html[data-theme="light"] .sticky-apply-col,
html[data-theme="light"] .apply-cell,
html[data-theme="light"] #planningTable th.sticky-apply-col,
html[data-theme="light"] #planningTable td.sticky-apply-col,
html[data-theme="light"] #planningTable td.apply-cell {
  background: #ffffff !important;
  color: #111827 !important;
}

html[data-theme="light"] .table-wrap tbody tr:nth-child(even) .sticky-apply-col,
html[data-theme="light"] .table-wrap tbody tr:nth-child(even) .apply-cell,
html[data-theme="light"] #planningTable tbody tr:nth-child(even) td.sticky-apply-col,
html[data-theme="light"] #planningTable tbody tr:nth-child(even) td.apply-cell {
  background: #f7faff !important;
}

.planning-table-header,
.application-table-header,
.scheduler-table-header {
  gap: 18px !important;
}

.planning-table-header-right,
.application-table-header-right,
.scheduler-table-header-right {
  min-width: min(100%, 420px);
}

.dashboard-toolbar,
.controls-card,
.filters-card,
.table-card,
.stats-grid,
.planning-table-header,
.application-table-header,
.scheduler-table-header {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.dashboard-toolbar-actions,
.header-actions,
.planning-pagination-inline,
.application-pagination-inline,
.scheduler-pagination-inline {
  min-width: 0 !important;
}

.table-card {
  contain: none !important;
  overflow: visible !important;
}

.table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  contain: none !important;
}

.table-wrap table,
.saved-scans-table-wrap table,
#queueTable,
#planningTable,
#decisionsTable,
#applicationTable,
#schedulerTable {
  display: table !important;
}

.table-wrap thead,
.saved-scans-table-wrap thead {
  display: table-header-group !important;
}

.table-wrap tbody,
.saved-scans-table-wrap tbody {
  display: table-row-group !important;
}

.table-wrap tr,
.saved-scans-table-wrap tr {
  display: table-row !important;
}

.table-wrap th,
.table-wrap td,
.saved-scans-table-wrap th,
.saved-scans-table-wrap td {
  display: table-cell !important;
}

#queueTable {
  table-layout: fixed !important;
  min-width: 2640px !important;
}

#planningTable {
  table-layout: fixed !important;
  min-width: 3660px !important;
}

#applicationTable {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}

#decisionsTable {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 2440px !important;
}

#schedulerTable {
  table-layout: auto !important;
  width: 100% !important;
  min-width: 820px !important;
}

.scheduler-attached-table-wrap {
  overflow-x: auto !important;
}

#applicationTable th,
#applicationTable td,
#decisionsTable th,
#decisionsTable td,
#schedulerTable th,
#schedulerTable td {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

#applicationTable th:nth-child(1),
#applicationTable td:nth-child(1) {
  width: 180px !important;
}

#applicationTable th:nth-child(2),
#applicationTable td:nth-child(2) {
  width: 220px !important;
}

#applicationTable th:nth-child(3),
#applicationTable td:nth-child(3) {
  width: 360px !important;
}

#applicationTable th:nth-child(4),
#applicationTable td:nth-child(4) {
  width: 150px !important;
}

#applicationTable th:nth-child(5),
#applicationTable td:nth-child(5) {
  width: 170px !important;
}

#applicationTable th:nth-child(6),
#applicationTable td:nth-child(6) {
  width: auto !important;
  min-width: 220px !important;
}

#applicationTable th:nth-child(7),
#applicationTable td:nth-child(7) {
  width: 120px !important;
}

#decisionsTable th:nth-child(1),
#decisionsTable td:nth-child(1) {
  width: 190px !important;
}

#decisionsTable th:nth-child(2),
#decisionsTable td:nth-child(2) {
  width: 120px !important;
}

#decisionsTable th:nth-child(3),
#decisionsTable td:nth-child(3) {
  width: 130px !important;
}

#decisionsTable th:nth-child(4),
#decisionsTable td:nth-child(4) {
  width: 190px !important;
}

#decisionsTable th:nth-child(5),
#decisionsTable td:nth-child(5) {
  width: 300px !important;
}

#decisionsTable th:nth-child(6),
#decisionsTable td:nth-child(6) {
  width: 180px !important;
}

#decisionsTable th:nth-child(7),
#decisionsTable td:nth-child(7) {
  width: 170px !important;
}

#decisionsTable th:nth-child(8),
#decisionsTable td:nth-child(8),
#decisionsTable th:nth-child(9),
#decisionsTable td:nth-child(9),
#decisionsTable th:nth-child(10),
#decisionsTable td:nth-child(10) {
  width: 230px !important;
}

#decisionsTable th:nth-child(11),
#decisionsTable td:nth-child(11) {
  width: 260px !important;
}

#decisionsTable th:nth-child(12),
#decisionsTable td:nth-child(12) {
  width: 150px !important;
}

#schedulerTable th:nth-child(1),
#schedulerTable td:nth-child(1) {
  min-width: 260px !important;
}

#schedulerTable th:nth-child(2),
#schedulerTable td:nth-child(2) {
  min-width: 180px !important;
}

#schedulerTable th:nth-child(3),
#schedulerTable td:nth-child(3) {
  min-width: 150px !important;
}

#applicationTable .sort-header-btn,
#decisionsTable .sort-header-btn,
#schedulerTable .sort-header-btn {
  white-space: normal !important;
}

#applicationTable .sort-header-label,
#decisionsTable .sort-header-label,
#schedulerTable .sort-header-label,
#applicationTable .resizable-col-label,
#decisionsTable .resizable-col-label,
#schedulerTable .resizable-col-label {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

@media (max-width: 1500px) {
  #applicationTable {
    min-width: 1240px !important;
  }
}

.table-wrap thead th,
.table-wrap thead th *,
.saved-scans-table-wrap thead th,
.saved-scans-table-wrap thead th *,
.table-wrap tbody td,
.table-wrap tbody td *,
.saved-scans-table-wrap tbody td,
.saved-scans-table-wrap tbody td * {
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="light"] .table-wrap thead th,
html[data-theme="light"] .table-wrap thead th *,
html[data-theme="light"] .saved-scans-table-wrap thead th,
html[data-theme="light"] .saved-scans-table-wrap thead th * {
  color: #172033 !important;
}

html[data-theme="light"] .table-wrap tbody td,
html[data-theme="light"] .table-wrap tbody td *,
html[data-theme="light"] .saved-scans-table-wrap tbody td,
html[data-theme="light"] .saved-scans-table-wrap tbody td * {
  color: #111827 !important;
}

html[data-theme="light"] .table-wrap tbody td .job-link,
html[data-theme="light"] .table-wrap tbody td .title-cell a,
html[data-theme="light"] .table-wrap tbody td a.job-link {
  color: #2563eb !important;
}

@media (max-width: 1180px) {
  .app-shell-top-right {
    position: static !important;
    margin: 0 0 18px auto;
  }
}

/* ui_redesign_v12: sidebar/table QA fixes. Keep behavior intact; only tighten presentation. */
body.app-shell-collapsed .app-shell {
  width: var(--app-shell-collapsed-width, 68px) !important;
  padding: 18px 8px !important;
  overflow: visible !important;
}

body.app-shell-collapsed .app-shell-brand-row,
body.app-shell-collapsed .app-shell-brand {
  display: none !important;
}

body.app-shell-collapsed .app-shell-nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 104px 0 0 !important;
  overflow: visible !important;
}

body.app-shell-collapsed .app-shell-nav-link {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  border-radius: 15px !important;
}

body.app-shell-collapsed .app-shell-nav-link:hover {
  transform: none !important;
}

body.app-shell-collapsed .app-shell-nav-label {
  display: none !important;
}

body.app-shell-collapsed .app-shell-nav-short {
  position: static !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: var(--app-text) !important;
  background: rgba(124, 156, 255, 0.14) !important;
  border-radius: 10px !important;
  transform: none !important;
}

body.app-shell-collapsed .app-shell-nav-link.active .app-shell-nav-short,
body.app-shell-collapsed .app-shell-nav-link[aria-current="page"] .app-shell-nav-short {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24) !important;
}

html[data-theme="light"] body.app-shell-collapsed .app-shell-nav-short {
  color: #334155 !important;
  background: rgba(37, 99, 235, 0.1) !important;
}

html[data-theme="light"] body.app-shell-collapsed .app-shell-nav-link.active .app-shell-nav-short,
html[data-theme="light"] body.app-shell-collapsed .app-shell-nav-link[aria-current="page"] .app-shell-nav-short {
  color: #ffffff !important;
}

.table-wrap thead th,
.saved-scans-table-wrap thead th,
.scheduler-attached-table-wrap thead th {
  overflow: hidden !important;
}

.table-wrap thead .sort-header-btn,
.table-wrap thead th .sort-header-btn,
.saved-scans-table-wrap thead .sort-header-btn,
.scheduler-attached-table-wrap thead .sort-header-btn,
.table-wrap thead .resizable-col-content,
.table-wrap thead th .resizable-col-content,
.saved-scans-table-wrap thead .resizable-col-content,
.scheduler-attached-table-wrap thead .resizable-col-content {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
}

.table-wrap thead .sort-header-btn::before,
.table-wrap thead .sort-header-btn::after,
.table-wrap thead .resizable-col-content::before,
.table-wrap thead .resizable-col-content::after,
.saved-scans-table-wrap thead .sort-header-btn::before,
.saved-scans-table-wrap thead .sort-header-btn::after,
.saved-scans-table-wrap thead .resizable-col-content::before,
.saved-scans-table-wrap thead .resizable-col-content::after,
.scheduler-attached-table-wrap thead .sort-header-btn::before,
.scheduler-attached-table-wrap thead .sort-header-btn::after,
.scheduler-attached-table-wrap thead .resizable-col-content::before,
.scheduler-attached-table-wrap thead .resizable-col-content::after {
  content: none !important;
  display: none !important;
}

.table-wrap thead .sort-header-label,
.table-wrap thead .sort-header-indicator,
.table-wrap thead .resizable-col-label,
.table-wrap thead .resizable-col-content > span,
.saved-scans-table-wrap thead .sort-header-label,
.saved-scans-table-wrap thead .sort-header-indicator,
.saved-scans-table-wrap thead .resizable-col-label,
.saved-scans-table-wrap thead .resizable-col-content > span,
.scheduler-attached-table-wrap thead .sort-header-label,
.scheduler-attached-table-wrap thead .sort-header-indicator,
.scheduler-attached-table-wrap thead .resizable-col-label,
.scheduler-attached-table-wrap thead .resizable-col-content > span {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
}

.table-wrap thead .sort-header-label,
.table-wrap thead .resizable-col-label,
.saved-scans-table-wrap thead .sort-header-label,
.saved-scans-table-wrap thead .resizable-col-label,
.scheduler-attached-table-wrap thead .sort-header-label,
.scheduler-attached-table-wrap thead .resizable-col-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.table-wrap thead .col-resize-handle,
.saved-scans-table-wrap thead .col-resize-handle,
.scheduler-attached-table-wrap thead .col-resize-handle {
  opacity: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  pointer-events: none !important;
}

#applicationTable {
  min-width: 1380px !important;
}

#applicationTable th,
#applicationTable td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#applicationTable td:nth-child(3) {
  white-space: normal !important;
  line-height: 1.25 !important;
}

#applicationTable th:nth-child(5),
#applicationTable td:nth-child(5) {
  width: 220px !important;
}

#applicationTable th:nth-child(6),
#applicationTable td:nth-child(6) {
  width: 260px !important;
  min-width: 260px !important;
}

#decisionsTable {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 3200px !important;
}

#decisionsTable th,
#decisionsTable td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  vertical-align: middle !important;
}

#decisionsTable tbody td {
  max-width: none !important;
  line-height: 1.25 !important;
}

#decisionsTable td.reason-cell,
#decisionsTable td:nth-child(11) {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

#decisionsTable th:nth-child(7),
#decisionsTable td:nth-child(7) {
  width: 210px !important;
}

#decisionsTable th:nth-child(8),
#decisionsTable td:nth-child(8),
#decisionsTable th:nth-child(9),
#decisionsTable td:nth-child(9),
#decisionsTable th:nth-child(10),
#decisionsTable td:nth-child(10) {
  width: 330px !important;
}

#decisionsTable th:nth-child(11),
#decisionsTable td:nth-child(11) {
  width: 390px !important;
}

#decisionsTable th:nth-child(12),
#decisionsTable td:nth-child(12) {
  width: 170px !important;
}

#decisionsTable td.apply-cell,
#decisionsTable td.sticky-apply-col {
  overflow: visible !important;
  max-width: none !important;
}

/* ui_redesign_v13: compact shell chrome, quieter headings, richer simple queue cells. */
.app-shell-menu-btn {
  left: calc(var(--app-shell-width, 268px) - 66px) !important;
  right: auto !important;
  top: 32px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 9px !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

.app-shell-menu-btn:hover,
.app-shell-menu-btn:focus-visible {
  background: #ffffff !important;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.14) !important;
}

.app-shell-menu-btn-line {
  width: 22px !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: var(--app-text) !important;
}

html[data-theme="light"] .app-shell-menu-btn-line {
  background: #0f172a !important;
}

body.app-shell-collapsed .app-shell-menu-btn {
  left: 13px !important;
  right: auto !important;
  top: 30px !important;
}

.app-shell-top-right {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  gap: 12px !important;
}

html[data-theme="light"] .app-shell-top-right {
  background: transparent !important;
}

.notification-btn,
.theme-toggle-btn,
.app-shell-primary-link,
.app-shell-top-right .profile-avatar-btn {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14) !important;
}

.page-header h1,
.scan-workspace-page .page-header h1,
.tailoring-workspace-page .page-header h1 {
  font-size: clamp(42px, 5.2vw, 78px) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.055em !important;
}

.table-card h2,
.section-card h2,
.dashboard-section h2,
.scan-workspace-card h2,
.profile-card h2,
.saved-scans-card h2 {
  font-size: clamp(26px, 2.3vw, 42px) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.04em !important;
}

.page-header .subtext,
.page-header p,
.dashboard-subtitle,
.section-subtitle,
.subtext {
  font-size: clamp(16px, 1.1vw, 21px) !important;
  line-height: 1.45 !important;
}

.stat-card-value,
.metric-value {
  font-size: clamp(38px, 4.1vw, 68px) !important;
  line-height: 0.98 !important;
}

body.executive-simple-mode #queueTable {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}

body.executive-simple-mode #queueTable col[data-col-key="queue_rank"] {
  width: 112px !important;
}

body.executive-simple-mode #queueTable col[data-col-key="job"] {
  width: auto !important;
}

body.executive-simple-mode #queueTable col[data-col-key="resume_options"] {
  width: 360px !important;
}

body.executive-simple-mode #queueTable col[data-static-col-key="apply"] {
  width: 116px !important;
}

body.executive-simple-mode #queueTable th.sticky-apply-col,
body.executive-simple-mode #queueTable td.sticky-apply-col,
body.executive-simple-mode #queueTable td.apply-cell {
  width: 116px !important;
  min-width: 116px !important;
  max-width: 116px !important;
  padding-inline: 14px !important;
}

body.executive-simple-mode #queueTable td.apply-cell .job-apply-btn {
  width: 84px !important;
  min-width: 84px !important;
  padding-inline: 10px !important;
}

.queue-simple-job-cell {
  text-align: left !important;
}

.queue-simple-company {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.13);
  color: #0f766e;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.queue-simple-title {
  margin-bottom: 8px;
  color: var(--app-primary);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.queue-simple-title .job-link {
  color: inherit !important;
}

.queue-simple-posted {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.queue-simple-action {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.11);
  color: #6d28d9;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="dark"] .queue-simple-company {
  background: rgba(45, 212, 191, 0.16);
  color: #99f6e4;
}

html[data-theme="dark"] .queue-simple-posted {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

html[data-theme="dark"] .queue-simple-action {
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
}

/* ui_redesign_v14: final shell pinning and calmer type scale. */
body:not(.app-shell-collapsed) .app-shell-menu-btn {
  position: fixed !important;
  top: 32px !important;
  left: calc(var(--app-shell-width, 268px) - 66px) !important;
  right: auto !important;
  z-index: 180 !important;
}

body.app-shell-collapsed .app-shell-menu-btn {
  position: fixed !important;
  top: 30px !important;
  left: 13px !important;
  right: auto !important;
  z-index: 180 !important;
}

.page-header h1,
.scan-workspace-page .page-header h1,
.tailoring-workspace-page .page-header h1 {
  font-size: clamp(34px, 4.2vw, 58px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.045em !important;
}

.table-card h2,
.section-card h2,
.dashboard-section h2,
.scan-workspace-card h2,
.profile-card h2,
.saved-scans-card h2,
.modal-card h2 {
  font-size: clamp(22px, 1.9vw, 34px) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.032em !important;
}

.page-header .subtext,
.page-header p,
.dashboard-subtitle,
.section-subtitle,
.subtext,
.control-help,
.field-help-wide {
  font-size: clamp(14px, 0.95vw, 18px) !important;
  line-height: 1.45 !important;
}

.stat-card-value,
.metric-value {
  font-size: clamp(32px, 3.2vw, 52px) !important;
  line-height: 1 !important;
}

.stat-card-label,
.metric-label,
label,
.form-label,
.table-wrap th,
.saved-scans-table-wrap th {
  font-size: clamp(12px, 0.82vw, 15px) !important;
}

/* ui_redesign_v15: readable/expandable data tables across the app. */
.table-wrap,
.saved-scans-table-wrap,
.scheduler-attached-table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

.table-wrap table,
.saved-scans-table-wrap table,
.scheduler-attached-table-wrap table,
#queueTable,
#planningTable,
#decisionsTable,
#applicationTable,
#schedulerTable {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 100% !important;
}

.table-wrap th,
.table-wrap td,
.saved-scans-table-wrap th,
.saved-scans-table-wrap td,
.scheduler-attached-table-wrap th,
.scheduler-attached-table-wrap td,
#queueTable th,
#queueTable td,
#planningTable th,
#planningTable td,
#decisionsTable th,
#decisionsTable td,
#applicationTable th,
#applicationTable td,
#schedulerTable th,
#schedulerTable td {
  min-width: 132px !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  vertical-align: top !important;
}

.table-wrap th,
.saved-scans-table-wrap th,
.scheduler-attached-table-wrap th {
  position: relative;
  resize: horizontal;
  overflow: auto !important;
}

.table-wrap thead .sort-header-btn,
.table-wrap thead th .sort-header-btn,
.saved-scans-table-wrap thead .sort-header-btn,
.scheduler-attached-table-wrap thead .sort-header-btn,
.table-wrap thead .resizable-col-content,
.table-wrap thead th .resizable-col-content,
.saved-scans-table-wrap thead .resizable-col-content,
.scheduler-attached-table-wrap thead .resizable-col-content {
  align-items: flex-start !important;
  gap: 8px !important;
  white-space: normal !important;
  overflow: visible !important;
}

.table-wrap thead .sort-header-label,
.table-wrap thead .resizable-col-label,
.saved-scans-table-wrap thead .sort-header-label,
.saved-scans-table-wrap thead .resizable-col-label,
.scheduler-attached-table-wrap thead .sort-header-label,
.scheduler-attached-table-wrap thead .resizable-col-label {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.table-wrap thead .sort-header-indicator,
.saved-scans-table-wrap thead .sort-header-indicator,
.scheduler-attached-table-wrap thead .sort-header-indicator {
  flex: 0 0 auto !important;
}

.table-wrap thead .col-resize-handle,
.saved-scans-table-wrap thead .col-resize-handle,
.scheduler-attached-table-wrap thead .col-resize-handle {
  position: absolute !important;
  top: 12px !important;
  right: 0 !important;
  bottom: 12px !important;
  display: block !important;
  width: 8px !important;
  min-width: 8px !important;
  opacity: 0.65 !important;
  pointer-events: auto !important;
  cursor: col-resize !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.55), rgba(37, 99, 235, 0)) !important;
}

.table-wrap thead th:hover .col-resize-handle,
.saved-scans-table-wrap thead th:hover .col-resize-handle,
.scheduler-attached-table-wrap thead th:hover .col-resize-handle {
  opacity: 1 !important;
}

#queueTable th:nth-child(2),
#queueTable td:nth-child(2),
#planningTable th:nth-child(4),
#planningTable td:nth-child(4),
#planningTable th:nth-child(19),
#planningTable td:nth-child(19),
#decisionsTable th:nth-child(11),
#decisionsTable td:nth-child(11),
#applicationTable th:nth-child(3),
#applicationTable td:nth-child(3) {
  min-width: 260px !important;
}

#queueTable td.apply-cell,
#queueTable td.sticky-apply-col,
#planningTable td.apply-cell,
#planningTable td.sticky-apply-col,
#decisionsTable td.apply-cell,
#decisionsTable td.sticky-apply-col {
  vertical-align: middle !important;
}

body.executive-simple-mode #queueTable {
  width: 100% !important;
  min-width: 100% !important;
}

body.executive-simple-mode #queueTable th.sticky-apply-col,
body.executive-simple-mode #queueTable td.sticky-apply-col,
body.executive-simple-mode #queueTable td.apply-cell {
  width: 116px !important;
  min-width: 116px !important;
}

/* ui_redesign_v16: stronger solid metric-card backgrounds. */
.stats-grid .stat-card {
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14) !important;
}

.stats-grid .stat-card::before {
  display: none !important;
}

.stats-grid .stat-card:nth-child(4n + 1) {
  background: #dbeafe !important;
}

.stats-grid .stat-card:nth-child(4n + 2) {
  background: #ccfbf1 !important;
}

.stats-grid .stat-card:nth-child(4n + 3) {
  background: #ffedd5 !important;
}

.stats-grid .stat-card:nth-child(4n + 4) {
  background: #fee2e2 !important;
}

.stats-grid .stat-card:nth-child(4n + 1) .stat-label,
.stats-grid .stat-card:nth-child(4n + 1) .stat-value {
  color: #0f2f64 !important;
}

.stats-grid .stat-card:nth-child(4n + 2) .stat-label,
.stats-grid .stat-card:nth-child(4n + 2) .stat-value {
  color: #0f4f47 !important;
}

.stats-grid .stat-card:nth-child(4n + 3) .stat-label,
.stats-grid .stat-card:nth-child(4n + 3) .stat-value {
  color: #7c2d12 !important;
}

.stats-grid .stat-card:nth-child(4n + 4) .stat-label,
.stats-grid .stat-card:nth-child(4n + 4) .stat-value {
  color: #7f1d1d !important;
}

.stats-grid .stat-card .stat-label {
  opacity: 0.86 !important;
}

html[data-theme="dark"] .stats-grid .stat-card:nth-child(4n + 1) {
  background: #1d3b73 !important;
}

html[data-theme="dark"] .stats-grid .stat-card:nth-child(4n + 2) {
  background: #14514a !important;
}

html[data-theme="dark"] .stats-grid .stat-card:nth-child(4n + 3) {
  background: #7a3a12 !important;
}

html[data-theme="dark"] .stats-grid .stat-card:nth-child(4n + 4) {
  background: #742323 !important;
}

html[data-theme="dark"] .stats-grid .stat-card .stat-label,
html[data-theme="dark"] .stats-grid .stat-card .stat-value {
  color: #f8fafc !important;
}

/* ui_redesign_v17: table header spacing and subtle resize grips. */
.table-wrap thead th,
.saved-scans-table-wrap thead th,
.scheduler-attached-table-wrap thead th,
#queueTable thead th,
#planningTable thead th,
#decisionsTable thead th,
#applicationTable thead th,
#schedulerTable thead th {
  padding: 16px 26px 16px 18px !important;
  vertical-align: middle !important;
  line-height: 1.25 !important;
}

.table-wrap thead .sort-header-btn,
.table-wrap thead th .sort-header-btn,
.saved-scans-table-wrap thead .sort-header-btn,
.scheduler-attached-table-wrap thead .sort-header-btn,
.table-wrap thead .resizable-col-content,
.table-wrap thead th .resizable-col-content,
.saved-scans-table-wrap thead .resizable-col-content,
.scheduler-attached-table-wrap thead .resizable-col-content {
  align-items: center !important;
  min-height: 28px !important;
  line-height: 1.25 !important;
}

.table-wrap thead .sort-header-label,
.table-wrap thead .resizable-col-label,
.saved-scans-table-wrap thead .sort-header-label,
.saved-scans-table-wrap thead .resizable-col-label,
.scheduler-attached-table-wrap thead .sort-header-label,
.scheduler-attached-table-wrap thead .resizable-col-label {
  line-height: 1.25 !important;
}

.table-wrap thead .col-resize-handle,
.saved-scans-table-wrap thead .col-resize-handle,
.scheduler-attached-table-wrap thead .col-resize-handle {
  top: 50% !important;
  right: 8px !important;
  bottom: auto !important;
  width: 4px !important;
  min-width: 4px !important;
  height: 26px !important;
  transform: translateY(-50%) !important;
  opacity: 0.42 !important;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.25), rgba(37, 99, 235, 0.85), rgba(37, 99, 235, 0.25)) !important;
  box-shadow: none !important;
}

.table-wrap thead .col-resize-handle::before,
.saved-scans-table-wrap thead .col-resize-handle::before,
.scheduler-attached-table-wrap thead .col-resize-handle::before {
  content: "" !important;
  position: absolute;
  inset: -6px -4px;
}

.table-wrap thead th.sticky-apply-col,
.table-wrap thead th.apply-col-fixed,
.table-wrap thead th:last-child,
.saved-scans-table-wrap thead th:last-child,
.scheduler-attached-table-wrap thead th:last-child,
#queueTable thead th.sticky-apply-col,
#planningTable thead th.sticky-apply-col,
#decisionsTable thead th.sticky-apply-col,
#queueTable thead th.apply-col-fixed,
#planningTable thead th.apply-col-fixed,
#decisionsTable thead th.apply-col-fixed {
  padding-right: 18px !important;
  resize: none !important;
}

.table-wrap thead th.sticky-apply-col .col-resize-handle,
.table-wrap thead th.apply-col-fixed .col-resize-handle,
.table-wrap thead th:last-child .col-resize-handle,
.saved-scans-table-wrap thead th:last-child .col-resize-handle,
.scheduler-attached-table-wrap thead th:last-child .col-resize-handle,
#queueTable thead th.sticky-apply-col .col-resize-handle,
#planningTable thead th.sticky-apply-col .col-resize-handle,
#decisionsTable thead th.sticky-apply-col .col-resize-handle,
#queueTable thead th.apply-col-fixed .col-resize-handle,
#planningTable thead th.apply-col-fixed .col-resize-handle,
#decisionsTable thead th.apply-col-fixed .col-resize-handle {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ui_redesign_v18: align page titles with the fixed top-right app controls. */
.app-shell ~ .page,
body.app-shell-collapsed .app-shell ~ .page {
  padding-top: 18px !important;
}

.page-header {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  min-height: 64px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 14px !important;
  padding-right: min(760px, calc(100vw - var(--app-shell-collapsed-width, 68px) - 560px)) !important;
  text-align: left !important;
}

.page-header h1,
.scan-workspace-page .page-header h1,
.tailoring-workspace-page .page-header h1 {
  font-size: clamp(28px, 2.8vw, 44px) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 1180px) {
  .app-shell ~ .page,
  body.app-shell-collapsed .app-shell ~ .page {
    padding-top: 86px !important;
  }

  .page-header {
    min-height: auto !important;
    padding-right: 0 !important;
    flex-wrap: wrap !important;
  }
}

/* ui_redesign_v22: final end-of-file compact owner after legacy blocks. */
body .app-shell ~ .page,
body.app-shell-collapsed .app-shell ~ .page {
  padding-top: 16px !important;
}

body .app-shell ~ .page > .page-header,
body.app-shell-collapsed .app-shell ~ .page > .page-header,
body .page > .page-header {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 40px !important;
  margin: 0 0 12px !important;
  padding: 0 min(620px, calc(max(0px, 100vw - var(--app-shell-collapsed-width, 68px) - 640px))) 0 0 !important;
  text-align: left !important;
}

body .page > .page-header h1,
body .scan-workspace-page.page > .page-header h1,
body .scan-workspace-page.page > .page-header .scan-workspace-header-copy h1,
body .tailoring-workspace-page.page > .page-header h1 {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: clamp(26px, 2vw, 34px) !important;
  font-weight: 900 !important;
  line-height: 1.04 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
}

body .page > .page-header p,
body .page > .page-header .subtext {
  margin-top: 5px !important;
  font-size: clamp(12px, 0.85vw, 14px) !important;
  line-height: 1.35 !important;
}

body .controls-card,
body .filters-card {
  padding: 18px 20px !important;
}

body .stats-grid {
  gap: 14px !important;
}

body .stat-card {
  min-height: 104px !important;
  padding: 18px 20px !important;
  border-radius: 14px !important;
}

body .stat-label {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

body .stat-value,
body .stat-card-value {
  font-size: clamp(30px, 3vw, 52px) !important;
  line-height: 0.95 !important;
}

body .control-group input,
body .control-group select,
body .control-group textarea {
  min-height: 38px !important;
  padding: 8px 12px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
}

body .control-group label {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

body button,
body .ghost-btn,
body .btn-sm {
  min-height: 34px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
}

html[data-theme="light"] body .scheduler-page {
  background:
    linear-gradient(135deg, rgba(191, 219, 254, 0.86) 0%, rgba(236, 254, 255, 0.82) 46%, rgba(248, 250, 252, 0.96) 100%),
    #edf7ff !important;
}

body .scheduler-page .page-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  padding-right: min(520px, calc(max(0px, 100vw - var(--app-shell-collapsed-width, 68px) - 760px))) !important;
}

body .scheduler-page .header-actions {
  justify-self: end !important;
  align-self: center !important;
}

body .scheduler-page #refreshSchedulerSummaryBtn {
  border: 1px solid #0891b2 !important;
  background: #06b6d4 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(6, 182, 212, 0.22) !important;
}

html[data-theme="light"] body .scheduler-page .scheduler-table-tabs {
  border-color: #bae6fd !important;
  background: #e0f2fe !important;
}
/* ui_redesign_v24_eof: final tab/dropdown override. */
body .multi-select-menu {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 8px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.98)) !important;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(191, 219, 254, 0.42) !important;
}

body .multi-select-option {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
  min-height: 44px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: break-word !important;
  box-shadow: none !important;
}

body .multi-select-option + .multi-select-option {
  margin-top: 4px !important;
}

body .multi-select-option:hover,
body .multi-select-option:focus-visible {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

body .multi-select-option.is-selected {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

body .multi-select-option-check {
  display: inline-grid !important;
  place-items: center !important;
  width: 22px !important;
  height: 22px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: transparent !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

body .multi-select-option.is-selected .multi-select-option-check {
  border-color: #22c55e !important;
  background: #22c55e !important;
  color: #ffffff !important;
}

body .multi-select-option-label {
  min-width: 0 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

body .application-tabs,
body .scheduler-page .scheduler-table-tabs,
body .scheduler-tab-row {
  display: inline-flex !important;
  align-items: flex-end !important;
  gap: 22px !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body .application-tab,
body .scheduler-page .scheduler-table-tab,
body .scheduler-tab {
  position: relative !important;
  min-height: 44px !important;
  padding: 0 2px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
}

body .application-tab::after,
body .scheduler-page .scheduler-table-tab::after,
body .scheduler-tab::after {
  content: "" !important;
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

body .application-tab.active,
body .scheduler-page .scheduler-table-tab.is-active,
body .scheduler-tab.is-active {
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body .application-tab.active::after,
body .scheduler-page .scheduler-table-tab.is-active::after,
body .scheduler-tab.is-active::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
}

/* ui_redesign_v25: remove remaining tab button chrome on concrete pages. */
body #applicationViewRoot .application-tabs {
  display: inline-flex !important;
  align-items: flex-end !important;
  gap: 28px !important;
  margin-bottom: 14px !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body #applicationViewRoot .application-tab,
body #applicationViewRoot .application-tab.active,
body #applicationViewRoot .application-tab:focus,
body #applicationViewRoot .application-tab:focus-visible,
body #applicationViewRoot .application-tab:hover {
  appearance: none !important;
  position: relative !important;
  min-height: 34px !important;
  padding: 0 0 4px !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body #applicationViewRoot .application-tab:not(.active) {
  color: #475569 !important;
}

body #applicationViewRoot .application-tab::after {
  content: "" !important;
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

body #applicationViewRoot .application-tab.active::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
}

/* ui_redesign_v27: icon-only theme toggle. */
body .theme-toggle-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 92px !important;
  width: auto !important;
  padding: 6px 12px !important;
}

body .theme-toggle-icon {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  color: #f8fafc !important;
  filter: invert(1) brightness(1.35) !important;
  flex: 0 0 22px !important;
}

html[data-theme="light"] body .theme-toggle-icon {
  color: #0f172a !important;
  filter: none !important;
}

body .theme-toggle-label {
  display: none !important;
}

/* ui_redesign_v29: dark page titles and Scheduler Ops dark surfaces. */
html[data-theme="dark"] body .page > .page-header h1,
html[data-theme="dark"] body .page-header h1 {
  color: #f8fafc !important;
  opacity: 1 !important;
  filter: none !important;
  text-shadow: 0 10px 34px rgba(96, 165, 250, 0.12) !important;
}

html[data-theme="dark"] body .page > .page-header .subtext,
html[data-theme="dark"] body .page-header .subtext,
html[data-theme="dark"] body .page > .page-header p {
  color: #a8b6cc !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body .scheduler-page {
  background:
    radial-gradient(circle at 12% -12%, rgba(96, 165, 250, 0.16), transparent 32%),
    radial-gradient(circle at 88% 4%, rgba(45, 212, 191, 0.1), transparent 28%),
    linear-gradient(135deg, #050914 0%, #08101f 48%, #060914 100%) !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-table-card {
  border-color: rgba(96, 165, 250, 0.28) !important;
  background:
    linear-gradient(180deg, rgba(20, 30, 49, 0.96), rgba(12, 19, 33, 0.97)),
    #111827 !important;
  color: #f8fafc !important;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32) !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-table-tabs,
html[data-theme="dark"] body .scheduler-page .scheduler-tab-row {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-tab-btn {
  background: transparent !important;
  border: 0 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-tab-btn:hover {
  color: #dbeafe !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-tab-btn.active,
html[data-theme="dark"] body .scheduler-page .scheduler-tab-btn.is-active {
  color: #f8fafc !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-tab-btn.active::after,
html[data-theme="dark"] body .scheduler-page .scheduler-tab-btn.is-active::after {
  background: linear-gradient(90deg, #60a5fa, #22d3ee) !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-table-header h2,
html[data-theme="dark"] body .scheduler-page #schedulerTableTitle {
  color: #f8fafc !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body .scheduler-page #schedulerTableSubtitle {
  color: #a8b6cc !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body .scheduler-page #refreshSchedulerSummaryBtn {
  border-color: rgba(34, 211, 238, 0.48) !important;
  background: linear-gradient(135deg, #2563eb, #0891b2) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(8, 145, 178, 0.22) !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-attached-table-wrap {
  border-color: rgba(96, 165, 250, 0.24) !important;
  background: #0f172a !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body .scheduler-page #schedulerTable thead th {
  border-bottom-color: rgba(148, 163, 184, 0.22) !important;
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.18), rgba(96, 165, 250, 0.08)),
    #18243a !important;
  color: #dbeafe !important;
}

html[data-theme="dark"] body .scheduler-page #schedulerTable tbody td {
  border-bottom-color: rgba(148, 163, 184, 0.16) !important;
  background: #111c2f !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] body .scheduler-page #schedulerTable tbody tr:nth-child(even) td {
  background: #142238 !important;
}

html[data-theme="dark"] body .scheduler-page #schedulerTable tbody tr:hover td {
  background: #1b2d49 !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-run-badge--success {
  background: #16a34a !important;
  color: #ffffff !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-run-badge--danger {
  background: #dc2626 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] body .scheduler-page .scheduler-run-badge--muted {
  background: #64748b !important;
  color: #ffffff !important;
}

/* ui_redesign_v30: notification popover is anchored by JS below the bell. */
body .notification-shell {
  position: relative !important;
  flex: 0 0 auto !important;
}

body .notification-btn {
  flex: 0 0 48px !important;
  transform: none !important;
}

body .notification-btn:hover,
body .notification-btn:focus,
body .notification-btn:focus-visible,
body .notification-btn[aria-expanded="true"] {
  transform: none !important;
}

body .notification-dropdown {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1000 !important;
  width: min(440px, calc(100vw - 28px)) !important;
  overflow: hidden !important;
}

body .notification-dropdown.hidden {
  display: none !important;
}

/* New user onboarding: one shared empty state and first-run prompt for authenticated pages. */
body.app-new-user-empty .page {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

body.app-new-user-empty .page > :not(.new-user-empty-state) {
  display: none !important;
}

.new-user-empty-state {
  width: min(720px, calc(100vw - 48px));
  margin: 0 auto;
}

.new-user-empty-card,
.first-run-prompt-card {
  border: 1px solid rgba(96, 165, 250, 0.24);
  background:
    radial-gradient(circle at 16% 0%, rgba(34, 211, 238, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  color: #0f172a;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
}

.new-user-empty-card {
  border-radius: 30px;
  padding: clamp(32px, 5vw, 58px);
  text-align: center;
}

.new-user-empty-kicker,
.first-run-prompt-kicker {
  margin-bottom: 12px;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.new-user-empty-card h2,
.first-run-prompt-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.98;
  font-weight: 950;
}

.new-user-empty-card p,
.first-run-prompt-card p {
  margin: 18px auto 0;
  max-width: 560px;
  color: #52627a;
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 650;
}

.new-user-empty-actions,
.first-run-prompt-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.new-user-empty-primary,
.first-run-prompt-primary,
.first-run-prompt-secondary {
  min-height: 52px;
  border-radius: 16px;
  padding: 0 24px;
  font-weight: 900;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.new-user-empty-primary,
.first-run-prompt-primary {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.first-run-prompt-secondary {
  background: #ffffff;
  color: #334155;
}

.first-run-prompt-modal.hidden {
  display: none;
}

.first-run-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 24px;
}

.first-run-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(12px);
}

.first-run-prompt-card {
  position: relative;
  width: min(560px, calc(100vw - 48px));
  border-radius: 28px;
  padding: 34px;
  text-align: center;
}

html[data-theme="dark"] .new-user-empty-card,
html[data-theme="dark"] .first-run-prompt-card {
  border-color: rgba(96, 165, 250, 0.32);
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.18), transparent 36%),
    linear-gradient(135deg, #111c2f, #0f172a);
  color: #f8fafc;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .new-user-empty-card h2,
html[data-theme="dark"] .first-run-prompt-card h2 {
  color: #f8fafc;
}

html[data-theme="dark"] .new-user-empty-card p,
html[data-theme="dark"] .first-run-prompt-card p {
  color: #a8b6cc;
}

html[data-theme="dark"] .first-run-prompt-secondary {
  border-color: rgba(148, 163, 184, 0.28);
  background: #17243a;
  color: #dbeafe;
}
