/*
  UX Base System
  - Jerarquia: kicker -> titulo -> apoyo -> accion.
  - Spacing: 4, 8, 12, 16, 20, 24, 32.
  - Color: un acento operativo y colores semanticos solo para estado.
*/
:root {
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-alt: #f7f9fa;
  --surface-soft: #f1f5f5;
  --surface-strong: #e5ecef;
  --text: #16232b;
  --text-soft: #31424d;
  --muted: #687983;
  --line: #d4dee3;
  --line-strong: #b8c7cf;
  --accent: #0e5a50;
  --accent-strong: #0a433b;
  --accent-soft: #e3f0ec;
  --accent-ink: #0a3b35;
  --success: #1d7a46;
  --success-soft: #dff1e6;
  --error: #b23b3b;
  --error-soft: #f5dfdf;
  --warning: #936615;
  --warning-soft: #f6eccf;
  --info: #1b5f8a;
  --info-soft: #dcecf7;
  --shadow-sm: 0 1px 3px rgba(18, 35, 43, 0.08);
  --shadow: 0 14px 30px rgba(18, 35, 43, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --page-max: 1420px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --font-size-kicker: 0.72rem;
  --font-size-sm: 0.84rem;
  --font-size-body: 0.95rem;
  --font-size-title-1: clamp(1.55rem, 1.25rem + 0.95vw, 2rem);
  --font-size-title-2: 1.16rem;
  --control-height: 42px;
  --control-height-sm: 36px;
  --focus-ring: 0 0 0 3px rgba(14, 90, 80, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", Tahoma, sans-serif;
  font-size: var(--font-size-body);
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(14, 90, 80, 0.05), transparent 32%),
    linear-gradient(180deg, #f8f9fa 0%, var(--bg) 100%);
  color: var(--text);
}

body.login-shell {
  background:
    radial-gradient(circle at top left, rgba(14, 90, 80, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(10, 67, 59, 0.08), transparent 34%),
    #f4f7f8;
}

body.nav-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p,
ul,
ol {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  color: var(--text);
}

h2 {
  font-size: var(--font-size-title-1);
}

h3 {
  font-size: var(--font-size-title-2);
}

/* Canonical action scale: primary > secondary > ghost. Danger only for irreversible flows. */
button,
.button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--control-height);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.95rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

button,
.button {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}

button:hover,
.button:hover,
.link-button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.link-button,
button.ghost,
.button.ghost,
.button.tertiary,
button.tertiary {
  background: var(--surface-alt);
  color: var(--accent-ink);
  border-color: rgba(14, 90, 80, 0.18);
  box-shadow: none;
}

button.warning,
.button.warning {
  background: var(--warning-soft);
  color: #6b4f12;
  border-color: #dfc88f;
  box-shadow: none;
}

button.info,
.button.info {
  background: var(--info);
  color: #fff;
  border-color: rgba(24, 88, 124, 0.94);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}

button.info:hover,
.button.info:hover {
  background: #164f73;
}

button.danger,
.button.danger {
  background: var(--error-soft);
  color: #8f2e2e;
  border-color: #dfb0b0;
  box-shadow: none;
}

button.small,
.button.small,
.link-button.small {
  min-height: var(--control-height-sm);
  padding: 0.5rem 0.78rem;
  font-size: 0.9rem;
}

button:disabled,
.button:disabled,
.link-button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

button:focus-visible,
.button:focus-visible,
.link-button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(14, 90, 80, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  top: 1rem;
}

/* Shell and navigation: low-noise chrome, strong orientation, one accent. */
.shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
}

.nav-scrim {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 34, 40, 0.98) 0%, rgba(9, 24, 29, 0.99) 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 42%);
  color: #fff;
  padding: var(--space-5) var(--space-4) 1.1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-kicker,
.topbar-kicker,
.eyebrow,
.nav-group-label,
.section-label,
.kiosk-label,
.flash-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--font-size-kicker);
}

.brand {
  display: grid;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem 1.1rem;
}

.brand-logo {
  width: min(100%, 152px);
  height: auto;
  display: block;
}

.brand h1 {
  font-size: 1.34rem;
  color: #fff;
}

.sidebar-user {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.95rem;
  overflow-wrap: anywhere;
}

.sidebar-user strong {
  font-size: 1rem;
}

.nav-shell {
  display: grid;
  gap: 0.95rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.nav-group {
  display: grid;
  gap: 0.4rem;
}

.nav-group-label {
  margin: 0;
  padding: 0.1rem 0.7rem;
  color: rgba(255, 255, 255, 0.62);
}

.nav {
  display: grid;
  gap: 0.25rem;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.7rem 0.82rem;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 650;
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.nav a.is-active {
  background: rgba(227, 240, 236, 0.12);
  border-color: rgba(227, 240, 236, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.content {
  min-width: 0;
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.content-shell {
  display: grid;
  gap: var(--space-6);
  width: min(100%, var(--page-max));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 auto 1.1rem;
  padding: 0.95rem 0 0.85rem;
  width: min(100%, var(--page-max));
  background: linear-gradient(180deg, rgba(243, 246, 247, 0.96) 0%, rgba(243, 246, 247, 0.82) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 222, 227, 0.85);
}

.topbar-main,
.topbar-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.topbar-copy {
  display: grid;
  gap: 0.2rem;
}

.topbar-copy strong {
  font-size: 1.15rem;
  line-height: 1.25;
}

.topbar-kicker,
.eyebrow,
.section-label,
.kiosk-label,
.flash-title {
  color: var(--muted);
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-actions form {
  margin: 0;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.topbar-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(212, 222, 227, 0.95);
  color: var(--text-soft);
  font-size: 0.83rem;
  font-weight: 700;
}

.topbar-chip-muted {
  color: var(--muted);
  background: rgba(247, 249, 250, 0.92);
}

.nav-toggle {
  display: none;
}

/* Alerts: semantic color with restrained background, never decorative. */
.flash-stack {
  display: grid;
  gap: 0.75rem;
}

.flash {
  display: grid;
  gap: 0.22rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 4px;
}

.flash.info {
  border-left-color: var(--info);
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfe 100%);
}

.flash.success {
  border-left-color: var(--success);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
}

.flash.warning {
  border-left-color: var(--warning);
  background: linear-gradient(180deg, #fffef9 0%, #fcf8ea 100%);
}

.flash.error {
  border-left-color: var(--error);
  background: linear-gradient(180deg, #fffefe 0%, #fdf6f6 100%);
}

.flash-message {
  color: var(--text-soft);
}

/* Canonical header pattern: kicker + h2/h3 + support copy + optional actions. */
.page-head,
.card-head,
.section-head,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.page-head {
  margin-bottom: 0.25rem;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(212, 222, 227, 0.95);
  box-shadow: var(--shadow-sm);
}

.page-head-copy,
.card-head-copy,
.section-head-copy,
.page-head > div,
.card-head > div,
.section-head > div {
  display: grid;
  gap: 0.35rem;
}

.page-head-actions,
.card-head-meta,
.section-head-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.page-head p,
.card p,
.section-head p {
  margin-bottom: 0;
}

.page-subtitle {
  max-width: 68ch;
  color: var(--text-soft);
}

.page-head .actions,
.toolbar .actions,
.page-head-actions {
  justify-content: flex-end;
}

.stats-grid,
.summary-grid,
.cta-grid,
.grid.two,
.grid.three,
.meta-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid,
.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.cta-grid,
.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

/* Section and surface system: one job per block, one visual weight per layer. */
.card,
.stat-card,
.action-tile,
.detail-item,
.summary-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card,
.summary-strip {
  padding: 1.15rem;
}

.card.narrow {
  max-width: 640px;
}

.card > * + *,
.action-tile > * + * {
  margin-top: 0.2rem;
}

.stat-card {
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%);
}

.stat-card span,
.detail-label,
.action-tile span,
.metric-meta,
.table-meta,
.helper-list li,
.list-empty,
.kpi-copy span {
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.stat-card strong,
.kpi-copy strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 0.3rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-card small {
  display: block;
  margin-top: 0.45rem;
}

.action-tile {
  display: grid;
  gap: 0.45rem;
  padding: 1.05rem;
  background: linear-gradient(180deg, rgba(247, 249, 250, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
  align-content: start;
}

.action-tile strong {
  font-size: 1.08rem;
}

.kpi-row,
.info-grid,
.detail-list,
.meta-grid {
  display: grid;
  gap: 0.9rem;
}

.kpi-row,
.info-grid,
.detail-list {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.info-pair {
  display: grid;
  gap: 0.2rem;
}

.detail-item {
  padding: 0.95rem;
  background: var(--surface-alt);
}

.detail-value {
  display: block;
  margin-top: 0.35rem;
  font-weight: 700;
  word-break: break-word;
}

.budget-shell {
  display: grid;
  gap: 1rem;
}

.budget-shell.budget-shell-sidebar {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  align-items: start;
}

.budget-shell.budget-shell-form {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
  align-items: start;
}

.budget-main,
.budget-side,
.budget-form-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.budget-highlight {
  display: grid;
  gap: 0.35rem;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(190, 205, 212, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 247, 1) 100%);
  box-shadow: var(--shadow-sm);
}

.budget-highlight span {
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.budget-highlight strong {
  font-size: 2.15rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.budget-highlight small {
  color: var(--text-soft);
}

.budget-meta-list,
.budget-compact-list {
  display: grid;
  gap: 0.75rem;
}

.budget-meta-item,
.budget-compact-item {
  display: grid;
  gap: 0.28rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(209, 220, 225, 0.88);
  background: var(--surface-alt);
}

.budget-meta-item strong,
.budget-compact-item strong {
  font-size: 1rem;
}

.budget-compact-item-header,
.budget-inline-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
}

.budget-compact-item p {
  margin: 0;
}

.budget-compact-item .actions {
  margin-top: 0.15rem;
}

.budget-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.budget-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.66rem;
  border-radius: 999px;
  border: 1px solid rgba(209, 220, 225, 0.9);
  background: var(--surface-alt);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.budget-pill strong {
  color: var(--text);
  font-size: 0.92rem;
}

.budget-table-note {
  display: grid;
  gap: 0.18rem;
}

.budget-chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.budget-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.budget-chip-grid-compact {
  gap: 0.24rem;
}

.budget-chip-grid-compact .budget-coverage-chip {
  min-height: 1.45rem;
  padding: 0.16rem 0.42rem;
  font-size: 0.68rem;
}

.budget-coverage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(204, 214, 220, 0.92);
  background: rgba(243, 247, 248, 0.96);
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 800;
}

.budget-coverage-chip.is-present {
  border-color: rgba(163, 208, 183, 0.95);
  background: rgba(231, 245, 236, 0.96);
  color: #23613f;
}

.budget-coverage-chip.is-missing {
  border-color: rgba(224, 187, 187, 0.94);
  background: rgba(249, 238, 238, 0.97);
  color: #8a3c3c;
}

.budget-table-note .table-emphasis {
  margin-bottom: 0;
}

.budget-sidebar-table .table-wrap table {
  min-width: 0;
}

.budget-sidebar-table th,
.budget-sidebar-table td {
  padding: 0.68rem 0.74rem;
}

.budget-form-side .card {
  padding: 1rem;
}

.budget-opportunity-tray {
  display: grid;
  gap: 0;
  border: 1px solid rgba(209, 220, 225, 0.88);
  border-radius: 14px;
  background: var(--surface-alt);
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}

.budget-opportunity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.82rem 0.95rem;
  border-bottom: 1px solid rgba(209, 220, 225, 0.88);
}

.budget-opportunity-row:last-child {
  border-bottom: 0;
}

.budget-opportunity-main {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.budget-opportunity-main p {
  margin: 0;
}

.budget-opportunity-main strong {
  font-size: 0.98rem;
}

.budget-opportunity-actions {
  justify-content: flex-end;
}

.compact-budget-list-layout {
  gap: 0.7rem;
}

.budget-shell.budget-shell-sidebar.compact-budget-list-layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.65fr);
}

.compact-sidebar-panel {
  padding: 0.72rem;
}

.compact-sidebar-panel .section-head {
  margin-bottom: 0.1rem;
}

.compact-sidebar-panel .section-head-copy {
  gap: 0.18rem;
}

.compact-sidebar-panel .budget-meta-list {
  gap: 0.38rem;
}

.compact-sidebar-panel .secondary-info-summary {
  min-height: 2.1rem;
  padding: 0.3rem 0;
}

.compact-sidebar-panel .budget-meta-item {
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
}

.compact-sidebar-panel .budget-opportunity-row {
  gap: 0.55rem;
  padding: 0.55rem 0.68rem;
}

.compact-sidebar-panel .budget-opportunity-main strong {
  font-size: 0.88rem;
}

.compact-sidebar-panel .budget-opportunity-main p {
  font-size: 0.76rem;
  line-height: 1.25;
}

.compact-sidebar-panel .budget-opportunity-tray {
  max-height: 360px;
}

.chapter-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 1rem;
  margin-bottom: 0.35rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(194, 208, 216, 0.92);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 249, 0.98) 58%, rgba(238, 244, 243, 0.98) 100%);
  box-shadow: var(--shadow-sm);
}

.chapter-hero-main,
.chapter-hero-actions {
  display: grid;
  align-content: start;
}

.chapter-hero-main {
  gap: 0.68rem;
}

.chapter-hero-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.chapter-hero-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 60ch;
}

.chapter-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.compact-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.compact-meta-grid span {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.46rem 0.58rem;
  border-radius: 12px;
  border: 1px solid rgba(211, 222, 227, 0.86);
  background: rgba(246, 250, 250, 0.78);
  color: var(--text-soft);
  font-size: 0.79rem;
  font-weight: 700;
}

.compact-meta-grid strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.chapter-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.chapter-hero-stats-compact {
  grid-template-columns: minmax(220px, 1.15fr) repeat(2, minmax(0, 0.78fr));
}

.chapter-hero-stat {
  display: grid;
  gap: 0.18rem;
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  background: rgba(248, 251, 251, 0.98);
  border: 1px solid rgba(212, 222, 227, 0.92);
}

.chapter-hero-stat span,
.chapter-hero-stat small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.chapter-hero-stat strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.chapter-hero-stat-primary {
  background: linear-gradient(180deg, rgba(252, 253, 253, 1) 0%, rgba(243, 248, 247, 0.98) 100%);
}

.chapter-hero-stat-primary strong {
  font-size: 1.45rem;
  letter-spacing: 0;
}

.chapter-hero-actions {
  gap: 0.7rem;
}

.chapter-top-actions {
  padding: 0.68rem;
  border: 1px solid rgba(198, 211, 218, 0.95);
  border-radius: 14px;
  background: rgba(247, 250, 251, 0.9);
}

.chapter-action-button {
  justify-content: flex-start;
  gap: 0.45rem;
}

.chapter-note-modal-text {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.chapter-note-link {
  font-weight: 800;
}

.chapter-context-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chapter-context-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.34rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(205, 217, 223, 0.92);
  background: rgba(247, 250, 251, 0.9);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.chapter-context-link span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

a.chapter-context-link:hover {
  border-color: rgba(155, 184, 176, 0.95);
  background: rgba(239, 247, 245, 0.96);
  color: var(--accent-ink);
}

.action-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding-inline: 0.22rem;
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(229, 240, 237, 0.92);
  border: 1px solid rgba(188, 210, 204, 0.9);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.chapter-hero-back {
  justify-self: end;
}

.chapter-context-banner {
  margin-bottom: 0.65rem;
}

.chapter-action-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
}

.chapter-action-heading strong {
  font-size: 0.96rem;
}

.chapter-hero-action-grid,
.chapter-hero-secondary-grid,
.chapter-hero-ops-grid {
  display: grid;
  gap: 0.55rem;
}

.primary-cost-actions,
.secondary-cost-actions,
.compact-action-row {
  display: grid;
  gap: 0.55rem;
}

.chapter-hero-action-grid,
.chapter-hero-secondary-grid,
.chapter-hero-ops-grid,
.primary-cost-actions,
.secondary-cost-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-hero-primary,
.chapter-hero-action-grid .button,
.primary-cost-actions .button,
.secondary-cost-actions .button,
.compact-action-row .button,
.chapter-hero-secondary-grid .button,
.chapter-hero-secondary-grid .inline-form,
.chapter-hero-secondary-grid .inline-form button,
.chapter-hero-ops-grid .inline-form,
.chapter-hero-ops-grid .inline-form button {
  width: 100%;
}

.secondary-action-group {
  display: grid;
  gap: 0.55rem;
  padding: 0.68rem;
  border: 1px solid rgba(205, 217, 223, 0.92);
  border-radius: 14px;
  background: rgba(247, 250, 251, 0.86);
}

.secondary-action-group > summary {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.secondary-action-group > summary::-webkit-details-marker {
  display: none;
}

.secondary-action-group > summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(227, 240, 236, 0.95);
  border: 1px solid rgba(190, 211, 204, 0.9);
}

.secondary-action-group[open] > summary {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(212, 222, 227, 0.85);
}

.secondary-action-group[open] > summary::after {
  content: "-";
}

.secondary-action-group > summary span {
  color: var(--muted);
}

.secondary-action-group > summary strong {
  margin-left: auto;
  color: var(--text);
  font-size: 0.82rem;
  text-align: right;
}

.chapter-note-bar {
  display: grid;
  gap: 0.22rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(208, 219, 224, 0.9);
  background: rgba(244, 248, 249, 0.96);
}

.chapter-note-bar strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.chapter-empty-state {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
  padding: 1.15rem;
}

.chapter-empty-state p {
  margin: 0;
  color: var(--text-soft);
}

.chapter-cost-summary {
  padding: 1rem;
}

.chapter-cost-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.chapter-cost-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  align-content: space-between;
  padding: 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(205, 217, 223, 0.92);
  background: rgba(249, 252, 252, 0.98);
}

.chapter-cost-card.is-empty {
  background: rgba(246, 249, 250, 0.88);
}

.chapter-cost-card-main,
.chapter-cost-card-value {
  display: grid;
  gap: 0.16rem;
}

.chapter-cost-card-main strong,
.chapter-cost-card-value strong {
  font-size: 1rem;
  line-height: 1.1;
}

.chapter-section-head {
  padding: 0.95rem 1rem 0;
}

.chapter-cost-table table {
  min-width: 900px;
}

.chapter-section-empty {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.9rem 1rem 1rem;
}

.compact-empty-state {
  padding-block: 0.72rem;
  background: rgba(247, 250, 250, 0.75);
}

.inline-note-truncate {
  display: -webkit-box;
  max-width: 34ch;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.budget-item-head {
  margin-bottom: 1rem;
}

.chapter-workspace-card {
  padding: 0;
  overflow: hidden;
  border-color: rgba(190, 204, 212, 0.98);
  box-shadow: 0 8px 24px rgba(20, 45, 55, 0.06);
}

.chapter-workspace-summary {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 1.1rem;
  list-style: none;
  cursor: pointer;
}

.chapter-workspace-summary::-webkit-details-marker {
  display: none;
}

.chapter-workspace-main,
.chapter-workspace-meta {
  display: grid;
  gap: 0.18rem;
}

.chapter-workspace-main p,
.chapter-workspace-main h3 {
  margin: 0;
}

.chapter-workspace-main h3 {
  font-size: 1.08rem;
}

.chapter-workspace-meta {
  justify-items: end;
}

.chapter-workspace-card[open] .chapter-workspace-summary {
  border-bottom: 1px solid rgba(212, 222, 227, 0.92);
  background: rgba(242, 247, 248, 0.98);
}

.cost-section-card {
  padding: 0;
  overflow: hidden;
  border-color: rgba(188, 204, 212, 0.98);
  box-shadow: 0 8px 24px rgba(20, 45, 55, 0.06);
}

.cost-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid rgba(205, 217, 223, 0.9);
  background: rgba(242, 247, 248, 0.98);
  list-style: none;
  cursor: pointer;
}

.cost-section-summary-line {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.cost-section-summary::-webkit-details-marker {
  display: none;
}

.cost-section-summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(229, 240, 237, 0.94);
  border: 1px solid rgba(188, 210, 204, 0.92);
  font-size: 0.9rem;
  font-weight: 900;
}

.cost-section-details[open] > .cost-section-summary::after {
  content: "-";
}

.cost-section-summary-main {
  min-width: 9rem;
  flex: 0 0 auto;
}

.cost-section-summary-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.cost-section-summary-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(218, 226, 230, 0.82);
}

.cost-section-summary-main h3 {
  margin: 0;
}

.cost-section-summary-main h3 {
  font-size: 1.02rem;
}

.cost-section-summary-action {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cost-lines-table th {
  padding-block: 0.52rem;
  background: rgba(238, 245, 246, 0.98);
  color: var(--text);
}

.cost-lines-table td {
  padding-block: 0.5rem;
  vertical-align: middle;
}

.cost-lines-table .table-emphasis {
  line-height: 1.2;
}

.cost-row-actions {
  flex-wrap: nowrap;
  gap: 0.28rem;
  justify-content: flex-start;
}

.cost-row-actions .button.small,
.cost-row-actions .inline-form button {
  min-height: 1.9rem;
  white-space: nowrap;
}

.chapter-side-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(194, 208, 216, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 247, 246, 0.98) 100%);
  box-shadow: var(--shadow-sm);
}

.chapter-executive-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: end;
}

.chapter-side-heading,
.chapter-side-summary {
  display: grid;
  gap: 0.15rem;
}

.chapter-side-summary {
  justify-items: end;
  text-align: right;
}

.chapter-executive-head strong {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.chapter-executive-head small {
  color: var(--muted);
}

.chapter-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.chapter-mini-stat {
  display: grid;
  gap: 0.15rem;
  padding: 0.68rem 0.74rem;
  border-radius: 14px;
  background: rgba(244, 248, 249, 0.95);
  border: 1px solid rgba(210, 220, 226, 0.88);
}

.chapter-mini-stat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.chapter-mini-stat strong {
  font-size: 1rem;
}

.chapter-focus-line {
  display: grid;
  gap: 0.18rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  background: rgba(238, 244, 242, 0.92);
  border: 1px solid rgba(205, 217, 221, 0.88);
}

.chapter-financial-rail {
  display: grid;
  gap: 0.45rem;
}

.chapter-financial-details {
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.88);
  background: rgba(246, 249, 250, 0.88);
}

.chapter-financial-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  background: rgba(244, 248, 249, 0.95);
  border: 1px solid rgba(210, 220, 226, 0.88);
}

.chapter-financial-main {
  display: grid;
  gap: 0.12rem;
}

.chapter-financial-main strong {
  font-size: 1rem;
}

.chapter-financial-pct {
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.chapter-nav-panel {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.05rem;
  border-top: 1px solid rgba(212, 222, 227, 0.8);
}

.chapter-nav-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
}

.chapter-nav-list {
  gap: 0.45rem;
}

