/* Staging-only palette rule:
   This warm tan canvas is reserved for staging. Production must use a distinct background palette. */
:root {
  --ink: #172033;
  --muted: #40495b;
  --line: rgba(23, 32, 51, 0.18);
  --accent: #8a3b12;
  --accent-strong: #5f2414;
  --surface: rgba(230, 220, 204, 0.92);
  --surface-strong: #ded1bf;
  --canvas: #d3bea0;
  --canvas-deep: #b89a72;
  --success: #206247;
  --warning: #9a6a10;
  --danger: #9a2f24;
  --shadow: 0 14px 32px rgba(84, 56, 24, 0.12);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

:root.dark-mode {
  --ink: #f1ece2;
  --muted: #c9c0b2;
  --on-colored-surface: #111820;
  --on-colored-surface-muted: #29363d;
  --on-colored-surface-accent: #075070;
  --line: rgba(241, 236, 226, 0.22);
  --accent: #76d0ef;
  --accent-strong: #3ba9d1;
  --surface: rgba(44, 48, 49, 0.95);
  --surface-strong: #393d3d;
  --canvas: #182024;
  --canvas-deep: #0e1519;
  --success: #78c69d;
  --warning: #efc86a;
  --danger: #ff9a8d;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

:root.dark-mode body {
  background:
    radial-gradient(circle at top left, rgba(128, 91, 55, 0.2), transparent 36%),
    radial-gradient(circle at top right, rgba(72, 101, 93, 0.16), transparent 30%),
    linear-gradient(145deg, var(--canvas), var(--canvas-deep));
}

:root.dark-mode .hero {
  background: linear-gradient(135deg, rgba(53, 57, 56, 0.98), rgba(31, 37, 39, 0.98));
}

:root.dark-mode .page-menu-dropdown,
:root.dark-mode input,
:root.dark-mode select,
:root.dark-mode textarea,
:root.dark-mode .dashboard-notifications-card.has-alert {
  background: var(--surface-strong);
  color: var(--ink);
}

:root.dark-mode .dashboard-notifications-card.has-alert {
  border-color: rgba(255, 154, 141, 0.45);
}

/* Keep standard dark surfaces dark, while preserving intentional card colors. */
:root.dark-mode :is(.console-output, .callout, .review-card, .backup-alert-item),
:root.dark-mode .detail-card:not([class*="dashboard-card-tone-"]) {
  background: var(--surface);
  color: var(--ink);
}

:root.dark-mode :is(
  .detail-card.dashboard-card-tone-sand,
  .detail-card.dashboard-card-tone-stone,
  .detail-card.dashboard-card-tone-sage,
  .detail-card.dashboard-card-tone-slate,
  .detail-card.dashboard-card-tone-clay,
  .detail-card.dashboard-card-tone-mist,
  .detail-card.dashboard-card-tone-rose,
  .detail-card.dashboard-card-tone-moss
) {
  --ink: var(--on-colored-surface);
  --muted: var(--on-colored-surface-muted);
  --accent: #08729a;
  --accent-strong: var(--on-colored-surface-accent);
  --line: rgba(17, 24, 32, 0.24);
  color: var(--on-colored-surface);
}

:root.dark-mode :is(
  .detail-card.dashboard-card-tone-sand,
  .detail-card.dashboard-card-tone-stone,
  .detail-card.dashboard-card-tone-sage,
  .detail-card.dashboard-card-tone-slate,
  .detail-card.dashboard-card-tone-clay,
  .detail-card.dashboard-card-tone-mist,
  .detail-card.dashboard-card-tone-rose,
  .detail-card.dashboard-card-tone-moss
) :is(input, select, textarea) {
  background: rgba(255, 255, 255, 0.78);
  color: var(--on-colored-surface);
  border-color: rgba(17, 24, 32, 0.32);
}

:root.dark-mode .page-menu-button:is(
  .menu-tone-sand,
  .menu-tone-stone,
  .menu-tone-sage,
  .menu-tone-slate,
  .menu-tone-clay,
  .menu-tone-mist,
  .menu-tone-rose,
  .menu-tone-moss
) {
  color: var(--on-colored-surface);
}

:root.dark-mode .overview-section-toggle {
  color: #76d0ef;
}

:root.dark-mode .overview-section-toggle:hover,
:root.dark-mode .overview-section-toggle:focus-visible {
  color: #b8edfb;
}

/* Neutral status labels need a solid enough surface behind their light text. */
:root.dark-mode :is(.badge, .dashboard-chip, .document-status-chip, .status-pill-neutral) {
  background: #252d33;
  border-color: #536069;
  color: #f7f3ea;
}

/* These operational panels intentionally remain light in dark mode. */
:root.dark-mode :is(
  .admin-attention,
  #spend-history-table-wrap,
  #my-charges-table-wrap,
  #data-browser-table-wrap,
  #timecard-labor-queue-wrap,
  #admin-access-events-wrap,
  #admin-upload-status-wrap,
  #admin-cardholder-upload-wrap,
  #admin-backup-wrap
) {
  --ink: #111820;
  --muted: #29363d;
  --surface: #f1ede5;
  --line: rgba(17, 24, 32, 0.22);
  color: var(--ink);
}

/* Dark-mode contrast policy: these surfaces intentionally remain light, so
   their text must never inherit the global light dark-mode foreground. */
:root.dark-mode :is(
  .table-wrap,
  .matrix-table,
  .data-browser-table,
  .search-picker-results,
  .search-picker-option,
  .document-preview-toolbar,
  .inline-form,
  .statement-form,
  .compact-form
):is([style*="background: white"], [style*="background:#fff"], [style*="background: #fff"]),
:root.dark-mode .matrix-table :is(td, caption),
:root.dark-mode .data-browser-table :is(td, caption) {
  color: #111820;
}

/* Weather forecast details retain pale forecast panels in both themes. */
:root.dark-mode .dashboard-weather-card :is(
  .dashboard-weather-current,
  .dashboard-weather-metric,
  .dashboard-weather-period,
  .dashboard-weather-compact-current,
  .dashboard-weather-compact-table
) {
  --ink: #111820;
  --muted: #29363d;
  --line: rgba(17, 24, 32, 0.22);
  color: var(--ink);
}

/* Result lists are light surfaces; their text must remain dark in dark mode. */
:root.dark-mode :is(
  #my-upload-job-options,
  .dashboard-my-upload-job-search-picker,
  .dashboard-my-upload-job-picker,
  #dashboard-my-upload-job-results,
  #my-upload-status,
  .dashboard-upload-form .upload-ocr-status
) {
  --ink: var(--contrast-on-light);
  --muted: #29363d;
  color: var(--contrast-on-light);
}

/* The full-page CC & Expenses picker itself stays on the dark form surface. */
:root.dark-mode #my-upload-job-picker > label,
:root.dark-mode #my-upload-job::placeholder {
  color: var(--contrast-on-dark);
  opacity: 1;
}

:root.dark-mode :is(#my-upload-job-options, #dashboard-my-upload-job-results) {
  background: var(--contrast-light-surface);
  border-color: rgba(17, 24, 32, 0.28);
}

:root.dark-mode :is(#my-upload-job-options, #dashboard-my-upload-job-results) :is(.search-picker-option, .search-picker-empty) {
  color: var(--contrast-on-light);
}

/* These dashboard messages are intentionally dark panels and require light copy. */
:root.dark-mode .dashboard-notifications-card.has-alert .dashboard-card-header h3,
:root.dark-mode .dashboard-card-status,
:root.dark-mode #wishlist-create-status {
  background: var(--contrast-dark-surface);
  border-color: #536069;
  color: var(--contrast-on-dark);
}

/* SSH Admin operational tables remain dark in dark mode, including their sticky headers. */
:root.dark-mode :is(
  #admin-scan-events-wrap,
  #admin-document-events-wrap,
  #admin-ocr-usage-wrap,
  #admin-ocr-diagnostic-wrap
) :is(table, thead th, tbody td, caption) {
  color: var(--contrast-on-dark);
}

:root.dark-mode :is(
  #admin-scan-events-wrap,
  #admin-document-events-wrap,
  #admin-ocr-usage-wrap,
  #admin-ocr-diagnostic-wrap
) :is(thead th, tbody td) {
  background: var(--contrast-dark-surface);
  border-color: #536069;
}

/* Preserve readable light text on explicitly dark panels and controls. */
:root.dark-mode :is(.hero, .console-output, .modal, .status-pill-neutral, .project-document-access-maroon, .project-document-access-blue, .project-document-access-green, .project-document-access-teal, .project-document-access-purple) {
  color: #f7f3ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(237, 226, 205, 0.54), transparent 36%),
    radial-gradient(circle at top right, rgba(164, 119, 74, 0.18), transparent 30%),
    linear-gradient(145deg, var(--canvas), var(--canvas-deep));
  min-height: 100vh;
}

code,
button,
input,
select,
textarea,
table {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.page-shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  min-width: 0;
}

#app-shell {
  min-width: 0;
}

.hero {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(235, 226, 212, 0.96), rgba(213, 195, 168, 0.94));
  box-shadow: var(--shadow);
  animation: rise-in 320ms ease-out;
}

