/* ForgeClarityDefault – Bootstrap 5.3 base + reference UX styling */
@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css");

/* ---- Theme palette (reference UX) ---- */
:root,
[data-bs-theme="light"] {
  --fc-primary-dark: #101C2B;
  --fc-primary-dark-hover: #2D3C4F;
  --fc-active-bg: #E6F0F6;
  --fc-border: #DEE2E6;
  --fc-input-bg: #F8F9FA;
  --fc-text-muted: #ADB5BD;
  --bs-primary: #007BFF;
  --bs-primary-rgb: 0, 123, 255;
  --bs-secondary: #6C757D;
  --bs-body-bg: #FFFFFF;
  --bs-body-color: #212529;
  --bs-border-color: #DEE2E6;
  --bs-heading-color: #212529;
  --bs-link-color: #007BFF;
  --bs-link-hover-color: #0056b3;
  --bs-form-valid-border-color: #198754;
  --bs-form-invalid-border-color: #DC3545;
  --bs-form-invalid-color: #DC3545;
  /* Health / RAG (overridden in layout when company branding supplies colours) */
  --fc-health-green-bg: #4EA72E;
  --fc-health-green-fg: #FFFFFF;
  --fc-health-amber-bg: #FFC000;
  --fc-health-amber-fg: #000000;
  --fc-health-red-bg: #FF0000;
  --fc-health-red-fg: #FFFFFF;
  --fc-health-offtrack-bg: #782170;
  --fc-health-offtrack-fg: #FFFFFF;
  --fc-health-grey-bg: #A6A6A6;
  --fc-health-grey-fg: #FFFFFF;
}

/* ---- Dark mode (system / user choice) — Windows-like neutrals ---- */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --fc-primary-dark: #0d1117;
  --fc-primary-dark-hover: #161b22;
  --fc-active-bg: #21262d;
  --fc-border: #30363d;
  --fc-input-bg: #0d1117;
  --fc-text-muted: #8b949e;
  --bs-primary: #58a6ff;
  --bs-primary-rgb: 88, 166, 255;
  --bs-secondary: #8b949e;
  --bs-body-bg: #1e1e1e;
  --bs-body-color: #e6edf3;
  --bs-border-color: #30363d;
  --bs-heading-color: #f0f6fc;
  --bs-link-color: #58a6ff;
  --bs-link-hover-color: #79b8ff;
  --bs-form-valid-border-color: #3fb950;
  --bs-form-invalid-border-color: #f85149;
  --bs-form-invalid-color: #f85149;
}