.chapter-nav-item {
  position: relative;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.chapter-nav-item.is-empty {
  opacity: 0.76;
  background: rgba(246, 249, 250, 0.92);
}

.chapter-nav-item.is-active {
  border-color: rgba(108, 149, 187, 0.95);
  box-shadow: 0 12px 24px rgba(26, 58, 84, 0.1);
}

.chapter-nav-link {
  display: grid;
  gap: 0.6rem;
  padding: 0.82rem 0.88rem 0.78rem;
  color: inherit;
  text-decoration: none;
}

.chapter-nav-top,
.chapter-nav-bottom {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.chapter-nav-top {
  align-items: start;
}

.chapter-nav-bottom {
  align-items: center;
}

.chapter-nav-title-group,
.chapter-nav-value {
  display: grid;
  gap: 0.12rem;
}

.chapter-nav-title-group strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.chapter-nav-value {
  justify-items: end;
  text-align: right;
}

.chapter-nav-value strong {
  font-size: 1.12rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.chapter-nav-value span,
.chapter-nav-items,
.chapter-nav-jump {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.chapter-nav-items {
  color: var(--muted);
}

.chapter-nav-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
}

.chapter-nav-jump::after {
  content: ">";
  font-size: 0.84rem;
}

.chapter-nav-meter {
  display: block;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(214, 223, 228, 0.9);
  overflow: hidden;
}

.chapter-nav-meter::after {
  content: "";
  display: block;
  height: 100%;
  width: max(0.85rem, var(--block-share));
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(48, 102, 160, 0.88) 0%, rgba(84, 150, 132, 0.9) 100%);
}

.chapter-nav-item.is-empty .chapter-nav-value strong {
  font-size: 0.98rem;
}

.chapter-nav-item.is-empty .chapter-nav-meter::after {
  width: 0.5rem;
  background: rgba(158, 171, 180, 0.75);
}

.chapter-nav-item:hover,
.chapter-nav-item:focus-within {
  transform: translateY(-1px);
  border-color: rgba(172, 188, 198, 0.95);
}

.budget-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  gap: 1rem;
  margin-bottom: 0.35rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(194, 208, 216, 0.92);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 249, 0.98) 58%, rgba(238, 244, 243, 0.98) 100%);
  box-shadow: var(--shadow-sm);
}

.budget-hero-main,
.budget-hero-actions,
.budget-hero-status-block {
  display: grid;
}

.budget-hero-main {
  gap: 0.68rem;
  align-content: start;
}

.budget-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
}

.budget-title-row .eyebrow {
  margin: 0;
}

.budget-hero-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.budget-hero-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 60ch;
}

.budget-context-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.budget-context-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 1.72rem;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(205, 216, 222, 0.95);
  background: rgba(246, 249, 249, 0.96);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}

.budget-context-link span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a.budget-context-link:hover {
  border-color: rgba(111, 138, 149, 0.9);
  background: #ffffff;
  color: var(--primary);
}

.budget-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.budget-header-status-flow {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(207, 218, 224, 0.9);
  background: rgba(248, 251, 251, 0.8);
}

.budget-status-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.28rem;
}

.budget-status-steps .budget-state-chip {
  min-height: 2rem;
  padding: 0.32rem 0.42rem;
  border-radius: 11px;
  font-size: 0.68rem;
}

.budget-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.budget-hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  background: rgba(240, 245, 246, 0.95);
  border: 1px solid rgba(208, 219, 224, 0.92);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.budget-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.budget-hero-stats-compact {
  grid-template-columns: minmax(220px, 1.15fr) repeat(2, minmax(0, 0.78fr));
}

.budget-hero-stat {
  display: grid;
  gap: 0.18rem;
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  background: rgba(248, 251, 251, 0.98);
  border: 1px solid rgba(212, 222, 227, 0.92);
}

.budget-hero-stat span,
.budget-hero-stat small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.budget-hero-stat strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.budget-hero-stat-primary {
  background: linear-gradient(180deg, rgba(252, 253, 253, 1) 0%, rgba(243, 248, 247, 0.98) 100%);
}

.budget-hero-stat-primary strong {
  font-size: 1.45rem;
  letter-spacing: 0;
}

.budget-hero-actions {
  gap: 0.7rem;
  align-content: start;
}

.budget-hero-back {
  justify-self: end;
}

.budget-hero-status-block {
  gap: 0.45rem;
}

.budget-hero-status-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.budget-hero-status-head strong {
  font-size: 0.96rem;
}

.budget-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.35rem;
  border-radius: 18px;
  background: rgba(231, 238, 241, 0.9);
  border: 1px solid rgba(199, 210, 217, 0.92);
}

.budget-hero-action-grid,
.budget-hero-export-grid,
.budget-hero-secondary-grid {
  display: grid;
  gap: 0.55rem;
}

.budget-hero-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.budget-hero-primary,
.budget-hero-action-grid .inline-form,
.budget-hero-action-grid .inline-form button,
.budget-hero-export-grid a,
.budget-hero-secondary-grid .button,
.budget-hero-secondary-grid .inline-form,
.budget-hero-secondary-grid .inline-form button {
  width: 100%;
}

.budget-hero-primary {
  grid-column: 1 / -1;
}

.budget-primary-action {
  min-height: 2.55rem;
  font-weight: 900;
}

.budget-action-button {
  min-height: 2.2rem;
  padding: 0.44rem 0.62rem;
  gap: 0.38rem;
}

.budget-secondary-actions-inline {
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(207, 218, 224, 0.82);
  background: rgba(248, 251, 251, 0.74);
}

.budget-hero-export-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.budget-hero-secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.budget-context-banner {
  margin-bottom: 0.65rem;
}

.budget-empty-state {
  display: grid;
  justify-items: start;
  gap: 0.55rem;
  padding: 1.15rem;
}

.budget-empty-state p {
  margin: 0;
  color: var(--text-soft);
}

.budget-chapter-list-compact {
  padding: 0.95rem;
}

.budget-chapter-list-compact .section-head {
  align-items: center;
  margin-bottom: 0.35rem;
}

.budget-chapter-list-compact .section-head h3 {
  margin: 0;
}

.budget-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.budget-chapters-table table {
  min-width: 980px;
}

.budget-table-dense th,
.budget-table-dense td {
  padding-top: 0.54rem;
  padding-bottom: 0.54rem;
  vertical-align: middle;
}

.budget-table-dense th {
  font-size: 0.72rem;
}

.budget-row-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.budget-row-actions .button.small {
  font-weight: 850;
}

.budget-chapter-actions {
  gap: 0.25rem;
}

.budget-chapter-primary-link {
  white-space: nowrap;
}

.budget-duplicate-modal .form-section,
.chapter-duplicate-modal .form-section {
  margin-bottom: 0;
}

.budget-composition-total {
  background: rgba(238, 246, 242, 0.96);
  border-color: rgba(166, 199, 184, 0.92);
}

.budget-state-form {
  margin: 0;
  min-width: 0;
}

.budget-state-chip {
  --state-fg: #65717c;
  --state-line: rgba(163, 173, 184, 0.9);
  --state-surface: rgba(244, 247, 248, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--state-line);
  background: var(--state-surface);
  color: var(--state-fg);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.budget-state-chip::before {
  content: "";
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: currentColor;
  margin-right: 0.42rem;
  opacity: 0.9;
}

.budget-state-chip.status-draft {
  --state-fg: #55606a;
  --state-line: rgba(174, 183, 191, 0.95);
  --state-surface: rgba(243, 246, 248, 1);
}

.budget-state-chip.status-sent {
  --state-fg: #155eaa;
  --state-line: rgba(122, 174, 227, 0.95);
  --state-surface: rgba(232, 242, 252, 1);
}

.budget-state-chip.status-accepted {
  --state-fg: #1f7a45;
  --state-line: rgba(130, 195, 151, 0.95);
  --state-surface: rgba(229, 246, 235, 1);
}

.budget-state-chip.status-rejected {
  --state-fg: #a13333;
  --state-line: rgba(225, 157, 157, 0.95);
  --state-surface: rgba(251, 235, 235, 1);
}

.budget-state-chip.status-archived {
  --state-fg: #3f4d59;
  --state-line: rgba(144, 157, 169, 0.95);
  --state-surface: rgba(234, 239, 243, 1);
}

.budget-state-chip.is-current {
  border-color: transparent;
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 12px 24px rgba(20, 35, 48, 0.16);
}

.budget-state-chip.is-current::before {
  background: rgba(255, 255, 255, 0.92);
}

.budget-state-chip.status-draft.is-current {
  background: #6b7280;
}

.budget-state-chip.status-sent.is-current {
  background: #1d6fd1;
}

.budget-state-chip.status-accepted.is-current {
  background: #2c8b4f;
}

.budget-state-chip.status-rejected.is-current {
  background: #bf3c3c;
}

.budget-state-chip.status-archived.is-current {
  background: #465463;
}

button.budget-state-chip {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

button.budget-state-chip.is-action:hover,
button.budget-state-chip.is-action:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 35, 52, 0.1);
  border-color: currentColor;
}

.budget-state-chip.is-disabled {
  opacity: 0.34;
  filter: saturate(0.45);
}

.budget-checkline {
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  background: rgba(238, 244, 242, 0.92);
  border: 1px solid rgba(205, 217, 221, 0.88);
}

.budget-side-card {
  padding: 0.95rem 1rem;
}

.budget-side-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
}

.budget-side-heading strong {
  font-size: 1rem;
}

.budget-composition-list,
.budget-history-list {
  display: grid;
  gap: 0.55rem;
}

.budget-history-summary {
  display: grid;
  gap: 0.18rem;
  padding: 0.76rem 0.82rem;
  border-radius: 14px;
  background: rgba(243, 247, 248, 0.96);
  border: 1px solid rgba(209, 220, 225, 0.88);
}

.budget-history-summary-main {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
}

.budget-composition-row,
.budget-history-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid rgba(209, 220, 225, 0.86);
}

.budget-composition-main,
.budget-history-main,
.budget-history-meta {
  display: grid;
  gap: 0.12rem;
}

.budget-history-meta {
  justify-items: end;
  text-align: right;
}

.secondary-info-panel {
  display: grid;
  gap: 0.8rem;
}

.secondary-info-panel > summary {
  list-style: none;
  cursor: pointer;
}

.secondary-info-panel > summary::-webkit-details-marker {
  display: none;
}

.secondary-info-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.secondary-info-summary div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.secondary-info-summary strong {
  color: var(--text);
  font-size: 0.98rem;
}

.secondary-info-summary > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.secondary-info-summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(227, 240, 236, 0.95);
  border: 1px solid rgba(190, 211, 204, 0.9);
}

.secondary-info-panel[open] > .secondary-info-summary {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(212, 222, 227, 0.85);
}

.secondary-info-panel[open] > .secondary-info-summary::after {
  content: "-";
}

/* Badges communicate state and only state. Neutral badges are for context, not emphasis. */
.badge,
.status-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  font-size: 0.79rem;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  white-space: nowrap;
}

.badge::before,
.status-pill::before,
.status-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

.status-badge.status-draft,
.status-badge.status-open,
.status-badge.status-submitted,
.status-pill.unknown {
  color: #78591b;
  background: #f8edcf;
  border-color: #e6cf92;
}

.status-badge.status-sent,
.status-badge.status-in_progress,
.status-badge.status-posted,
.status-badge.status-approved,
.status-pill.ok {
  color: #0a584a;
  background: #dff0ea;
  border-color: #abd5c6;
}

.status-badge.status-accepted,
.status-badge.status-done,
.status-badge.status-paid,
.status-badge.status-converted {
  color: #1a663c;
  background: #dff2e5;
  border-color: #acd6bb;
}

.status-badge.status-rejected,
.status-badge.status-cancelled,
.status-badge.status-void,
.status-pill.error {
  color: #8c2d2d;
  background: #f5dfdf;
  border-color: #e3b6b6;
}

.status-badge.status-archived,
.status-badge.status-unpaid {
  color: #5c6770;
  background: #edf1f3;
  border-color: #d0d9de;
}

.badge-neutral {
  color: var(--text-soft);
  background: var(--surface-soft);
  border-color: var(--line);
}

.badge-neutral::before {
  display: none;
}

.section-stack,
.stack-sm,
.stack-md,
.stack-lg,
.helper-list,
.form-shell,
.form-section,
.kiosk-steps,
.field-stack {
  display: grid;
}

.section-stack,
.stack-md,
.helper-list,
.form-shell,
.form-section,
.kiosk-steps {
  gap: 1rem;
}

.stack-sm {
  gap: 0.6rem;
}

.stack-lg {
  gap: 1.3rem;
}

.helper-list {
  margin: 0;
  padding-left: 1.1rem;
}

/* Forms: grouped, calm, dense enough for ERP use. */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-grid label,
.field-stack,
.form-section label {
  display: grid;
  gap: 0.42rem;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-soft);
}