.eyebrow {
  margin: 0;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.5rem);
  line-height: 1.1;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hero-note {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  margin-top: 2px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(138, 59, 18, 0.08);
  border: 1px solid rgba(138, 59, 18, 0.12);
  flex-wrap: wrap;
}

.dashboard {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  min-width: 0;
}

.dashboard-layout {
  display: grid;
  gap: 18px;
}

.dashboard-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.dashboard-notifications-card {
  align-self: start;
}

.dashboard-notifications-card.has-alert {
  color: var(--danger);
  border-color: rgba(154, 47, 36, 0.3);
  background: rgba(238, 219, 214, 0.95);
}

#overview-import-section {
  order: 1;
}

#overview-export-section {
  order: 2;
}

#overview-support-section {
  order: 3;
}

#overview-raw-summary-section {
  order: 4;
}

#overview-ap-queue-section {
  order: 5;
}

.page-menu {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.page-menu-toggle {
  min-width: 160px;
}

.page-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  min-width: 240px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.page-menu-button.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.page-menu-button.has-alert {
  border-color: rgba(154, 47, 36, 0.5);
  color: var(--danger);
  background: rgba(154, 47, 36, 0.08);
}

.page-menu-button.has-alert.is-active {
  background: linear-gradient(135deg, #b13a2d, #7b2118);
  color: #fff8f6;
}

.page-hidden,
[data-page].page-hidden {
  /* Permission-gated controls must remain hidden even inside form layouts that
     apply a more-specific display rule to labels or other child elements. */
  display: none !important;
}

.overview-section .panel-header {
  margin-bottom: 0;
}

.overview-section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.overview-section-toggle::after {
  content: "Expand";
  float: right;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.overview-section-toggle[aria-expanded="true"]::after {
  content: "Collapse";
}

.overview-section-toggle:hover,
.overview-section-toggle:focus-visible {
  color: var(--accent);
}

.overview-section-body {
  margin-top: 12px;
}

.auth-panel {
  margin-bottom: 12px;
}

.auth-banner {
  margin-left: auto;
}

.user-site-access-active {
  color: #2357a6;
}

.role-requires-mfa {
  color: var(--success);
  font-weight: 700;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-mfa-panel {
  margin-top: 12px;
}

.auth-mfa-methods {
  margin-top: 8px;
  margin-bottom: 8px;
}

.sms-consent-copy {
  margin-top: 6px;
  line-height: 1.35;
  color: #202938;
}

.auth-mfa-method-button.is-active {
  background: #1f5ea8;
  color: #ffffff;
  border-color: #1f5ea8;
}

.auth-mfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-mfa-qr {
  width: 220px;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(31, 52, 76, 0.18);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.auth-mfa-secret {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Liberation Mono", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.auth-mfa-test-code {
  margin: 10px 0 8px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Liberation Mono", monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #163a67;
}

.user-site-access-inactive {
  color: #7a7f89;
}

.user-site-access-legacy {
  color: #7b4ab2;
}

.spend-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.dashboard-card-grid {
  column-count: 2;
  column-gap: 12px;
  min-width: 0;
}

.dashboard-card {
  display: inline-grid;
  gap: 8px;
  min-height: 148px;
  min-width: 0;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 12px;
}

.dashboard-notifications-card {
  min-height: 168px;
  border-width: 2px;
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.12);
}

.dashboard-notifications-card.is-compact {
  min-height: 0;
  width: fit-content;
  min-width: 260px;
  max-width: min(100%, 420px);
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.dashboard-card-header h3 {
  margin: 0;
  color: var(--ink);
}

.dashboard-card-copy {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.3;
}

.dashboard-card-actions,
.dashboard-manage-actions,
.dashboard-module-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-card-footer {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-tone-label {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 0.78rem;
}

.detail-card.dashboard-card-tone-sand {
  background: rgba(226, 212, 191, 0.94);
}

.detail-card.dashboard-card-tone-stone {
  background: rgba(212, 202, 189, 0.95);
}

.detail-card.dashboard-card-tone-sage {
  background: rgba(205, 214, 198, 0.95);
}

.detail-card.dashboard-card-tone-slate {
  background: rgba(201, 206, 212, 0.95);
}

.detail-card.dashboard-card-tone-clay {
  background: rgba(220, 201, 189, 0.95);
}

.detail-card.dashboard-card-tone-mist {
  background: rgba(202, 217, 226, 0.96);
}

.detail-card.dashboard-card-tone-rose {
  background: rgba(230, 205, 209, 0.96);
}

.detail-card.dashboard-card-tone-moss {
  background: rgba(199, 211, 189, 0.96);
}

.page-menu-button.menu-tone-sand { background: rgba(226, 212, 191, 0.94); color: var(--ink); }
.page-menu-button.menu-tone-stone { background: rgba(212, 202, 189, 0.95); color: var(--ink); }
.page-menu-button.menu-tone-sage { background: rgba(205, 214, 198, 0.95); color: var(--ink); }
.page-menu-button.menu-tone-slate { background: rgba(201, 206, 212, 0.95); color: var(--ink); }
.page-menu-button.menu-tone-clay { background: rgba(220, 201, 189, 0.95); color: var(--ink); }
.page-menu-button.menu-tone-mist { background: rgba(202, 217, 226, 0.96); color: var(--ink); }
.page-menu-button.menu-tone-rose { background: rgba(230, 205, 209, 0.96); color: var(--ink); }
.page-menu-button.menu-tone-moss { background: rgba(199, 211, 189, 0.96); color: var(--ink); }

.dashboard-module-picker-panel {
  display: grid;
  gap: 10px;
}

.dashboard-module-picker {
  display: grid;
  gap: 12px;
}

.dashboard-manage-board-section {
  display: grid;
  gap: 10px;
}

.dashboard-manage-board {
  column-count: 2;
  column-gap: 12px;
}

.dashboard-manage-outline {
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
  align-items: start;
  gap: 14px;
  min-height: 0;
}

.dashboard-manage-outline-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-manage-outline-order {
  min-width: 2.1rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.1);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.dashboard-manage-outline-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-manage-outline-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.dashboard-card-list {
  margin: 0;
  padding-left: 14px;
  display: grid;
  gap: 6px;
}

.dashboard-card-list li {
  color: var(--muted);
}

.dashboard-notification-list li {
  color: inherit;
}

.dashboard-notification-list {
  display: grid;
  gap: 6px;
}

.dashboard-notification-link {
  justify-self: start;
  display: inline;
  color: var(--danger);
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-notification-link:hover,
.dashboard-notification-link:focus-visible {
  text-decoration: underline;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(138, 59, 18, 0.08);
  border: 1px solid rgba(138, 59, 18, 0.12);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
}

.dashboard-module-picker {
  margin-top: 10px;
}

.dashboard-module-picker .detail-card {
  min-width: min(100%, 280px);
  flex: 1 1 280px;
}

.dashboard-module-group {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-module-group:first-child {
  margin-top: 0;
}

.dashboard-module-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-module-group-header h4 {
  margin: 0;
}

.dashboard-module-group-list {
  display: grid;
  gap: 8px;
}

.dashboard-module-item {
  gap: 10px;
}

.dashboard-module-outline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-module-preview {
  padding-left: 12px;
  border-left: 2px solid rgba(23, 32, 51, 0.08);
}

.dashboard-module-preview-card {
  max-width: 360px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed rgba(23, 32, 51, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.dashboard-module-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.dashboard-module-preview-body {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-weather-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.dashboard-weather-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.dashboard-weather-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.dashboard-weather-view-toggle {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-weather-location-query {
  min-width: 0;
}

.dashboard-weather-location-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-weather-current {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 244, 214, 0.92), rgba(221, 236, 250, 0.86));
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.dashboard-weather-current-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.dashboard-weather-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.dashboard-weather-temperature {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.dashboard-weather-summary {
  margin-top: 4px;
  font-weight: 600;
}

.dashboard-weather-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-weather-metric {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 32, 51, 0.08);
  text-align: center;
}

.dashboard-weather-metric span {
  font-size: 0.88rem;
}

.dashboard-weather-metric strong {
  font-size: 0.84rem;
}

.dashboard-weather-metric small {
  color: var(--muted);
  font-size: 0.68rem;
}

.dashboard-weather-periods {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(124px, 1fr);
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.dashboard-weather-period {
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  min-height: 100%;
}

.dashboard-weather-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dashboard-weather-period-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.dashboard-weather-period-copy {
  margin-top: 4px;
  font-size: 0.75rem;
}

.dashboard-weather-period-stats {
  margin-top: 6px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.dashboard-weather-periods::-webkit-scrollbar {
  height: 8px;
}

.dashboard-weather-periods::-webkit-scrollbar-thumb {
  background: rgba(23, 32, 51, 0.18);
  border-radius: 999px;
}

.dashboard-weather-compact {
  display: grid;
  gap: 8px;
}

.dashboard-weather-compact-current {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 247, 230, 0.72);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.dashboard-weather-compact-wrap {
  max-width: 100%;
}

.dashboard-weather-compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.dashboard-weather-compact-table th,
.dashboard-weather-compact-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
  text-align: left;
  white-space: nowrap;
}

.dashboard-weather-compact-table th {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-weather-compact-table tbody tr:last-child td {
  border-bottom: 0;
}

#spend-history-drilldown {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.bar-label-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bar-label-button:hover,
.bar-label-button:focus-visible {
  color: var(--accent);
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.my-charge-readonly-label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--ink);
}

.my-charge-readonly {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 600;
}

.charge-documents {
  min-width: 260px;
}

.document-dropzone {
  width: 100%;
  text-align: center;
}

.document-preview-slot,
.document-status,
.document-list {
  margin-top: 8px;
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#my-upload-entry-section > summary {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.my-upload-summary-title {
  color: var(--ink);
  font-size: 1.17rem;
  font-weight: 700;
}

#my-upload-entry-section > summary > span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
}

.document-preview-slot {
  min-height: 88px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.document-preview-asset {
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-preview-name {
  max-width: 100%;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  word-break: break-word;
}

.dashboard-upload-preview {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.document-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.document-preview-row .document-preview-slot,
.document-preview-row .dashboard-upload-preview {
  margin-top: 0;
}

.document-preview-row .upload-ocr-status {
  margin: 0;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(223, 211, 194, 0.72);
}

.document-preview-row:has(.upload-ocr-status:empty) {
  grid-template-columns: 1fr;
}

.document-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.document-item + .document-item {
  margin-top: 8px;
}

.document-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.local-upload-document-preview {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: zoom-in;
}

.local-upload-document-preview:focus-visible {
  outline: 3px solid rgba(31, 78, 120, 0.75);
  outline-offset: 2px;
}

.document-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.document-copy {
  display: grid;
  gap: 4px;
}

.document-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.document-link-button:hover,
.document-link-button:focus-visible {
  color: var(--accent);
}

.project-manager-unco-value {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1769aa;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-manager-unco-value span {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 0.2rem;
  font-size: 0.68em;
  letter-spacing: 0.04em;
  padding: 0.04rem 0.18rem;
}

.project-manager-unco-badge {
  color: #1769aa;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-manager-change-order-list,
.project-manager-unco-body {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.55rem;
}

.project-manager-change-order-list > div,
.project-manager-unco-item {
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}

.project-manager-unco-modal-shell {
  max-width: 38rem;
}

.document-meta {
  font-size: 0.83rem;
  color: var(--muted);
}

.document-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 114, 130, 0.12);
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
}

.document-status-chip-success {
  background: rgba(32, 98, 71, 0.12);
  color: var(--success);
}

.document-status-chip-warning {
  background: rgba(154, 106, 16, 0.14);
  color: var(--warning);
}

.document-status-chip-danger {
  background: rgba(154, 47, 36, 0.12);
  color: var(--danger);
}

.document-status-check {
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.document-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 32, 51, 0.84);
}

.document-preview-modal.page-hidden {
  display: none;
}

/* Contrast policy for new interactive surfaces: use contrast-dark-surface for
   dark containers and contrast-light-control for white inputs. This preserves
   white text on dark backgrounds and near-black text on white backgrounds in
   both color modes. */
:root {
  --contrast-light-surface: #fffdfa;
  --contrast-on-light: #172033;
  --contrast-dark-surface: #1b283b;
  --contrast-on-dark: #ffffff;
}

:root.dark-mode {
  --contrast-light-surface: #f4f7fb;
  --contrast-on-light: #111827;
  --contrast-dark-surface: #172033;
  --contrast-on-dark: #ffffff;
}

.contrast-dark-surface {
  background: var(--contrast-dark-surface);
  color: var(--contrast-on-dark);
}

.contrast-light-surface,
.contrast-light-control {
  background: var(--contrast-light-surface);
  color: var(--contrast-on-light);
}

.contrast-light-control::placeholder {
  color: #4b5563;
  opacity: 1;
}

.contrast-dark-control {
  background: var(--contrast-dark-surface);
  color: var(--contrast-on-dark);
  border-color: rgba(255, 255, 255, 0.35);
}

.contrast-dark-control::placeholder {
  color: var(--contrast-on-dark);
  opacity: 1;
}

#foundation-ap-note-modal .document-preview-title,
#foundation-ap-note-form label {
  color: var(--contrast-on-light);
}

.foundation-ap-internal-note + .foundation-ap-internal-note {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.document-preview-shell {
  width: min(1240px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.document-preview-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow);
}

.document-preview-title {
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-preview-body {
  min-height: 0;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-preview-image,
.document-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.document-preview-image {
  object-fit: contain;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  animation: rise-in 360ms ease-out;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.panel h2,
.panel h3,
.panel h4 {
  margin: 0;
  color: var(--ink);
}

.button-row,
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.transaction-search-form {
  align-items: end;
}

.transaction-search-term {
  flex: 1 1 430px;
  min-width: min(100%, 320px);
}

.transaction-search-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 9px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.transaction-search-scope legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.transaction-search-scope label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.transaction-search-scope input {
  width: auto;
}

.transaction-search-results-wrap {
  margin-top: 10px;
  max-height: 440px;
}

.foundation-transaction-search-filter-row th {
  padding: 5px;
  background: color-mix(in srgb, var(--surface) 90%, var(--accent) 10%);
}

.foundation-transaction-search-filter {
  width: 100%;
  min-width: 100px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-actions {
  display: flex;
  align-items: end;
}

.upload-ocr-actions {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upload-ocr-status {
  font-size: 0.76rem;
  line-height: 1.25;
  text-align: left;
  max-width: none;
  width: 100%;
}

.approved-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.field-hidden {
  display: none;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button-secondary {
  background: linear-gradient(135deg, #284463, #172033);
}

.button-danger {
  background: linear-gradient(135deg, #ba4739, var(--danger));
}

.button-muted {
  background: linear-gradient(135deg, #7f6d56, #675642);
}

.button-inline {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.console-output,
.callout,
.detail-card {
  margin: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(235, 227, 215, 0.82);
  border: 1px solid var(--line);
  overflow: auto;
}

.dismissible-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.dismissible-callout-copy {
  min-width: 0;
}

.dismissible-callout-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dismissible-callout-button:hover,
.dismissible-callout-button:focus-visible {
  color: var(--accent);
}

.callout:empty,
.helper-text:empty {
  display: none;
}

.console-output {
  min-height: 90px;
  white-space: pre-wrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.admin-attention,
.admin-status-strip {
  margin-top: 12px;
}

.admin-attention {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 248, 232, 0.9);
}

.admin-attention-items,
.admin-status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-attention-link,
.admin-status-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.admin-attention-link {
  padding: 7px 10px;
  text-align: left;
}

.admin-attention-danger {
  border-color: rgba(166, 45, 45, 0.45);
  background: rgba(166, 45, 45, 0.1);
  color: var(--danger);
}

.admin-attention-warning {
  border-color: rgba(153, 103, 14, 0.45);
  background: rgba(255, 225, 151, 0.34);
}

.admin-attention-clear {
  color: #266347;
}

.admin-attention-ocr {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, #e8f1ef);
}

.admin-attention-ocr .callout {
  margin: 0;
}

.admin-status-card {
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 9px 11px;
  text-align: left;
}

.admin-status-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-status-card strong {
  font-size: 1.35rem;
}

.admin-last-refreshed {
  margin-top: 8px;
}

.admin-section-body {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.admin-section-toggle-header {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.admin-section-toggle-header::before {
  content: "▸";
  font-size: 0.92em;
  line-height: 1;
  transition: transform 160ms ease;
}

.admin-section-toggle-header[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.admin-section-toggle-header:hover,
.admin-section-toggle-header:focus-visible {
  color: var(--accent);
  outline: none;
}

.admin-pipeline-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-weight: 700;
}

.project-manager-ms-project-frame {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(224, 232, 229, 0.4);
}

.dashboard-weather-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 7px 12px;
}

.dashboard-weather-collapsed span {
  color: var(--muted);
  flex: 1;
}

.stat-card {
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(223, 211, 194, 0.94);
  border: 1px solid var(--line);
}

.stat-card .label {
  display: block;
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card .value {
  display: block;
  margin-top: 6px;
  font-size: 1.7rem;
  font-weight: 700;
}

/* AP Overview summary cards intentionally remain light in either color mode. */
:root.dark-mode :is(#support-summary-cards, #raw-summary-cards) .stat-card :is(.label, .value) {
  color: var(--contrast-on-light);
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
}

.table-wrap-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  scrollbar-gutter: stable both-edges;
}

.table-wrap-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

.matrix-table {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.matrix-table-wrap {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
}

/* Session details are intentionally dense; retain both axes and the revocation action. */
#web-admin-session-wrap {
  max-height: 30rem;
  /* Keep the End Session action reachable even where auto-scrollbars are hidden. */
  overflow-x: scroll;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

#web-admin-access-wrap,
#web-admin-mfa-wrap {
  max-height: 26rem;
}

#web-admin-session-wrap .matrix-table {
  min-width: 1180px;
}

#web-admin-session-wrap th:last-child,
#web-admin-session-wrap td:last-child {
  position: sticky;
  right: 0;
  min-width: 132px;
  background: var(--surface);
  box-shadow: -1px 0 0 var(--line);
}

#web-admin-session-wrap thead th:last-child {
  z-index: 4;
}

.matrix-table thead th {
  z-index: 3;
  background: var(--surface);
}

.matrix-table-roles,
.matrix-table-users {
  --access-page-group-header-height: 36px;
}

.matrix-table-roles .access-page-group-row th,
.matrix-table-users .access-page-group-row th {
  position: sticky !important;
  top: 0;
  left: auto !important;
  z-index: 7;
  box-shadow: none !important;
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  height: var(--access-page-group-header-height);
  text-align: center;
  text-transform: uppercase;
}

.matrix-table-roles .access-page-group-heading,
.matrix-table-users .access-page-group-heading {
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.matrix-table-roles thead tr:not(.access-page-group-row) th,
.matrix-table-users thead tr:not(.access-page-group-row) th {
  position: sticky;
  top: var(--access-page-group-header-height);
  z-index: 6;
}

.matrix-table .access-page-group-cell.access-page-group-start {
  border-left: 2px solid color-mix(in srgb, var(--accent) 65%, var(--line));
}

.matrix-table .access-page-group-cell.access-page-group-end {
  border-right: 2px solid color-mix(in srgb, var(--accent) 65%, var(--line));
}

.matrix-table td:first-child,
.matrix-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}

.matrix-table thead th:first-child {
  z-index: 5;
}

.matrix-table-roles thead tr:not(.access-page-group-row) th:first-child,
.matrix-table-users thead tr:not(.access-page-group-row) th:first-child {
  z-index: 8;
}

.matrix-table-roles td:first-child,
.matrix-table-roles th:first-child {
  min-width: 190px;
}

.matrix-table-roles {
  min-width: max-content;
}

.matrix-table-roles td {
  white-space: nowrap;
}

.matrix-table-roles th {
  white-space: normal;
  line-height: 1.15;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.matrix-table-roles td:not(:first-child),
.matrix-table-roles th:not(:first-child) {
  min-width: 86px;
  width: 86px;
}

.matrix-table-users td:first-child,
.matrix-table-users th:first-child {
  min-width: 220px;
}

.matrix-table-users {
  min-width: max-content;
}

.matrix-table-users td:nth-child(2),
.matrix-table-users th:nth-child(2) {
  position: sticky;
  left: 220px;
  z-index: 2;
  background: var(--surface);
  min-width: 150px;
  box-shadow: 1px 0 0 var(--line);
}

.matrix-table-users td:nth-child(3),
.matrix-table-users th:nth-child(3) {
  position: sticky;
  left: 370px;
  z-index: 2;
  background: var(--surface);
  min-width: 126px;
  box-shadow: 1px 0 0 var(--line);
}

.matrix-table-users thead th:nth-child(2),
.matrix-table-users thead th:nth-child(3) {
  z-index: 4;
}

.matrix-table-users td {
  white-space: nowrap;
}

.matrix-table-users th {
  white-space: normal;
  line-height: 1.15;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.matrix-table-users td:nth-child(n + 4),
.matrix-table-users th:nth-child(n + 4) {
  min-width: 74px;
  width: 74px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: color-mix(in srgb, var(--accent, #2855a3) 10%, var(--surface));
}

.clickable-row:hover td:first-child {
  background: color-mix(in srgb, var(--accent, #2855a3) 10%, var(--surface));
}

.clickable-row.is-selected td {
  background: color-mix(in srgb, var(--accent, #2855a3) 16%, var(--surface));
}

.clickable-row.is-selected td:first-child {
  background: color-mix(in srgb, var(--accent, #2855a3) 16%, var(--surface));
}

.matrix-table-users td:last-child,
.matrix-table-users th:last-child,
.matrix-table-roles td:last-child,
.matrix-table-roles th:last-child,
.spend-history-table td:last-child,
.spend-history-table th:last-child {
  min-width: 100px;
}

#role-access-matrix-wrap {
  height: 16rem;
  max-height: 16rem;
}

#user-access-matrix-wrap {
  height: 20rem;
  max-height: 20rem;
}

#job-cost-mapping-wrap {
  height: 20rem;
  max-height: 20rem;
}

#project-manager-visibility-wrap {
  height: 20rem;
  max-height: 20rem;
}

#project-manager-visibility-wrap tr.is-hidden-from-field td {
  background: rgba(45, 57, 72, 0.14);
}

#project-manager-ap-wrap,
#project-manager-ap-line-wrap,
#project-manager-ap-sidebar-wrap {
  height: 20rem;
  max-height: 20rem;
}

#project-manager-ap-wrap,
#project-manager-ap-line-wrap {
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (max-width: 1080px) {
  #project-manager-ap-wrap {
    overflow-x: auto !important;
    padding-bottom: 8px;
  }
}

#project-manager-ap-wrap .matrix-table {
  min-width: 1080px;
}

#project-manager-ap-line-wrap .matrix-table {
  min-width: 760px;
}

.project-manager-dev-note {
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--ink);
}

.project-manager-settings-section {
  margin: 0;
}

.project-manager-settings-section .panel-header {
  margin-bottom: 0;
}

.project-manager-settings-child {
  margin-left: 0.9rem;
  border-left: 3px solid rgba(20, 45, 78, 0.2);
}

.project-manager-cost-detail-site-entry td {
  background: #fff3b0;
}

.project-manager-cost-detail-subtotal td {
  background: #d9e0e8;
  font-weight: 700;
}

#project-manager-cost-drilldown-modal .table-wrap {
  overflow: auto;
}

#project-manager-cost-drilldown-modal .matrix-table {
  min-width: 1120px;
}

:root.dark-mode .project-manager-cost-detail-site-entry td,
:root.dark-mode .project-manager-cost-detail-subtotal td {
  color: #111820;
}

/* Current Cost Detail uses a light toolbar and a dark sticky source column. */
:root.dark-mode #project-manager-cost-drilldown-modal .document-preview-toolbar,
:root.dark-mode #project-manager-cost-drilldown-title {
  background: #f1ede5;
  color: #111820;
}

:root.dark-mode #project-manager-cost-drilldown-modal .matrix-table :is(th, td):first-child {
  background: #252d33;
  color: #f7f3ea;
}

/* Budget View stays on the dark workspace surface, so every data row is light. */
:root.dark-mode #project-manager-visibility-wrap .matrix-table td {
  color: #f7f3ea;
}

/* Change-order cost-code breakdowns share the dark Budget View surface. */
:root.dark-mode #project-manager-change-order-list .project-manager-change-order-breakdown .matrix-table td {
  color: #f7f3ea;
}

/* AP Overview Import Data tables remain on the dark workspace surface. */
:root.dark-mode #overview-import-section .imported-source-files-table tbody td {
  color: #f7f3ea;
}

/* Imported Statement Batches also remain on the dark AP Overview surface. */
:root.dark-mode #raw-batch-wrap .imported-source-files-table tbody td {
  color: #f7f3ea;
}

/* A bold row marks a Foundation cost code with one or more change-order lines. */
#project-manager-visibility-wrap .matrix-table tr.project-manager-change-order-row > td {
  font-weight: 700;
}

/* Dark-mode controls set their own font styles, so make the change-order cue explicit. */
:root.dark-mode #project-manager-visibility-wrap .matrix-table tr.project-manager-change-order-row > td,
:root.dark-mode #project-manager-visibility-wrap .matrix-table tr.project-manager-change-order-row :is(button, input, label, span) {
  font-weight: 800;
}

/* The Project Manager AP Approval Queue remains on the dark workspace surface. */
:root.dark-mode #project-manager-ap-wrap .matrix-table td {
  color: #f7f3ea;
}

/* These AP review areas deliberately retain light operational surfaces in dark mode. */
:root.dark-mode :is(
  #project-manager-ap-modal .document-preview-toolbar,
  #project-manager-ap-status,
  #project-manager-budget-modal .document-preview-toolbar,
  #project-manager-budget-modal-summary
) {
  --ink: #111820;
  --muted: #29363d;
  --line: rgba(17, 24, 32, 0.22);
  color: #111820;
}

:root.dark-mode #project-manager-ap-modal :is(.document-preview-toolbar, #project-manager-ap-status),
:root.dark-mode #project-manager-budget-modal :is(.document-preview-toolbar, #project-manager-budget-modal-summary) {
  background: #f1ede5;
}

/* AP review tables use light data cells and dark, high-contrast headings. */
:root.dark-mode :is(#project-manager-ap-line-wrap, #project-manager-ap-sidebar-wrap, #project-manager-budget-modal .table-wrap) .matrix-table td {
  background: #f1ede5;
  color: #111820;
}

:root.dark-mode :is(#project-manager-ap-line-wrap, #project-manager-ap-sidebar-wrap, #project-manager-budget-modal .table-wrap) .matrix-table thead th,
:root.dark-mode #project-manager-ap-sidebar-wrap .project-manager-ap-sidebar-job td {
  background: #252d33;
  color: #f7f3ea;
}

/* Sticky identifier columns remain dark so their labels are readable while scrolling. */
:root.dark-mode #project-manager-ap-line-wrap .matrix-table :is(th, td):first-child,
:root.dark-mode #project-manager-ap-sidebar-wrap .matrix-table :is(th, td):first-child,
:root.dark-mode #project-manager-budget-modal .table-wrap .matrix-table :is(th, td):first-child {
  background: #252d33;
  color: #f7f3ea;
}

/* Job selectors intentionally remain light in dark mode so matching job text is black. */
:root.dark-mode :is(#project-manager-job-picker, #project-documents-job-picker, #project-schedule-job-picker),
:root.dark-mode :is(#project-manager-job-results, #project-documents-job-results, #project-schedule-job-results) {
  background: #f1ede5;
  color: #111820;
  border-color: rgba(17, 24, 32, 0.28);
}

:root.dark-mode :is(#project-manager-job-results, #project-documents-job-results, #project-schedule-job-results) .search-picker-option,
:root.dark-mode :is(#project-manager-job-results, #project-documents-job-results, #project-schedule-job-results) .search-picker-empty {
  color: #111820;
}

.project-manager-settings-child .panel-header {
  margin-bottom: 0;
}

.project-documents-explorer {
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  margin-top: 0.8rem;
  min-height: 56rem;
}

.project-documents-inactive-toggle { align-items: center; display: inline-flex; gap: 0.35rem; white-space: nowrap; }
/* The job results are an absolute popup. It must escape the generic panel clip
   before a document library has been selected and the explorer is visible. */
#project-documents-page { min-height: 56rem; overflow: visible; }
.project-documents-active-job-field { color: var(--ink); display: grid; font-size: 0.84rem; gap: 4px; position: relative; z-index: 31; }

.project-documents-folder-pane { background: color-mix(in srgb, var(--surface-strong) 60%, var(--surface)); border-right: 1px solid var(--line); padding: 0.7rem; }
.project-documents-explorer-pane-title { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; padding: 0.2rem 0.35rem 0.45rem; text-transform: uppercase; }
.project-document-folder-list { display: grid; gap: 0.18rem; }
.project-document-folder-row { align-items: center; display: flex; gap: 0.25rem; min-width: 0; }
.project-document-folder {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  color: inherit;
  font-size: 0.88rem;
  min-width: 0;
  padding: 0.4rem 0.45rem;
}
.project-document-folder-tree { align-items: center; cursor: pointer; display: flex; flex: 1; gap: 0.45rem; text-align: left; }
.project-document-folder-tree:hover, .project-document-folder-tree:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.project-document-folder-tree.is-selected { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); font-weight: 700; }
.project-document-folder-icon, .project-document-file-icon { background: #d7a72e; border: 1px solid #9a6a10; border-radius: 0.12rem; display: inline-block; flex: 0 0 auto; height: 0.72rem; position: relative; width: 0.9rem; }
.project-document-folder-icon::before { background: #e2bc55; border: 1px solid #9a6a10; border-bottom: 0; border-radius: 0.12rem 0.12rem 0 0; content: ""; height: 0.2rem; left: 0.05rem; position: absolute; top: -0.2rem; width: 0.42rem; }
.project-document-file-icon { background: #eef2f5; border-color: #7a8790; height: 0.9rem; width: 0.68rem; }
.project-document-folder-count { color: var(--muted); font-size: 0.78rem; margin-left: auto; }
.project-document-folder-required-toggle, .project-document-folder-required-label { border: 1px solid var(--line); border-radius: 0.2rem; color: var(--muted); font-size: 0.7rem; padding: 0.2rem 0.3rem; }
.project-document-folder-required-toggle { background: var(--surface); cursor: pointer; }
.project-document-folder-required-toggle.is-required, .project-document-folder-required-label.is-required { border-color: #a82b2b; color: #9b1c1c; font-weight: 700; }
.project-documents-file-pane { min-width: 0; }
.project-documents-explorer-toolbar { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 0.75rem; justify-content: space-between; padding: 0.6rem 0.75rem; }
.project-documents-location { font-size: 0.9rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-documents-file-search { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.project-documents-file-search input { margin-left: 0.3rem; max-width: 12rem; }
.project-documents-file-list { margin: 0; max-height: 34rem; }
.project-document-file-name { min-width: 16rem; }
.project-documents-status-missing { color: #9b1c1c; font-weight: 700; }
.project-documents-job-search-picker { flex: 1 1 34rem; min-width: min(100%, 34rem); }
.project-documents-job-search-picker input { width: 100%; }

@media (max-width: 720px) {
  .project-documents-job-search-picker { flex-basis: 100%; min-width: 100%; }
}

.project-document-access-chip {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  margin: 0.1rem;
  padding: 0.22rem 0.42rem;
}

.project-document-access-maroon { background: #7d2638; color: #fff; }
.project-document-access-blue { background: #1769aa; color: #fff; }
.project-document-access-green { background: #28734a; color: #fff; }
.project-document-access-teal { background: #007d7c; color: #fff; }
.project-document-access-purple { background: #6c4fa3; color: #fff; }
.project-documents-access-card { max-width: 38rem; }
.modal-shell {
  align-items: center;
  background: rgba(11, 20, 33, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 1000;
}
.modal-shell.page-hidden { display: none; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.35);
  color: var(--ink);
  max-height: min(88vh, 48rem);
  max-width: min(42rem, 100%);
  overflow: auto;
  padding: 1rem;
  width: 100%;
}
.project-document-share-picker { position: relative; }
.project-document-share-picker .search-picker-results {
  max-height: min(38vh, 18rem);
}
.project-document-share-card { max-width: min(32rem, 100%); }
.project-document-share-card > :not(.panel-header) { margin-top: 0.85rem; }
.project-document-share-selection {
  align-items: center;
  background: var(--panel-muted, rgba(127, 127, 127, 0.12));
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  display: flex;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
}
.project-document-share-selection span { color: var(--muted); font-size: 0.82rem; }
.project-document-share-selection strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-document-share-actions { align-items: end; display: flex; gap: 0.7rem; justify-content: space-between; }
.project-document-share-actions label { flex: 1; }
.project-document-share-picker .search-picker-results button { display: grid; gap: 0.1rem; text-align: left; }
.project-document-share-picker .search-picker-results button span { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 560px) {
  .project-document-share-actions { align-items: stretch; flex-direction: column; }
}

.project-documents-tabs {
  display: flex;
  gap: 0.45rem;
  margin: 0.85rem 0;
}

.project-documents-tabs [aria-selected="true"] {
  background: var(--accent-color, #1769aa);
  color: #fff;
}

.project-documents-schedule-panel {
  border: 1px solid var(--border-color, #b9b3a8);
  border-radius: 0.5rem;
  margin-top: 0.85rem;
  padding: 1rem;
}

.project-documents-upload-section { border: 1px solid var(--line); border-radius: 0.5rem; margin-top: 0.8rem; padding: 0.85rem; }
.project-documents-upload-dropzone { border: 2px dashed var(--accent); border-radius: 0.45rem; cursor: pointer; margin-top: 0.7rem; padding: 1.1rem; text-align: center; }
.project-documents-upload-dropzone.is-dragover { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); }
.project-document-group-policy-section { border: 1px solid var(--line); border-radius: 0.5rem; margin-top: 0.8rem; padding: 0.85rem; }
.project-document-group-policy-section td:first-child { font-weight: 700; }
.project-document-group-policy-list { display: grid; gap: 0.55rem; }
.project-document-group-policy-card { border: 1px solid var(--line); border-radius: 0.45rem; overflow: hidden; }
.project-document-group-policy-toggle { width: 100%; justify-content: space-between; gap: 0.75rem; }
.project-document-group-policy-toggle .helper-text { margin-left: auto; font-size: 0.8rem; font-weight: 500; }
.project-document-group-policy-details { border-top: 1px solid var(--line); padding: 0.65rem; }
.project-document-active-schedule-name,
.project-document-active-schedule,
.project-document-redacted { color: #1e73be; font-weight: 800; }
.project-document-active-schedule,
.project-document-redacted { display: inline-block; margin-left: 0.35rem; cursor: help; }

@media (max-width: 720px) {
  .project-documents-explorer { display: block; min-height: 36rem; }
  #project-documents-page { min-height: 36rem; }
  .project-documents-folder-pane { border-bottom: 1px solid var(--line); border-right: 0; max-height: 12rem; overflow: auto; }
  .project-documents-explorer-toolbar { align-items: stretch; flex-direction: column; }
  .project-documents-file-search input { max-width: none; width: 100%; }
  .project-documents-file-list { max-height: 24rem; }
}

.project-schedule-summary-row td {
  background: color-mix(in srgb, var(--accent-color, #1769aa) 14%, transparent);
  font-weight: 700;
}

.project-schedule-gantt-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.project-schedule-gantt-controls label {
  display: grid;
  font-weight: 700;
  gap: 0.25rem;
}

.project-schedule-gantt-controls input { min-width: min(20rem, 80vw); }

.project-schedule-gantt {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin-top: 0.75rem;
  max-height: 38rem;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.project-schedule-gantt-grid { --task-pane-width: 19rem; min-width: 62rem; position: relative; }

.project-schedule-gantt-header,
.project-schedule-gantt-row {
  display: grid;
  grid-template-columns: var(--task-pane-width) max-content;
  min-height: 2.15rem;
}

.project-schedule-gantt-header {
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 3;
}

.project-schedule-gantt-row { border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent); position: relative; z-index: 2; }

.project-schedule-gantt-task {
  align-items: center;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 3.3rem 1fr;
  left: 0;
  padding: 0.35rem 0.5rem;
  position: sticky;
  z-index: 2;
}

.project-schedule-gantt-header .project-schedule-gantt-task { z-index: 4; }
.project-schedule-gantt-task.is-summary { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.project-schedule-gantt-task strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-schedule-gantt-task small { color: var(--muted); display: none; font-size: 0.67rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.project-schedule-gantt-axis,
.project-schedule-gantt-track { position: relative; }

.project-schedule-gantt-axis {
}

.project-schedule-gantt-month { border-left: 2px solid var(--accent); font-size: 0.78rem; padding-left: 0.25rem; position: absolute; top: 0.45rem; white-space: nowrap; }

.project-schedule-gantt-track {
}

.project-schedule-gantt-time-grid { left: var(--task-pane-width); pointer-events: none; position: absolute; top: 2.15rem; z-index: 0; }
.project-schedule-gantt-time-line { border-left: 1px solid color-mix(in srgb, var(--line) 55%, transparent); bottom: 0; height: 100%; position: absolute; top: 0; }
.project-schedule-gantt-time-line.is-month { border-left-color: var(--accent); border-left-width: 2px; }

.project-schedule-gantt-dependencies { left: var(--task-pane-width); overflow: visible; pointer-events: none; position: absolute; top: 2.15rem; z-index: 1; }
.project-schedule-gantt-dependency { fill: none; stroke: color-mix(in srgb, var(--accent) 78%, var(--ink)); stroke-width: 1.5; }
.project-schedule-gantt-dependencies marker path { fill: var(--accent); }
.project-schedule-gantt-lag { fill: var(--muted); font-size: 10px; font-weight: 700; }

.project-schedule-gantt-bar {
  background: color-mix(in srgb, #2573a9 72%, var(--surface));
  border-radius: 0.25rem;
  height: 1rem;
  overflow: hidden;
  position: absolute;
  top: 0.55rem;
}

.project-schedule-gantt-bar i { background: color-mix(in srgb, #103f64 84%, transparent); display: block; height: 100%; }
.project-schedule-gantt-bar.is-summary { background: var(--accent); height: 1.2rem; top: 0.47rem; }
.project-schedule-gantt-bar.is-milestone { border-radius: 0; transform: rotate(45deg); width: 0.75rem !important; }

@media (max-width: 720px) {
  .project-schedule-gantt-grid { --task-pane-width: 11rem; }
  .project-schedule-gantt-grid { min-width: 0; }
  .project-schedule-gantt { max-height: calc(100dvh - 15rem); min-height: 24rem; }
  .project-schedule-gantt-task { gap: 0.3rem; grid-template-columns: 2.2rem minmax(0, 1fr); padding: 0.3rem 0.4rem; }
  .project-schedule-gantt-task small { display: block; }
  .project-schedule-gantt.is-timeline-scrolled .project-schedule-gantt-grid { --task-pane-width: 5rem; }
  .project-schedule-gantt.is-timeline-scrolled .project-schedule-gantt-task strong { font-size: 0.72rem; }
  .project-schedule-gantt.is-timeline-scrolled .project-schedule-gantt-task small { display: none; }
  .project-schedule-gantt-month { font-size: 0.7rem; top: 0.55rem; }
  .project-schedule-gantt-controls { align-items: stretch; }
  .project-schedule-gantt-controls label { flex: 1 1 100%; }
  .project-schedule-gantt-controls input { min-width: 0; width: 100%; }
}

.project-manager-sync-toggle {
  justify-content: flex-start;
  min-height: 0;
}

.project-manager-source-file-meta {
  display: grid;
  gap: 0.2rem;
}

.project-manager-source-file-meta a {
  font-weight: 700;
}

@media (max-width: 720px) {
  .project-manager-settings-child {
    margin-left: 0.45rem;
  }
}

.helper-text-danger {
  color: var(--danger, #b42318);
  font-weight: 700;
}

.project-manager-budget-section,
.project-manager-ap-section {
  margin: 0;
}

.project-manager-budget-section.project-manager-settings-child {
  margin-left: 1.75rem;
}

#project-manager-accounts-payable-section > .overview-section-body:not([hidden]) {
  display: grid;
  gap: 0.7rem;
}

#project-manager-accounts-payable-section > .overview-section-body > .project-manager-ap-section {
  margin-left: 1.75rem;
}

.project-manager-budget-section .panel-header,
.project-manager-ap-section .panel-header {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .project-manager-budget-section.project-manager-settings-child {
    margin-left: 0.8rem;
  }

  #project-manager-accounts-payable-section > .overview-section-body > .project-manager-ap-section { margin-left: 0.8rem; }
}

.project-manager-ap-modal-shell {
  width: min(1480px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.project-manager-ap-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(320px, 1fr);
  gap: 12px;
}

.role-impact-modal-shell {
  width: min(880px, 100%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.role-impact-modal-body {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow);
  overflow: auto;
}

.role-impact-list {
  display: grid;
  gap: 12px;
}

.role-impact-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid rgba(20, 45, 78, 0.16);
  border-radius: 14px;
  background: rgba(245, 248, 252, 0.88);
}

.role-impact-item strong {
  display: block;
}

.project-manager-ap-main,
.project-manager-ap-sidebar {
  min-height: 0;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  overflow: hidden;
}

.project-manager-ap-main {
  display: grid;
  grid-template-rows: minmax(400px, 1.4fr) minmax(330px, 1fr);
  gap: 12px;
}

.project-manager-ap-document {
  min-height: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-manager-ap-image-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(20, 45, 78, 0.18);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.project-manager-ap-document-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.project-manager-ap-document-list {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 0 0 0.6rem 0.6rem;
  display: grid;
  gap: 0.3rem;
  max-height: 9rem;
  overflow-y: auto;
  padding: 0.55rem 0.7rem;
}

.project-manager-ap-document-row {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.2rem 0.3rem;
}

.project-manager-ap-document-row.is-selected { border-color: var(--accent); }
.project-manager-ap-document-row small { color: var(--muted); }

:root.dark-mode #project-manager-ap-modal .project-manager-ap-line-items > .subsection > h3 { color: #111820; }

#project-manager-ap-image {
  transform-origin: center center;
  transition: transform 160ms ease-out;
}

.project-manager-ap-line-items,
.project-manager-ap-sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
}

#project-manager-ap-status {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  overflow: auto;
}

.project-manager-ap-placeholder {
  margin: 16px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  max-height: 42%;
  overflow: auto;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.project-manager-ap-image-actions {
  display: grid;
  gap: 8px;
  width: min(680px, 100%);
  margin-top: 12px;
}

.project-manager-ap-image-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.project-manager-ap-image-row small {
  color: var(--muted);
}

#project-manager-ap-line-wrap {
  height: 17rem;
  max-height: 17rem;
  overflow-y: auto;
}

#project-manager-ap-sidebar-wrap {
  height: 32rem;
  max-height: 32rem;
  overflow-y: auto;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#project-manager-ap-sidebar-wrap .matrix-table th:first-child,
#project-manager-ap-sidebar-wrap .matrix-table td:first-child {
  width: 11.5rem;
  max-width: 11.5rem;
  min-width: 11.5rem;
  white-space: normal;
  word-break: break-word;
}

#project-manager-ap-sidebar-wrap .project-manager-ap-sidebar-job td {
  background: rgba(20, 45, 78, 0.12);
  color: var(--ink);
  font-weight: 700;
}

#project-manager-ap-sidebar-wrap tr.is-under-review td {
  background: #fff3a6;
}

.my-upload-split-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(20, 45, 78, 0.2);
  border-radius: 10px;
  background: rgba(20, 45, 78, 0.04);
}

.my-upload-split-grid label {
  min-width: 0;
}

.is-split-locked {
  background: repeating-linear-gradient(-45deg, #d7dce2, #d7dce2 8px, #c6ccd4 8px, #c6ccd4 16px) !important;
  color: #59616d;
  cursor: not-allowed;
  opacity: 0.78;
}

.is-cost-code-disabled {
  background: repeating-linear-gradient(-45deg, #d7dce2, #d7dce2 8px, #c6ccd4 8px, #c6ccd4 16px) !important;
  color: #59616d;
}

@media (max-width: 720px) {
  .my-upload-split-grid {
    grid-template-columns: 1fr;
  }
}

.project-manager-budget-modal-shell {
  width: min(1680px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.project-manager-budget-modal-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow);
}

.project-manager-budget-modal-table-wrap {
  min-height: 0;
  height: auto;
  max-height: none;
}

.project-manager-ap-job-input,
.project-manager-ap-cost-code-input,
.project-manager-ap-cost-class-input,
.project-manager-ap-amount-input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1080px) {
  #project-manager-ap-modal {
    padding: 8px;
  }

  .project-manager-ap-modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
    grid-auto-rows: max-content;
    padding-bottom: 20px;
  }

  .project-manager-ap-main {
    grid-template-rows: minmax(440px, 58svh) minmax(330px, auto);
    overflow: visible;
  }

  .project-manager-ap-document {
    min-height: 440px;
  }

  .project-manager-ap-line-items {
    min-height: 330px;
  }

  #project-manager-ap-line-wrap {
    height: 18rem;
    max-height: 18rem;
  }

  #project-manager-ap-status {
    min-height: 5.5rem;
  }

  #project-manager-ap-sidebar-wrap {
    height: min(20rem, 42svh);
    max-height: min(20rem, 42svh);
  }

  .project-manager-ap-sidebar {
    min-height: 300px;
    overflow: visible;
  }
}

.is-dirty-row td {
  background: color-mix(in srgb, var(--accent, #2855a3) 10%, var(--surface));
}

.dashboard-project-manager-list {
  display: grid;
  gap: 0.35rem;
}

.dashboard-project-manager-row {
  justify-content: flex-start;
  gap: 0.45rem;
}

.project-manager-field-order,
.project-manager-ms-task-id,
.project-manager-ms-task-name {
  width: 100%;
  min-width: 0;
}

.project-manager-field-order-column {
  width: 88px;
  min-width: 88px;
}

.project-manager-field-order {
  width: 72px;
  max-width: 72px;
}

.wide-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable both-edges;
}

.wide-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.wide-table th,
.wide-table td {
  min-width: 102px;
  white-space: nowrap;
}

.spend-history-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
}

.spend-history-table td:first-child,
.spend-history-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  min-width: 98px;
  width: 98px;
  box-shadow: 1px 0 0 var(--line);
}

.spend-history-table td:nth-child(2),
.spend-history-table th:nth-child(2) {
  position: sticky;
  left: 98px;
  z-index: 2;
  background: var(--surface);
  min-width: 88px;
  width: 88px;
  box-shadow: 1px 0 0 var(--line);
}

.spend-history-table td:nth-child(3),
.spend-history-table th:nth-child(3) {
  position: sticky;
  left: 186px;
  z-index: 2;
  background: var(--surface);
  min-width: 138px;
  width: 138px;
  box-shadow: 1px 0 0 var(--line);
}

.spend-history-table thead th:first-child,
.spend-history-table thead th:nth-child(2),
.spend-history-table thead th:nth-child(3) {
  z-index: 4;
}

.spend-history-table td,
.spend-history-table th {
  white-space: nowrap;
}

.spend-history-table td:nth-child(n + 4),
.spend-history-table th:nth-child(n + 4) {
  min-width: 102px;
}

.data-browser-table td,
.data-browser-table th {
  min-width: 120px;
  white-space: nowrap;
}

.data-browser-row-selected td {
  background: rgba(191, 221, 214, 0.42);
}

.data-browser-row-selected td:first-child {
  background: rgba(191, 221, 214, 0.7);
}

.imported-source-files-table td,
.imported-source-files-table th {
  min-width: 120px;
  white-space: nowrap;
}

.imported-source-files-table td:last-child,
.imported-source-files-table th:last-child {
  min-width: 100px;
}

#spend-history-table-wrap {
  display: block;
  min-height: 40rem;
  height: 40rem;
  max-height: 40rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: scroll;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable both-edges;
}

#my-charges-table-wrap {
  display: block;
  min-height: 34rem;
  height: 34rem;
  max-height: 34rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: scroll;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable both-edges;
}

#data-browser-table-wrap {
  display: block;
  min-height: 40rem;
  height: 40rem;
  max-height: 40rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: scroll;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable both-edges;
}

#timecard-labor-queue-wrap {
  display: block;
  min-height: 80rem;
  height: 80rem;
  max-height: 80rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable both-edges;
}

.timecard-labor-queue-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.timecard-labor-queue-table td,
.timecard-labor-queue-table th {
  min-width: 0;
}

#admin-access-events-wrap {
  display: block;
  min-height: 40rem;
  height: 40rem;
  max-height: 40rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: scroll;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable both-edges;
}

#admin-upload-status-wrap,
#admin-cardholder-upload-wrap,
#admin-backup-wrap {
  display: block;
  min-height: 20rem;
  height: 20rem;
  max-height: 20rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: scroll;
  border: 2px solid rgba(23, 32, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable both-edges;
}

.data-browser-search-label {
  min-width: 28rem;
  flex: 1 1 28rem;
}

#data-browser-search {
  min-width: 26rem;
}

#imported-source-files-wrap {
  height: 20rem;
  max-height: 20rem;
}

#support-unmatched-wrap,
#support-matched-wrap,
#raw-batch-wrap {
  height: 20rem;
  max-height: 20rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.review-card-header-compact {
  align-items: center;
}

.review-card-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review-card-header h3 {
  font-size: 0.96rem;
  color: var(--ink);
}

.review-card-collapsible .review-card-header h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-card-body {
  margin-top: 10px;
}

.review-meta,
.review-notes {
  color: var(--muted);
}

.compact-upload-entry-row td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  white-space: nowrap;
  vertical-align: middle;
}

.compact-upload-entry-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.compact-upload-entry-doc-check {
  color: #1d7f49;
  font-weight: 800;
  line-height: 1;
}

.compact-upload-match {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.compact-upload-match-empty {
  color: var(--muted);
}

.timecard-link-button {
  border: none;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.timecard-link-button:hover {
  color: var(--accent);
}

.timecard-breakdown-row > td {
  background: rgba(240, 227, 210, 0.22);
  max-width: 0;
}

.timecard-breakdown-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
}

.timecard-breakdown-table {
  width: max-content;
  min-width: 100%;
}

.timecard-breakdown-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.timecard-breakdown-table th {
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: normal;
}

.timecard-breakdown-table td {
  white-space: nowrap;
}

.timecard-breakdown-table th,
.timecard-breakdown-table td {
  overflow-wrap: normal;
}

.timecard-breakdown-table th:nth-child(6),
.timecard-breakdown-table td:nth-child(6) {
  width: 4.6rem;
  min-width: 4.6rem;
  text-align: center;
}

.timecard-breakdown-table th:nth-child(7),
.timecard-breakdown-table td:nth-child(7) {
  width: 5.6rem;
  min-width: 5.6rem;
  text-align: center;
}

.timecard-breakdown-table th:nth-child(8),
.timecard-breakdown-table td:nth-child(8) {
  width: 5.5rem;
  min-width: 5.5rem;
}

.timecard-breakdown-table th:nth-child(9),
.timecard-breakdown-table td:nth-child(9) {
  width: 5.2rem;
  min-width: 5.2rem;
}

.timecard-breakdown-table th:nth-child(10),
.timecard-breakdown-table td:nth-child(10) {
  width: 5.2rem;
  min-width: 5.2rem;
  text-align: center;
}

.timecard-breakdown-table th:nth-child(11),
.timecard-breakdown-table td:nth-child(11) {
  width: 4.5rem;
  min-width: 4.5rem;
  text-align: center;
}

.timecard-hours-override-input {
  width: 100%;
  min-width: 72px;
}

.timecard-inline-editor {
  display: grid;
  gap: 4px;
}

.timecard-inline-picker {
  width: 100%;
  min-width: 0;
}

.timecard-source-corr-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-strong);
  white-space: nowrap;
}

.timecard-budget-invalid {
  color: #a43a2f;
  font-weight: 700;
}

.timecard-breakdown-total-row td {
  background: rgba(23, 32, 51, 0.06);
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.compact-form {
  margin-top: 10px;
}

.timecard-note {
  margin-top: 10px;
}

.candidate-item {
  display: grid;
  align-content: start;
  min-height: 100%;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(221, 208, 190, 0.62);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.candidate-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.my-charge-update-status {
  align-self: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.my-charge-update-status-success {
  color: #186a3b;
  font-weight: 700;
}

.candidate-score {
  font-weight: 700;
  color: var(--accent-strong);
}

.my-charge-summary-row td {
  vertical-align: top;
}

.my-charge-summary-copy {
  display: grid;
  gap: 4px;
}

.my-charge-summary-copy .document-link-button {
  justify-self: start;
  text-align: left;
}

.my-charge-detail-row td {
  padding-top: 0;
}

.my-charge-detail-panel {
  display: grid;
  gap: 14px;
  margin: 6px 0 2px;
}

.my-charge-detail-summary {
  display: grid;
  gap: 4px;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.08);
  font-size: 0.76rem;
}

.statement-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.statement-form label,
.inline-form label {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 0.84rem;
}

.dashboard-card-form {
  display: grid;
  gap: 8px;
}

.dashboard-card-form label {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 0.84rem;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.15;
}

.statement-form input,
.statement-form textarea,
.statement-form select,
.inline-form input,
.dashboard-card-form input,
.dashboard-card-form textarea,
.dashboard-card-form select {
  width: 100%;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 11px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.2;
}

.statement-form textarea,
.dashboard-card-form textarea {
  resize: vertical;
  min-height: 78px;
  font-family: inherit;
}

.search-picker {
  position: relative;
  min-width: 0;
}

.search-picker-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.99);
  box-shadow: 0 14px 28px rgba(23, 32, 51, 0.2);
}

.search-picker-option {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-picker-option:last-child {
  border-bottom: 0;
}

.search-picker-option:hover,
.search-picker-option:focus-visible {
  background: rgba(138, 59, 18, 0.1);
}

.search-picker-empty {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.84rem;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 2px dashed rgba(31, 78, 120, 0.28);
  border-radius: 16px;
  background: rgba(31, 78, 120, 0.08);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.upload-dropzone small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.upload-dropzone.drag-active {
  border-color: rgba(31, 78, 120, 0.72);
  background: rgba(31, 78, 120, 0.12);
}

.document-dropzone {
  min-height: 36px;
  padding: 6px 10px;
}

.inline-form.drag-active .upload-dropzone {
  border-color: rgba(31, 78, 120, 0.72);
  background: rgba(31, 78, 120, 0.12);
}

.dashboard-card-form.drag-active .upload-dropzone {
  border-color: rgba(31, 78, 120, 0.72);
  background: rgba(31, 78, 120, 0.12);
}

.span-2 {
  grid-column: span 2;
}

.required-marker {
  color: var(--danger);
  font-weight: 700;
}

.dashboard-optional-wrap {
  display: grid;
  gap: 8px;
}

.dashboard-optional-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* The grid display rule would otherwise override the browser's hidden attribute. */
.dashboard-optional-fields[hidden] {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  border: 1px solid transparent;
}

.status-pill-neutral {
  background: rgba(23, 32, 51, 0.08);
  color: var(--ink);
}

.status-pill-info {
  background: rgba(31, 78, 120, 0.12);
  border-color: rgba(31, 78, 120, 0.18);
  color: #1f4e78;
}

.status-pill-success {
  background: rgba(49, 113, 66, 0.12);
  border-color: rgba(49, 113, 66, 0.18);
  color: #2f5f39;
}

.status-pill-warning {
  background: rgba(159, 97, 18, 0.12);
  border-color: rgba(159, 97, 18, 0.18);
  color: #8a4d12;
}

.status-pill-danger {
  background: rgba(154, 47, 36, 0.12);
  border-color: rgba(154, 47, 36, 0.18);
  color: var(--danger);
}

.dashboard-attention-list,
.dashboard-entry-list {
  display: grid;
  gap: 10px;
}

.dashboard-attention-item,
.dashboard-entry-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.dashboard-attention-main,
.dashboard-entry-main,
.dashboard-attention-side,
.dashboard-entry-side {
  display: grid;
  gap: 6px;
}

.dashboard-attention-side,
.dashboard-entry-side {
  justify-items: end;
  align-content: start;
}

.wishlist-detail-row td {
  padding-top: 0;
}

.wishlist-detail-row .subsection {
  margin-top: 8px;
}

.wishlist-list-group-row td {
  padding: 10px 8px 4px;
  background: rgba(31, 78, 120, 0.06);
}

.wishlist-list-group-toggle {
  width: 100%;
  border: 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(31, 78, 120, 0.12);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.wishlist-list-group-toggle:hover,
.wishlist-list-group-toggle:focus-visible {
  background: rgba(31, 78, 120, 0.2);
}

.wishlist-user-entered-text {
  color: #1f5f9c;
}

.access-function-header {
  cursor: default;
  color: #1f5f9c;
  text-decoration: underline dotted rgba(31, 95, 156, 0.7);
  text-underline-offset: 3px;
}

.wishlist-create-toggle {
  margin-bottom: 10px;
}

#wishlist-create-wrap:not(.page-hidden) {
  display: grid;
  gap: 10px;
}

#wishlist-detail-park.subsection {
  margin-top: 12px;
}

.wishlist-gantt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wishlist-gantt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.wishlist-gantt-shell {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.wishlist-gantt-legend {
  color: var(--muted);
  font-size: 0.82rem;
}

.wishlist-gantt-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.wishlist-gantt-row-wrap {
  display: grid;
  gap: 8px;
}

.wishlist-gantt-grid-header,
.wishlist-gantt-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.wishlist-gantt-item-heading,
.wishlist-gantt-item-meta {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(71, 61, 45, 0.12);
}

.wishlist-gantt-item-meta {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.wishlist-gantt-item-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.wishlist-gantt-request-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(71, 61, 45, 0.08);
}

.wishlist-gantt-request-label.has-group-color {
  color: var(--wishlist-gantt-group-solid);
  background: var(--wishlist-gantt-group-soft);
}

.wishlist-table-request {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(71, 61, 45, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.wishlist-table-request.wishlist-table-colored {
  color: var(--wishlist-gantt-group-solid);
  background: var(--wishlist-gantt-group-soft);
}

.wishlist-table-row-colored td {
  background: color-mix(in srgb, var(--wishlist-gantt-group-soft) 32%, white);
}

#wishlist-body tr[data-selected="true"] td {
  box-shadow: inset 0 1px 0 rgba(31, 78, 120, 0.18), inset 0 -1px 0 rgba(31, 78, 120, 0.18);
  background: color-mix(in srgb, rgba(31, 78, 120, 0.14) 72%, white);
}

.wishlist-gantt-title {
  display: inline-block;
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.wishlist-open-table.wishlist-table-colored {
  color: #fff;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--wishlist-gantt-group-solid) 92%, white),
    color-mix(in srgb, var(--wishlist-gantt-group-solid) 76%, black)
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wishlist-gantt-group-solid) 82%, black);
}

.wishlist-open-table.wishlist-link-requested,
.wishlist-open-gantt.wishlist-link-requested {
  color: var(--danger);
  background: linear-gradient(135deg, rgba(186, 71, 57, 0.2), rgba(154, 47, 36, 0.12));
  box-shadow: inset 0 0 0 1px rgba(154, 47, 36, 0.28);
}

.wishlist-open-table.wishlist-link-requested:hover,
.wishlist-open-gantt.wishlist-link-requested:hover,
.wishlist-open-table.wishlist-link-requested:focus-visible,
.wishlist-open-gantt.wishlist-link-requested:focus-visible {
  background: linear-gradient(135deg, rgba(186, 71, 57, 0.28), rgba(154, 47, 36, 0.18));
}

.wishlist-gantt-status-inline {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  color: var(--muted);
}

.wishlist-gantt-item-meta.has-group-color {
  box-shadow: inset 0 0 0 1px var(--wishlist-gantt-group-soft);
}

.wishlist-gantt-week-grid,
.wishlist-gantt-row-grid {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.wishlist-gantt-week {
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(31, 78, 120, 0.09);
  border: 1px solid rgba(31, 78, 120, 0.16);
  text-align: center;
  font-size: 0.78rem;
}

.wishlist-gantt-week span {
  display: block;
  color: var(--muted);
}

.wishlist-gantt-cell {
  min-height: 28px;
  border-radius: 12px;
  border: 1px solid rgba(71, 61, 45, 0.12);
  background: rgba(255, 255, 255, 0.32);
}

.wishlist-gantt-cell.is-active {
  background: rgba(31, 78, 120, 0.7);
  border-color: rgba(31, 78, 120, 0.85);
}

.wishlist-gantt-cell.has-group-color.is-active {
  background: var(--wishlist-gantt-group-solid);
  border-color: var(--wishlist-gantt-group-solid);
}

.wishlist-gantt-cell.is-completed.is-active {
  background: rgba(32, 98, 71, 0.7);
  border-color: rgba(32, 98, 71, 0.85);
}

.wishlist-gantt-cell.has-group-color.is-completed.is-active {
  background: var(--wishlist-gantt-group-solid);
  border-color: var(--wishlist-gantt-group-solid);
  opacity: 0.72;
}

.wishlist-gantt-cell.is-selected {
  box-shadow: inset 0 0 0 2px rgba(154, 106, 16, 0.75);
}

.wishlist-gantt-detail-row {
  padding: 0 0 4px;
}

.wishlist-gantt-detail-row > div > .subsection,
.wishlist-gantt-detail-row > .subsection {
  margin-top: 0;
}

.status-pill {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-balanced {
  background: rgba(32, 98, 71, 0.12);
  color: var(--success);
}

.status-unbalanced {
  background: rgba(154, 47, 36, 0.12);
  color: var(--danger);
}

.status-warning {
  background: rgba(154, 106, 16, 0.14);
  color: var(--warning);
}

.callout-danger {
  border: 1px solid rgba(154, 47, 36, 0.3);
  background: rgba(154, 47, 36, 0.08);
  color: var(--danger);
}

.backup-alert-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.backup-alert-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(154, 47, 36, 0.16);
}

.backup-alert-copy {
  display: grid;
  gap: 4px;
}

.backup-alert-copy strong {
  color: var(--danger);
}

.backup-alert-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.backup-alert-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.backup-row-failed td,
.backup-row-partial_failure td {
  color: var(--danger);
}

.subsection {
  margin-top: 14px;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

.helper-text {
  color: var(--muted);
  font-size: 0.78rem;
}

#wishlist-admin-helper,
.dashboard-wishlist-admin-helper {
  color: var(--danger);
  font-weight: 600;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .page-shell {
    width: min(100vw - 20px, 1380px);
    padding: 10px 0 14px;
  }

  .dashboard-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-count: unset;
  }

  .dashboard-manage-board {
    column-count: 1;
  }

  .dashboard-manage-outline {
    grid-template-columns: 1fr;
  }

  .dashboard-manage-outline-actions {
    justify-items: stretch;
  }

  .dashboard-optional-fields,
  .dashboard-attention-item,
  .dashboard-entry-item {
    grid-template-columns: 1fr;
  }

  .dashboard-attention-side,
  .dashboard-entry-side {
    justify-items: start;
  }

  .dashboard-notifications-card.is-compact {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  .hero,
  .panel {
    padding: 14px;
    border-radius: 20px;
  }

  .statement-form {
    grid-template-columns: 1fr;
  }

  .wishlist-gantt-grid-header,
  .wishlist-gantt-row {
    grid-template-columns: 1fr;
  }

  .document-preview-row {
    grid-template-columns: 1fr;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .candidate-list {
    grid-template-columns: 1fr;
  }
}