[data-bs-theme="dark"] .fc-main header.border-bottom {
  background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .card {
  background-color: #252526;
  border-color: var(--fc-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .card-header {
  background-color: #252526;
  border-bottom-color: var(--fc-border);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #0d1117;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
}

[data-bs-theme="dark"] .table-light {
  /* Bootstrap keeps --bs-table-color as black for .table-light; override for dark backgrounds */
  --bs-table-bg: #21262d;
  --bs-table-color: var(--bs-heading-color);
  --bs-table-border-color: var(--fc-border);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
  --bs-table-striped-color: var(--bs-heading-color);
  --bs-table-active-bg: rgba(255, 255, 255, 0.08);
  --bs-table-active-color: var(--bs-heading-color);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-table-hover-color: var(--bs-heading-color);
}

/* Other coloured table rows keep pale tints + #000 from Bootstrap — readable. */

/* .text-dark always maps to near-black RGB; fix pairs that sit on dark / muted surfaces */
[data-bs-theme="dark"] .badge.bg-light.text-dark {
  background-color: var(--fc-border) !important;
  color: var(--bs-heading-color) !important;
}

/*
 * .bg-light keeps light RGB even in dark mode, so body-coloured text on it was low contrast;
 * elevate these surfaces to match cards and keep light text.
 */
[data-bs-theme="dark"] .bg-light:not(.fc-sidebar):not(.badge) {
  background-color: #30363d !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .border-secondary-subtle.bg-light {
  border-color: var(--fc-border) !important;
}

[data-bs-theme="dark"] .bg-white:not(.btn):not(.btn-close) {
  background-color: #252526 !important;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .text-dark {
  color: var(--bs-body-color) !important;
}

/* Keep dark type on amber badges (contrast); wins over the rule above */
[data-bs-theme="dark"] .badge.bg-warning.text-dark {
  color: rgba(var(--bs-dark-rgb), 1) !important;
}

/* ---- Typography ---- */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

/* Standard right-aligned action row (exclude sidebar/login usage by convention). */
.fc-actions-end {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

h1, .h1 {
  font-weight: 700;
  color: var(--bs-heading-color);
}

/* Theme-aware product / company logo in header (light vs dark page theme) */
.fc-brand-logo .fc-brand-logo-dark {
  display: none;
}

[data-bs-theme="dark"] .fc-brand-logo .fc-brand-logo-light {
  display: none !important;
}

[data-bs-theme="dark"] .fc-brand-logo .fc-brand-logo-dark {
  display: block !important;
}

/* ---- Primary sidebar (dark) ---- */
.fc-app-shell .fc-sidebar {
  background-color: var(--fc-primary-dark) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-header,
.fc-app-shell .fc-sidebar .fc-sidebar-nav,
.fc-app-shell .fc-sidebar .fc-sidebar-footer {
  background-color: transparent;
}

.fc-app-shell .fc-sidebar .fc-sidebar-header {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.fc-app-shell .fc-sidebar .sidebar-text,
.fc-app-shell .fc-sidebar .nav-link,
.fc-app-shell .fc-sidebar .fc-sidebar-brand {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Keep sidebar typography consistent across links, context, subsections and footer. */
.fc-app-shell .fc-sidebar .sidebar-text,
.fc-app-shell .fc-sidebar .small,
.fc-app-shell .fc-sidebar .fc-sidebar-footer-label,
.fc-app-shell .fc-sidebar .fc-sidebar-subsection-label {
  font-size: 0.875rem !important;
  line-height: 1.25rem;
}

.fc-app-shell .fc-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff !important;
}

.fc-app-shell .fc-sidebar .nav-link.active {
  background-color: var(--fc-primary-dark-hover);
  color: #fff !important;
}

.fc-app-shell .fc-sidebar .nav-link.active .fc-sidebar-icon {
  background-color: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0;
}

.fc-app-shell .fc-sidebar .fc-sidebar-nav .bi,
.fc-app-shell .fc-sidebar .fc-sidebar-footer .bi {
  color: rgba(255, 255, 255, 0.85);
}

.fc-app-shell .fc-sidebar .fc-sidebar-header .fc-sidebar-toggle,
.fc-app-shell .fc-sidebar .fc-sidebar-header .fc-sidebar-toggle .bi {
  color: rgba(255, 255, 255, 0.85) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-header .fc-sidebar-toggle:hover,
.fc-app-shell .fc-sidebar .fc-sidebar-header .fc-sidebar-toggle:hover .bi {
  color: #fff !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer .text-muted {
  color: rgba(255, 255, 255, 0.7) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer .btn-link {
  color: rgba(255, 255, 255, 0.8) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer .btn-link:hover {
  color: #fff !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer .fc-sidebar-footer-line,
.fc-app-shell .fc-sidebar .fc-sidebar-footer .fc-sidebar-footer-line .fc-sidebar-footer-label,
.fc-app-shell .fc-sidebar .fc-sidebar-footer .fc-sidebar-footer-action {
  font-size: var(--bs-small-font-size);
  line-height: var(--bs-small-line-height);
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer .fc-sidebar-footer-action {
  color: rgba(255, 255, 255, 0.7) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-footer .fc-sidebar-footer-action:hover {
  color: #fff !important;
}

.fc-app-shell .fc-sidebar,
.fc-app-shell .fc-sidebar .fc-sidebar-nav,
.fc-app-shell .fc-sidebar .fc-sidebar-footer {
  overflow-x: hidden;
}

.fc-app-shell .fc-sidebar .border-top,
.fc-app-shell .fc-sidebar .border-bottom {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-nav-divider-line {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-nav-divider-line {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.fc-app-shell .fc-sidebar .nav-item .text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

.fc-app-shell .fc-sidebar .nav-link,
.fc-app-shell .fc-sidebar .fc-sidebar-footer-line {
  min-width: 0;
}

.fc-app-shell .fc-sidebar .nav-link .sidebar-text,
.fc-app-shell .fc-sidebar .fc-sidebar-footer-label {
  min-width: 0;
}

.fc-app-shell .fc-sidebar .fc-sidebar-context-title {
  min-width: 0;
}

.fc-app-shell .fc-sidebar .fc-sidebar-context-health {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

/* Sidebar nav 2.1 (NAV-02–15) */
.fc-app-shell .fc-sidebar .fc-sidebar-nav-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 8rem);
}

.fc-app-shell .fc-sidebar .nav-link.active {
  border-left: 3px solid var(--bs-primary);
  padding-left: calc(1rem - 3px);
}

.fc-app-shell .fc-sidebar .fc-sidebar-nav-primary {
  font-weight: 600;
}

.fc-app-shell .fc-sidebar .fc-sidebar-section-toggle {
  display: grid !important;
  grid-template-columns: 1.25rem minmax(0, 1fr) 1rem;
  column-gap: 0.5rem;
  align-items: center;
  text-align: start;
  justify-content: normal;
}

.fc-app-shell .fc-sidebar:not(.collapsed) .fc-sidebar-nav-children .nav-link {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: start !important;
  padding-left: 2.25rem !important;
  padding-right: 0.75rem;
}

.fc-app-shell .fc-sidebar:not(.collapsed) .fc-sidebar-section-flat .fc-sidebar-nav-children .nav-link {
  padding-left: 1rem !important;
}

.fc-app-shell .fc-sidebar:not(.collapsed) .fc-sidebar-section-toggle .fc-sidebar-section-label {
  text-align: start;
}

.fc-app-shell .fc-sidebar .fc-sidebar-section-toggle .fc-sidebar-icon {
  margin-right: 0;
}

.fc-app-shell .fc-sidebar .fc-sidebar-section-toggle .fc-sidebar-section-label {
  margin-left: 0 !important;
}

.fc-app-shell .fc-sidebar .fc-nav-chevron {
  transition: transform 0.2s ease;
  flex: 0 0 auto;
  width: 1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.fc-app-shell .fc-sidebar .fc-nav-chevron.fc-nav-chevron-open {
  transform: rotate(180deg);
}

.fc-app-shell .fc-sidebar .fc-sidebar-nav-children .nav-link {
  padding-left: 2.25rem;
}

.fc-app-shell .fc-sidebar .nav-link .sidebar-text {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.fc-app-shell .fc-sidebar .fc-sidebar-section-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-app-shell .fc-sidebar .fc-sidebar-subsection-label {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fc-app-shell .fc-sidebar .nav-link:focus-visible,
.fc-app-shell .fc-sidebar button.nav-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-nav-section .fc-sidebar-section-label,
.fc-app-shell .fc-sidebar.collapsed .fc-nav-chevron,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-subsection-label {
  display: none !important;
}

/* ---- Compact sidebar rail (icons only) + flyout (Phase 2/3) ---- */
.fc-app-shell .fc-sidebar.collapsed [data-fc-nav-collapse-panel] {
  display: none !important;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-context-header,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-scope-tabs {
  display: none !important;
}

.fc-app-shell .fc-sidebar .fc-sidebar-context-rail,
.fc-app-shell .fc-sidebar .fc-sidebar-scope-rail {
  display: none;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-context-rail,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-scope-rail {
  display: block;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-rail-row {
  justify-content: center;
  align-items: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-inline: 0 !important;
  border-radius: 6px;
  min-height: 2.75rem;
  width: 100%;
  text-align: center;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-nav .nav-link {
  justify-content: center !important;
  align-items: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-inline: 0 !important;
  min-height: 2.75rem;
  width: 100%;
  text-align: center;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-toggle {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  grid-template-columns: none !important;
  column-gap: 0 !important;
  text-align: center !important;
  width: 100%;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-inline: 0 !important;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-toggle .fc-sidebar-section-label,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-toggle .fc-nav-chevron {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  pointer-events: none !important;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-toggle .fc-sidebar-icon {
  margin: 0 !important;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-nav-children .nav-link,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-flat .fc-sidebar-nav-children .nav-link {
  padding-left: 0 !important;
  padding-right: 0 !important;
  justify-content: center !important;
  align-items: center !important;
}

.fc-app-shell .fc-sidebar.collapsed .nav-link.active,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-toggle.fc-sidebar-rail-trigger-active,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-section-toggle:has(+ [data-fc-nav-collapse-panel] a.nav-link.active) {
  border-left: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background-color: var(--fc-primary-dark-hover);
  color: #fff !important;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-footer-line,
.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-footer-action {
  justify-content: center;
}

.fc-app-shell .fc-sidebar.collapsed .fc-sidebar-footer .fc-sidebar-icon {
  margin: 0 !important;
}

.fc-app-shell .fc-sidebar-context-rail-icon-wrap {
  display: inline-flex;
  line-height: 1;
}

.fc-sidebar-rail-health-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1px solid var(--fc-primary-dark);
}

.fc-sidebar-rail-health-green {
  background-color: var(--fc-health-green-bg);
}

.fc-sidebar-rail-health-amber {
  background-color: var(--fc-health-amber-bg);
}

.fc-sidebar-rail-health-red {
  background-color: var(--fc-health-red-bg);
}

.fc-sidebar-rail-health-grey {
  background-color: var(--fc-health-grey-bg);
}

.fc-sidebar-flyout {
  position: fixed;
  z-index: 1080;
  min-width: 240px;
  max-width: 320px;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fc-sidebar-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--fc-border);
  font-weight: 600;
  font-size: 0.875rem;
}

.fc-sidebar-flyout-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-sidebar-flyout-close {
  color: var(--bs-body-color);
  flex-shrink: 0;
}

.fc-sidebar-flyout-body {
  overflow-y: auto;
  padding: 0.35rem 0;
}

.fc-sidebar-flyout-nav .nav-link {
  color: var(--bs-body-color);
  padding: 0.45rem 1rem;
  border-radius: 0;
}

.fc-sidebar-flyout-nav .nav-link:hover {
  background-color: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.05));
}

.fc-sidebar-flyout-nav .nav-link.active {
  background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.12));
  color: var(--bs-primary);
  border-left: 3px solid var(--bs-primary);
  padding-left: calc(1rem - 3px);
  font-weight: 600;
}

.fc-sidebar-flyout-nav .fc-sidebar-subsection-label {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  padding-left: 1rem;
}

/* Density (UX-08) */
body.fc-density-compact .fc-main-body {
  font-size: 0.925rem;
}

body.fc-density-compact .fc-main-body .card-body {
  padding: 0.65rem 0.85rem;
}

body.fc-density-compact .fc-main-body .table > :not(caption) > * > * {
  padding: 0.35rem 0.5rem;
}

/* Viewer / presentation mode (UX-03) */
body.fc-viewer-mode .btn-suggest-improvement,
body.fc-viewer-mode .fc-canvas-quick-actions {
  display: none !important;
}

/* Report layout (UX-09) */
.fc-report-layout {
  max-width: 960px;
}

@media print {
  .fc-report-layout .btn,
  .fc-report-layout .fc-sidebar {
    display: none !important;
  }
}

/* Canvas hero (UX-01, UX-05, UX-12) */
.fc-canvas-stale-hint {
  font-weight: 500;
}

@media (min-width: 768px) {
  .fc-canvas-enhanced .fc-canvas-health-band {
    position: sticky;
    top: 0.5rem;
    z-index: 2;
  }
}

.fc-status-scan-table table {
  table-layout: fixed;
}

.fc-empty-state {
  border: 1px dashed var(--fc-border);
  border-radius: 8px;
  background: var(--bs-body-bg);
}

:root {
  --fc-font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, .h1 {
  font-family: var(--fc-font-display);
}

.fc-main header.border-bottom {
  background-color: var(--bs-body-bg);
  border-color: var(--fc-border) !important;
}

/* ---- Buttons ---- */
.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  border-radius: 6px;
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

.btn-outline-primary,
.btn-info.btn-outline,
.btn-outline-info {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  border-radius: 6px;
}

.btn-outline-primary:hover,
.btn-info.btn-outline:hover {
  background-color: var(--bs-primary);
  color: #fff;
  border-color: var(--bs-primary);
}

/* Suggest improvement — orange button, black label (Bootstrap has no orange variant) */
.btn.btn-suggest-improvement {
  color: #000;
  background-color: #fd7e14;
  border-color: #e8590c;
}
.btn.btn-suggest-improvement:hover,
.btn.btn-suggest-improvement:focus-visible {
  color: #000;
  background-color: #e96b02;
  border-color: #cc5500;
}
.btn.btn-suggest-improvement:active {
  color: #000;
  background-color: #cc5500;
  border-color: #b84d00;
}

/* ---- Cards (form sections) ---- */
.card {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-header {
  background-color: var(--bs-body-bg);
  border-bottom-color: var(--fc-border);
  font-weight: 600;
  color: var(--bs-body-color);
  padding: 0.75rem 1rem;
}

.card-body {
  padding: 1rem;
}

/* ---- Form controls (placement & input boxes) ---- */
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: var(--bs-body-color);
}

.form-control,
.form-select {
  background-color: var(--fc-input-bg);
  border: 1px solid var(--fc-border);
  border-radius: 6px;
  color: var(--bs-body-color);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.2);
}

.form-control::placeholder {
  color: var(--fc-text-muted);
}

/* Character counter style (small, right-aligned) */
.form-control + .form-text,
.text-muted.small[data-count] {
  font-size: 0.8rem;
  color: var(--fc-text-muted);
}

/* Required asterisk */
.required,
[aria-required="true"] label::after,
.form-label.required::after {
  color: #DC3545;
}

/* ---- Checkbox / form-check ---- */
.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check-input:focus {
  border-color: rgba(0, 123, 255, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.2);
}

/* ---- Tables (e.g. form field list) ---- */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--fc-border);
}

.table-light {
  --bs-table-bg: var(--fc-input-bg);
  --bs-table-border-color: var(--fc-border);
}

/* ---- Utilities ---- */
.border-end {
  border-right-color: var(--fc-border) !important;
}

.text-muted {
  color: var(--fc-text-muted) !important;
}

/* Secondary sidebar style (if used elsewhere) */
.fc-secondary-sidebar,
.bg-light.fc-sidebar-secondary {
  background-color: var(--fc-input-bg) !important;
}

.fc-secondary-sidebar .nav-link.active,
.bg-light.fc-sidebar-secondary .nav-link.active {
  background-color: var(--fc-active-bg);
  border-left: 3px solid var(--bs-primary);
  color: var(--bs-primary);
}

/* Canvas status badges (health only): slightly larger, equal width */
.fc-canvas-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Canvas content badges (notes, milestones, risks, benefits, doc links): uniform size, exclude health */
.fc-canvas-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Documentation card: fixed badge width so Tag and OpenPreference badges are the same size */
.fc-doc-link-badge {
  width: 5.5rem;
  min-width: 5.5rem;
}

/* Programs RollUp: same badge width in Projects card, Top risks, and Benefits line-of-sight */
.fc-rollup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  white-space: nowrap;
}

/* Canvas three-pillar cards: same height as tallest, with a minimum baseline height. */
.fc-canvas-pillars-row > [class*="col-"] {
  display: flex;
}

.fc-canvas-pillars-card {
  width: 100%;
  min-height: 16rem;
  display: flex;
  flex-direction: column;
}

.fc-canvas-pillars-card .card-body {
  flex: 1 1 auto;
}

/* Health status fills (badges, toolbar buttons) — uses CSS variables from branding */
.badge.fc-health-fill-green,
.btn.fc-health-fill-green {
  background-color: var(--fc-health-green-bg) !important;
  border-color: var(--fc-health-green-bg) !important;
  color: var(--fc-health-green-fg) !important;
}
.btn.fc-health-outline-green {
  background-color: transparent !important;
  border-color: var(--fc-health-green-bg) !important;
  color: var(--fc-health-green-bg) !important;
}
.badge.fc-health-fill-amber,
.btn.fc-health-fill-amber {
  background-color: var(--fc-health-amber-bg) !important;
  border-color: var(--fc-health-amber-bg) !important;
  color: var(--fc-health-amber-fg) !important;
}
.btn.fc-health-outline-amber {
  background-color: transparent !important;
  border-color: var(--fc-health-amber-bg) !important;
  color: var(--fc-health-amber-fg) !important;
}
.badge.fc-health-fill-red,
.btn.fc-health-fill-red {
  background-color: var(--fc-health-red-bg) !important;
  border-color: var(--fc-health-red-bg) !important;
  color: var(--fc-health-red-fg) !important;
}
.btn.fc-health-outline-red {
  background-color: transparent !important;
  border-color: var(--fc-health-red-bg) !important;
  color: var(--fc-health-red-bg) !important;
}
.badge.fc-health-fill-offtrack,
.btn.fc-health-fill-offtrack {
  background-color: var(--fc-health-offtrack-bg) !important;
  border-color: var(--fc-health-offtrack-bg) !important;
  color: var(--fc-health-offtrack-fg) !important;
}
.btn.fc-health-outline-offtrack {
  background-color: transparent !important;
  border-color: var(--fc-health-offtrack-bg) !important;
  color: var(--fc-health-offtrack-bg) !important;
}
.badge.fc-health-fill-grey,
.btn.fc-health-fill-grey {
  background-color: var(--fc-health-grey-bg) !important;
  border-color: var(--fc-health-grey-bg) !important;
  color: var(--fc-health-grey-fg) !important;
}
.btn.fc-health-outline-grey {
  background-color: transparent !important;
  border-color: var(--fc-health-grey-bg) !important;
  color: var(--fc-health-grey-bg) !important;
}

/* Health radio toolbars: outline per color; filled style follows :checked */
.btn-group .btn-check:checked + .btn.fc-health-outline-green {
  background-color: var(--fc-health-green-bg) !important;
  border-color: var(--fc-health-green-bg) !important;
  color: var(--fc-health-green-fg) !important;
}
.btn-group .btn-check:checked + .btn.fc-health-outline-amber {
  background-color: var(--fc-health-amber-bg) !important;
  border-color: var(--fc-health-amber-bg) !important;
  color: var(--fc-health-amber-fg) !important;
}
.btn-group .btn-check:checked + .btn.fc-health-outline-red {
  background-color: var(--fc-health-red-bg) !important;
  border-color: var(--fc-health-red-bg) !important;
  color: var(--fc-health-red-fg) !important;
}
.btn-group .btn-check:checked + .btn.fc-health-outline-offtrack {
  background-color: var(--fc-health-offtrack-bg) !important;
  border-color: var(--fc-health-offtrack-bg) !important;
  color: var(--fc-health-offtrack-fg) !important;
}

/* Canvas enhanced visuals (scoped under .fc-canvas-enhanced; toggle via Canvas:EnhancedVisuals) */
.fc-canvas-enhanced .fc-canvas-health-primary.fc-canvas-status-badge {
  min-width: 8.5rem;
  padding: 0.55rem 1rem;
  font-size: 1rem;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.fc-canvas-budget-fill {
  background: linear-gradient(
    90deg,
    var(--fc-health-green-bg),
    var(--fc-health-amber-bg)
  );
  opacity: 0.9;
}

.fc-canvas-enhanced .fc-canvas-priority-item {
  border-left: 3px solid var(--bs-primary);
}

.fc-canvas-enhanced .fc-canvas-risk-row {
  border-left: 3px solid transparent;
}

.fc-canvas-enhanced .fc-canvas-risk-trend-Up {
  border-left-color: var(--bs-danger);
}

.fc-canvas-enhanced .fc-canvas-risk-trend-Down {
  border-left-color: var(--bs-success);
}

.fc-canvas-enhanced .fc-canvas-risk-trend-Stable {
  border-left-color: var(--bs-secondary);
}

/* Program milestone horizon: aligned columns across 30/60/90 day tables */
.fc-report-milestone-horizon .fc-report-milestone-horizon-table {
  table-layout: fixed;
  width: 100%;
}

.fc-report-milestone-horizon .fc-report-milestone-horizon-table col.col-project {
  width: 42%;
}

.fc-report-milestone-horizon .fc-report-milestone-horizon-table col.col-milestone {
  width: 38%;
}

.fc-report-milestone-horizon .fc-report-milestone-horizon-table col.col-date {
  width: 20%;
}

/* System status: same column widths in every area table */
.fc-system-status .fc-system-status-table {
  table-layout: fixed;
  width: 100%;
}

.fc-system-status .fc-system-status-table col.col-id {
  width: 4.5rem;
}

.fc-system-status .fc-system-status-table col.col-check {
  width: 13rem;
}

.fc-system-status .fc-system-status-table col.col-purpose {
  width: 24%;
}

.fc-system-status .fc-system-status-table col.col-status {
  width: 8.75rem;
}

.fc-system-status .fc-system-status-table th.col-id,
.fc-system-status .fc-system-status-table td.col-id {
  white-space: nowrap;
}

.fc-system-status .fc-system-status-table th.col-status,
.fc-system-status .fc-system-status-table td.col-status {
  white-space: nowrap;
}

.fc-system-status .fc-system-status-table td.col-purpose,
.fc-system-status .fc-system-status-table td.col-detail {
  overflow-wrap: anywhere;
  word-break: break-word;
}