.form-help,
.form-hint,
.kiosk-steps li {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-shell {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(212, 222, 227, 0.95);
}

.form-section {
  padding: 1rem;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid rgba(212, 222, 227, 0.8);
}

.form-section-compact {
  gap: 0.72rem;
  padding: 0.86rem;
}

.form-section-compact .field-grid {
  gap: 0.75rem;
}

.form-section-compact textarea {
  min-height: 96px;
}

.form-secondary-block {
  background: rgba(247, 250, 250, 0.88);
  border-style: dashed;
}

.form-muted-help {
  color: var(--muted);
  font-size: 0.84rem;
}

.material-combobox {
  position: relative;
  display: grid;
  gap: 0.3rem;
  margin: 0.38rem 0 0.45rem;
}

.material-combobox-input {
  width: 100%;
  min-height: 2.35rem;
  padding-right: 2rem;
  border-color: rgba(43, 107, 120, 0.5);
  background: rgba(250, 253, 253, 0.98);
}

.material-combobox-results {
  position: absolute;
  z-index: 40;
  top: calc(2.35rem + 0.25rem);
  right: 0;
  left: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid rgba(191, 207, 216, 0.96);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(20, 38, 48, 0.16);
}

.material-combobox-option {
  display: grid;
  width: 100%;
  gap: 0.08rem;
  min-height: 2.35rem;
  padding: 0.42rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.material-combobox-option:hover,
.material-combobox-option.is-active {
  background: rgba(229, 241, 244, 0.96);
}

.material-combobox-option span,
.material-combobox-meta,
.material-combobox-empty {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
}

.material-combobox-empty {
  padding: 0.45rem 0.55rem;
}

.material-catalog-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.tools-hub-head,
.tools-tool-head {
  align-items: flex-start;
}

.tools-hub-layout,
.proposal-tool-layout {
  display: grid;
  gap: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.tools-card {
  display: grid;
  gap: 0.45rem;
  min-height: 10rem;
  padding: 1rem;
  border: 1px solid rgba(210, 220, 226, 0.94);
  border-left: 4px solid rgba(111, 134, 147, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.tools-card:hover {
  border-color: rgba(91, 143, 155, 0.7);
  transform: translateY(-1px);
}

.tools-card-primary {
  border-left-color: #0e3a5d;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 250, 252, 0.96));
}

.tools-card-kicker,
.tools-card-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tools-card strong {
  font-size: 1.05rem;
}

.tools-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.35;
}

.tools-card-status {
  align-self: end;
  color: #0e3a5d;
}

.tools-empty {
  max-width: 34rem;
}

.proposal-tool-layout {
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  align-items: start;
}

.proposal-tool-panel,
.proposal-preview-panel {
  min-width: 0;
}

.proposal-linked-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(210, 220, 226, 0.92);
  border-radius: 14px;
  background: rgba(247, 250, 251, 0.86);
}

.proposal-client-combobox {
  position: relative;
  display: grid;
  gap: 0.25rem;
}

.proposal-client-search {
  width: 100%;
}

.proposal-client-results {
  position: absolute;
  z-index: 38;
  top: calc(2.35rem + 0.28rem);
  right: 0;
  left: 0;
  max-height: 15rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid rgba(191, 207, 216, 0.96);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(20, 38, 48, 0.16);
}

.proposal-client-option {
  display: grid;
  width: 100%;
  gap: 0.08rem;
  min-height: 2.35rem;
  padding: 0.42rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.proposal-client-option:hover,
.proposal-client-option.is-active {
  background: rgba(229, 241, 244, 0.96);
}

.proposal-client-option span,
.proposal-client-empty {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
}

.proposal-client-empty {
  padding: 0.45rem 0.55rem;
}

.proposal-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.proposal-items-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.proposal-items-head p {
  margin: 0.12rem 0 0;
}

.proposal-item-editor {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.proposal-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 0.32fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.proposal-download-button {
  width: 100%;
  margin-top: 1rem;
}

.proposal-tool-note {
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
}

.proposal-preview-scroll {
  overflow: auto;
  max-height: 78vh;
  padding: 0.75rem;
  border-radius: 14px;
  background: #eef3f5;
}

.proposal-pdf-page {
  width: min(100%, 820px);
  min-height: 980px;
  margin: 0 auto;
  padding: 2rem;
  background: #fff;
  color: #111;
  font-size: 0.82rem;
  line-height: 1.5;
  box-shadow: 0 18px 36px rgba(21, 39, 48, 0.12);
}

.proposal-pdf-header,
.proposal-pdf-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 1rem;
}

.proposal-pdf-header {
  align-items: start;
  margin-bottom: 1.8rem;
}

.proposal-pdf-logo {
  max-width: 220px;
  max-height: 70px;
}

.proposal-company-copy {
  margin: 0.45rem 0 0;
  color: #4a4a4a;
  font-size: 0.72rem;
  line-height: 1.4;
}

.proposal-title-block {
  display: grid;
  justify-items: end;
  gap: 0.25rem;
  color: #0b2545;
  text-align: right;
}

.proposal-title-block strong {
  font-size: 1.4rem;
  letter-spacing: 0.06em;
}

.proposal-title-block span {
  color: #555;
  font-size: 0.76rem;
}

.proposal-items-table,
.proposal-totals-table {
  width: 100%;
  border-collapse: collapse;
}

.proposal-items-table {
  margin-top: 1.2rem;
}

.proposal-items-table th {
  padding: 0.5rem;
  border: 1px solid #c5d3e8;
  background: #eef4f8;
  color: #0b2545;
  text-align: left;
}

.proposal-items-table th:last-child,
.proposal-items-table td:last-child,
.proposal-totals-table td:last-child {
  text-align: right;
}

.proposal-items-table td,
.proposal-totals-table td {
  padding: 0.5rem;
  border: 1px solid #d3d3d3;
  vertical-align: top;
}

.proposal-totals-table {
  width: 45%;
  margin-top: 1.2rem;
  margin-left: auto;
}

.proposal-grand-total td {
  background: #0b2545;
  color: #fff;
  font-weight: 800;
}

.proposal-pdf-footer {
  margin-top: 2.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid #ccc;
  color: #555;
  font-size: 0.68rem;
}

.modal-form-context-banner {
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
}

.form-section + .form-section,
.form-actions {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.form-section h3,
.form-section p {
  margin: 0;
}

.field-grid {
  display: grid;
  gap: 1rem;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 95, 83, 0.55);
  box-shadow: var(--focus-ring);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: rgba(178, 59, 59, 0.7);
  box-shadow: 0 0 0 3px rgba(178, 59, 59, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #7a8c96;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input[type="file"] {
  padding: 0.6rem 0.75rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  min-height: auto;
  accent-color: var(--accent);
}

/* Operational tables: sticky head, calm zebra, clear hover, no decorative density. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(212, 222, 227, 0.92);
  border-radius: 14px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap table {
  min-width: 720px;
}

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

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

tbody tr:nth-child(even) {
  background: rgba(14, 90, 80, 0.012);
}

tbody tr:hover {
  background: rgba(14, 90, 80, 0.032);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody td[colspan] {
  padding: 1.1rem 0.9rem;
  color: var(--muted);
  text-align: center;
}

.actions,
.form-actions,
.action-cluster {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.actions a:not(.button):not(.link-button),
.table-actions a:not(.button):not(.link-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 0.78rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-ink);
  font-weight: 700;
}

.actions a:not(.button):not(.link-button):hover,
.table-actions a:not(.button):not(.link-button):hover {
  background: var(--surface-soft);
}

.actions form,
.inline-form {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.inline-form input,
.inline-form select {
  width: auto;
  min-width: 120px;
}

.form-actions {
  justify-content: flex-end;
}

.muted,
.table-note,
.empty-state,
.list-empty {
  color: var(--muted);
}

.metric-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-meta {
  margin-top: 0.35rem;
}

.smoke-card.status-ok,
.stat-card.status-ok {
  border-color: rgba(29, 122, 70, 0.3);
}

.smoke-card.status-error,
.stat-card.status-error {
  border-color: rgba(178, 59, 59, 0.3);
}

.list-empty {
  padding: 0.75rem 0;
}

.kiosk-shell {
  max-width: 620px;
}

.kiosk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.kiosk-actions button {
  min-height: 3.4rem;
  font-size: 1rem;
}

.kiosk-actions button:last-child {
  background: #204d74;
}

.toolbar {
  margin-bottom: 1rem;
}

.note-box,
.context-banner {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(14, 90, 80, 0.16);
  background: linear-gradient(180deg, #f5faf8 0%, var(--accent-soft) 100%);
}

.context-banner strong {
  display: block;
  margin-bottom: 0.2rem;
}

.finance-page-head {
  padding: 0.9rem 1.05rem;
  margin-bottom: 0.15rem;
}

.finance-page-head .page-subtitle {
  max-width: 62ch;
  font-size: 0.92rem;
}

.finance-signal-grid,
.finance-filter-summary,
.finance-link-row,
.finance-badge-row,
.finance-detail-pills,
.finance-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.finance-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.finance-signal-card {
  padding: 0.88rem 0.95rem;
}

.finance-signal-card strong {
  font-size: 1.45rem;
}

.finance-signal-card.is-alert {
  border-color: #ebd49d;
  background: linear-gradient(180deg, #fffaf0 0%, #f9f0cf 100%);
}

.finance-signal-card.is-positive {
  border-color: #bcd8c7;
  background: linear-gradient(180deg, #f8fcf9 0%, #e4f2e9 100%);
}

.finance-signal-card.is-neutral {
  border-color: rgba(199, 210, 217, 0.92);
  background: linear-gradient(180deg, #fbfcfc 0%, #f1f5f6 100%);
}

.finance-signal-card.is-danger {
  border-color: #ddb7b7;
  background: linear-gradient(180deg, #fff8f8 0%, #f5e1e1 100%);
}

.finance-dashboard-head {
  align-items: end;
}

.finance-dashboard-filter-card {
  gap: 0.95rem;
}

.finance-dashboard-preset-row {
  justify-content: flex-end;
}

.finance-preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(203, 214, 220, 0.92);
  background: rgba(247, 250, 250, 0.96);
  color: var(--text);
  font-weight: 700;
}

.finance-preset-chip.is-active {
  border-color: rgba(14, 90, 80, 0.24);
  background: rgba(228, 242, 235, 0.96);
  color: var(--accent-strong);
}

.finance-dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.finance-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.finance-dashboard-main,
.finance-dashboard-side,
.finance-dashboard-category-list,
.finance-dashboard-movement-list {
  display: grid;
  gap: 1rem;
}

.finance-dashboard-legend {
  align-items: center;
}

.finance-legend-chip {
  border-color: rgba(208, 219, 224, 0.9);
}

.finance-legend-chip.is-income {
  color: #1f7b5a;
}

.finance-legend-chip.is-expense {
  color: #9b4d2b;
}

.finance-dashboard-chart-card {
  padding: 0.7rem 0.2rem 0.15rem;
  border-radius: 18px;
  border: 1px solid rgba(211, 221, 226, 0.9);
  background: linear-gradient(180deg, rgba(248, 251, 251, 0.98) 0%, rgba(243, 247, 248, 0.98) 100%);
}

.finance-trend-chart {
  width: 100%;
  height: auto;
  display: block;
}

.finance-chart-grid {
  stroke: rgba(201, 212, 218, 0.78);
  stroke-width: 1;
}

.finance-chart-axis-line {
  stroke: rgba(164, 178, 186, 0.92);
  stroke-width: 1.2;
}

.finance-chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-chart-line.is-income,
.finance-chart-dot.is-income {
  stroke: #1f7b5a;
  fill: #1f7b5a;
}

.finance-chart-line.is-expense,
.finance-chart-dot.is-expense {
  stroke: #9b4d2b;
  fill: #9b4d2b;
}

.finance-chart-axis {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.finance-chart-axis-y {
  text-anchor: end;
}

.finance-dashboard-movement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 1px solid rgba(214, 223, 228, 0.9);
}

.finance-dashboard-movement:first-child {
  padding-top: 0;
  border-top: 0;
}

.finance-dashboard-movement-main,
.finance-dashboard-movement-amount,
.finance-dashboard-category-item {
  display: grid;
  gap: 0.35rem;
}

.finance-dashboard-movement-amount {
  justify-items: end;
  align-content: start;
}

.finance-dashboard-movement-amount strong {
  font-size: 1.04rem;
}

.finance-dashboard-category-item {
  gap: 0.45rem;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(214, 223, 228, 0.9);
}

.finance-dashboard-category-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.finance-dashboard-category-head,
.finance-dashboard-category-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.finance-dashboard-category-head strong {
  font-size: 0.98rem;
}

.finance-dashboard-category-bar {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(231, 237, 240, 0.96);
  overflow: hidden;
}

.finance-dashboard-category-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5c77c 0%, #c7855d 100%);
}

.finance-dashboard-empty {
  background: rgba(242, 246, 247, 0.96);
}

.purchase-page-head {
  margin-bottom: 0.2rem;
}

.purchase-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.purchase-signal-card.is-review {
  border-color: #d8cba5;
  background: linear-gradient(180deg, #fffdf7 0%, #f7f0dc 100%);
}

.purchase-signal-card.is-action {
  border-color: #cad9e0;
  background: linear-gradient(180deg, #fbfcfd 0%, #eef4f6 100%);
}

.purchase-signal-card.is-danger {
  border-color: #dfc4c4;
  background: linear-gradient(180deg, #fff9f9 0%, #f6e8e8 100%);
}

.purchase-signal-card.is-positive {
  border-color: #bed6c7;
  background: linear-gradient(180deg, #f8fcf9 0%, #e6f1ea 100%);
}

.purchase-filter-drawer {
  gap: 0.85rem;
}

.purchase-filter-drawer summary {
  list-style: none;
  cursor: pointer;
}

.purchase-filter-drawer summary::-webkit-details-marker {
  display: none;
}

.purchase-filter-toggle {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.purchase-filter-toggle-copy {
  display: grid;
  gap: 0.12rem;
}

.purchase-filter-toggle-copy strong {
  font-size: 1rem;
}

.purchase-filter-drawer[open] .purchase-filter-toggle {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(212, 222, 227, 0.88);
}

.purchase-filter-summary,
.purchase-link-row,
.purchase-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.purchase-table-title,
.purchase-status-stack,
.purchase-action-callout,
.purchase-hero-main,
.purchase-hero-actions,
.purchase-timeline,
.purchase-receipt-log {
  display: grid;
}

.purchase-table-title,
.purchase-status-stack,
.purchase-timeline,
.purchase-receipt-log {
  gap: 0.38rem;
}

.purchase-status-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
}

.purchase-trace-inline {
  display: grid;
  gap: 0.12rem;
  padding: 0.65rem 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(246, 249, 250, 0.96);
}

.purchase-trace-inline strong {
  font-size: 0.85rem;
}

.purchase-trace-inline span {
  color: var(--text-soft);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.purchase-trace-inline.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-trace-inline.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-trace-inline.is-danger {
  border-color: rgba(225, 196, 196, 0.92);
  background: rgba(251, 241, 241, 0.96);
}

.purchase-trace-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.purchase-fulfillment-note {
  display: grid;
  gap: 0.14rem;
  padding: 0.66rem 0.74rem;
  border-radius: 12px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(246, 249, 250, 0.96);
}

.purchase-fulfillment-note strong {
  font-size: 0.85rem;
}

.purchase-fulfillment-note span {
  color: var(--text-soft);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.purchase-fulfillment-note.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-fulfillment-note.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-fulfillment-note.is-danger {
  border-color: rgba(225, 196, 196, 0.92);
  background: rgba(251, 241, 241, 0.96);
}

.purchase-inline-meta {
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.purchase-flag,
.purchase-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-size: 0.76rem;
  font-weight: 800;
}

.purchase-flag::before,
.purchase-ok::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.84;
}

.purchase-flag.is-warning {
  color: #7c5a16;
}

.purchase-flag.is-danger {
  color: #8f3131;
}

.purchase-ok {
  color: #4f7867;
}

.purchase-action-callout {
  gap: 0.22rem;
  padding: 0.78rem 0.84rem;
  border-radius: 14px;
  border: 1px solid rgba(205, 216, 221, 0.92);
  background: rgba(243, 247, 248, 0.96);
}

.purchase-action-callout.is-urgent {
  border-color: rgba(229, 204, 132, 0.95);
  background: linear-gradient(180deg, rgba(251, 247, 233, 0.98) 0%, rgba(247, 238, 206, 0.95) 100%);
}

.purchase-action-callout strong {
  font-size: 0.98rem;
}

.purchase-action-callout span {
  color: var(--text-soft);
}

.purchase-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.purchase-hero-main {
  gap: 0.85rem;
  padding: 1.2rem 1.25rem;
  border-radius: 20px;
  border: 1px solid rgba(205, 216, 221, 0.92);
  background: linear-gradient(180deg, rgba(250, 252, 252, 0.98) 0%, rgba(244, 248, 249, 0.98) 100%);
  box-shadow: var(--shadow-sm);
}

.purchase-hero-main h2 {
  margin-bottom: 0;
}

.purchase-hero-pills,
.purchase-hero-secondary-grid {
  gap: 0.5rem;
}

.purchase-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.purchase-hero-actions {
  gap: 0.8rem;
}

.purchase-hero-back {
  justify-self: end;
}

.purchase-hero-action-grid,
.purchase-hero-secondary-grid {
  display: grid;
  gap: 0.7rem;
}

.purchase-decision-card {
  border-radius: 18px;
}

.purchase-shell {
  align-items: start;
}

.purchase-focus-card.is-quiet .context-banner {
  border-color: rgba(184, 212, 194, 0.92);
  background: linear-gradient(180deg, #f6fbf8 0%, #e9f3ed 100%);
}

.purchase-side-card-quiet .budget-checkline {
  background: rgba(236, 245, 239, 0.96);
  border-color: rgba(182, 212, 194, 0.9);
}

.purchase-trace-summary.is-positive {
  background: rgba(236, 245, 239, 0.96);
  border-color: rgba(182, 212, 194, 0.9);
}

.purchase-fulfillment-card.is-quiet .purchase-fulfillment-callout {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-fulfillment-callout {
  display: grid;
  gap: 0.22rem;
  padding: 0.82rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(246, 249, 250, 0.96);
}

.purchase-fulfillment-callout strong {
  font-size: 1rem;
}

.purchase-fulfillment-callout span {
  color: var(--text-soft);
}

.purchase-fulfillment-callout.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-fulfillment-callout.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-fulfillment-callout.is-danger {
  border-color: rgba(225, 196, 196, 0.92);
  background: rgba(251, 241, 241, 0.96);
}

.purchase-fulfillment-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.purchase-procedure-callout,
.purchase-action-note,
.purchase-empty-state,
.purchase-receipt-event {
  display: grid;
  gap: 0.24rem;
  padding: 0.82rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(246, 249, 250, 0.96);
}

.purchase-procedure-callout strong,
.purchase-action-note strong,
.purchase-empty-state strong,
.purchase-receipt-event strong {
  font-size: 0.94rem;
}

.purchase-procedure-callout.is-positive,
.purchase-action-note.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-procedure-callout.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-action-note.is-muted,
.purchase-empty-state {
  background: rgba(248, 250, 251, 0.96);
}

.purchase-procedure-card {
  gap: 0.85rem;
}

.purchase-procedure-stats,
.purchase-receipt-feed {
  display: grid;
  gap: 0.7rem;
}

.purchase-procedure-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.purchase-manage-button {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.purchase-manage-button.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-manage-button.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-manage-button.is-danger-soft {
  border-color: rgba(225, 196, 196, 0.92);
  background: rgba(251, 241, 241, 0.96);
}

.purchase-manage-state {
  display: grid;
  gap: 0.16rem;
  font-size: var(--font-size-sm);
}

.purchase-manage-state strong {
  font-size: 0.86rem;
}

.purchase-manage-state.is-positive strong {
  color: #2c6a4b;
}

.purchase-manage-state.is-warning strong {
  color: #7c5a16;
}

.purchase-manage-state.is-danger-soft strong {
  color: #8f3131;
}

.purchase-operational-state,
.purchase-operational-lane,
.purchase-operational-row,
.purchase-operational-hint,
.purchase-operational-row-copy,
.purchase-operational-head,
.purchase-operational-list,
.purchase-operational-form {
  display: grid;
}

.purchase-operational-state,
.purchase-operational-lane {
  gap: 0.55rem;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(247, 250, 251, 0.98);
}

.purchase-operational-state.is-positive,
.purchase-operational-lane.is-positive,
.purchase-operational-row.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-operational-state.is-empty,
.purchase-operational-lane.is-warning,
.purchase-operational-row.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-operational-lane.is-muted,
.purchase-operational-row.is-muted {
  background: rgba(248, 250, 251, 0.98);
}

.purchase-operational-state strong,
.purchase-operational-head strong,
.purchase-operational-row strong {
  font-size: 0.96rem;
}

.purchase-operational-grid {
  display: none;
}

.purchase-operational-list {
  gap: 0.65rem;
}

.purchase-operational-row {
  gap: 0.55rem;
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.88);
}

.purchase-operational-row-copy,
.purchase-operational-hint {
  gap: 0.18rem;
}

.purchase-operational-hint {
  font-size: var(--font-size-sm);
  color: var(--text-soft);
  font-weight: 700;
}

.purchase-operational-form {
  gap: 0.55rem;
}

.purchase-operational-form button {
  width: 100%;
}

.purchase-operational-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.purchase-modal {
  width: min(720px, calc(100vw - 2rem));
  border: 0;
  padding: 0;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(16, 31, 36, 0.28);
}

.purchase-modal::backdrop {
  background: rgba(17, 24, 27, 0.45);
}

.purchase-modal-card,
.purchase-modal-head,
.purchase-modal-copy,
.purchase-modal-form,
.purchase-modal-options,
.purchase-modal-note,
.purchase-modal-history {
  display: grid;
}

.purchase-modal-card {
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 251, 0.98) 100%);
}

.purchase-modal-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
}

.purchase-modal-copy {
  gap: 0.2rem;
}

.purchase-modal-copy h3,
.purchase-modal-copy p {
  margin: 0;
}

.purchase-modal-note,
.purchase-modal-history {
  gap: 0.25rem;
  padding: 0.82rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(247, 250, 251, 0.98);
}

.purchase-modal-form,
.purchase-modal-options {
  gap: 0.75rem;
}

.purchase-modal-paths {
  display: grid;
  gap: 0.72rem;
}

.purchase-path,
.purchase-path-copy,
.purchase-path-actions,
.purchase-path-option-grid,
.purchase-path-inline-form {
  display: grid;
}

.purchase-path {
  gap: 0.7rem;
  padding: 0.82rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(247, 250, 251, 0.98);
}

.purchase-path-copy {
  gap: 0.18rem;
}

.purchase-path-copy strong {
  font-size: 0.94rem;
}

.purchase-path-copy span,
.purchase-path-note {
  color: var(--text-soft);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.purchase-path-actions,
.purchase-path-option-grid {
  gap: 0.6rem;
}

.purchase-path-option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-path-form {
  display: grid;
  gap: 0.5rem;
}

.purchase-path-inline-form {
  gap: 0.45rem;
}

.purchase-path-form textarea {
  min-height: 2.7rem;
}

.purchase-path-inline-form button,
.purchase-path-actions > .button,
.purchase-path-actions > button {
  width: 100%;
}

.purchase-path.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.purchase-path.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-path.is-manual {
  border-color: rgba(228, 188, 160, 0.92);
  background: rgba(252, 243, 237, 0.96);
}

.purchase-path.is-muted {
  border-color: rgba(210, 220, 226, 0.9);
  background: rgba(247, 250, 251, 0.98);
}

.purchase-path.is-positive strong {
  color: #2c6a4b;
}

.purchase-path.is-warning strong {
  color: #7c5a16;
}

.purchase-path.is-manual strong {
  color: #a45522;
}

.purchase-path.is-muted strong {
  color: var(--text-soft);
}

.purchase-path.is-manual button.secondary {
  border-color: rgba(214, 182, 160, 0.96);
  background: rgba(248, 238, 231, 0.98);
}

.purchase-path.is-muted .purchase-path-note {
  color: var(--muted);
}

.purchase-item-links {
  margin-top: 0.45rem;
}

.purchase-action-note {
  margin-bottom: 0.6rem;
}

.purchase-action-note.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.purchase-regularization-stack {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.purchase-link-material-form,
.purchase-create-material-form {
  display: grid;
  gap: 0.45rem;
}

.purchase-link-material-form button,
.purchase-create-material-form button {
  width: 100%;
}

.purchase-action-note a,
.purchase-receipt-event-meta a {
  font-weight: 700;
}

.purchase-receipt-event-main,
.purchase-receipt-event-meta {
  display: grid;
  gap: 0.35rem;
}

.purchase-edit-locked {
  margin-top: -0.2rem;
  padding: 0.15rem 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.purchase-timeline-item {
  display: grid;
  gap: 0.18rem;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(213, 222, 227, 0.9);
}

.purchase-timeline-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.purchase-inline-receive textarea {
  min-height: 70px;
}

.project-engineering-summary-card,
.project-engineering-overview,
.project-engineering-overview-copy,
.project-engineering-reading-list,
.project-engineering-reading-card,
.project-engineering-reading-head,
.project-engineering-reading-title,
.project-engineering-reading-actions,
.project-engineering-modal-card,
.project-engineering-modal-head,
.project-engineering-modal-form,
.project-engineering-empty {
  display: grid;
}

.project-engineering-summary-grid,
.project-engineering-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-engineering-head h2,
.project-engineering-reading-title h3,
.project-engineering-modal-head h3 {
  margin-bottom: 0;
}

.project-engineering-head .muted {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.project-engineering-head {
  margin-bottom: 1.25rem;
}

.project-engineering-head .eyebrow {
  margin-bottom: 0.45rem;
}

.project-engineering-head h2 {
  font-size: clamp(2rem, 3.2vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.project-engineering-overview {
  gap: 1.15rem;
  padding: 1.15rem 1.4rem;
  border: 1px solid rgba(214, 223, 228, 0.92);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(248, 250, 251, 0.99) 100%);
  box-shadow: 0 14px 36px rgba(16, 31, 36, 0.045);
}

.project-engineering-overview-copy {
  gap: 0.35rem;
}

.project-engineering-overview-copy h3 {
  font-size: 1.45rem;
  line-height: 1.18;
  margin-bottom: 0;
}

.project-engineering-overview-stats .detail-item {
  min-height: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(222, 229, 233, 0.88);
  background: rgba(251, 252, 253, 0.92);
}

.project-engineering-overview-stats .detail-value {
  font-size: 1.45rem;
}

.project-engineering-overview-actions {
  display: flex;
  justify-content: flex-start;
}

.project-engineering-overview-actions .button {
  min-height: 2.8rem;
  padding-inline: 1.15rem;
  font-size: 0.98rem;
  box-shadow: 0 10px 24px rgba(20, 64, 55, 0.12);
}

.project-engineering-reading {
  display: grid;
  gap: 1.15rem;
}

.project-engineering-reading-list {
  gap: 1.2rem;
}

.project-engineering-reading-card {
  gap: 0.85rem;
  padding: 1.2rem 1.35rem;
  border-radius: 20px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(249, 251, 252, 0.99) 100%);
  box-shadow: 0 10px 24px rgba(16, 31, 36, 0.05);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.project-engineering-reading-card:hover {
  border-color: rgba(196, 209, 216, 0.98);
  box-shadow: 0 14px 32px rgba(16, 31, 36, 0.07);
}

.project-engineering-reading-card:focus-within {
  border-color: rgba(106, 142, 156, 0.95);
  box-shadow: 0 0 0 3px rgba(111, 145, 157, 0.14), 0 14px 32px rgba(16, 31, 36, 0.08);
}

.project-engineering-reading-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: start;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(230, 235, 238, 0.82);
}

.project-engineering-reading-title {
  gap: 0.28rem;
}

.project-engineering-reading-title h3 {
  font-size: 1.5rem;
  line-height: 1.22;
}

.project-engineering-reading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  align-items: flex-start;
}

.project-engineering-reading-actions .button,
.project-engineering-reading-actions button {
  min-height: 2.45rem;
  padding-inline: 0.9rem;
  border-radius: 12px;
  font-size: 0.95rem;
}

.project-engineering-reading-actions .button.secondary {
  background: rgba(248, 250, 251, 0.98);
  border-color: rgba(209, 220, 226, 0.96);
}

.project-engineering-reading-actions .button.secondary:hover,
.project-engineering-reading-actions .button.secondary:focus-visible {
  background: rgba(243, 247, 249, 0.99);
  border-color: rgba(182, 199, 208, 0.96);
}

.project-engineering-reading-actions .danger {
  border-color: rgba(223, 197, 197, 0.92);
  background: rgba(251, 244, 244, 0.96);
  color: #7d4545;
}

.project-engineering-reading-actions .danger:hover,
.project-engineering-reading-actions .danger:focus-visible {
  border-color: rgba(209, 179, 179, 0.95);
  background: rgba(248, 238, 238, 0.98);
}

.project-engineering-reading-meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.5;
  font-weight: 700;
}

.project-engineering-reading-body {
  white-space: pre-wrap;
  line-height: 1.92;
  color: #22313a;
  font-size: 1.12rem;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(249, 251, 252, 0.99) 0%, rgba(246, 249, 250, 0.99) 100%);
  border: 1px solid rgba(224, 230, 234, 0.94);
  max-width: none;
}

.project-engineering-order {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.9rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(232, 238, 242, 0.95);
  border: 1px solid rgba(205, 216, 222, 0.92);
  color: #475762;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.project-engineering-modal {
  width: min(920px, calc(100vw - 2rem));
  border: 0;
  padding: 0;
  border-radius: 22px;
  box-shadow: 0 28px 84px rgba(16, 31, 36, 0.28);
}

.project-engineering-modal::backdrop {
  background: rgba(17, 24, 27, 0.48);
}

.project-engineering-modal-card {
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 250, 251, 0.985) 100%);
  border: 1px solid rgba(218, 226, 231, 0.95);
}

.project-engineering-modal-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(230, 235, 238, 0.82);
}

.project-engineering-modal-head p,
.project-engineering-modal-head h3 {
  margin-top: 0;
}

.project-engineering-modal-head h3 {
  font-size: 1.38rem;
}

.project-engineering-modal-form {
  gap: 0.9rem;
}

.project-engineering-modal-form label {
  font-size: 1rem;
  font-weight: 800;
}

.project-engineering-modal-form input,
.project-engineering-modal-form textarea {
  font-size: 1rem;
}

.project-engineering-modal-form input:focus-visible,
.project-engineering-modal-form textarea:focus-visible,
.project-engineering-overview-actions .button:focus-visible,
.project-engineering-reading-actions .button:focus-visible,
.project-engineering-reading-actions button:focus-visible,
.project-engineering-modal-head .button:focus-visible {
  outline: 3px solid rgba(108, 141, 153, 0.24);
  outline-offset: 2px;
}

.project-engineering-modal-form textarea {
  min-height: 210px;
}

.project-engineering-empty {
  gap: 0.6rem;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  border: 1px dashed rgba(204, 215, 221, 0.95);
  background: rgba(248, 250, 251, 0.92);
}

.project-engineering-empty strong {
  font-size: 1.08rem;
}

.journal-modal,
.journal-submodal {
  border: 0;
  padding: 0;
  border-radius: 22px;
  box-shadow: 0 28px 84px rgba(16, 31, 36, 0.28);
}

.journal-modal {
  width: min(880px, calc(100vw - 2rem));
}

.journal-submodal {
  width: min(680px, calc(100vw - 2rem));
}

.journal-modal::backdrop,
.journal-submodal::backdrop {
  background: rgba(17, 24, 27, 0.48);
}

.journal-modal-card,
.journal-modal-head,
.journal-modal-copy,
.journal-modal-main,
.journal-modal-history,
.journal-entry-list,
.journal-entry,
.journal-composer,
.journal-composer-tools,
.journal-attachment-fields,
.journal-submodal-card,
.journal-submodal-head {
  display: grid;
}

.journal-modal-card,
.journal-submodal-card {
  gap: 0.95rem;
  padding: 1.1rem 1.15rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 250, 251, 0.985) 100%);
  border: 1px solid rgba(218, 226, 231, 0.95);
}

.journal-modal-head,
.journal-submodal-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(230, 235, 238, 0.82);
}

.journal-modal-copy {
  gap: 0.18rem;
}

.journal-modal-copy h3,
.journal-modal-copy p,
.journal-submodal-head h3,
.journal-submodal-head p {
  margin: 0;
}

.journal-modal-main {
  gap: 0.95rem;
}

.journal-modal-history {
  gap: 0.6rem;
}

.journal-modal-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.journal-entry-list {
  gap: 0.6rem;
  max-height: 360px;
  overflow: auto;
  padding-right: 0.18rem;
}

.journal-entry,
.journal-entry-empty,
.journal-submodal-body {
  border-radius: 16px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(249, 251, 252, 0.98);
}

.journal-entry {
  gap: 0.45rem;
  padding: 0.82rem 0.9rem;
  border-left: 3px solid rgba(209, 220, 226, 0.94);
}

.journal-entry.is-milestone {
  border-color: rgba(229, 204, 132, 0.95);
  background: linear-gradient(180deg, rgba(252, 248, 236, 0.99) 0%, rgba(249, 244, 225, 0.98) 100%);
  border-left-width: 6px;
  border-left-color: #c38d17;
  box-shadow: inset 0 0 0 1px rgba(229, 204, 132, 0.26), 0 10px 24px rgba(167, 128, 29, 0.08);
}

.journal-entry-top,
.journal-entry-foot {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.journal-entry-top {
  justify-content: space-between;
  align-items: start;
}

.journal-entry-topline {
  display: grid;
  gap: 0.14rem;
}

.journal-entry-date {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.journal-entry-kicker {
  color: #8a6310;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.journal-entry-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.16rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(229, 204, 132, 0.95);
  background: linear-gradient(180deg, #f2d06f 0%, #e5b84a 100%);
  color: #563f0b;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 rgba(93, 65, 11, 0.14);
}

.journal-entry-body,
.journal-submodal-body {
  white-space: pre-wrap;
  line-height: 1.62;
}

.journal-entry-body {
  font-size: 0.95rem;
  color: #20333b;
}

.journal-entry-author {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.journal-entry-empty {
  display: grid;
  gap: 0.25rem;
  padding: 0.92rem 0.96rem;
}

.journal-composer {
  gap: 0.8rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(230, 235, 238, 0.82);
}

.journal-composer-feedback {
  padding: 0.72rem 0.82rem;
  border-radius: 12px;
  border: 1px solid rgba(225, 196, 196, 0.95);
  background: rgba(251, 242, 242, 0.98);
  color: #8c3b3b;
  font-weight: 700;
}

.journal-composer-feedback[hidden] {
  display: none !important;
}

.journal-composer textarea {
  min-height: 110px;
}

.journal-attachment-fields textarea {
  min-height: 120px;
}

.journal-composer-tools {
  gap: 0.55rem;
}

.journal-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.journal-attachment-fields {
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(248, 250, 251, 0.96);
}

.journal-attachment-fields[hidden] {
  display: none !important;
}

.journal-submodal-body {
  padding: 0.95rem 1rem;
  max-height: 55vh;
  overflow: auto;
  font-size: 0.96rem;
  color: #22323a;
}

.journal-summary-card,
.journal-summary-head,
.journal-summary-body {
  display: grid;
}

.journal-summary-card {
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(250, 252, 253, 0.95);
}

.journal-summary-card.is-milestone {
  border-color: rgba(229, 204, 132, 0.95);
  background: linear-gradient(180deg, rgba(252, 248, 236, 0.98) 0%, rgba(248, 244, 230, 0.96) 100%);
  box-shadow: inset 0 0 0 1px rgba(229, 204, 132, 0.2);
}

.journal-summary-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
}

.journal-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.18rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.journal-summary-body {
  gap: 0.35rem;
}

.journal-summary-flag {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.journal-summary-kicker {
  color: #7f5d12;
  font-size: 0.78rem;
  font-weight: 800;
}

.journal-summary-body p {
  margin: 0;
  color: #22323a;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journal-summary-empty {
  color: var(--text-soft);
  font-weight: 700;
}

.journal-summary-badge {
  width: fit-content;
}

.project-engineering-empty .button:hover,
.project-engineering-overview-actions .button:hover {
  transform: translateY(-1px);
}

.project-hub-shell,
.project-hub-hero,
.project-hub-hero-main,
.project-hub-hero-copy,
.project-hub-hero-actions,
.project-hub-metric-grid,
.project-hub-crosslinks,
.project-hub-attention-card,
.project-hub-alert-list,
.project-hub-alert,
.project-hub-alert-copy,
.project-hub-module-grid,
.project-hub-module-card,
.project-hub-module-head,
.project-hub-module-meta,
.project-hub-module-list,
.project-hub-module-row,
.project-hub-bottom,
.project-hub-activity-card,
.project-hub-activity-list,
.project-hub-activity-row,
.project-hub-context-card,
.project-hub-context-grid,
.project-hub-context-links,
.project-hub-notes {
  display: grid;
}

.project-hub-shell {
  gap: 1.1rem;
}

.project-hub-hero {
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border-radius: 22px;
  border: 1px solid rgba(210, 220, 226, 0.94);
  background:
    radial-gradient(circle at top right, rgba(239, 246, 248, 0.9), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 250, 251, 0.99) 100%);
  box-shadow: 0 14px 36px rgba(16, 31, 36, 0.05);
}

.project-hub-hero-main {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 1.2rem;
  align-items: start;
}

.project-hub-hero-copy {
  gap: 0.72rem;
}

.project-hub-hero-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.project-hub-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 3.1vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.project-hub-subtitle,
.project-hub-status-detail {
  margin: 0;
}

.project-hub-subtitle {
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 700;
}

.project-hub-status-detail {
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 62ch;
}

.project-hub-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.22rem 0.82rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(206, 218, 224, 0.95);
  background: rgba(244, 247, 248, 0.98);
  color: #44545d;
}

.project-hub-state-badge.is-positive {
  background: rgba(235, 245, 239, 0.98);
  border-color: rgba(183, 210, 193, 0.96);
  color: #365d4b;
}

.project-hub-state-badge.is-warning {
  background: rgba(251, 246, 230, 0.99);
  border-color: rgba(230, 205, 135, 0.96);
  color: #75571e;
}

.project-hub-state-badge.is-danger {
  background: rgba(251, 240, 240, 0.99);
  border-color: rgba(226, 194, 194, 0.96);
  color: #863d3d;
}

.project-hub-state-badge.is-neutral {
  background: rgba(242, 246, 248, 0.98);
  border-color: rgba(209, 219, 225, 0.96);
  color: #46565f;
}

.project-hub-facts,
.project-hub-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-hub-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.1rem;
  padding: 0.32rem 0.74rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 221, 226, 0.94);
  background: rgba(248, 250, 251, 0.98);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
}

.project-hub-fact strong {
  color: var(--text);
  font-weight: 900;
}

.project-hub-hero-actions {
  gap: 0.8rem;
  justify-items: end;
  align-content: start;
}

.project-hub-action-group {
  justify-content: flex-end;
}

.project-hub-action-group .button,
.project-hub-action-group .back-link {
  min-height: 2.6rem;
}

.project-hub-action-group-primary .button:first-child {
  box-shadow: 0 10px 24px rgba(20, 64, 55, 0.14);
}

.primary-flow-action {
  order: -1;
  display: grid;
  justify-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.primary-flow-action .button {
  width: 100%;
}

.secondary-actions-panel {
  width: 100%;
  justify-self: stretch;
}

.compact-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.compact-link-list .button,
.compact-link-list .back-link {
  width: 100%;
}

.project-hub-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.82rem;
}

.project-hub-metric-card {
  display: grid;
  gap: 0.1rem;
  min-height: 100%;
  padding: 0.92rem 0.98rem;
  border-radius: 16px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(250, 252, 253, 0.95);
}

.project-hub-metric-card span,
.project-hub-metric-card small {
  color: var(--text-soft);
  font-weight: 700;
}

.project-hub-metric-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.project-hub-crosslinks {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.project-hub-crosslinks a {
  display: grid;
  gap: 0.16rem;
  min-height: 100%;
  padding: 0.86rem 0.92rem;
  border-radius: 15px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(251, 252, 253, 0.94);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.project-hub-crosslinks a:hover,
.project-hub-crosslinks a:focus-visible,
.project-hub-module-row:hover,
.project-hub-module-row:focus-visible,
.project-hub-activity-row:hover,
.project-hub-activity-row:focus-visible {
  border-color: rgba(186, 201, 208, 0.98);
  box-shadow: 0 10px 24px rgba(16, 31, 36, 0.06);
  transform: translateY(-1px);
  text-decoration: none;
}

.project-hub-crosslinks strong {
  font-size: 0.92rem;
}

.project-hub-crosslinks span {
  font-size: 0.82rem;
  color: var(--text-soft);
  font-weight: 700;
}

.project-hub-section-head h3 {
  margin-bottom: 0.18rem;
}

.project-hub-attention-card {
  gap: 0.9rem;
}

.project-hub-alert-list {
  gap: 0.72rem;
}

.project-hub-alert {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(248, 250, 251, 0.98);
}

.project-hub-alert.is-warning {
  border-color: rgba(229, 204, 132, 0.95);
  background: rgba(251, 247, 233, 0.98);
}

.project-hub-alert.is-danger {
  border-color: rgba(225, 196, 196, 0.95);
  background: rgba(251, 242, 242, 0.98);
}

.project-hub-alert.is-neutral {
  border-color: rgba(205, 216, 222, 0.95);
  background: rgba(245, 248, 249, 0.98);
}

.project-hub-alert-copy {
  gap: 0.18rem;
}

.project-hub-alert-copy p,
.project-hub-alert-empty span,
.project-hub-module-detail,
.project-hub-notes-body {
  margin: 0;
}

.project-hub-alert-copy strong,
.project-hub-alert-empty strong {
  font-size: 1rem;
}

.project-hub-alert-empty {
  display: grid;
  gap: 0.18rem;
  padding: 0.92rem 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(205, 216, 222, 0.96);
  background: rgba(247, 250, 251, 0.95);
}

.project-hub-module-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.project-hub-module-card {
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(255, 255, 255, 0.995);
  box-shadow: 0 10px 26px rgba(16, 31, 36, 0.045);
}

.project-hub-module-card.is-positive {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 252, 249, 0.99) 100%);
}

.project-hub-module-card.is-warning {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(252, 249, 240, 0.99) 100%);
}

.project-hub-module-card.is-danger {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(252, 245, 245, 0.99) 100%);
}

.project-hub-module-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: 0.82rem;
  border-bottom: 1px solid rgba(224, 231, 235, 0.94);
}

.project-hub-module-head .button {
  min-height: 2.45rem;
}

.project-hub-module-title-row,
.project-hub-section-title-row,
.client-hub-module-title-row,
.client-hub-section-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
}

.project-hub-module-mark,
.client-hub-module-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(208, 218, 224, 0.96);
  background: rgba(245, 248, 249, 0.98);
  color: #4c5d66;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.project-hub-module-title,
.client-hub-module-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.1;
  font-weight: 900;
  color: var(--text);
}

.project-hub-module-copy,
.client-hub-module-copy {
  display: grid;
  gap: 0.22rem;
}

.project-hub-module-headline {
  display: block;
  margin-top: 0.04rem;
  font-size: 0.98rem;
  line-height: 1.28;
  font-weight: 800;
  color: #20333b;
}

.project-hub-module-detail {
  margin-top: 0.24rem;
  color: var(--text-soft);
  line-height: 1.52;
}

.project-hub-module-meta,
.project-hub-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-hub-module-meta span,
.project-hub-context-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.18rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(247, 250, 251, 0.98);
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 800;
  text-decoration: none;
}

.project-hub-module-list,
.project-hub-activity-list {
  gap: 0.55rem;
}

.project-hub-module-row,
.project-hub-activity-row {
  gap: 0.12rem;
  padding: 0.78rem 0.84rem;
  border-radius: 14px;
  border: 1px solid rgba(218, 226, 231, 0.9);
  background: rgba(248, 250, 251, 0.92);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.project-hub-module-row span,
.project-hub-activity-row span,
.project-hub-activity-row small {
  color: var(--text-soft);
  font-size: 0.83rem;
  font-weight: 700;
}

.project-hub-module-empty {
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  border: 1px dashed rgba(207, 218, 224, 0.94);
  background: rgba(248, 250, 251, 0.94);
  color: var(--text-soft);
  font-weight: 700;
}

.project-hub-bottom {
  align-items: start;
}

.project-hub-activity-card,
.project-hub-context-card {
  gap: 0.9rem;
  border: 1px solid rgba(214, 223, 228, 0.92);
  box-shadow: 0 10px 26px rgba(16, 31, 36, 0.045);
}

.project-hub-context-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.project-hub-notes {
  gap: 0.38rem;
}

.project-hub-notes-body {
  padding: 0.95rem 1rem;
  border-radius: 15px;
  border: 1px solid rgba(220, 227, 231, 0.94);
  background: rgba(249, 251, 252, 0.98);
  line-height: 1.72;
  white-space: pre-wrap;
}

.project-hub-hero .button:focus-visible,
.project-hub-alert .button:focus-visible,
.project-hub-crosslinks a:focus-visible,
.project-hub-module-row:focus-visible,
.project-hub-module-head .button:focus-visible,
.project-hub-context-links a:focus-visible,
.project-hub-activity-row:focus-visible {
  outline: 3px solid rgba(108, 141, 153, 0.22);
  outline-offset: 2px;
}

.project-compact-header {
  gap: 0.55rem;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.985);
}

.project-compact-header .project-hub-hero-main {
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.62fr);
  gap: 0.78rem;
  align-items: center;
}

.project-compact-header .project-hub-hero-copy {
  gap: 0.38rem;
}

.project-compact-header .project-hub-hero-topline {
  gap: 0.35rem;
}

.project-compact-header .project-hub-hero h2,
.project-compact-header h2 {
  font-size: clamp(1.55rem, 2.1vw, 2rem);
}

.project-compact-header .project-hub-subtitle,
.project-compact-header .project-hub-status-detail {
  font-size: 0.86rem;
  line-height: 1.3;
}

.project-compact-header .project-hub-state-badge,
.project-compact-header .derived-attention-badge,
.project-compact-header .entity-stale-label {
  min-height: 1.48rem;
  padding: 0.1rem 0.46rem;
  font-size: 0.68rem;
}

.project-compact-header .project-hub-facts {
  gap: 0.28rem;
}

.project-compact-header .project-hub-fact {
  min-height: 1.55rem;
  padding: 0.14rem 0.48rem;
  font-size: 0.74rem;
}

.project-human-header {
  border-color: rgba(204, 216, 222, 0.94);
}

.project-detail-human-header {
  padding-block: 0.72rem;
}

.project-detail-human-header .project-hub-hero-main {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  align-items: start;
}

.project-main-cta {
  min-height: 2.45rem;
  padding-inline: 0.95rem;
  border-color: rgba(36, 101, 114, 0.88);
  box-shadow: 0 8px 18px rgba(36, 101, 114, 0.12);
  font-weight: 900;
  white-space: nowrap;
}

.project-detail-human-header .primary-flow-action {
  padding: 0.42rem;
  border-radius: 12px;
  border: 1px solid rgba(202, 216, 223, 0.86);
  background: rgba(248, 251, 252, 0.92);
}

.project-header-actions-visible {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
  align-content: start;
  justify-items: stretch;
  padding: 0.42rem;
  border: 1px solid rgba(206, 218, 224, 0.86);
  border-radius: 14px;
  background: rgba(248, 251, 252, 0.76);
}

.project-header-actions-visible .button {
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  align-items: center;
  min-height: 2.18rem;
  padding: 0.28rem 0.62rem;
  font-size: 0.8rem;
  text-align: left;
  white-space: nowrap;
}

.project-header-action-button {
  gap: 0.36rem;
  border-color: rgba(194, 207, 215, 0.95);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.project-header-action-symbol {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(229, 237, 241, 0.92);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.project-detail-human-header .project-hub-derived-line {
  gap: 0.24rem;
}

.project-context-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem 0.55rem;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.project-context-link {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.project-context-link:hover {
  text-decoration: underline;
}

.project-key-data-line {
  margin-top: 0.06rem;
}

.project-compact-header .project-hub-hero-actions {
  gap: 0.45rem;
}

.project-compact-header .project-hub-action-group .button,
.project-compact-header .project-hub-action-group .back-link {
  min-height: 2rem;
}

.project-compact-header .secondary-actions-panel summary {
  min-height: 1.85rem;
  padding: 0.16rem 0.5rem;
}

.project-secondary-actions .compact-link-list,
.project-compact-header .compact-link-list {
  gap: 0.32rem;
}

.project-secondary-actions .button.secondary,
.project-secondary-actions .back-link {
  min-height: 1.86rem;
  padding: 0.16rem 0.5rem;
  font-size: 0.76rem;
}

.project-compact-header .project-compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.project-compact-header .project-hub-metric-card {
  min-height: 0;
  padding: 0.46rem 0.58rem;
  border-radius: 11px;
}

.project-compact-header .project-hub-metric-card strong {
  font-size: 1.02rem;
}

.project-compact-header .project-hub-metric-card span,
.project-compact-header .project-hub-metric-card small {
  font-size: 0.7rem;
  line-height: 1.16;
}

.project-hub-crosslinks-panel,
.project-secondary-panels {
  border-color: rgba(216, 225, 230, 0.86);
}

.project-hub-crosslinks-panel {
  padding: 0.48rem 0.62rem;
  border-radius: 12px;
  border: 1px solid rgba(216, 225, 230, 0.86);
  background: rgba(249, 251, 252, 0.92);
}

.project-hub-crosslinks-panel > summary,
.project-compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.project-hub-crosslinks-panel > summary strong,
.project-compact-summary strong {
  color: var(--text);
  font-size: 0.82rem;
}

.project-hub-crosslinks-panel .project-hub-crosslinks {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.42rem;
  margin-top: 0.55rem;
}

.project-hub-crosslinks-panel .project-hub-crosslinks a {
  padding: 0.48rem 0.58rem;
  border-radius: 11px;
}

.project-primary-flow {
  padding: 0.85rem 0.95rem;
  border-radius: 15px;
}

.project-primary-budget-card {
  margin-top: 0.7rem;
  border-color: rgba(124, 174, 149, 0.92);
  box-shadow: 0 12px 28px rgba(39, 92, 58, 0.08);
}

.project-section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 0.95rem 0 0.45rem;
  padding-inline: 0.1rem;
}

.project-section-title h3 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  line-height: 1.25;
}

.project-budget-focus {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgba(188, 208, 199, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 252, 249, 0.98) 100%);
}

.project-budget-focus.is-warning {
  border-color: rgba(226, 205, 143, 0.94);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(253, 249, 237, 0.98) 100%);
}

.project-budget-focus-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.project-budget-focus-copy {
  display: grid;
  gap: 0.12rem;
}

.project-budget-focus h3 {
  margin: 0;
  font-size: 1.12rem;
}

.project-budget-focus .button {
  min-height: 2.15rem;
}

.project-budget-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.project-budget-focus-meta span,
.project-budget-focus-list a {
  border: 1px solid rgba(214, 223, 228, 0.9);
  background: rgba(250, 252, 253, 0.92);
}

.project-budget-focus-meta span {
  display: inline-flex;
  min-height: 1.55rem;
  align-items: center;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.project-budget-focus-list {
  display: grid;
  gap: 0.36rem;
}

.project-budget-focus-list a {
  display: grid;
  gap: 0.08rem;
  padding: 0.45rem 0.58rem;
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
}

.project-budget-focus-list a strong {
  font-size: 0.84rem;
}

.project-budget-focus-list a span {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.project-budget-list {
  display: grid;
  gap: 0.45rem;
}

.project-budget-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.58rem 0.68rem;
  border: 1px solid rgba(214, 223, 228, 0.9);
  border-radius: 12px;
  background: rgba(250, 252, 253, 0.94);
}

.project-budget-row-copy {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.project-budget-row-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-budget-row-copy span {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.project-budget-action {
  min-height: 2rem;
  white-space: nowrap;
}

.project-signal-strip {
  padding: 0.62rem 0.78rem;
  gap: 0.48rem;
}

.project-signal-strip .project-hub-section-head {
  padding-bottom: 0.42rem;
}

.project-signal-strip .project-hub-section-head h3 {
  font-size: 1rem;
}

.project-signal-strip .project-hub-section-head .muted {
  font-size: 0.78rem;
}

.project-signal-strip .project-hub-alert-list {
  gap: 0.45rem;
}

.project-signal-strip .project-hub-alert {
  padding: 0.58rem 0.68rem;
  border-radius: 12px;
}

.project-signal-strip .project-hub-alert-copy p {
  margin: 0.12rem 0 0;
  font-size: 0.8rem;
  line-height: 1.25;
}

.project-signal-strip-compact {
  padding: 0.5rem 0.68rem;
}

.project-signal-strip-compact .project-hub-section-head {
  padding-bottom: 0.28rem;
}

.project-signal-strip-compact .project-hub-alert {
  padding: 0.48rem 0.58rem;
}

.compact-module-grid {
  gap: 0.62rem;
}

.project-module-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.compact-module-grid .project-hub-module-card,
.project-hub-bottom.project-secondary-panels .project-hub-activity-card,
.project-hub-bottom.project-secondary-panels .project-hub-context-card {
  padding: 0.78rem 0.86rem;
  border-radius: 14px;
  box-shadow: none;
}

.project-module-grid-compact .project-hub-module-list,
.project-module-grid-compact .project-hub-module-empty {
  display: none;
}

.project-module-grid-compact .project-hub-module-card {
  min-height: 0;
}

.project-module-grid-compact .project-hub-module-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.project-module-grid-readable {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.project-module-grid-readable .project-hub-module-card {
  min-width: 0;
  min-height: 0;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border-color: rgba(190, 205, 214, 0.9);
  box-shadow: 0 10px 22px rgba(31, 49, 60, 0.06);
}

.project-module-card-readable {
  position: relative;
  overflow: hidden;
}

.project-module-card-readable::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(112, 128, 138, 0.52);
}

.project-module-card-production {
  border-color: rgba(126, 166, 149, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(246, 252, 249, 0.98) 100%);
}

.project-module-card-production::before,
.project-module-card-production .project-hub-module-mark {
  background: rgba(82, 138, 113, 0.18);
  color: #2f6d51;
}

.project-module-card-purchases {
  border-color: rgba(202, 179, 122, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(253, 250, 241, 0.98) 100%);
}

.project-module-card-purchases::before,
.project-module-card-purchases .project-hub-module-mark {
  background: rgba(177, 136, 53, 0.18);
  color: #7a5a18;
}

.project-module-card-finance {
  border-color: rgba(132, 165, 203, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(246, 250, 254, 0.98) 100%);
}

.project-module-card-finance::before,
.project-module-card-finance .project-hub-module-mark {
  background: rgba(77, 121, 174, 0.16);
  color: #315f99;
}

.project-module-card-workorders,
.project-module-card-work_orders {
  border-color: rgba(152, 143, 199, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(249, 248, 253, 0.98) 100%);
}

.project-module-card-workorders::before,
.project-module-card-workorders .project-hub-module-mark,
.project-module-card-work_orders::before,
.project-module-card-work_orders .project-hub-module-mark {
  background: rgba(112, 96, 176, 0.16);
  color: #51448f;
}

.project-module-card-engineering {
  border-color: rgba(118, 171, 184, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(245, 251, 252, 0.98) 100%);
}

.project-module-card-engineering::before,
.project-module-card-engineering .project-hub-module-mark {
  background: rgba(63, 139, 156, 0.17);
  color: #2f7280;
}

.project-module-card-docs {
  border-color: rgba(165, 177, 187, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(248, 250, 251, 0.98) 100%);
}

.project-module-card-docs::before,
.project-module-card-docs .project-hub-module-mark {
  background: rgba(100, 116, 130, 0.16);
  color: #52606c;
}

.project-module-card-readable .project-hub-module-mark {
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.project-module-action-primary {
  border-color: rgba(162, 180, 190, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 850;
}

.project-module-grid-readable .project-hub-module-head {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.56rem;
  align-items: start;
  padding-bottom: 0.65rem;
}

.project-module-grid-readable .project-hub-module-head .button {
  justify-self: start;
  min-height: 2rem;
  white-space: nowrap;
}

.project-module-grid-readable .project-hub-module-title-row,
.project-module-grid-readable .project-hub-module-title-row > div {
  min-width: 0;
}

.project-module-grid-readable .project-hub-module-headline {
  overflow-wrap: anywhere;
}

.project-module-grid-readable .project-hub-module-detail {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  line-height: 1.35;
}

.project-module-grid-readable .project-hub-module-meta {
  gap: 0.35rem;
}

.project-module-grid-readable .project-hub-module-list {
  gap: 0.42rem;
}

.project-module-grid-readable .project-hub-module-row {
  padding: 0.48rem 0.58rem;
}

@media (max-width: 1180px) {
  .project-module-grid-readable {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .project-detail-human-header .project-hub-hero-main {
    grid-template-columns: 1fr;
  }

  .project-header-actions-visible {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .project-header-actions-visible,
  .client-header-actions,
  .client-project-section-header,
  .project-budget-row {
    grid-template-columns: 1fr;
  }

  .client-project-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .client-project-primary-action {
    width: 100%;
    justify-content: center;
  }

  .project-module-grid-readable {
    grid-template-columns: 1fr;
  }

  .project-section-title {
    align-items: start;
    flex-direction: column;
    gap: 0.25rem;
  }
}

.compact-module-grid .project-hub-module-head {
  gap: 0.58rem;
}

.compact-module-grid .project-hub-module-head .button {
  min-height: 2rem;
}

.compact-module-grid .project-hub-module-detail,
.project-hub-bottom.project-secondary-panels .muted,
.project-hub-bottom.project-secondary-panels .project-hub-notes-body {
  font-size: 0.82rem;
  line-height: 1.32;
}

.compact-module-grid .project-hub-module-meta {
  gap: 0.28rem;
}

.compact-module-grid .project-hub-module-meta span {
  min-height: 1.5rem;
  padding: 0.12rem 0.44rem;
  font-size: 0.7rem;
}

.compact-module-grid .project-hub-module-list,
.project-hub-bottom.project-secondary-panels .project-hub-activity-list {
  gap: 0.38rem;
}

.compact-module-grid .project-hub-module-row,
.project-hub-bottom.project-secondary-panels .project-hub-activity-row {
  padding: 0.5rem 0.58rem;
  border-radius: 11px;
}

.project-hub-bottom.project-secondary-panels {
  gap: 0.7rem;
}

.project-activity-compact .card-head {
  padding-bottom: 0.36rem;
}

.project-activity-compact .project-hub-context-grid {
  gap: 0.5rem;
}

.project-activity-compact .project-hub-notes-body {
  max-height: 7rem;
  overflow: auto;
}

.client-hub-shell,
.client-hub-hero,
.client-hub-hero-main,
.client-hub-hero-copy,
.client-hub-hero-actions,
.client-hub-metric-grid,
.client-hub-crosslinks,
.client-hub-attention-card,
.client-hub-alert-list,
.client-hub-alert,
.client-hub-alert-copy,
.client-hub-portfolio-card,
.client-hub-portfolio-list,
.client-hub-project-card,
.client-hub-project-head,
.client-hub-project-links,
.client-hub-project-snapshot,
.client-hub-project-flags,
.client-hub-module-grid,
.client-hub-module-card,
.client-hub-module-head,
.client-hub-module-list,
.client-hub-module-row,
.client-hub-activity-card,
.client-hub-activity-list,
.client-hub-activity-row,
.client-hub-context-card,
.client-hub-context-grid,
.client-hub-context-links,
.client-hub-notes {
  display: grid;
}

.client-hub-shell {
  gap: 1.05rem;
}

.client-hub-hero {
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border-radius: 22px;
  border: 1px solid rgba(210, 220, 226, 0.94);
  background:
    radial-gradient(circle at top right, rgba(242, 247, 249, 0.96), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 250, 251, 0.99) 100%);
  box-shadow: 0 14px 36px rgba(16, 31, 36, 0.05);
}

.client-hub-hero-main {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 1.2rem;
  align-items: start;
}

.client-hub-hero-copy {
  gap: 0.7rem;
}

.client-hub-hero-topline,
.client-hub-facts,
.client-hub-action-group,
.client-hub-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.client-hub-hero-topline {
  align-items: center;
  gap: 0.6rem;
}

.client-hub-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.client-hub-subtitle,
.client-hub-status-detail {
  margin: 0;
}

.client-hub-subtitle {
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 700;
}

.client-hub-status-detail {
  max-width: 64ch;
  font-size: 1.02rem;
  line-height: 1.55;
}

.client-hub-state-badge,
.client-hub-project-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.22rem 0.82rem;
  border-radius: 999px;
  font-size: 0.81rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(206, 218, 224, 0.95);
  background: rgba(244, 247, 248, 0.98);
  color: #45555f;
}

.client-hub-state-badge.is-positive,
.client-hub-project-badge.is-positive {
  background: rgba(235, 245, 239, 0.98);
  border-color: rgba(183, 210, 193, 0.96);
  color: #365d4b;
}

.client-hub-state-badge.is-warning,
.client-hub-project-badge.is-warning {
  background: rgba(251, 246, 230, 0.99);
  border-color: rgba(230, 205, 135, 0.96);
  color: #75571e;
}

.client-hub-state-badge.is-danger,
.client-hub-project-badge.is-danger {
  background: rgba(251, 240, 240, 0.99);
  border-color: rgba(226, 194, 194, 0.96);
  color: #863d3d;
}

.client-hub-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.1rem;
  padding: 0.32rem 0.74rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 221, 226, 0.94);
  background: rgba(248, 250, 251, 0.98);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
}

.client-hub-fact strong {
  color: var(--text);
  font-weight: 900;
}

.client-hub-hero-actions {
  gap: 0.8rem;
  justify-items: end;
  align-content: start;
}

.client-hub-action-group {
  justify-content: flex-end;
}

.client-hub-action-group .button,
.client-hub-action-group .back-link {
  min-height: 2.55rem;
}

.client-hub-action-group-primary .button:first-child {
  box-shadow: 0 10px 24px rgba(20, 64, 55, 0.14);
}

.project-hub-action-group.compact-link-list,
.client-hub-action-group.compact-link-list {
  display: grid;
  justify-content: stretch;
}

.client-hub-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.82rem;
}

.client-hub-metric-card {
  display: grid;
  gap: 0.1rem;
  padding: 0.92rem 0.98rem;
  border-radius: 16px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(250, 252, 253, 0.95);
}

.client-hub-metric-card span,
.client-hub-metric-card small,
.client-hub-module-row span,
.client-hub-activity-row span,
.client-hub-activity-row small {
  color: var(--text-soft);
  font-weight: 700;
}

.client-hub-metric-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.client-hub-crosslinks {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.client-hub-crosslinks a,
.client-hub-module-row,
.client-hub-activity-row {
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.client-hub-crosslinks a {
  display: grid;
  gap: 0.16rem;
  padding: 0.86rem 0.92rem;
  border-radius: 15px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(251, 252, 253, 0.94);
}

.client-hub-crosslinks strong {
  font-size: 0.92rem;
}

.client-hub-crosslinks span {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.client-hub-section-head h3 {
  margin-bottom: 0.18rem;
}

.client-hub-alert-list,
.client-hub-portfolio-list,
.client-hub-module-list,
.client-hub-activity-list {
  gap: 0.72rem;
}

.client-hub-alert {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(248, 250, 251, 0.98);
}

.client-hub-alert.is-warning {
  border-color: rgba(229, 204, 132, 0.95);
  background: rgba(251, 247, 233, 0.98);
}

.client-hub-alert.is-danger {
  border-color: rgba(225, 196, 196, 0.95);
  background: rgba(251, 242, 242, 0.98);
}

.client-hub-alert-empty,
.client-hub-empty,
.client-hub-module-empty {
  padding: 0.9rem 1rem;
  border-radius: 15px;
  border: 1px dashed rgba(207, 218, 224, 0.94);
  background: rgba(248, 250, 251, 0.95);
  color: var(--text-soft);
  font-weight: 700;
}

.client-hub-portfolio-card,
.client-hub-activity-card,
.client-hub-context-card {
  gap: 0.9rem;
}

.client-hub-project-card {
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(255, 255, 255, 0.995);
  box-shadow: 0 10px 26px rgba(16, 31, 36, 0.045);
}

.client-hub-project-card.is-positive {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 252, 249, 0.99) 100%);
}

.client-hub-project-card.is-warning {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(252, 249, 240, 0.99) 100%);
}

.client-hub-project-head {
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.client-hub-project-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.client-hub-project-date {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.client-hub-project-head h4 {
  margin: 0.32rem 0 0.18rem;
  font-size: 1.25rem;
  line-height: 1.14;
}

.client-hub-project-headline,
.client-hub-project-detail,
.client-hub-notes-body {
  margin: 0;
}

.client-hub-project-headline {
  font-size: 0.95rem;
  font-weight: 800;
}

.client-hub-project-detail {
  color: var(--text-soft);
  line-height: 1.56;
  margin-top: 0.24rem;
}

.client-hub-project-links {
  gap: 0.5rem;
  justify-items: end;
}

.client-hub-project-links a,
.client-hub-context-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.18rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(247, 250, 251, 0.98);
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 800;
  text-decoration: none;
}

.client-hub-project-snapshot,
.client-hub-context-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.client-hub-project-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.client-hub-flag {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(211, 221, 227, 0.94);
  background: rgba(247, 250, 251, 0.98);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-soft);
}

.client-hub-flag.is-warning {
  color: #7b5a17;
  background: rgba(251, 247, 233, 0.98);
  border-color: rgba(229, 204, 132, 0.95);
}

.client-hub-module-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.client-hub-module-card {
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(214, 223, 228, 0.92);
  background: rgba(255, 255, 255, 0.995);
  box-shadow: 0 10px 26px rgba(16, 31, 36, 0.045);
}

.client-hub-module-card.is-warning {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(252, 249, 240, 0.99) 100%);
}

.client-hub-module-card.is-danger {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(252, 245, 245, 0.99) 100%);
}

.client-hub-module-card.is-positive {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(247, 252, 249, 0.99) 100%);
}

.client-hub-module-headline {
  display: block;
  margin-top: 0.04rem;
  font-size: 0.98rem;
  line-height: 1.28;
  font-weight: 800;
  color: #20333b;
}

.client-hub-module-detail {
  margin: 0.24rem 0 0;
  color: var(--text-soft);
  line-height: 1.52;
}

.client-hub-module-head,
.client-hub-section-head {
  padding-bottom: 0.82rem;
  border-bottom: 1px solid rgba(224, 231, 235, 0.94);
}

.project-hub-section-head {
  padding-bottom: 0.82rem;
  border-bottom: 1px solid rgba(224, 231, 235, 0.94);
}

.client-hub-module-row,
.client-hub-activity-row {
  gap: 0.12rem;
  padding: 0.78rem 0.84rem;
  border-radius: 14px;
  border: 1px solid rgba(218, 226, 231, 0.9);
  background: rgba(248, 250, 251, 0.92);
}

.client-hub-notes {
  gap: 0.32rem;
}

.client-hub-activity-card,
.client-hub-context-card {
  border: 1px solid rgba(214, 223, 228, 0.92);
  box-shadow: 0 10px 26px rgba(16, 31, 36, 0.045);
}

.client-hub-context-card {
  gap: 0.72rem;
}

.client-hub-context-summary {
  display: grid;
  gap: 0.48rem;
}

.client-hub-context-row {
  display: grid;
  gap: 0.08rem;
  padding: 0.58rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(222, 228, 232, 0.92);
  background: rgba(249, 251, 252, 0.94);
}

.client-hub-notes-body {
  padding: 0.82rem 0.92rem;
  border-radius: 15px;
  border: 1px solid rgba(220, 227, 231, 0.94);
  background: rgba(249, 251, 252, 0.98);
  line-height: 1.62;
  white-space: pre-wrap;
}

.client-hub-notes-empty {
  padding: 0.76rem 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(214, 223, 228, 0.94);
  background: rgba(248, 250, 251, 0.95);
  color: var(--text-soft);
  font-weight: 700;
}

.client-hub-context-links {
  padding-top: 0.12rem;
}

.client-hub-crosslinks a:hover,
.client-hub-crosslinks a:focus-visible,
.client-hub-module-row:hover,
.client-hub-module-row:focus-visible,
.client-hub-activity-row:hover,
.client-hub-activity-row:focus-visible,
.client-hub-project-links a:hover,
.client-hub-project-links a:focus-visible,
.client-hub-context-links a:hover,
.client-hub-context-links a:focus-visible {
  border-color: rgba(186, 201, 208, 0.98);
  box-shadow: 0 10px 24px rgba(16, 31, 36, 0.06);
  transform: translateY(-1px);
  text-decoration: none;
}

.client-hub-hero .button:focus-visible,
.client-hub-alert .button:focus-visible,
.client-hub-crosslinks a:focus-visible,
.client-hub-module-row:focus-visible,
.client-hub-activity-row:focus-visible,
.client-hub-project-links a:focus-visible,
.client-hub-context-links a:focus-visible {
  outline: 3px solid rgba(108, 141, 153, 0.22);
  outline-offset: 2px;
}

.client-compact-header {
  gap: 0.55rem;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.985);
}

.client-compact-header .client-hub-hero-main {
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.62fr);
  gap: 0.78rem;
  align-items: center;
}

.client-compact-header .client-hub-hero-copy {
  gap: 0.38rem;
}

.client-compact-header .client-hub-hero-topline {
  gap: 0.35rem;
}

.client-compact-header .client-hub-hero h2,
.client-compact-header h2 {
  font-size: clamp(1.55rem, 2.1vw, 2rem);
}

.client-compact-header .client-hub-subtitle,
.client-compact-header .client-hub-status-detail {
  font-size: 0.86rem;
  line-height: 1.3;
}

.client-compact-header .client-hub-state-badge,
.client-compact-header .derived-attention-badge,
.client-compact-header .entity-stale-label {
  min-height: 1.48rem;
  padding: 0.1rem 0.46rem;
  font-size: 0.68rem;
}

.client-compact-header .client-hub-facts {
  gap: 0.28rem;
}

.client-compact-header .client-hub-fact {
  min-height: 1.55rem;
  padding: 0.14rem 0.48rem;
  font-size: 0.74rem;
}

.client-compact-header .client-hub-hero-actions {
  gap: 0.45rem;
}

.client-header-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  padding: 0.42rem;
  border: 1px solid rgba(206, 218, 224, 0.86);
  border-radius: 14px;
  background: rgba(248, 251, 252, 0.76);
}

.client-header-actions .button {
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  min-height: 2.08rem;
  padding: 0.24rem 0.58rem;
  font-size: 0.78rem;
  text-align: left;
  white-space: nowrap;
}

.client-header-action-button {
  gap: 0.34rem;
  border-color: rgba(194, 207, 215, 0.95);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.client-project-section-header {
  align-items: center;
}

.client-project-section-header > div {
  min-width: 0;
}

.client-project-primary-action {
  flex: 0 0 auto;
  min-height: 2.2rem;
  padding-inline: 0.85rem;
  border-color: rgba(36, 101, 114, 0.88);
  box-shadow: 0 8px 18px rgba(36, 101, 114, 0.12);
  font-weight: 900;
  white-space: nowrap;
}

.client-compact-header .client-hub-action-group .button,
.client-compact-header .client-hub-action-group .back-link {
  min-height: 2rem;
}

.client-compact-header .secondary-actions-panel summary {
  min-height: 1.85rem;
  padding: 0.16rem 0.5rem;
}

.client-compact-header .client-compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.client-compact-header .client-hub-metric-card {
  padding: 0.46rem 0.58rem;
  border-radius: 11px;
}

.client-compact-header .client-hub-metric-card strong {
  font-size: 1.02rem;
}

.client-compact-header .client-hub-metric-card span,
.client-compact-header .client-hub-metric-card small {
  font-size: 0.7rem;
  line-height: 1.16;
}

.client-secondary-panels {
  margin-top: -0.15rem;
}

.client-hub-crosslinks-panel,
.client-secondary-panels {
  border-color: rgba(216, 225, 230, 0.86);
}

.client-hub-crosslinks-panel {
  padding: 0.48rem 0.62rem;
  border-radius: 12px;
  border: 1px solid rgba(216, 225, 230, 0.86);
  background: rgba(249, 251, 252, 0.92);
}

.client-hub-crosslinks-panel > summary,
.client-compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.client-hub-crosslinks-panel > summary strong,
.client-compact-summary strong {
  color: var(--text);
  font-size: 0.82rem;
}

.client-hub-crosslinks-panel .client-hub-crosslinks {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.42rem;
  margin-top: 0.55rem;
}

.client-hub-crosslinks-panel .client-hub-crosslinks a {
  padding: 0.48rem 0.58rem;
  border-radius: 11px;
}

.compact-alert-list {
  padding: 0.62rem 0.78rem;
  gap: 0.48rem;
}

.compact-alert-list .client-hub-section-head {
  padding-bottom: 0.42rem;
}

.compact-alert-list .client-hub-section-head h3 {
  font-size: 1rem;
}

.compact-alert-list .client-hub-section-head .muted {
  font-size: 0.78rem;
}

.compact-alert-list .client-hub-alert-list {
  gap: 0.45rem;
}

.compact-alert-list .client-hub-alert {
  padding: 0.58rem 0.68rem;
  border-radius: 12px;
}

.compact-alert-list .client-hub-alert-copy p {
  margin: 0.12rem 0 0;
  font-size: 0.8rem;
  line-height: 1.25;
}

.client-primary-flow {
  padding: 0.9rem 1rem;
  gap: 0.55rem;
}

.client-primary-flow .client-hub-section-head {
  padding-bottom: 0.48rem;
}

.client-primary-flow .client-hub-section-head h3 {
  margin-bottom: 0.08rem;
  font-size: 1.08rem;
}

.client-primary-flow .client-hub-section-head .muted {
  font-size: 0.8rem;
}

.dense-client-projects .client-hub-portfolio-list {
  gap: 0.5rem;
}

.dense-client-projects .client-hub-project-card {
  gap: 0.5rem;
  padding: 0.68rem 0.78rem;
  border-radius: 13px;
  box-shadow: none;
}

.dense-client-projects .client-hub-project-head {
  grid-template-columns: minmax(0, 1.65fr) minmax(170px, 0.55fr);
  gap: 0.65rem;
}

.dense-client-projects .client-hub-project-head h4 {
  margin: 0.18rem 0 0.08rem;
  font-size: 1rem;
}

.dense-client-projects .client-hub-project-date {
  font-size: 0.72rem;
}

.dense-client-projects .client-hub-project-badge,
.dense-client-projects .client-hub-flag {
  min-height: 1.42rem;
  padding: 0.08rem 0.42rem;
  font-size: 0.68rem;
}

.dense-client-projects .client-hub-project-headline,
.dense-client-projects .client-hub-project-detail {
  font-size: 0.78rem;
  line-height: 1.24;
}

.dense-client-projects .client-hub-project-links {
  gap: 0.28rem;
}

.dense-client-projects .client-hub-project-links a {
  min-height: 1.65rem;
  padding: 0.1rem 0.48rem;
  font-size: 0.72rem;
}

.dense-client-projects .client-hub-project-snapshot {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.dense-client-projects .client-hub-project-snapshot .info-pair {
  padding: 0.46rem 0.52rem;
}

.dense-client-projects .client-hub-project-snapshot .detail-label,
.dense-client-projects .client-hub-project-snapshot .detail-value {
  font-size: 0.72rem;
  line-height: 1.18;
}

.dense-client-projects .client-hub-project-flags {
  gap: 0.25rem;
}

.client-module-secondary-grid {
  gap: 0.62rem;
}

.client-module-secondary-grid .client-hub-module-card,
.client-hub-bottom .client-hub-activity-card,
.client-hub-bottom .client-hub-context-card {
  padding: 0.78rem 0.86rem;
  border-radius: 14px;
  box-shadow: none;
}

.client-module-card-readable {
  position: relative;
  overflow: hidden;
  border-color: rgba(190, 205, 214, 0.9);
  box-shadow: 0 10px 22px rgba(31, 49, 60, 0.055);
}

.client-module-card-readable::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(112, 128, 138, 0.52);
}

.client-module-card-pr {
  border-color: rgba(124, 174, 149, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(246, 252, 249, 0.98) 100%);
}

.client-module-card-pr::before,
.client-module-card-pr .client-hub-module-mark {
  background: rgba(82, 138, 113, 0.18);
  color: #2f6d51;
}

.client-module-card-cp {
  border-color: rgba(202, 179, 122, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(253, 250, 241, 0.98) 100%);
}

.client-module-card-cp::before,
.client-module-card-cp .client-hub-module-mark {
  background: rgba(177, 136, 53, 0.18);
  color: #7a5a18;
}

.client-module-card-fn {
  border-color: rgba(132, 165, 203, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(246, 250, 254, 0.98) 100%);
}

.client-module-card-fn::before,
.client-module-card-fn .client-hub-module-mark {
  background: rgba(77, 121, 174, 0.16);
  color: #315f99;
}

.client-module-card-ct {
  border-color: rgba(165, 177, 187, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(248, 250, 251, 0.98) 100%);
}

.client-module-card-ct::before,
.client-module-card-ct .client-hub-module-mark {
  background: rgba(100, 116, 130, 0.16);
  color: #52606c;
}

.client-module-secondary-grid .client-hub-module-head,
.client-hub-bottom .client-hub-section-head {
  padding-bottom: 0.48rem;
}

.client-module-secondary-grid .client-hub-module-detail,
.client-hub-bottom .muted,
.client-hub-notes-body {
  font-size: 0.82rem;
  line-height: 1.32;
}

.client-hub-bottom .client-hub-activity-row,
.client-module-secondary-grid .client-hub-module-row {
  padding: 0.5rem 0.58rem;
  border-radius: 11px;
}

.entity-list-shell {
  display: grid;
  gap: 1rem;
}

.entity-list-head {
  margin-bottom: 0;
}

.entity-list-stats {
  margin-top: -0.1rem;
}

.commercial-stats-compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.compact-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem 1rem;
  align-items: center;
  margin-bottom: 0.4rem;
  padding-block: 0.1rem;
}

.compact-page-hero .eyebrow {
  margin-bottom: 0.1rem;
}

.compact-page-hero h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.05;
}

.compact-page-hero .page-subtitle {
  margin-top: 0.2rem;
  font-size: 0.88rem;
  line-height: 1.3;
}

.compact-list-toolbar {
  gap: 0.45rem;
  align-items: center;
}

.compact-list-toolbar .entity-sort-form {
  padding: 0.35rem 0.52rem;
  gap: 0.4rem;
  border-radius: 12px;
}

.compact-list-toolbar .entity-sort-form label {
  font-size: 0.78rem;
}

.compact-list-toolbar .entity-sort-form select {
  min-width: 180px;
  min-height: 2.18rem;
}

.compact-list-toolbar .button,
.compact-list-toolbar button {
  min-height: 2.18rem;
  padding-block: 0.42rem;
}

.compact-list-toolbar .muted {
  max-width: 220px;
  font-size: 0.76rem;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .compact-page-hero {
    grid-template-columns: 1fr;
    padding-block: 0.75rem;
  }

  .compact-list-toolbar {
    justify-content: flex-start;
  }
}

.compact-metrics-strip {
  gap: 0.45rem;
  margin-top: -0.35rem;
  margin-bottom: 0.25rem;
}

.compact-metrics-strip .stat-card {
  min-height: 0;
  padding: 0.58rem 0.72rem;
  border-radius: 12px;
}

.compact-metrics-strip .stat-card span {
  font-size: 0.72rem;
}

.compact-metrics-strip .stat-card strong {
  font-size: 1.12rem;
  line-height: 1.05;
}

.compact-metrics-strip .stat-card small {
  margin-top: 0.05rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.low-priority-data {
  color: var(--muted);
  font-size: 0.84rem;
}

.entity-row-support.low-priority-data,
.budget-table-note .low-priority-data {
  display: -webkit-box;
  max-width: 38ch;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.entity-sort-form,
.entity-badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.entity-sort-form {
  padding: 0.5rem 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(212, 222, 227, 0.92);
  background: rgba(248, 250, 251, 0.96);
}

.entity-sort-form label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-soft);
}

.entity-sort-form select {
  min-width: 220px;
  min-height: 2.55rem;
}

.entity-list-card {
  padding: 0;
  overflow: hidden;
}

.dense-list-card {
  border-radius: 14px;
}

.dense-list-card .table-wrap {
  border-radius: 12px;
}

.dense-list-card .section-head {
  margin-bottom: 0.25rem;
}

.dense-table th,
.dense-table td {
  padding: 0.5rem 0.62rem;
  vertical-align: top;
}

.dense-table th {
  font-size: 0.72rem;
}

.dense-table .table-emphasis,
.dense-table .entity-row-title strong,
.dense-table .entity-row-title a {
  font-size: 0.9rem;
  line-height: 1.22;
}

.dense-table .muted,
.dense-table .entity-row-support {
  font-size: 0.78rem;
  line-height: 1.28;
}

.compact-badge-list {
  gap: 0.22rem;
}

.signal-strip-compact {
  gap: 0.2rem 0.26rem;
  align-items: center;
}

.signal-badge-compact {
  max-width: 18ch;
  min-height: 1.32rem;
  padding: 0.08rem 0.38rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.67rem;
  line-height: 1.08;
}

.signal-badge-compact::before {
  width: 0.34rem;
  height: 0.34rem;
  margin-right: 0.2rem;
}

.signal-list-muted {
  gap: 0.18rem;
  margin-top: 0.22rem;
}

.signal-list-muted span,
.signal-overflow-count {
  max-width: 22ch;
  min-height: 1.28rem;
  padding: 0.08rem 0.34rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.66rem;
  line-height: 1.08;
}

.signal-overflow-count {
  color: var(--text-soft);
  border-color: rgba(216, 225, 230, 0.88);
  background: rgba(246, 249, 250, 0.96);
}

.truncate-signal {
  max-width: min(100%, 32ch);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dense-alert-row {
  min-height: 0;
}

.dense-alert-row .button {
  min-height: 1.85rem;
  padding-block: 0.18rem;
  font-size: 0.76rem;
}

.dense-alert-row strong,
.dense-alert-row p {
  max-width: min(100%, 58ch);
}

.dense-table .derived-state-badge,
.dense-table .derived-attention-badge,
.dense-table .entity-stale-label,
.dense-table .entity-reason-list span,
.dense-table .status-badge,
.dense-table .budget-pill {
  min-height: 1.4rem;
  padding: 0.12rem 0.42rem;
  font-size: 0.68rem;
  line-height: 1.1;
}

.truncate-2-lines {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.table-secondary-actions {
  align-items: center;
  gap: 0.45rem;
}

.table-secondary-actions .button.small {
  font-weight: 900;
}

.table-actions-compact {
  gap: 0.28rem;
}

.table-secondary-actions a:not(.button),
.table-secondary-actions .inline-form button {
  min-height: 2rem;
  padding: 0.18rem 0.54rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(247, 250, 251, 0.88);
  border: 1px solid rgba(216, 225, 230, 0.86);
  font-size: 0.8rem;
  font-weight: 800;
}

.table-actions-compact .button.small,
.table-actions-compact a:not(.button),
.table-actions-compact .inline-form button,
.table-actions-compact button {
  min-height: 1.78rem;
  padding: 0.14rem 0.48rem;
  font-size: 0.74rem;
}

.budget-list-fullwidth {
  grid-template-columns: minmax(0, 1fr);
}

.budget-list-fullwidth .budget-main {
  min-width: 0;
}

.budget-list-table-wide {
  width: 100%;
}

.budget-list-table-wide table,
table.budget-list-table-wide {
  min-width: 1040px;
}

.budget-row-compact td {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.budget-actions-compact {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.budget-new-modal .form-section {
  margin-bottom: 0;
}

.budget-status-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
  padding: 0.48rem;
  margin-bottom: 0.7rem;
  border: 1px solid rgba(209, 220, 225, 0.88);
  border-radius: 14px;
  background: rgba(248, 251, 252, 0.92);
}

.budget-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid rgba(207, 219, 225, 0.92);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.budget-status-filter:hover,
.budget-status-filter.is-active {
  border-color: rgba(43, 107, 120, 0.82);
  background: rgba(232, 244, 247, 0.96);
  color: var(--text);
}

.budget-status-count {
  min-width: 1.65rem;
  padding: 0.08rem 0.36rem;
  border-radius: 999px;
  background: rgba(229, 237, 241, 0.96);
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.1;
  text-align: center;
}

.budget-status-filter.is-active .budget-status-count {
  background: rgba(43, 107, 120, 0.14);
  color: #1f5965;
}

.project-status-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
  padding: 0.48rem;
  margin-bottom: 0.7rem;
  border: 1px solid rgba(209, 220, 225, 0.88);
  border-radius: 14px;
  background: rgba(248, 251, 252, 0.92);
}

.project-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid rgba(207, 219, 225, 0.92);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.project-status-filter:hover,
.project-status-filter.is-active {
  border-color: rgba(43, 107, 120, 0.82);
  background: rgba(232, 244, 247, 0.96);
  color: var(--text);
}

.project-status-count {
  min-width: 1.65rem;
  padding: 0.08rem 0.36rem;
  border-radius: 999px;
  background: rgba(229, 237, 241, 0.96);
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.1;
  text-align: center;
}

.project-status-filter.is-active .project-status-count {
  background: rgba(43, 107, 120, 0.14);
  color: #1f5965;
}

.client-status-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
  padding: 0.48rem;
  margin-bottom: 0.7rem;
  border: 1px solid rgba(209, 220, 225, 0.88);
  border-radius: 14px;
  background: rgba(248, 251, 252, 0.92);
}

.client-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid rgba(207, 219, 225, 0.92);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.client-status-filter:hover,
.client-status-filter.is-active {
  border-color: rgba(43, 107, 120, 0.82);
  background: rgba(232, 244, 247, 0.96);
  color: var(--text);
}

.client-status-count {
  min-width: 1.65rem;
  padding: 0.08rem 0.36rem;
  border-radius: 999px;
  background: rgba(229, 237, 241, 0.96);
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.1;
  text-align: center;
}

.client-status-filter.is-active .client-status-count {
  background: rgba(43, 107, 120, 0.14);
  color: #1f5965;
}

.project-list-wide {
  width: 100%;
}

.project-row-compact td {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.client-row-compact td {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.row-more-actions {
  position: relative;
}

.row-more-actions summary {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.08rem 0.46rem;
  border: 1px solid rgba(212, 222, 228, 0.9);
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  list-style: none;
}

.row-more-actions summary::-webkit-details-marker {
  display: none;
}

.row-more-actions[open] summary {
  border-color: rgba(160, 181, 191, 0.95);
  background: rgba(248, 251, 252, 0.96);
  color: var(--text);
}

.row-more-actions form {
  margin-top: 0.28rem;
}

.row-more-actions button {
  min-height: 1.75rem;
  padding: 0.1rem 0.48rem;
  font-size: 0.72rem;
}

.project-list-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.project-row-secondary-actions {
  position: relative;
}

.project-row-secondary-actions summary {
  min-height: 1.78rem;
  padding: 0.14rem 0.48rem;
  border: 1px solid rgba(216, 225, 230, 0.86);
  border-radius: 999px;
  background: rgba(247, 250, 251, 0.88);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  list-style: none;
}

.project-row-secondary-actions summary::-webkit-details-marker {
  display: none;
}

.project-row-secondary-actions[open] {
  z-index: 5;
}

.project-row-secondary-actions[open] .project-archive-secondary {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  padding: 0.35rem;
  border: 1px solid rgba(216, 225, 230, 0.9);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.project-archive-secondary button {
  min-height: 1.78rem;
  padding: 0.14rem 0.5rem;
  font-size: 0.74rem;
}

.entity-row-title,
.entity-row-support {
  display: block;
}

.entity-row-title strong,
.entity-row-title a {
  font-size: 0.98rem;
}

.entity-row-support {
  margin-top: 0.18rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.48;
}

.entity-reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.entity-reason-list span,
.entity-stale-label {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(209, 220, 226, 0.92);
  background: rgba(246, 248, 249, 0.96);
  color: var(--text-soft);
}

.entity-reason-list.is-warning span,
.entity-stale-label.is-warning {
  background: rgba(251, 247, 233, 0.98);
  border-color: rgba(229, 204, 132, 0.95);
  color: #78591a;
}

.entity-reason-list.is-danger span,
.entity-stale-label.is-danger {
  background: rgba(251, 242, 242, 0.98);
  border-color: rgba(225, 196, 196, 0.95);
  color: #8c3b3b;
}

.entity-reason-list.is-positive span,
.entity-stale-label.is-positive {
  background: rgba(236, 245, 239, 0.98);
  border-color: rgba(182, 212, 194, 0.95);
  color: #35604d;
}

.entity-reason-list.is-neutral span,
.entity-stale-label.is-neutral {
  background: rgba(242, 246, 248, 0.98);
  border-color: rgba(209, 219, 225, 0.96);
  color: #4d5b63;
}

.entity-reason-list.is-info span,
.entity-stale-label.is-info {
  background: rgba(237, 245, 251, 0.98);
  border-color: rgba(184, 205, 223, 0.96);
  color: #35586f;
}

.entity-stale-label {
  margin-top: 0.45rem;
}

.client-hub-derived-line,
.project-hub-derived-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.client-hub-activity-label,
.project-hub-activity-label {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.client-hub-target,
.project-hub-target {
  scroll-margin-top: 1.25rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.client-hub-target:target,
.project-hub-target:target {
  border-color: rgba(160, 181, 191, 0.98);
  box-shadow:
    0 0 0 3px rgba(108, 141, 153, 0.14),
    0 14px 32px rgba(16, 31, 36, 0.08);
}

.derived-state-badge,
.derived-attention-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.95rem;
  padding: 0.18rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(209, 220, 226, 0.94);
  background: rgba(245, 248, 249, 0.98);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.derived-state-badge.is-positive,
.derived-attention-badge.is-positive {
  background: rgba(236, 245, 239, 0.98);
  border-color: rgba(182, 212, 194, 0.95);
  color: #35604d;
}

.derived-state-badge.is-warning,
.derived-attention-badge.is-warning {
  background: rgba(251, 247, 233, 0.98);
  border-color: rgba(229, 204, 132, 0.95);
  color: #78591a;
}

.derived-state-badge.is-danger,
.derived-attention-badge.is-danger {
  background: rgba(251, 242, 242, 0.98);
  border-color: rgba(225, 196, 196, 0.95);
  color: #8c3b3b;
}

.derived-state-badge.is-neutral,
.derived-attention-badge.is-neutral {
  background: rgba(242, 246, 248, 0.98);
  border-color: rgba(209, 219, 225, 0.96);
  color: #4d5b63;
}

.derived-state-badge.is-info,
.derived-attention-badge.is-info {
  background: rgba(237, 245, 251, 0.98);
  border-color: rgba(184, 205, 223, 0.96);
  color: #35586f;
}

.entity-stale-label.signal-badge-compact,
.entity-reason-list.signal-list-muted span,
.derived-state-badge.signal-badge-compact,
.derived-attention-badge.signal-badge-compact,
.status-badge.signal-badge-compact,
.budget-pill.signal-badge-compact,
.budget-state-chip.signal-badge-compact,
.traceability-status.signal-badge-compact,
.client-hub-flag.signal-badge-compact,
.client-hub-project-badge.signal-badge-compact,
.project-hub-state-badge.signal-badge-compact {
  max-width: 18ch;
  min-height: 1.3rem;
  padding: 0.08rem 0.38rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.67rem;
  line-height: 1.08;
}

.entity-stale-label.signal-badge-compact {
  margin-top: 0.22rem;
}

.entity-reason-list.signal-list-muted {
  gap: 0.18rem;
  margin-top: 0.24rem;
}

.entity-reason-list.signal-list-muted span.signal-overflow-count,
.client-hub-flag.signal-overflow-count {
  color: var(--text-soft);
  border-color: rgba(216, 225, 230, 0.88);
  background: rgba(246, 249, 250, 0.96);
}

@media (max-width: 860px) {
  .project-engineering-summary-grid,
  .project-engineering-overview-stats,
  .project-engineering-reading-head,
  .project-engineering-modal-head {
    grid-template-columns: 1fr;
  }

  .project-engineering-reading-actions {
    justify-content: flex-start;
  }

  .project-engineering-reading-card,
  .project-engineering-reading-body,
  .project-engineering-overview {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .project-hub-hero-main,
  .project-compact-header .project-hub-hero-main,
  .project-hub-module-head,
  .project-budget-focus-main,
  .project-hub-alert,
  .project-hub-context-grid {
    grid-template-columns: 1fr;
  }

  .project-hub-metric-grid,
  .project-compact-header .project-compact-metrics,
  .project-hub-crosslinks,
  .project-hub-module-grid,
  .compact-link-list {
    grid-template-columns: 1fr;
  }

  .project-hub-hero-actions,
  .project-hub-action-group {
    justify-items: stretch;
    justify-content: flex-start;
  }

  .client-hub-hero-main,
  .client-compact-header .client-hub-hero-main,
  .client-hub-alert,
  .client-hub-project-head,
  .dense-client-projects .client-hub-project-head,
  .client-hub-project-snapshot,
  .dense-client-projects .client-hub-project-snapshot,
  .client-hub-context-grid,
  .client-hub-module-grid,
  .client-hub-crosslinks,
  .client-hub-metric-grid,
  .client-compact-header .client-compact-metrics {
    grid-template-columns: 1fr;
  }

  .client-hub-hero-actions,
  .client-hub-action-group,
  .client-hub-project-links {
    justify-items: stretch;
    justify-content: flex-start;
  }

  .entity-sort-form {
    width: 100%;
  }

  .entity-sort-form select {
    width: 100%;
    min-width: 0;
  }
}

.finance-category-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.finance-category-shell {
  align-items: start;
}

.finance-category-list {
  display: grid;
  gap: 0.8rem;
}

.finance-category-item {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(209, 220, 225, 0.9);
  background: rgba(247, 250, 250, 0.96);
}

.finance-category-item.is-inactive {
  background: rgba(244, 247, 248, 0.92);
  opacity: 0.9;
}

.finance-category-main,
.finance-category-copy,
.finance-category-metrics {
  display: grid;
}

.finance-category-main,
.finance-category-copy {
  gap: 0.55rem;
}

.finance-category-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.finance-category-copy strong {
  font-size: 1.02rem;
}

.finance-category-toggle {
  margin: 0;
}

.finance-category-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.finance-filter-card .form-actions {
  align-items: center;
}

.finance-filter-drawer {
  gap: 0.85rem;
}

.finance-filter-drawer summary {
  list-style: none;
  cursor: pointer;
}

.finance-filter-drawer summary::-webkit-details-marker {
  display: none;
}

.finance-filter-toggle {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.finance-filter-toggle-copy {
  display: grid;
  gap: 0.12rem;
}

.finance-filter-toggle-copy strong {
  font-size: 1rem;
}

.finance-filter-drawer[open] .finance-filter-toggle {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(212, 222, 227, 0.88);
}

.finance-table-title,
.finance-control-stack,
.finance-doc-list,
.finance-action-callout,
.finance-doc-upload,
.finance-doc-panel {
  display: grid;
}

.finance-table-title,
.finance-control-stack,
.finance-doc-list {
  gap: 0.38rem;
}

.finance-control-stack {
  gap: 0.35rem;
}

.finance-origin-note {
  display: grid;
  gap: 0.14rem;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(210, 220, 226, 0.9);
  background: rgba(246, 249, 250, 0.96);
}

.finance-origin-note strong {
  font-size: 0.84rem;
}

.finance-origin-note span {
  color: var(--text-soft);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.finance-origin-note.is-positive {
  border-color: rgba(182, 212, 194, 0.9);
  background: rgba(236, 245, 239, 0.96);
}

.finance-origin-note.is-warning {
  border-color: rgba(229, 204, 132, 0.92);
  background: rgba(251, 247, 233, 0.96);
}

.finance-origin-note.is-danger {
  border-color: rgba(225, 196, 196, 0.92);
  background: rgba(251, 241, 241, 0.96);
}

.finance-control-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
}

.finance-control-flag,
.finance-control-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-size: 0.76rem;
  font-weight: 800;
}

.finance-control-flag::before,
.finance-control-ok::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.84;
}

.finance-control-flag.is-warning {
  color: #7c5a16;
}

.finance-control-flag.is-danger {
  color: #8f3131;
}

.finance-control-ok {
  color: var(--muted);
}

.finance-action-callout {
  gap: 0.22rem;
  padding: 0.78rem 0.84rem;
  border-radius: 14px;
  border: 1px solid rgba(205, 216, 221, 0.92);
  background: rgba(243, 247, 248, 0.96);
}

.finance-action-callout.is-urgent {
  border-color: rgba(229, 204, 132, 0.95);
  background: linear-gradient(180deg, rgba(251, 247, 233, 0.98) 0%, rgba(247, 238, 206, 0.95) 100%);
}

.finance-action-callout strong,
.finance-doc-item strong {
  font-size: 0.98rem;
}

.finance-action-callout span,
.finance-action-callout small {
  color: var(--text-soft);
}

.finance-badge-row .status-badge,
.finance-badge-row .status-pill {
  margin: 0;
}

.finance-doc-item {
  gap: 0.55rem;
}

.finance-doc-card {
  gap: 0.85rem;
}

.finance-doc-card.is-quiet .section-head-copy p {
  max-width: 64ch;
}

.finance-doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.finance-doc-upload,
.finance-doc-panel {
  gap: 0.75rem;
}

.finance-doc-panel {
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  background: rgba(246, 249, 250, 0.96);
  border: 1px solid rgba(210, 220, 226, 0.88);
}

.finance-doc-empty {
  background: rgba(241, 246, 247, 0.96);
}

.finance-upload-drawer {
  border-radius: 14px;
  border: 1px solid rgba(210, 220, 226, 0.88);
  background: rgba(246, 249, 250, 0.96);
  padding: 0.85rem 0.9rem;
}

.finance-upload-drawer summary {
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.finance-upload-drawer summary::-webkit-details-marker {
  display: none;
}

.finance-upload-drawer[open] summary {
  margin-bottom: 0.8rem;
}

.finance-focus-checkline.is-positive,
.finance-status-card.is-quiet .budget-checkline {
  background: rgba(236, 245, 239, 0.96);
  border-color: rgba(182, 212, 194, 0.9);
}

.finance-cross-checkline.is-positive {
  background: rgba(236, 245, 239, 0.96);
  border-color: rgba(182, 212, 194, 0.9);
}

.finance-cross-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.finance-preview-trigger {
  padding-inline: 0;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.finance-preview-trigger:hover {
  background: transparent;
}

.finance-preview-modal[hidden] {
  display: none;
}

.finance-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.finance-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 29, 0.56);
}

.finance-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 2rem);
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(210, 220, 226, 0.92);
  box-shadow: 0 24px 48px rgba(10, 24, 29, 0.26);
}

.finance-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.finance-preview-body {
  min-height: 320px;
  max-height: calc(100vh - 10rem);
  display: grid;
  place-items: center;
  overflow: auto;
}

.finance-preview-body img,
.finance-preview-body iframe {
  width: 100%;
  max-height: calc(100vh - 12rem);
  border: 0;
  border-radius: 12px;
  background: rgba(241, 246, 247, 0.96);
}

.finance-preview-body img {
  object-fit: contain;
}

.finance-preview-fallback {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  text-align: center;
}

.finance-doc-meta {
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.finance-trace-card .budget-meta-item {
  gap: 0.18rem;
}

.finance-trace-note {
  display: block;
}

/* Operational modules: reuse these dense-reading patterns instead of per-template card systems. */
.ops-list,
.ops-day-grid,
.ops-support-grid,
.choice-grid {
  display: grid;
  gap: 1rem;
}

.ops-list.compact {
  gap: 0.75rem;
}

.ops-day-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ops-support-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.ops-item,
.ops-day-card,
.ops-note,
.ops-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.ops-item,
.ops-day-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.ops-note,
.ops-panel {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  background: var(--surface-alt);
}

.ops-item.is-warning,
.ops-day-card.is-warning {
  border-color: #e6cf92;
  background: linear-gradient(180deg, #fffdf7 0%, #fcf8ea 100%);
}

.ops-item.is-danger,
.ops-day-card.is-danger {
  border-color: #e3b6b6;
  background: linear-gradient(180deg, #fffdfd 0%, #fbf2f2 100%);
}

.ops-item.is-success,
.ops-day-card.is-success {
  border-color: #acd6bb;
  background: linear-gradient(180deg, #fdfefd 0%, #f3faf5 100%);
}

.ops-item-head,
.ops-note-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.ops-title {
  display: grid;
  gap: 0.35rem;
}

.ops-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.ops-meta strong {
  color: var(--text);
  font-size: inherit;
}

.ops-metrics {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.ops-metric {
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  background: rgba(241, 245, 245, 0.9);
  border: 1px solid rgba(212, 222, 227, 0.9);
}

.ops-metric span {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--muted);
}

.ops-metric strong {
  display: block;
  margin-top: 0.22rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ops-note strong,
.ops-panel strong {
  color: var(--text);
}

.budget-production-bridge {
  border: 1px solid rgba(26, 46, 80, 0.10);
}

.budget-production-bridge-banner.is-success {
  border-color: rgba(46, 125, 87, 0.22);
  background: linear-gradient(180deg, #f4faf6 0%, #e8f3eb 100%);
}

.budget-production-bridge-banner.is-positive {
  border-color: rgba(46, 125, 87, 0.22);
  background: linear-gradient(180deg, #f4faf6 0%, #e8f3eb 100%);
}

.budget-production-bridge-banner.is-warning {
  border-color: rgba(180, 128, 28, 0.26);
  background: linear-gradient(180deg, #fff9ef 0%, #f8efd8 100%);
}

.budget-production-bridge-banner.is-danger {
  border-color: rgba(168, 73, 63, 0.24);
  background: linear-gradient(180deg, #fff7f4 0%, #f7e8e3 100%);
}

.budget-production-bridge-banner.is-neutral {
  border-color: rgba(85, 119, 166, 0.2);
  background: linear-gradient(180deg, #f5f8fc 0%, #e8eef7 100%);
}

.traceability-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(166, 176, 190, 0.45);
  background: rgba(247, 249, 250, 0.96);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.traceability-status.is-success {
  border-color: rgba(46, 125, 87, 0.22);
  background: rgba(234, 245, 238, 0.96);
  color: #1d6a46;
}

.traceability-status.is-positive {
  border-color: rgba(46, 125, 87, 0.22);
  background: rgba(234, 245, 238, 0.96);
  color: #1d6a46;
}

.traceability-status.is-warning {
  border-color: rgba(180, 128, 28, 0.26);
  background: rgba(251, 244, 224, 0.98);
  color: #8f6415;
}

.traceability-status.is-danger {
  border-color: rgba(168, 73, 63, 0.24);
  background: rgba(250, 237, 233, 0.98);
  color: #8e3d31;
}

.traceability-status.is-muted {
  border-color: rgba(155, 167, 179, 0.28);
  background: rgba(245, 247, 249, 0.98);
  color: #617182;
}

.traceability-status.is-neutral {
  border-color: rgba(85, 119, 166, 0.2);
  background: rgba(236, 242, 248, 0.98);
  color: #44607e;
}

.plan-real-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.plan-real-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(166, 176, 190, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.plan-real-card strong {
  font-size: 1.15rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.plan-real-card.is-success {
  border-color: rgba(46, 125, 87, 0.16);
  background: linear-gradient(180deg, rgba(244, 250, 246, 0.96) 0%, rgba(236, 246, 240, 0.98) 100%);
}

.plan-real-card.is-warning {
  border-color: rgba(180, 128, 28, 0.18);
  background: linear-gradient(180deg, rgba(255, 249, 239, 0.96) 0%, rgba(251, 243, 222, 0.98) 100%);
}

.plan-real-card.is-danger {
  border-color: rgba(168, 73, 63, 0.18);
  background: linear-gradient(180deg, rgba(255, 247, 244, 0.96) 0%, rgba(250, 238, 234, 0.98) 100%);
}

.work-orders-filter-grid {
  align-items: end;
}

.work-orders-control-card .actions {
  gap: 0.5rem;
}

.engineering-section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.engineering-section-links .traceability-status {
  text-decoration: none;
}

.work-order-row-alert {
  background: rgba(255, 247, 244, 0.42);
}

.work-order-pending-list {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.plan-real-card.is-muted {
  border-color: rgba(155, 167, 179, 0.18);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(242, 245, 248, 0.98) 100%);
}

.plan-real-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.budget-bridge-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #617182;
}

.budget-bridge-delta.is-success {
  color: #1d6a46;
}

.budget-bridge-delta.is-warning {
  color: #8f6415;
}

.budget-bridge-delta.is-danger {
  color: #8e3d31;
}

.production-deviation-filter form {
  align-items: end;
}

.production-deviation-filter .checkbox-field {
  align-self: end;
}

.production-deviation-checkbox {
  min-height: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(166, 176, 190, 0.18);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.96);
}

.production-deviation-queue .ops-support-list li {
  display: grid;
  gap: 0.28rem;
  padding: 0.2rem 0;
}

.deviation-cause-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.deviation-cause-list li + li {
  margin-top: 0.2rem;
}

.ops-support-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.ops-support-list li + li {
  margin-top: 0.35rem;
}

.choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.choice-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}

.choice-chip input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.card > summary,
.card details > summary,
.ops-item details > summary,
.ops-note details > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.card[open] > summary,
.card details[open] > summary,
.ops-item details[open] > summary,
.ops-note details[open] > summary {
  margin-bottom: 0.85rem;
}

.compact-card > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

.compact-card > summary::-webkit-details-marker {
  display: none;
}

.compact-card > summary::after {
  content: "Mostrar";
  margin-left: 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.compact-card[open] > summary {
  margin-bottom: 0.9rem;
}

.compact-card[open] > summary::after {
  content: "Ocultar";
}


.weekly-page-head,
.weekly-summary,
.weekly-support {
  box-shadow: none;
}

.weekly-board {
  --weekly-day-width: 18.75rem;
  gap: 0.72rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.weekly-board > .section-head {
  padding: 0 0 0.2rem;
}

.weekly-board-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 0.45rem;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior-x: contain;
}

.weekly-day-grid {
  gap: 0.72rem;
  grid-auto-flow: column;
  grid-auto-columns: var(--weekly-day-width);
  grid-template-columns: none;
  align-items: start;
  min-width: max-content;
}

.weekly-day-card {
  gap: 0.55rem;
  padding: 0.82rem 0.88rem 0.78rem;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(212, 222, 227, 0.9);
  box-shadow: none;
}

.weekly-day-card .ops-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
}

.weekly-day-card .ops-title {
  gap: 0.12rem;
}

.weekly-day-card .ops-title strong {
  font-size: 0.96rem;
}

.weekly-day-add {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-ink);
  box-shadow: none;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.weekly-day-add:hover {
  transform: none;
  background: none;
  text-decoration: underline;
}

.weekly-day-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem 0.75rem;
  padding-top: 0.08rem;
}

.weekly-day-metrics .ops-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.weekly-day-metrics .ops-metric span {
  display: inline;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weekly-day-metrics .ops-metric strong {
  display: inline;
  margin-top: 0;
  font-size: 0.9rem;
}

.weekly-entry-list {
  gap: 0;
}

.weekly-entry {
  gap: 0;
  padding: 0.62rem 0 0.66rem;
  border: 0;
  border-top: 1px solid rgba(212, 222, 227, 0.84);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.weekly-entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.weekly-entry:last-child {
  padding-bottom: 0;
}

.weekly-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.75rem;
  gap: 0.55rem 0.9rem;
  align-items: start;
}

.weekly-entry-title {
  gap: 0.16rem;
  min-width: 0;
  overflow: hidden;
}

.weekly-entry-taskline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.38rem;
}

.weekly-entry-title-link {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.22;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
}

.weekly-entry-title-link:hover {
  color: var(--accent-ink);
}

.weekly-entry-title-link.is-empty {
  color: var(--text);
}

.weekly-entry-inline-link {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.weekly-entry-inline-link:hover {
  color: var(--accent-ink);
}

.weekly-entry-lead,
.weekly-entry-support,
.weekly-entry-detail {
  gap: 0.38rem;
  font-size: 0.78rem;
}

.weekly-entry-lead {
  row-gap: 0.15rem;
}

.weekly-entry-person {
  color: var(--text);
  font-weight: 800;
}

.weekly-entry-detail {
  margin-top: 0.1rem;
  color: var(--muted);
}

.weekly-entry-detail span {
  min-width: 0;
}

.weekly-entry-detail a {
  font-weight: 700;
}

.weekly-entry-rail {
  display: grid;
  gap: 0.24rem;
  justify-items: end;
  align-content: start;
  min-width: 0;
}

.weekly-entry-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
  justify-content: flex-end;
}

.weekly-entry-hours {
  color: var(--text-soft);
  font-size: 0.76rem;
  white-space: nowrap;
}

.weekly-entry-hours strong {
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.weekly-entry-hours-secondary {
  padding-left: 0.35rem;
  border-left: 1px solid rgba(212, 222, 227, 0.9);
}

.weekly-entry-summary .status-badge {
  padding: 0.18rem 0.44rem;
  font-size: 0.68rem;
}

.weekly-entry-summary .status-badge::before {
  width: 0.38rem;
  height: 0.38rem;
}

.weekly-entry-support {
  justify-content: flex-end;
  color: var(--muted);
}

.weekly-entry-actions {
  gap: 0.22rem 0.5rem;
  justify-content: flex-end;
}

.weekly-entry-actions form {
  gap: 0;
}

.weekly-entry-actions .button.weekly-entry-commit,
.weekly-entry-actions button.weekly-entry-commit {
  min-height: 28px;
  padding: 0.28rem 0.5rem;
  font-size: 0.74rem;
  border-radius: 8px;
}

.weekly-action-link {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-ink);
  box-shadow: none;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
}

.weekly-action-link:hover {
  transform: none;
  background: none;
  text-decoration: underline;
}

.weekly-entry-empty {
  gap: 0.22rem;
  padding: 0.5rem 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}


@media (max-width: 980px) {
  .weekly-entry-head,
  .weekly-day-card .ops-item-head {
    grid-template-columns: 1fr;
  }

  .weekly-entry-rail {
    width: 100%;
    justify-items: start;
  }

  .weekly-entry-summary,
  .weekly-entry-support,
  .weekly-entry-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .weekly-entry-hours-secondary {
    border-left: 0;
    padding-left: 0;
  }

  .weekly-entry-actions {
    gap: 0.32rem 0.6rem;
  }
}

/* Login is the most reduced expression of the system: title, trust note, action. */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.25rem;
}

.login-card {
  width: min(100%, 500px);
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(212, 222, 227, 0.95);
  box-shadow: var(--shadow);
}

.login-flow {
  gap: 1.15rem;
}

.login-header {
  display: grid;
  gap: 0.45rem;
}

.login-trust {
  margin-bottom: 0.15rem;
}

.login-form {
  gap: 0.9rem;
}

.login-form button {
  margin-top: 0.15rem;
}

.login-footnote {
  margin-bottom: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.5rem 0.78rem;
  color: var(--muted);
  font-weight: 700;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(212, 222, 227, 0.9);
}

.back-link:hover {
  background: var(--surface);
  text-decoration: none;
}

.table-actions {
  white-space: nowrap;
}

.table-emphasis {
  font-weight: 700;
  color: var(--text);
}

.table-number {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-text {
  font-weight: 700;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 700;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
  margin-top: 0.2rem;
}

.checkbox-field small {
  display: block;
}

ol.helper-list {
  padding-left: 1.25rem;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 24, 28, 0.42);
    z-index: 19;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 84vw);
    height: 100vh;
    min-height: 100vh;
    z-index: 20;
    border-radius: 0 24px 24px 0;
    transform: translateX(-104%);
    transition: transform 0.18s ease;
    box-shadow: 0 18px 48px rgba(5, 18, 22, 0.25);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  .content {
    padding: 1rem;
  }

  .chapter-hero,
  .budget-hero,
  .budget-shell.budget-shell-sidebar,
  .budget-shell.budget-shell-form {
    grid-template-columns: 1fr;
  }

  .finance-doc-layout {
    grid-template-columns: 1fr;
  }

  .finance-signal-grid {
    grid-template-columns: 1fr;
  }

  .finance-category-stats,
  .purchase-signal-grid,
  .purchase-hero-stats,
  .purchase-procedure-stats,
  .purchase-operational-grid,
  .purchase-modal-options,
  .purchase-fulfillment-stats,
  .finance-dashboard-kpi-grid,
  .finance-category-metrics {
    grid-template-columns: 1fr;
  }

  .purchase-hero,
  .finance-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .finance-filter-toggle,
  .purchase-filter-toggle,
  .finance-category-head,
  .finance-preview-head {
    flex-direction: column;
    align-items: stretch;
  }

  .purchase-hero-back {
    justify-self: start;
  }

  .finance-dashboard-movement {
    grid-template-columns: 1fr;
  }

  .finance-dashboard-movement-amount {
    justify-items: start;
  }

  .finance-dashboard-head {
    align-items: stretch;
  }

  .finance-dashboard-preset-row {
    justify-content: flex-start;
  }

  .budget-opportunity-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .budget-opportunity-actions {
    justify-content: flex-start;
  }

  .chapter-hero-stats,
  .chapter-cost-grid,
  .compact-meta-grid,
  .budget-hero-stats,
  .budget-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-hero-back,
  .budget-hero-back {
    justify-self: start;
  }

  .chapter-hero-action-grid,
  .chapter-hero-secondary-grid,
  .chapter-hero-ops-grid,
  .primary-cost-actions,
  .secondary-cost-actions,
  .budget-hero-action-grid,
  .budget-hero-export-grid,
  .budget-hero-secondary-grid,
  .budget-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-history-summary-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .budget-history-meta {
    justify-items: start;
    text-align: left;
  }

  .page-head,
  .card-head,
  .section-head,
  .toolbar,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-main {
    width: 100%;
  }

  .topbar-copy strong {
    font-size: 1.1rem;
  }

  .topbar {
    position: static;
    padding-top: 0.25rem;
    background: transparent;
    backdrop-filter: none;
  }

  .grid.two,
  .grid.three,
  .form-grid,
  .kiosk-actions,
  .field-grid.two,
  .field-grid.three,
  .field-grid.four {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .chapter-hero,
  .budget-hero {
    padding: 1rem;
  }

  .chapter-hero-action-grid,
  .chapter-hero-secondary-grid,
  .chapter-hero-ops-grid,
  .primary-cost-actions,
  .secondary-cost-actions,
  .chapter-hero-stats,
  .chapter-cost-grid,
  .compact-meta-grid,
  .budget-hero-stats,
  .budget-hero-action-grid,
  .budget-hero-export-grid,
  .budget-hero-secondary-grid,
  .budget-status-strip {
    grid-template-columns: 1fr;
  }

  .budget-status-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-section-actions {
    justify-content: flex-start;
  }

  .chapter-hero-title,
  .budget-hero-title {
    font-size: 1.8rem;
  }

  .chapter-workspace-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .cost-section-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .cost-section-summary-line {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .cost-section-summary-action {
    width: 100%;
  }

  .chapter-executive-head {
    grid-template-columns: 1fr;
  }

  .chapter-side-summary {
    justify-items: start;
    text-align: left;
  }

  .chapter-workspace-meta {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .page-head,
  .card,
  .summary-strip,
  .form-shell {
    padding: 1rem;
  }

  .topbar,
  .content-shell {
    gap: 1rem;
  }

  .stats-grid,
  .summary-grid,
  .cta-grid,
  .detail-list,
  .info-grid,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .budget-highlight strong {
    font-size: 1.8rem;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .table-wrap tbody {
    display: grid;
    gap: 0.8rem;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(110px, 42%) 1fr;
    gap: 0.75rem;
    padding: 0.78rem 0.9rem;
    border-bottom: 1px solid rgba(202, 215, 222, 0.75);
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .table-wrap td[colspan] {
    display: block;
    text-align: left;
  }

  .table-wrap td[colspan]::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .login-wrap {
    padding: 1rem;
  }

  .topbar-copy,
  .topbar-main {
    gap: 0.7rem;
  }

  .actions,
  .form-actions,
  .topbar-actions {
    align-items: stretch;
  }

  .actions > *,
  .form-actions > *,
  .topbar-actions > * {
    width: 100%;
  }

  .actions a:not(.button):not(.link-button),
  .table-actions a:not(.button):not(.link-button),
  .topbar-actions form button,
  .topbar-actions a,
  .form-actions button,
  .form-actions a {
    width: 100%;
  }
}


.docs-page-head {
  margin-bottom: 0.35rem;
}

.docs-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.85rem;
  align-items: center;
}

.docs-toolbar .button,
.docs-toolbar button {
  min-height: 3.1rem;
  padding: 0.95rem 1.35rem;
  font-size: 1rem;
  font-weight: 800;
}

.docs-toolbar > * {
  flex: 0 0 auto;
}

.docs-page-head .actions.docs-toolbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.85rem;
}

.docs-list-card {
  margin-top: 0;
}

.app-modal[hidden] {
  display: none;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 23, 31, 0.52);
  backdrop-filter: blur(3px);
}

.app-modal-card {
  width: min(860px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 248, 0.98) 100%);
  border: 1px solid rgba(202, 215, 222, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 64px rgba(10, 24, 33, 0.22);
}

.app-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.2rem 0.9rem;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid rgba(202, 215, 222, 0.75);
}

.app-modal-head h3,
.app-modal-head p {
  margin: 0;
}

.app-modal-body {
  padding: 1.1rem 1.2rem 1.2rem;
}

.modal-form-stack {
  display: grid;
  gap: 1rem;
}

.modal-form-summary {
  display: grid;
  gap: 0.4rem;
}

.modal-form-summary h3 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-form-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-form-breadcrumb a {
  color: inherit;
}

.modal-form-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.modal-form-context a,
.modal-form-context span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.modal-form-context > * + *::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--text-soft);
}

.modal-form-card {
  margin: 0;
}

.modal-form-stack .modal-form-context-banner {
  display: none;
}

.modal-form-stack .modal-form-card,
.modal-form-stack .form-shell {
  box-shadow: none;
}

.modal-form-stack .form-shell {
  padding: 0.8rem;
}

.modal-form-stack .form-section {
  padding: 0.78rem;
}

.modal-form-footer {
  margin-top: 0.15rem;
}

.modal-form-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.modal-form-side-compact {
  gap: 0.55rem;
  font-size: 0.9rem;
}

.docs-modal[hidden] {
  display: none;
}

.docs-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 23, 31, 0.52);
  backdrop-filter: blur(3px);
}

.docs-modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 248, 0.98) 100%);
  border: 1px solid rgba(202, 215, 222, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 64px rgba(10, 24, 33, 0.22);
}

.docs-modal-card--narrow {
  width: min(560px, 100%);
}

.docs-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.2rem 0.9rem;
  border-bottom: 1px solid rgba(202, 215, 222, 0.75);
}

.docs-modal-head > div {
  display: grid;
  gap: 0.3rem;
}

.docs-modal-body {
  padding: 1.1rem 1.2rem 1.2rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .docs-toolbar,
  .docs-page-head .actions.docs-toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .docs-toolbar > * {
    flex: 1 1 220px;
  }

  .docs-modal {
    padding: 0.75rem;
    align-items: end;
  }

  .app-modal {
    padding: 0.75rem;
    align-items: end;
  }

  .app-modal-card {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
  }

  .app-modal-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .docs-modal-card,
  .docs-modal-card--narrow {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
  }

  .docs-modal-head {
    flex-direction: column;
    align-items: stretch;
  }
}

.docs-filter-chips-card {
  margin-top: 0;
}

.docs-filter-chips-head {
  margin-bottom: 0.9rem;
}

.docs-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.docs-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.82rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3f7f6 0%, #ebf1ef 100%);
  border: 1px solid rgba(191, 206, 204, 0.95);
  color: var(--text);
  font-weight: 700;
}

.docs-filter-chip:hover {
  background: linear-gradient(180deg, #eef4f2 0%, #e2ebe8 100%);
}

.docs-filter-chip-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(17, 83, 67, 0.12);
  color: var(--accent-ink);
  font-weight: 900;
}

.docs-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  font-weight: 800;
}

.docs-sort-link:hover,
.docs-sort-link.is-active {
  color: var(--accent-ink);
}

.docs-title-cell {
  display: grid;
  gap: 0.22rem;
}

.docs-title-link {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
}

.docs-title-link:hover {
  color: var(--accent-ink);
}

.docs-project-text {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.docs-meta-line,
.docs-meta-text {
  color: var(--muted);
  font-size: 0.84rem;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.95rem;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.docs-badge-status-draft {
  background: #f5f0e4;
  border-color: #e4d6af;
  color: #7b5f17;
}

.docs-badge-status-current,
.docs-badge-status-approved {
  background: #e7f4ec;
  border-color: #b8d8c4;
  color: #1e6b42;
}

.docs-badge-status-delivered,
.docs-badge-status-submitted {
  background: #e9f0f7;
  border-color: #c1d0df;
  color: #2d5d84;
}

.docs-badge-status-obsolete {
  background: #f3eaea;
  border-color: #ddc4c4;
  color: #8a4d4d;
}

.docs-badge-format-pdf {
  background: #f6ece8;
  border-color: #e4c3b8;
  color: #8a442c;
}

.docs-badge-format-dwg {
  background: #ebeaf6;
  border-color: #cac7e7;
  color: #55469a;
}

.docs-badge-usage-internal {
  background: #eef1f3;
  border-color: #d4dce2;
  color: #4d5f6d;
}

.docs-badge-usage-workshop {
  background: #e8f4ee;
  border-color: #bddacb;
  color: #1b6d4d;
}

.docs-badge-usage-client {
  background: #f7f0e6;
  border-color: #e4d2af;
  color: #85621f;
}

.docs-badge-usage-regulatory {
  background: #edf0f9;
  border-color: #cbd3ed;
  color: #465f9b;
}

.docs-badge-usage-administrative {
  background: #f3edf7;
  border-color: #d8c9e3;
  color: #755594;
}

.docs-workshop-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #eef1f3;
  color: #6b7a85;
  font-weight: 900;
}

.docs-workshop-flag.is-visible {
  background: #e4f4eb;
  color: #1c6f4b;
}

.docs-table-actions {
  flex-wrap: nowrap;
}

@media (max-width: 760px) {
  .docs-filter-chips-head {
    margin-bottom: 0.75rem;
  }

  .docs-filter-chip {
    width: 100%;
    justify-content: space-between;
  }

  .docs-table-actions {
    flex-wrap: wrap;
  }
}

.docs-preview-layout {
  align-items: start;
}

.docs-preview-head .actions {
  flex-wrap: wrap;
}

.docs-preview-surface {
  min-height: 520px;
}

.docs-preview-frame-wrap {
  margin-top: 0.9rem;
  border: 1px solid rgba(202, 215, 222, 0.9);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #f7faf8 0%, #eef3f1 100%);
}

.docs-preview-frame {
  display: block;
  width: 100%;
  min-height: 72vh;
  border: 0;
  background: #dfe7e3;
}

.docs-preview-empty {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1.2rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8f5ee 0%, #f1ece0 100%);
  border: 1px solid rgba(217, 206, 181, 0.95);
}

.docs-preview-empty strong {
  font-size: 1rem;
}

.docs-preview-empty-actions {
  margin-top: 0.15rem;
}

.docs-preview-meta {
  position: sticky;
  top: 1rem;
}

.docs-preview-description {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(202, 215, 222, 0.8);
}

.docs-preview-description h4 {
  margin-bottom: 0.55rem;
}

.dashboard-page-head {
  align-items: flex-end;
}

.dashboard-head-meta {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.dashboard-operational-layout {
  display: grid;
  gap: 1rem;
}

.dashboard-operational-head {
  margin-bottom: 0;
}

.dashboard-section-card {
  display: grid;
  gap: 0.85rem;
  border-color: rgba(203, 216, 223, 0.95);
  box-shadow: 0 10px 24px rgba(31, 49, 60, 0.055);
}

.dashboard-section-card .card-head {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(221, 229, 233, 0.95);
}

.dashboard-feed-list,
.dashboard-compact-list {
  display: grid;
  gap: 0.48rem;
}

.dashboard-feed-item,
.dashboard-compact-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.7rem;
  align-items: center;
  min-height: 3.1rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(216, 225, 230, 0.9);
  border-radius: 13px;
  background: rgba(249, 251, 252, 0.92);
  text-decoration: none;
}

.dashboard-compact-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  color: var(--text);
}

.dashboard-feed-copy,
.dashboard-compact-row > div:first-child,
.dashboard-row-meta {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.dashboard-feed-copy strong,
.dashboard-compact-row strong {
  color: var(--text);
  line-height: 1.18;
}

.dashboard-feed-copy span,
.dashboard-compact-row span,
.dashboard-feed-date,
.dashboard-row-meta small {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.dashboard-row-meta {
  justify-items: end;
  text-align: right;
}

.dashboard-operational-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.2rem;
  min-height: 1.65rem;
  padding: 0.08rem 0.52rem;
  border-radius: 999px;
  background: rgba(231, 239, 242, 0.95);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.dashboard-feed-item.is-commercial .dashboard-operational-chip {
  background: rgba(223, 241, 233, 0.96);
  color: #2f6d51;
}

.dashboard-feed-item.is-project .dashboard-operational-chip,
.dashboard-feed-item.is-client .dashboard-operational-chip {
  background: rgba(226, 240, 245, 0.96);
  color: #2f6171;
}

.dashboard-feed-item.is-production .dashboard-operational-chip,
.dashboard-feed-item.is-workorder .dashboard-operational-chip,
.dashboard-feed-item.is-engineering .dashboard-operational-chip {
  background: rgba(244, 236, 218, 0.96);
  color: #70551c;
}

.dashboard-recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-secondary-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.dashboard-focus-grid,
.dashboard-quick-actions {
  display: grid;
  gap: 0.55rem;
}

.dashboard-focus-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-focus-card,
.dashboard-secondary-access {
  display: grid;
  gap: 0.26rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(215, 224, 229, 0.92);
  border-radius: 14px;
  background: rgba(249, 251, 252, 0.95);
  color: var(--text);
  text-decoration: none;
}

.dashboard-focus-card {
  border-left-width: 4px;
}

.dashboard-focus-card.is-warning {
  border-left-color: #c7a352;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf6e8 100%);
}

.dashboard-focus-card.is-info,
.dashboard-focus-card.is-commercial {
  border-left-color: #5997a4;
}

.dashboard-focus-card span,
.dashboard-secondary-access span {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-focus-card strong {
  font-size: 1.42rem;
  line-height: 1;
}

.dashboard-focus-card h4,
.dashboard-focus-card p,
.dashboard-secondary-access strong,
.dashboard-secondary-access small {
  margin: 0;
}

.dashboard-focus-card p,
.dashboard-secondary-access small {
  color: var(--text-soft);
  line-height: 1.32;
}

.dashboard-focus-card em {
  color: #245f6b;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.dashboard-quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-secondary-access {
  min-height: 5.2rem;
}

.dashboard-empty-row {
  padding: 0.8rem 0.9rem;
  border: 1px dashed rgba(207, 218, 224, 0.94);
  border-radius: 13px;
  background: rgba(248, 250, 251, 0.92);
  color: var(--text-soft);
  font-weight: 800;
}

.dashboard-priority-grid,
.dashboard-queue-grid,
.dashboard-shortcuts-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-priority-card,
.dashboard-shortcut {
  display: grid;
  gap: 0.5rem;
  padding: 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(247, 249, 250, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
  box-shadow: var(--shadow-sm);
  align-content: start;
}

.dashboard-priority-card {
  border-left-width: 4px;
}

.dashboard-priority-card span,
.dashboard-shortcut span {
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.dashboard-priority-card strong {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.dashboard-priority-card h3,
.dashboard-shortcut strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

.dashboard-priority-card.is-warning {
  border-left-color: #d4b26b;
  background: linear-gradient(180deg, #fffdf7 0%, #fcf6e9 100%);
}

.dashboard-priority-card.is-danger {
  border-left-color: #c97a7a;
  background: linear-gradient(180deg, #fffdfd 0%, #faf1f1 100%);
}

.dashboard-queue-card {
  min-height: 100%;
}

.dashboard-queue-card small {
  display: block;
  margin-top: 0.45rem;
}

.dashboard-empty {
  margin: 0;
}

.dashboard-smoke-card {
  display: grid;
  gap: 0.75rem;
}

.dashboard-smoke-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.dashboard-smoke-message {
  margin: 0;
  color: var(--text-soft);
}

@media (max-width: 980px) {
  .docs-preview-meta {
    position: static;
  }

  .docs-preview-frame {
    min-height: 58vh;
  }

  .dashboard-head-meta {
    justify-items: start;
  }

  .dashboard-recent-grid,
  .dashboard-secondary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-feed-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-feed-item .button {
    width: 100%;
    justify-content: center;
  }

  .dashboard-row-meta {
    justify-items: start;
    text-align: left;
  }
}

.production-home-head {
  align-items: start;
}

.production-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 1rem;
}

.production-action-grid,
.production-quick-actions,
.production-attention-list {
  display: grid;
  gap: 0.65rem;
}

.production-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(10rem, max-content));
  align-items: stretch;
  justify-content: flex-start;
}

.production-action-grid > * {
  justify-content: flex-start;
}

.production-cockpit-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.production-cockpit-card {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  grid-template-rows: auto auto auto min-content;
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(212, 222, 227, 0.92);
  border-left: 4px solid #6a9aa5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.production-cockpit-card.is-hot {
  border-left-color: #c7a352;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.production-cockpit-card h3,
.production-cockpit-card p {
  margin: 0;
}

.production-cockpit-number {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  align-items: baseline;
  min-width: 0;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: rgba(245, 249, 250, 0.92);
}

.production-flow-cta {
  align-self: end;
  justify-self: start;
  border-left: 4px solid var(--brand);
}

.production-cockpit-number strong {
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.production-cockpit-number span,
.production-cockpit-secondary {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.production-attention-list {
  margin-bottom: 1rem;
  padding: 0.95rem;
  border: 1px solid rgba(199, 163, 82, 0.28);
  border-left: 4px solid #c7a352;
  border-radius: 14px;
  background: #fffdf8;
}

.production-attention-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.production-attention-item,
.production-attention-empty {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(215, 224, 229, 0.88);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  text-decoration: none;
}

.production-attention-item span,
.production-attention-empty span {
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.25;
}

.production-metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.production-metric-card,
.production-attention-row,
.production-quick-actions a {
  display: grid;
  gap: 0.28rem;
  text-decoration: none;
  color: var(--text);
}

.production-metric-card {
  min-height: 5.1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(215, 224, 229, 0.92);
  border-left: 4px solid #6a9aa5;
  border-radius: 14px;
  background: rgba(249, 251, 252, 0.96);
  box-shadow: var(--shadow-sm);
}

.production-metric-card.is-warning {
  border-left-color: #c7a352;
}

.production-metric-card span,
.production-metric-card small {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.production-metric-card strong {
  font-size: 1.75rem;
  line-height: 1;
}

.production-attention-row,
.production-quick-actions a {
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(215, 224, 229, 0.88);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.94);
}

.production-attention-row span,
.production-quick-actions span {
  color: var(--text-soft);
  line-height: 1.3;
}

.production-quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.production-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.production-page-purpose {
  max-width: 58rem;
  color: var(--text-soft);
  font-weight: 650;
}

.production-secondary-actions {
  align-items: center;
}

.production-secondary-actions .button:not(:first-child),
.production-secondary-actions a:not(.button):not(.back-link) {
  font-weight: 800;
}

.production-secondary-actions .button.secondary,
.production-secondary-actions a:not(.button):not(.back-link) {
  background: rgba(248, 250, 251, 0.92);
}

.production-primary-action {
  border-left: 4px solid var(--brand);
}

.production-flow-card,
.production-subtle-panel {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(212, 222, 227, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.production-flow-card h3,
.production-flow-card p {
  margin: 0;
}

.production-flow-card {
  align-content: start;
}

.production-flow-metrics {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.25rem 0.45rem;
  align-items: baseline;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: rgba(245, 249, 250, 0.92);
}

.production-flow-metrics strong {
  font-size: 1.25rem;
  line-height: 1;
}

.production-flow-metrics span {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.production-secondary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.production-secondary-links a {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(248, 250, 251, 0.92);
  text-decoration: none;
  font-weight: 800;
}

.production-backlog-section {
  display: grid;
  gap: 1rem;
}

.production-task-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.production-task-filter-strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(212, 222, 227, 0.92);
  border-radius: 999px;
  background: rgba(248, 250, 251, 0.94);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.production-task-filter-strip strong {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.production-task-board {
  display: grid;
  gap: 1rem;
}

.production-task-section {
  border-left: 4px solid rgba(106, 154, 165, 0.9);
}

.production-task-section.is-muted {
  border-left-color: rgba(173, 190, 198, 0.7);
}

.production-task-section h3 span {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.production-stage-section,
.production-muted-context {
  border-color: rgba(212, 222, 227, 0.78);
}

.production-muted-context {
  opacity: 0.94;
}

.production-stage-section .section-label,
.production-muted-context .section-label {
  color: var(--text-soft);
}

.production-origin-strip,
.work-order-flow-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(173, 190, 198, 0.58);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.96);
}

.workorder-purpose-card {
  border-left-color: #5d7c8a;
}

.workorder-stage-strip {
  align-items: start;
}

.workorder-stage-strip .card {
  border-color: rgba(212, 222, 227, 0.78);
}

.production-origin-strip > div:first-child,
.work-order-flow-strip > div:first-child {
  display: grid;
  gap: 0.15rem;
}

.production-origin-strip strong,
.work-order-flow-strip strong {
  color: var(--text);
}

.production-origin-strip span,
.work-order-flow-strip span {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.production-origin-links,
.work-order-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.production-origin-links a,
.work-order-flow-actions a {
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(173, 190, 198, 0.7);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.production-task-origin {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 850;
}

.production-task-origin.is-ot {
  color: #2f6f4a;
}

.production-task-origin.is-direct {
  color: #8a6427;
}

.task-operational-focus {
  border-left: 4px solid var(--brand);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.95));
}

.task-operational-focus .section-head {
  align-items: flex-start;
}

.task-operational-focus .section-head-meta {
  align-items: flex-start;
  justify-content: flex-end;
}

.production-row-brief {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.production-compact-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(212, 222, 227, 0.92);
  border-radius: 999px;
  background: rgba(248, 250, 251, 0.96);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.15;
}

.production-compact-chip.is-warning {
  border-color: rgba(199, 163, 82, 0.38);
  background: #fff9eb;
  color: #725923;
}

.production-compact-chip.is-danger {
  border-color: rgba(168, 73, 63, 0.34);
  background: #fff4f1;
  color: #8d3f37;
}

.production-compact-chip.is-ok {
  border-color: rgba(65, 140, 95, 0.32);
  background: #edf8f1;
  color: #2f6f4a;
}

.production-task-summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.22rem 0.58rem;
  border: 1px solid rgba(212, 222, 227, 0.94);
  border-radius: 999px;
  background: rgba(248, 250, 251, 0.96);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.production-muted-detail {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.production-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.production-task-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.production-task-modal {
  width: min(780px, calc(100vw - 2rem));
  max-height: min(86vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.production-task-modal::backdrop {
  background: rgba(12, 26, 32, 0.44);
}

.production-task-modal-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
}

.production-task-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.production-task-modal-head h3,
.production-task-modal-head p {
  margin: 0;
}

.production-task-modal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.production-task-quick-view,
.production-plan-form,
.production-hh-form {
  display: grid;
  gap: 0.9rem;
}

.production-hh-history {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  border: 1px solid rgba(212, 222, 227, 0.9);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.86);
}

.production-hh-history > div {
  display: grid;
  gap: 0.15rem;
}

.production-hh-history span {
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.3;
}

.production-hh-flow-note {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(106, 154, 165, 0.28);
  border-radius: 12px;
  background: #f4fafb;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.production-hh-state-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.25rem;
  padding: 0.16rem 0.48rem;
  border: 1px solid rgba(212, 222, 227, 0.9);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.production-hh-state-chip.is-warning {
  border-color: rgba(199, 163, 82, 0.38);
  background: #fff9eb;
  color: #725923;
}

.production-hh-state-chip.is-ok {
  border-color: rgba(65, 140, 95, 0.32);
  background: #edf8f1;
  color: #2f6f4a;
}

.production-task-row-compact {
  gap: 0.8rem;
}

.production-task-row {
  display: grid;
  gap: 0.7rem;
}

.production-task-detail-layout,
.production-task-decision-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.production-task-hero {
  align-items: start;
}

.production-task-next-action-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
  border: 1px solid rgba(180, 202, 211, 0.72);
  border-left: 4px solid var(--brand);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.95));
  box-shadow: var(--shadow-sm);
}

.production-task-next-panel--warning {
  border-color: rgba(199, 163, 82, 0.42);
  border-left-color: #c7a352;
  background: linear-gradient(180deg, #fffdf7 0%, #fbf6e7 100%);
}

.production-task-next-panel--ready {
  border-color: rgba(88, 147, 158, 0.34);
  border-left-color: #5f9fac;
  background: linear-gradient(180deg, #f7fcfd 0%, #eef7f9 100%);
}

.production-task-next-panel--review {
  border-color: rgba(129, 113, 176, 0.32);
  border-left-color: #8171b0;
  background: linear-gradient(180deg, #faf9ff 0%, #f1eef9 100%);
}

.production-task-next-panel--done {
  border-color: rgba(65, 140, 95, 0.32);
  border-left-color: #418c5f;
  background: linear-gradient(180deg, #f7fcf8 0%, #edf8f1 100%);
}

.production-task-main-cta {
  min-height: 2.35rem;
  padding-inline: 0.9rem;
}

.production-task-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.production-task-next-action-card .section-head {
  align-items: flex-start;
}

.production-task-next-action-form {
  display: inline-flex;
  margin: 0;
}

.production-task-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(212, 222, 227, 0.82);
}

.production-task-summary-chip.is-warning {
  border-color: rgba(199, 163, 82, 0.38);
  background: #fff9eb;
  color: #725923;
}

.production-task-summary-chip.is-danger {
  border-color: rgba(168, 73, 63, 0.34);
  background: #fff4f1;
  color: #8d3f37;
}

.production-task-summary-chip.is-ok {
  border-color: rgba(65, 140, 95, 0.32);
  background: #edf8f1;
  color: #2f6f4a;
}

.production-task-section,
.production-task-section-card {
  border-color: rgba(180, 202, 211, 0.72);
}

.production-task-section-card {
  border-left: 4px solid rgba(106, 154, 165, 0.58);
}

.production-task-work-card {
  align-content: start;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 252, 0.92));
}

.production-task-work-card:nth-child(1) {
  border-left-color: rgba(95, 159, 172, 0.78);
}

.production-task-work-card:nth-child(2) {
  border-left-color: rgba(65, 140, 95, 0.58);
}

.production-task-history-list {
  display: grid;
  gap: 0.55rem;
}

.production-task-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.78rem;
  border: 1px solid rgba(212, 222, 227, 0.9);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.88);
}

.production-task-plan-row {
  align-items: start;
  background: linear-gradient(180deg, rgba(248, 252, 253, 0.98), rgba(242, 248, 250, 0.9));
}

.production-task-plan-row.is-warning {
  border-color: rgba(199, 163, 82, 0.42);
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.98), rgba(252, 246, 231, 0.92));
}

.production-task-plan-copy {
  display: grid;
  min-width: 0;
  gap: 0.14rem;
}

.production-task-plan-actions {
  justify-content: flex-end;
  max-width: 24rem;
}

.production-task-plan-actions .inline-form {
  margin: 0;
}

.production-task-hh-row {
  background: rgba(255, 255, 255, 0.94);
}

.production-task-history-row > div:first-child {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.production-task-history-row span {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.production-task-history-actions {
  justify-content: flex-end;
}

.production-task-review-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.production-task-secondary-context {
  border-left: 4px solid rgba(173, 190, 198, 0.72);
  opacity: 0.96;
}

.production-task-context-details {
  margin-top: 0.65rem;
  border-color: rgba(212, 222, 227, 0.78);
  background: rgba(248, 250, 251, 0.9);
}

.production-task-context-details > summary,
.production-task-context-details > details > summary {
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 850;
}

.production-task-ot-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 1rem;
  background: rgba(248, 250, 251, 0.92);
}

.production-task-muted-context {
  color: var(--text-soft);
}

.production-task-confirm-modal .production-hh-flow-note,
.production-task-plan-modal .production-hh-flow-note {
  margin-bottom: 0.65rem;
}

.production-task-context-compact,
.production-task-secondary-panel {
  padding: 0.72rem 0.85rem;
}

.production-task-details-summary,
.production-task-context-details > summary {
  min-height: 2rem;
}

.production-task-ot-assign .context-banner {
  align-items: center;
}

.production-task-compact-history {
  max-height: 8.5rem;
  overflow: auto;
}

.production-modal-impact {
  align-items: center;
}

.production-task-context-actions {
  justify-content: flex-end;
}

.production-task-ot-context p {
  margin: 0;
}

.production-task-secondary-context > summary {
  cursor: pointer;
  font-weight: 850;
}

.production-task-secondary-body {
  display: grid;
  gap: 1rem;
  margin-top: 0.85rem;
}

.production-task-row-clean {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem 0.8rem;
  align-items: center;
  padding: 0.68rem 0.78rem;
}

.production-task-row-clean .ops-item-head {
  grid-column: 1 / -1;
}

.production-task-main {
  min-width: 0;
}

.production-task-main > strong,
.production-task-main > strong a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.production-task-meta {
  gap: 0.45rem;
}

.production-task-hh-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
  min-width: 0;
}

.production-task-next-action {
  box-shadow: 0 8px 16px rgba(57, 101, 112, 0.12);
  white-space: nowrap;
}

.production-task-secondary-actions .button.secondary {
  border-color: rgba(212, 222, 227, 0.86);
  background: rgba(248, 250, 251, 0.74);
  box-shadow: none;
}

.production-task-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-task-row-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.production-task-risk {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.production-task-risk .muted {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.production-task-actions {
  align-items: center;
  justify-content: flex-end;
  min-width: max-content;
}

.production-task-more {
  position: relative;
}

.production-task-more summary,
.production-backlog-support summary {
  cursor: pointer;
  font-weight: 800;
}

.production-task-more-menu {
  position: absolute;
  right: 0;
  z-index: 5;
  display: grid;
  gap: 0.35rem;
  min-width: 11rem;
  margin-top: 0.35rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.production-task-more-menu a {
  white-space: nowrap;
}

.production-backlog-support {
  align-self: start;
}

.production-backlog-support summary {
  margin-bottom: 0.85rem;
}

.production-planning-header,
.production-weekly-header {
  align-items: start;
}

.production-planning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.production-planning-summary,
.production-weekly-summary {
  margin-top: 0.2rem;
}

.production-attention-panel {
  border-left: 4px solid #6a9aa5;
}

.production-attention-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.production-attention-grid > div {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.58rem 0.68rem;
  border: 1px solid rgba(212, 222, 227, 0.9);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.92);
}

.production-attention-grid strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.production-attention-grid span {
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.25;
}

.production-planning-layout,
.production-weekly-layout {
  border-color: rgba(180, 202, 211, 0.7);
}

.production-planning-row {
  border-left: 4px solid #6a9aa5;
}

.production-planning-row .ops-title {
  min-width: min(100%, 34rem);
}

.production-planning-row-actions {
  align-items: center;
  justify-content: flex-end;
}

.production-row-state {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.production-attendance-ref {
  border-color: rgba(106, 154, 165, 0.32);
  background: linear-gradient(180deg, #f7fbfc 0%, #eef6f7 100%);
}

.production-plan-real-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.5rem 0.58rem;
  border: 1px solid rgba(212, 222, 227, 0.9);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.82);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.production-overrun-chip,
.production-pending-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.65rem;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.production-overrun-chip {
  border: 1px solid rgba(168, 73, 63, 0.34);
  background: #fff4f1;
  color: #8d3f37;
}

.production-pending-chip {
  border: 1px solid rgba(199, 163, 82, 0.38);
  background: #fff9eb;
  color: #725923;
}

.production-pending-chip.is-complete {
  border-color: rgba(65, 140, 95, 0.32);
  background: #edf8f1;
  color: #2f6f4a;
}

.production-ot-link {
  font-weight: 800;
}

.production-weekly-layout .weekly-board-scroll {
  padding-bottom: 0.75rem;
}

.production-weekly-layout .weekly-day-card {
  min-height: 18rem;
}

.production-weekly-layout .weekly-entry-actions {
  align-items: center;
}

.production-hours-header {
  align-items: start;
}

.production-hours-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.production-hours-summary {
  margin-top: 0.2rem;
}

.production-hours-layout {
  border-color: rgba(180, 202, 211, 0.72);
}

.production-attendance-note {
  border-left: 4px solid #6a9aa5;
}

.production-hours-table th,
.production-hours-table td {
  vertical-align: top;
}

.production-hours-table tr.is-attention td {
  background: rgba(255, 249, 235, 0.48);
}

.production-hours-status,
.production-plan-real-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.65rem;
  padding: 0.22rem 0.48rem;
  border: 1px solid rgba(212, 222, 227, 0.94);
  border-radius: 999px;
  background: rgba(248, 250, 251, 0.96);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.production-hours-status.is-warning {
  border-color: rgba(199, 163, 82, 0.42);
  background: #fff9eb;
  color: #725923;
}

.production-plan-real-chip {
  white-space: normal;
}

.production-hours-exception-grid,
.production-approval-list {
  display: grid;
  gap: 0.72rem;
}

.production-approval-row {
  display: grid;
  gap: 0.72rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(212, 222, 227, 0.92);
  border-left: 4px solid #6a9aa5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.production-approval-row.is-warning {
  border-left-color: #c7a352;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf7ea 100%);
}

.production-approval-main {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 0.75rem;
}

.production-approval-main > div,
.production-approval-context {
  min-width: 0;
}

.production-approval-main p,
.production-approval-context div {
  margin: 0.18rem 0 0;
  line-height: 1.35;
}

.production-approval-context {
  display: grid;
  gap: 0.28rem;
  padding: 0.65rem 0.72rem;
  border-radius: 12px;
  background: rgba(244, 248, 249, 0.86);
  color: var(--text-soft);
  font-size: 0.88rem;
}

.production-approval-actions {
  justify-content: flex-end;
}

.approvals-support summary {
  cursor: pointer;
  font-weight: 800;
}

.approvals-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.9rem;
}

@media (max-width: 980px) {
  .production-home-layout,
  .production-cockpit-layout,
  .production-flow-grid,
  .production-metric-strip,
  .production-action-grid,
  .proposal-tool-layout,
  .production-task-main-grid,
  .production-task-metrics,
  .production-quick-actions,
  .production-attention-grid {
    grid-template-columns: 1fr;
  }

  .production-planning-actions {
    justify-content: flex-start;
  }

  .production-hours-actions,
  .production-approval-actions {
    justify-content: flex-start;
  }

  .production-approval-main {
    grid-template-columns: 1fr;
  }

  .production-task-row-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .production-task-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .production-row-actions {
    justify-content: flex-start;
  }

  .production-task-row-clean {
    grid-template-columns: 1fr;
  }

  .production-task-history-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .production-task-history-actions {
    justify-content: flex-start;
  }

  .production-task-plan-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .proposal-item-row,
  .proposal-linked-selectors,
  .proposal-pdf-header,
  .proposal-pdf-footer {
    grid-template-columns: 1fr;
  }

  .proposal-title-block {
    justify-items: start;
    text-align: left;
  }

  .proposal-totals-table {
    width: 100%;
  }

  .production-flow-metrics {
    grid-template-columns: auto 1fr;
  }

  .production-task-more-menu {
    position: static;
  }
}


