:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #e7eef2;
  background: #091118;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 18%, rgb(30 199 202 / 10%), transparent 32rem),
    linear-gradient(145deg, #0c161e 0%, #071017 62%, #0b141a 100%);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid #22333d;
  background: rgb(9 17 24 / 88%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #f3b526;
  color: #f3b526;
  font-family: Georgia, serif;
  font-size: 23px;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0.14em;
}

.brand strong {
  color: #f4f7f8;
  font-family: Georgia, serif;
  font-size: 18px;
}

.brand small {
  margin-top: 3px;
  color: #83a0ae;
  font-size: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #b7c9d0;
  font-size: 13px;
}

.header-actions a {
  color: #d8e3e7;
  font-weight: 700;
  text-decoration: none;
}

.header-actions a:hover {
  color: #f3b526;
}

.header-actions form {
  margin: 0;
}

.user-chip {
  padding: 6px 10px;
  border: 1px solid #2c4651;
  background: #10212a;
  color: #91acb8;
}

.page-shell {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
  padding: 48px 24px;
}

.message-stack {
  position: fixed;
  z-index: 20;
  top: 86px;
  right: 24px;
  width: min(390px, calc(100vw - 32px));
}

.message {
  padding: 14px 16px;
  border: 1px solid #34765d;
  background: #153a2c;
  box-shadow: 0 14px 34px rgb(0 0 0 / 32%);
  color: #c8f1dd;
  font-size: 13px;
}

.hero-card,
.login-card {
  width: min(100%, 760px);
  padding: clamp(30px, 6vw, 64px);
  border: 1px solid #253943;
  background: rgb(13 25 33 / 94%);
  box-shadow: 0 30px 80px rgb(0 0 0 / 35%);
}

.login-card {
  width: min(100%, 480px);
}

.eyebrow {
  margin-bottom: 18px;
  color: #f3b526;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  max-width: 680px;
  margin: 0;
  color: #f6f8f9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 500;
  line-height: 1.08;
}

.login-card h1 {
  font-size: clamp(32px, 5vw, 42px);
}

.lead {
  max-width: 610px;
  margin: 20px 0 0;
  color: #9cb0ba;
  font-size: 16px;
  line-height: 1.65;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
  padding: 16px 18px;
  border: 1px solid #28444c;
  background: #10242b;
  color: #bfd0d7;
  font-size: 14px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #57d49b;
  box-shadow: 0 0 10px rgb(87 212 155 / 65%);
}

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

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid #2b424d;
  background: #0a171e;
}

.filter-tab {
  min-height: 38px;
  padding: 10px 14px;
  color: #9eb1b9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 18px;
  text-decoration: none;
}

.filter-tab:hover {
  background: #142832;
  color: #f4f7f8;
}

.filter-tab.is-active {
  background: #f3b526;
  color: #12100a;
}

.catalog-filter-form {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.catalog-filter-form label {
  color: #9eb1b9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-filter-form select {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #35515d;
  background: #0b1c24;
  color: #dce7ea;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  border-color: #f3b526;
  background: #f3b526;
  color: #12100a;
}

.button-primary:hover {
  border-color: #ffd36a;
  background: #ffd36a;
}

.button-secondary {
  border-color: #36505c;
  background: #152731;
  color: #d8e3e7;
}

.button-secondary:hover {
  border-color: #5e7c89;
  background: #1a303b;
}

.button-danger {
  border-color: #a8514b;
  background: #3d201f;
  color: #ffd3cf;
}

.button-danger:hover {
  border-color: #dd7770;
  background: #572a28;
}

.button-full {
  width: 100%;
  margin-top: 8px;
}

.text-button {
  padding: 0;
  border: 0;
  color: #f3b526;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

code {
  color: #f0c65d;
  font-family: "Cascadia Code", Consolas, monospace;
}

.form-alert {
  margin-top: 24px;
  padding: 13px 15px;
  border: 1px solid #7d413e;
  background: #321d1c;
  color: #f0b3ad;
  font-size: 13px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: #bfd0d7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #354c57;
  border-radius: 0;
  outline: none;
  background: #09151c;
  color: #edf2f4;
  font: inherit;
}

.field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: #f3b526;
}

.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #354c57;
  border-radius: 0;
  outline: none;
  background: #09151c;
  color: #edf2f4;
  font: inherit;
}

.field select {
  min-height: 46px;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field select:focus,
.field textarea:focus {
  border-color: #f3b526;
  box-shadow: 0 0 0 2px rgb(243 181 38 / 14%);
}

.field input:focus {
  border-color: #f3b526;
  box-shadow: 0 0 0 2px rgb(243 181 38 / 14%);
}

.back-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 0 12px 0 9px;
  border: 1px solid #2c4651;
  background: rgb(16 33 42 / 72%);
  color: #d8e3e7;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.back-link:hover {
  border-color: #52717d;
  background: #152b35;
  color: #f3b526;
  transform: translateX(-2px);
}

.back-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.project-page {
  width: min(100%, 1320px);
  align-self: start;
}

.project-page-narrow {
  width: min(100%, 930px);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 34px;
}

.back-link + .page-heading {
  margin-top: 16px;
}

.page-heading h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.page-heading-compact {
  margin: 16px 0 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.dashboard-heading {
  margin-bottom: 24px;
}

.organization-context {
  margin: 12px 0 0;
  color: #8ca5af;
  font-size: 13px;
}

.organization-context strong {
  color: #dfe9ec;
  font-weight: 700;
}

.portfolio-metric-grid {
  display: grid;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portfolio-metric-card {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  padding: 22px;
  border-right: 1px solid #263d48;
}

.portfolio-metric-card:last-child {
  border-right: 0;
}

.portfolio-metric-card span,
.portfolio-metric-card small {
  color: #7794a1;
}

.portfolio-metric-card span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portfolio-metric-card strong {
  margin: 12px 0 8px;
  color: #f5f8f9;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1;
}

.portfolio-metric-card small {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.4;
}

.status-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
  padding: 20px 22px;
  border: 1px solid #263d48;
  background: rgb(10 21 28 / 78%);
}

.status-overview h2,
.project-section-heading h2 {
  margin: 5px 0 0;
  font-size: 21px;
}

.status-overview-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-overview-items > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 126px;
  padding: 9px 11px;
  border: 1px solid #263d48;
  background: #0d1921;
}

.status-overview-items strong {
  margin-left: auto;
  color: #f5f8f9;
  font-size: 18px;
}

.project-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.project-section-heading p {
  max-width: 440px;
  margin: 0;
  color: #7794a1;
  font-size: 12px;
  text-align: right;
}

.shared-project-card:hover {
  border-color: #263d48;
  transform: none;
}

.shared-project-note {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 16px;
  padding: 5px 8px;
  border: 1px solid #37525e;
  color: #9db2bb;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 26px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
  box-shadow: 0 18px 50px rgb(0 0 0 / 20%);
}

.project-card:hover {
  border-color: #496773;
  transform: translateY(-1px);
}

.linked-project-card {
  cursor: pointer;
}

.linked-project-card:focus {
  outline: none;
}

.linked-project-card:focus-visible {
  border-color: #f3b526;
  box-shadow:
    inset 0 0 0 1px #f3b526,
    0 18px 50px rgb(0 0 0 / 20%);
}

.project-card-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7794a1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #45626e;
  background: #172b35;
  color: #b9ccd4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-in_progress {
  border-color: #3b7b69;
  background: #15342b;
  color: #aee4cd;
}

.status-completed {
  border-color: #536c94;
  background: #172a45;
  color: #bed0ec;
}

.status-paused {
  border-color: #826b34;
  background: #342b17;
  color: #edd89f;
}

.status-archived {
  opacity: 0.7;
}

.project-revision {
  color: #6f8b97;
}

.project-card h2,
.detail-panel h2 {
  margin: 18px 0 0;
  color: #f4f7f8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
}

.project-card h2 a {
  text-decoration: none;
}

.project-card h2 a:hover {
  color: #f3c75b;
}

.project-description {
  min-height: 46px;
  margin: 12px 0 22px;
  color: #8ca5b0;
  font-size: 13px;
  line-height: 1.55;
}

.project-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: auto 0 22px;
  padding-top: 18px;
  border-top: 1px solid #263b45;
}

.linked-project-card .project-card-meta {
  margin-bottom: 0;
}

.project-card-meta div,
.detail-list div {
  min-width: 0;
}

.project-card-meta dt,
.detail-list dt {
  margin-bottom: 5px;
  color: #6c8894;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card-meta dd,
.detail-list dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: #c9d7dc;
  font-size: 13px;
  line-height: 1.4;
}

.empty-state {
  display: grid;
  min-height: 430px;
  place-items: center;
  padding: 50px;
  border: 1px dashed #38515c;
  background: rgb(13 25 33 / 75%);
  text-align: center;
}

.empty-state h2 {
  margin: 16px 0 0;
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 500;
}

.empty-state p {
  max-width: 600px;
  margin: 12px auto 24px;
  color: #8ca5b0;
  line-height: 1.65;
}

.empty-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid #f3b526;
  color: #f3b526;
  font-family: Georgia, serif;
  font-size: 38px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  color: #78939f;
  font-size: 13px;
}

.pagination a {
  color: #f3b526;
  font-weight: 700;
}

.project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 30px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
}

.field-wide {
  grid-column: 1 / -1;
}

.help-text,
.field-error {
  color: #78939f;
  font-size: 11px;
  line-height: 1.45;
}

.field-error {
  color: #f0aaa4;
}

.template-notes {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #2a424c;
  background: #0b171e;
}

.template-notes div {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) 1fr;
  gap: 14px;
  color: #78939f;
  font-size: 12px;
  line-height: 1.45;
}

.template-notes strong {
  color: #bdcdd4;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 10px;
}

.dxf-page-heading {
  align-items: center;
}

.dxf-privacy-note {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-left: 3px solid #2ca9be;
  background: #0b171e;
}

.dxf-privacy-note strong {
  color: #c8d8dd;
  font-size: 13px;
}

.dxf-privacy-note span {
  color: #78939f;
  font-size: 12px;
  line-height: 1.5;
}

.dxf-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 34px;
  padding: 24px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
}

.dxf-upload-form .form-actions {
  padding: 0;
}

.dxf-upload-form input[type="file"] {
  padding: 13px;
  border: 1px dashed #49636e;
  background: #09151b;
  color: #a9bdc5;
}

.dxf-import-panel {
  margin: 0 0 34px;
}

.dxf-import-panel .panel-heading p {
  max-width: 760px;
  margin: 7px 0 0;
  color: #78939f;
  font-size: 12px;
  line-height: 1.55;
}

.dxf-import-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.dxf-layer-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid #334b56;
}

.dxf-layer-fieldset legend {
  padding: 0 7px;
  color: #c8d8dd;
  font-size: 12px;
  font-weight: 700;
}

.dxf-layer-fieldset ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.dxf-layer-fieldset label,
.dxf-unpaired-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a9bdc5;
  font-size: 12px;
}

.dxf-layer-fieldset input,
.dxf-unpaired-option input {
  width: auto;
}

.dxf-import-advanced {
  border: 1px solid #334b56;
  background: #0a171d;
}

.dxf-import-advanced summary {
  padding: 14px 16px;
  color: #a9bdc5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.dxf-advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 16px 18px;
}

.dxf-unpaired-option {
  display: grid;
  gap: 6px;
}

.dxf-import-form .form-actions {
  justify-content: flex-end;
  padding: 4px 0 0;
}

.dxf-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 42px 0 18px;
}

.dxf-result-heading h2 {
  margin: 5px 0;
  color: #edf3f4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 500;
}

.dxf-result-heading p {
  margin: 0;
  color: #78939f;
  font-size: 12px;
}

.dxf-metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dxf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
  margin: 18px 0;
}

.dxf-preview-panel,
.dxf-cost-panel {
  min-width: 0;
  margin: 0;
}

.dxf-preview {
  display: grid;
  min-height: 480px;
  overflow: auto;
  place-items: center;
  border: 1px solid #334b56;
  background:
    linear-gradient(#edf2f2 1px, transparent 1px),
    linear-gradient(90deg, #edf2f2 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
}

.dxf-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: contain;
}

.dxf-extents {
  margin-top: 16px;
}

.dxf-cost-status {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid #3b4f57;
  background: #0a171d;
}

.dxf-cost-status.found {
  border-color: #76632c;
  background: #211c0e;
}

.dxf-cost-status strong {
  color: #d9e3e6;
  font-size: 13px;
}

.dxf-cost-status span {
  color: #89a0aa;
  font-size: 12px;
  line-height: 1.55;
}

.dxf-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.dxf-amounts span {
  padding: 7px 9px;
  border: 1px solid #76632c;
  background: #2a210d;
  color: #f3c75b;
  font-family: Consolas, monospace;
  font-size: 11px;
}

.dxf-cost-panel .table-scroll {
  max-height: 460px;
  margin-top: 14px;
  overflow: auto;
}

.dxf-inventory-layout {
  align-items: start;
}

.dxf-inventory-layout .table-scroll {
  max-height: 520px;
  overflow: auto;
}

.project-detail-heading {
  align-items: center;
  margin-top: 16px;
}

.project-detail-heading h1 {
  margin-top: 12px;
}

.actions-tight {
  max-width: 680px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid #2b414b;
  background: #0d1a22;
}

.metric-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  place-items: center;
  align-content: center;
  border-right: 1px solid #2b414b;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  color: #75909c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  color: #f2c75f;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 500;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.catalog-table-section {
  margin-bottom: 20px;
}

.detail-panel {
  padding: 26px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.panel-kicker {
  color: #f3b526;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.detail-panel h2 {
  margin-top: 7px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
  margin: 0;
}

.report-panel > p {
  color: #8ca5b0;
  font-size: 13px;
  line-height: 1.55;
}

.report-download-form {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.report-download-form > label {
  color: #a6bac2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-download-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.report-download-controls select {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #35515d;
  background: #0b1c24;
  color: #dce7ea;
}

.report-download-form small {
  color: #78939e;
  font-size: 11px;
  line-height: 1.45;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.report-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid #35515d;
  background: #12252e;
  text-decoration: none;
}

.report-card:hover {
  border-color: #f3b526;
}

.report-card strong {
  color: #f1c45a;
  font-size: 14px;
}

.report-card span {
  color: #86a0ab;
  font-size: 12px;
  line-height: 1.5;
}

.estimate-panel {
  margin-top: 20px;
}

.panel-heading-total {
  align-items: center;
}

.grand-total {
  display: grid;
  gap: 5px;
  text-align: right;
}

.grand-total span {
  color: #708b97;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grand-total strong {
  color: #f3b526;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #2b414b;
}

.table-actions {
  white-space: nowrap;
}

.table-actions a {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid #35515d;
  color: #c7d8de;
  text-decoration: none;
}

.table-actions a + a {
  margin-left: 5px;
}

.table-actions a:hover {
  border-color: #f3b526;
  color: #f3b526;
}

.import-upload-form {
  display: grid;
  max-width: 760px;
  gap: 12px;
}

.import-upload-form > label {
  color: #e7edef;
  font-weight: 800;
}

.import-upload-form input[type="file"] {
  padding: 14px;
  border: 1px dashed #3d5965;
  background: #0a171e;
  color: #b8c8ce;
}

.import-upload-form small {
  color: #829ba5;
  line-height: 1.5;
}

.import-preview {
  margin-top: 22px;
}

.import-summary {
  color: #9eb1b9;
  font-size: 12px;
}

.import-summary strong {
  color: #f3b526;
}

.import-row-invalid,
.import-row-duplicate {
  background: rgb(126 42 38 / 18%);
}

.import-row-existing {
  background: rgb(168 110 11 / 15%);
}

.schedule-gantt {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid #28424d;
  background: #0d1b22;
}

.schedule-gantt-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.schedule-gantt-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(22px, 3vw, 32px);
}

.schedule-gantt-heading > span {
  color: #a9bec7;
  font-size: 12px;
  font-weight: 750;
}

.schedule-gantt-scroll {
  overflow-x: auto;
  border: 1px solid #2a424c;
}

.gantt-chart {
  display: grid;
  min-width: 760px;
  grid-template-columns: minmax(180px, 240px) minmax(560px, 1fr);
  grid-template-rows: 34px repeat(var(--gantt-rows), 46px);
  background: #102129;
}

.gantt-corner,
.gantt-label {
  padding: 0 12px;
  border-right: 1px solid #304955;
  border-bottom: 1px solid #263e48;
}

.gantt-corner {
  display: flex;
  align-items: center;
  color: #8fa8b2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gantt-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.gantt-label strong {
  overflow: hidden;
  color: #e8eef0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-label span {
  color: #829ba5;
  font-size: 10px;
}

.gantt-timeline {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #263e48;
}

.gantt-months span {
  position: absolute;
  inset-block: 0;
  display: flex;
  min-width: 46px;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #35515d;
  color: #a9bec7;
  font-size: 10px;
  font-weight: 750;
}

.gantt-gridline {
  position: absolute;
  inset-block: 0;
  border-left: 1px solid rgb(82 111 123 / 34%);
}

.gantt-bar {
  position: absolute;
  top: 10px;
  display: flex;
  min-width: 5px;
  height: 26px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #ffc54a;
  background: linear-gradient(90deg, #d88d1f, #f0b333);
  color: #182026;
  box-shadow: 0 5px 14px rgb(0 0 0 / 22%);
}

.gantt-bar b {
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}

.schedule-gantt-empty {
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: #c6d4d9;
  font-size: 12px;
}

.data-table th {
  padding: 12px;
  border-bottom: 1px solid #3a515b;
  background: #10222b;
  color: #829ca7;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #263b45;
}

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

.linked-table-row {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.linked-table-row:hover,
.linked-table-row:focus {
  background: #17303a;
  outline: none;
}

.linked-table-row:focus-visible {
  box-shadow: inset 0 0 0 2px #56b7d4;
}

.linked-table-row a {
  color: inherit;
  text-decoration: none;
}

.linked-table-row a:hover {
  color: #8ed8ec;
}

.concept-unit-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 0;
  color: #829ca7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.concept-unit-price strong {
  color: #8ed8ec;
  font-size: 20px;
  letter-spacing: 0;
}

.concept-unit-price span {
  text-transform: none;
}

.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  white-space: nowrap;
}

.price-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #725c2e;
  background: #2b2518;
  color: #d7bd7c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.empty-inline {
  padding: 24px;
  border: 1px dashed #35505b;
  color: #819ba6;
  text-align: center;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 20px 24px;
  border: 1px solid #5e3533;
  background: #231817;
}

.danger-zone div {
  display: grid;
  gap: 5px;
}

.danger-zone strong {
  color: #edc1bd;
}

.danger-zone span {
  color: #9f7773;
  font-size: 12px;
}

.confirm-card {
  border-color: #623936;
}

@media (max-width: 620px) {
  .site-header {
    padding: 0 18px;
  }

  .header-actions > a,
  .user-chip {
    display: none;
  }

  .page-shell {
    padding: 24px 14px;
  }

  .session-card {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .session-card {
    flex-direction: column;
  }

  .actions,
  .button {
    width: 100%;
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .filter-tab {
    text-align: center;
  }

  .catalog-filter-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-heading,
  .project-detail-heading,
  .dxf-result-heading,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .project-form,
  .dxf-upload-form,
  .dxf-import-form,
  .dxf-advanced-grid,
  .dxf-layout,
  .detail-layout,
  .report-actions {
    grid-template-columns: 1fr;
  }

  .dxf-layer-fieldset ul {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

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

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-card:nth-child(3) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 3) {
    border-bottom: 1px solid #2b414b;
  }

  .actions-tight,
  .form-actions {
    flex-direction: column;
  }

  .detail-list,
  .project-card-meta {
    grid-template-columns: 1fr;
  }

  .panel-heading-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .grand-total {
    text-align: left;
  }
}

.theme-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #2c4651;
  background: #10212a;
  color: #b7c9d0;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: #52717d;
  color: #f3b526;
}

.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-moon,
[data-theme="light"] .theme-icon-sun {
  display: none;
}

[data-theme="light"] .theme-icon-moon {
  display: block;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-shell > :not(.message-stack) {
  animation: page-enter 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 140ms ease-out both fade-out;
}

::view-transition-new(root) {
  animation: 280ms cubic-bezier(0.22, 1, 0.36, 1) both page-enter;
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

[data-theme="light"] {
  color-scheme: light;
  background: #edf1f2;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 78% 18%, rgb(35 157 166 / 10%), transparent 34rem),
    linear-gradient(145deg, #f7f8f6 0%, #edf1f2 62%, #f5f2ea 100%);
  color: #18252c;
}

[data-theme="light"] .site-header {
  border-color: #cbd6da;
  background: rgb(248 250 249 / 90%);
}

[data-theme="light"] .brand strong,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .project-card h2 a {
  color: #132128;
}

[data-theme="light"] .brand small,
[data-theme="light"] .lead,
[data-theme="light"] .header-actions,
[data-theme="light"] .project-card p,
[data-theme="light"] .field-help,
[data-theme="light"] .detail-meta,
[data-theme="light"] .report-card p {
  color: #5c737d;
}

[data-theme="light"] .header-actions a,
[data-theme="light"] .text-button {
  color: #263b44;
}

[data-theme="light"] .theme-toggle,
[data-theme="light"] .user-chip,
[data-theme="light"] .back-link {
  border-color: #c2d0d5;
  background: #fff;
  color: #314a55;
}

[data-theme="light"] .hero-card,
[data-theme="light"] .login-card,
[data-theme="light"] .project-card,
[data-theme="light"] .detail-panel,
[data-theme="light"] .report-card,
[data-theme="light"] .form-card,
[data-theme="light"] .budget-panel,
[data-theme="light"] .danger-zone {
  border-color: #cbd6da;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 22px 60px rgb(37 55 63 / 12%);
}

[data-theme="light"] .session-card,
[data-theme="light"] .metric-grid,
[data-theme="light"] .project-card-meta,
[data-theme="light"] .report-note,
[data-theme="light"] .dxf-privacy-note,
[data-theme="light"] .dxf-cost-status,
[data-theme="light"] .empty-inline {
  border-color: #cbd8dc;
  background: #f1f6f6;
  color: #37505a;
}

[data-theme="light"] .button-secondary {
  border-color: #aebfc6;
  background: #f5f8f8;
  color: #233941;
}

[data-theme="light"] .dxf-upload-form {
  border-color: #cbd6da;
  background: rgb(255 255 255 / 94%);
}

[data-theme="light"] .dxf-upload-form input[type="file"] {
  border-color: #aebfc6;
  background: #f5f8f8;
  color: #29424c;
}

[data-theme="light"] .dxf-layer-fieldset,
[data-theme="light"] .dxf-import-advanced {
  border-color: #cbd6da;
  background: #f8fafa;
}

[data-theme="light"] .dxf-layer-fieldset legend,
[data-theme="light"] .dxf-layer-fieldset label,
[data-theme="light"] .dxf-unpaired-option label,
[data-theme="light"] .dxf-import-advanced summary {
  color: #29424c;
}

[data-theme="light"] .dxf-result-heading h2,
[data-theme="light"] .dxf-cost-status strong {
  color: #20343d;
}

[data-theme="light"] .dxf-cost-status.found {
  border-color: #c49c3e;
  background: #fff8e7;
}

[data-theme="light"] .filter-tabs {
  border-color: #c3d0d5;
  background: #eef3f4;
}

[data-theme="light"] .filter-tab {
  color: #405b65;
}

[data-theme="light"] .filter-tab:hover {
  background: #dce6e9;
  color: #172b33;
}

[data-theme="light"] .filter-tab.is-active {
  background: #b87500;
  color: #ffffff;
}

[data-theme="light"] .catalog-filter-form label {
  color: #405b65;
}

[data-theme="light"] .catalog-filter-form select {
  border-color: #aebfc6;
  background: #fff;
  color: #17272e;
}

[data-theme="light"] .table-actions a {
  border-color: #b8c8ce;
  color: #29424c;
}

[data-theme="light"] .table-actions a:hover {
  border-color: #9a6300;
  color: #704700;
}

[data-theme="light"] .import-upload-form > label {
  color: #20343d;
}

[data-theme="light"] .import-upload-form input[type="file"] {
  border-color: #aebfc6;
  background: #f5f8f8;
  color: #29424c;
}

[data-theme="light"] .field input,
[data-theme="light"] .field textarea,
[data-theme="light"] .field select {
  border-color: #b9c9cf;
  background: #fff;
  color: #17272e;
}

[data-theme="light"] .field label {
  color: #405861;
}

[data-theme="light"] .budget-table th {
  background: #e7eeee;
  color: #506974;
}

[data-theme="light"] .budget-table td,
[data-theme="light"] .budget-table th,
[data-theme="light"] .metric-card {
  border-color: #cfdbde;
}

[data-theme="light"] .budget-table td,
[data-theme="light"] .detail-list dd,
[data-theme="light"] .project-card-meta dd {
  color: #263b44;
}

[data-theme="light"] .panel-kicker,
[data-theme="light"] .grand-total strong {
  color: #7a4b00;
}

[data-theme="light"] .grand-total span,
[data-theme="light"] .report-panel > p,
[data-theme="light"] .report-download-form small {
  color: #405d68;
}

[data-theme="light"] .report-download-form > label {
  color: #324d58;
}

[data-theme="light"] .report-download-controls select {
  border-color: #aebfc6;
  background: #fff;
  color: #17272e;
}

[data-theme="light"] .table-scroll {
  border-color: #bdcdd2;
}

[data-theme="light"] .schedule-gantt {
  border-color: #c4d2d6;
  background: #fff;
  box-shadow: 0 16px 40px rgb(37 55 63 / 9%);
}

[data-theme="light"] .schedule-gantt-heading > span {
  color: #526d78;
}

[data-theme="light"] .schedule-gantt-scroll {
  border-color: #bdcdd2;
}

[data-theme="light"] .gantt-chart {
  background: #f8faf9;
}

[data-theme="light"] .gantt-corner,
[data-theme="light"] .gantt-label,
[data-theme="light"] .gantt-timeline {
  border-color: #d3dee1;
}

[data-theme="light"] .gantt-corner,
[data-theme="light"] .gantt-label span,
[data-theme="light"] .gantt-months span {
  color: #506a74;
}

[data-theme="light"] .gantt-label strong {
  color: #1d3038;
}

[data-theme="light"] .gantt-months span {
  border-color: #cbd8dc;
}

[data-theme="light"] .data-table {
  color: #20343d;
}

[data-theme="light"] .data-table th {
  border-color: #bdcdd2;
  background: #e4ecee;
  color: #38545f;
}

[data-theme="light"] .data-table td {
  border-color: #d5e0e3;
}

[data-theme="light"] .data-table tbody tr:nth-child(even) {
  background: #f5f8f8;
}

[data-theme="light"] .data-table code {
  color: #674200;
}

[data-theme="light"] .linked-table-row:hover,
[data-theme="light"] .linked-table-row:focus {
  background: #e7f1f3;
}

[data-theme="light"] .linked-table-row a:hover,
[data-theme="light"] .concept-unit-price strong {
  color: #176a82;
}

[data-theme="light"] .danger-zone span {
  color: #506872;
}

[data-theme="light"] .danger-zone strong {
  color: #8b2f2a;
}

@media (max-width: 620px) {
  .report-download-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}

.virtual-tour-video-panel {
  margin-bottom: 0;
}

.project-primary-details {
  margin-bottom: 20px;
}

.project-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.project-summary-layout .virtual-tour-video-panel {
  grid-column: 1;
  grid-row: 1;
}

.project-summary-layout .metric-grid {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: stretch;
  margin-bottom: 0;
}

.project-summary-layout .metric-card {
  min-height: 82px;
  border-right: 1px solid #2b414b;
  border-bottom: 1px solid #2b414b;
}

.project-summary-layout .metric-card:nth-child(3n) {
  border-right: 0;
}

.project-summary-layout .metric-card:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.virtual-tour-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.virtual-tour-video-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #263b44;
  border-radius: 12px;
  background: #0e1a20;
}

.virtual-tour-video-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.virtual-tour-video-card-heading > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.virtual-tour-video-card-heading strong {
  overflow: hidden;
  color: #e8eef0;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.virtual-tour-video-card-heading > div > span,
.virtual-tour-video-message,
.virtual-tour-video-empty p {
  color: #91a6ae;
  font-size: 0.86rem;
}

.virtual-tour-video-message {
  min-height: 2.7em;
  margin: 0;
  line-height: 1.45;
}

.video-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #425a64;
  border-radius: 999px;
  background: #17272e;
  color: #b9c9cf;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.video-status-ready {
  border-color: #39745f;
  background: #123128;
  color: #8bd4b7;
}

.video-status-queued,
.video-status-processing {
  border-color: #8b681d;
  background: #33270d;
  color: #efc866;
}

.video-status-failed {
  border-color: #7f413d;
  background: #351817;
  color: #efaaa4;
}

.virtual-tour-video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.virtual-tour-video-actions form {
  margin: 0;
}

.virtual-tour-video-actions .button {
  min-height: 38px;
}

.virtual-tour-video-empty {
  padding: 22px;
  border: 1px dashed #314851;
  border-radius: 12px;
  background: #0e1a20;
}

.virtual-tour-video-empty strong {
  color: #dbe5e8;
}

.virtual-tour-video-empty p {
  margin: 8px 0 0;
}

.video-modal {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid #314851;
  border-radius: 14px;
  background: #091319;
  box-shadow: 0 32px 90px rgb(0 0 0 / 60%);
  color: #e8eef0;
}

.video-modal::backdrop {
  background: rgb(2 8 12 / 82%);
  backdrop-filter: blur(5px);
}

.video-modal-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.video-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.video-modal-heading h2 {
  margin: 4px 0 0;
}

.video-modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid #344b55;
  border-radius: 9px;
  background: #122128;
  color: #d7e2e5;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.video-modal video {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  border-radius: 10px;
  background: #000;
}

[data-theme="light"] .virtual-tour-video-card,
[data-theme="light"] .virtual-tour-video-empty {
  border-color: #c8d5d9;
  background: #f8fafa;
}

[data-theme="light"] .virtual-tour-video-card-heading strong,
[data-theme="light"] .virtual-tour-video-empty strong {
  color: #20343d;
}

[data-theme="light"] .virtual-tour-video-card-heading > div > span,
[data-theme="light"] .virtual-tour-video-message,
[data-theme="light"] .virtual-tour-video-empty p {
  color: #506872;
}

[data-theme="light"] .video-modal {
  border-color: #b9c9cf;
  background: #ffffff;
  color: #20343d;
}

[data-theme="light"] .video-modal-close {
  border-color: #b9c9cf;
  background: #eef3f4;
  color: #20343d;
}

@media (max-width: 620px) {
  .virtual-tour-video-card-heading {
    display: grid;
  }

  .video-status {
    justify-self: start;
  }

  .virtual-tour-video-actions,
  .virtual-tour-video-actions form,
  .virtual-tour-video-actions .button {
    width: 100%;
  }

  .video-modal-shell {
    padding: 12px;
  }
}

@media (max-width: 1050px) {
  .portfolio-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-metric-card:nth-child(2) {
    border-right: 0;
  }

  .portfolio-metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid #263d48;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-summary-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-summary-layout .virtual-tour-video-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .project-summary-layout .metric-grid {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 620px) {
  .portfolio-metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portfolio-metric-card,
  .portfolio-metric-card:nth-child(2) {
    min-height: 124px;
    border-right: 0;
    border-bottom: 1px solid #263d48;
  }

  .portfolio-metric-card:last-child {
    border-bottom: 0;
  }

  .status-overview,
  .project-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .status-overview-items {
    justify-content: stretch;
  }

  .status-overview-items > div {
    width: 100%;
  }

  .project-section-heading p {
    max-width: none;
    text-align: left;
  }
}

[data-theme="light"] .portfolio-metric-grid,
[data-theme="light"] .status-overview,
[data-theme="light"] .status-overview-items > div {
  border-color: #cbd6da;
  background: rgb(255 255 255 / 94%);
}

[data-theme="light"] .portfolio-metric-card {
  border-color: #cbd6da;
}

[data-theme="light"] .portfolio-metric-card strong,
[data-theme="light"] .status-overview-items strong,
[data-theme="light"] .organization-context strong {
  color: #20343d;
}

[data-theme="light"] .organization-context,
[data-theme="light"] .project-section-heading p,
[data-theme="light"] .portfolio-metric-card span,
[data-theme="light"] .portfolio-metric-card small {
  color: #5c737d;
}

[data-theme="light"] .shared-project-note {
  border-color: #c4d2d7;
  color: #4d6872;
}

.read-only-project-badge {
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 13px 15px;
  border: 1px solid #4b626c;
  border-radius: 10px;
  background: #14242b;
}

.read-only-project-badge strong {
  color: #efc866;
}

.read-only-project-badge span,
.read-only-note {
  color: #9eb1b9;
  font-size: 0.84rem;
}

.intelligence-dashboard {
  max-width: 1480px;
}

.intelligence-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #263d48;
  border-radius: 14px;
  background: #263d48;
}

.intelligence-metric {
  display: grid;
  min-height: 142px;
  padding: 22px;
  background: #101d23;
}

.intelligence-metric span {
  color: #8ca2ab;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intelligence-metric strong {
  align-self: center;
  color: #ecf2f4;
  font-size: clamp(1.45rem, 2vw, 2.25rem);
}

.intelligence-metric small {
  align-self: end;
  color: #718992;
}

.primary-metric {
  background: linear-gradient(145deg, #172830, #101d23);
}

.primary-metric strong {
  color: #efbd67;
}

.attention-metric strong {
  color: #e58c84;
}

.attention-trigger {
  width: 100%;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.attention-trigger:hover {
  background: #271b1c;
}

.attention-trigger:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #e58c84;
  outline-offset: -3px;
}

.dashboard-definition-note {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #314851;
  border-radius: 10px;
  background: #0e1a20;
  color: #9eb1b9;
  font-size: 0.85rem;
  line-height: 1.55;
}

.dashboard-definition-note strong {
  color: #dce6e9;
}

.diagnostic-panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #314851;
  border-radius: 14px;
  background: linear-gradient(145deg, #13242b, #0e1b21);
}

.diagnostic-heading,
.diagnostic-block-heading,
.signal-evidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.diagnostic-heading h2 {
  margin: 4px 0 5px;
}

.diagnostic-heading p,
.diagnostic-disclaimer {
  margin: 0;
  color: #91a6ae;
  font-size: 0.82rem;
  line-height: 1.5;
}

.evidence-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgb(223 155 43 / 45%);
  border-radius: 999px;
  background: rgb(223 155 43 / 10%);
  color: #efbd67;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagnostic-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid #304750;
  border-radius: 10px;
  background: #304750;
}

.diagnostic-metrics > div {
  display: grid;
  gap: 7px;
  padding: 16px;
  background: #0f1c22;
}

.diagnostic-metrics span,
.diagnostic-metrics small {
  color: #829aa4;
  font-size: 0.72rem;
}

.diagnostic-metrics span {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagnostic-metrics strong {
  color: #edf3f5;
  font-size: 1.35rem;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.diagnostic-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid #2a414b;
  border-radius: 10px;
  background: #0d1920;
}

.diagnostic-block-wide {
  grid-column: span 2;
}

.diagnostic-block-heading {
  margin-bottom: 12px;
}

.diagnostic-block-heading h3 {
  margin: 0;
  font-size: 0.92rem;
}

.diagnostic-block-heading > span {
  color: #df9b2b;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.diagnostic-activity-list,
.signal-list {
  display: grid;
  gap: 8px;
}

.diagnostic-activity-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 11px 12px;
  border: 1px solid #263d47;
  border-radius: 8px;
  background: #101f26;
  color: #dce6e9;
  text-decoration: none;
}

.diagnostic-activity-row:hover,
.diagnostic-activity-row:focus-visible {
  border-color: #54727e;
  background: #152a33;
  outline: none;
}

.diagnostic-activity-row > span,
.diagnostic-activity-row small {
  display: grid;
  gap: 4px;
}

.diagnostic-activity-row small,
.signal-card small,
.signal-card p {
  margin: 0;
  color: #8198a1;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.45;
}

.diagnostic-gap,
.diagnostic-value {
  text-align: right;
}

.diagnostic-gap strong {
  color: #ed8f86;
}

.diagnostic-value strong {
  color: #efbd67;
}

.signal-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #263d47;
  border-radius: 8px;
  background: #101f26;
}

.signal-card > div:first-child:not(.signal-title) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.signal-card > div:first-child span,
.signal-title > span,
.signal-evidence {
  color: #829aa4;
  font-size: 0.7rem;
}

.signal-title {
  display: grid;
  gap: 4px;
}

.signal-title > span {
  color: #df9b2b;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.signal-evidence span:first-child {
  color: #75c5a9;
  font-weight: 800;
}

.signal-confirmed {
  border-color: rgb(212 99 88 / 60%);
  background: rgb(145 49 43 / 16%);
}

.signal-confirmed .signal-title > span {
  color: #ef9a91;
}

.confirmed-supply-evidence {
  padding: 8px;
  border-left: 3px solid #d46358;
  background: rgb(212 99 88 / 9%);
  color: #d9e3e6 !important;
}

.diagnostic-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #38515b;
  border-radius: 8px;
  color: #91a6ae;
  font-size: 0.8rem;
  line-height: 1.5;
}

.diagnostic-empty-success {
  border-color: rgb(72 168 137 / 40%);
  background: rgb(72 168 137 / 8%);
  color: #75c5a9;
}

.diagnostic-disclaimer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #2a414b;
}

.diagnostic-disclaimer strong {
  color: #c9d7dc;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.chart-panel,
.dashboard-table-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid #263d48;
  border-radius: 14px;
  background: #101d23;
}

.chart-panel-wide {
  grid-column: span 2;
}

.chart-panel-heading span {
  color: #df9b2b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.chart-panel-heading h2 {
  margin: 4px 0 18px;
  font-size: 1.05rem;
}

.chart-canvas {
  position: relative;
  height: 280px;
}

.chart-canvas-tall {
  height: min(440px, 56vh);
}

.chart-fallback {
  display: grid;
  height: 100%;
  place-items: center;
  color: #91a6ae;
}

.chart-caption {
  margin: 12px 0 0;
  color: #91a6ae;
  font-size: 0.78rem;
  line-height: 1.5;
}

.control-index-row {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 12px;
  color: #91a6ae;
  font-size: 0.8rem;
}

.control-index-row strong {
  color: #dce6e9;
  font-size: 1rem;
}

.dashboard-table-panel {
  padding: 0;
  overflow: hidden;
}

.dashboard-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.dashboard-table-heading h2 {
  margin: 4px 0 0;
}

.dashboard-table-heading > span {
  color: #91a6ae;
}

.portfolio-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 18px;
  border-bottom: 1px solid #263d48;
}

.portfolio-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #3a515b;
  border-radius: 999px;
  background: #14242b;
  color: #a8bbc2;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
}

.portfolio-filter span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: #243a44;
  color: #d7e2e6;
  font-size: 0.66rem;
}

.portfolio-filter:hover,
.portfolio-filter:focus-visible,
.portfolio-filter.is-active {
  border-color: #df9b2b;
  color: #f0c06d;
  outline: none;
}

.portfolio-filter.is-active {
  background: rgb(223 155 43 / 12%);
}

.portfolio-table td:first-child {
  min-width: 210px;
}

.attention-reasons-cell {
  min-width: 170px;
}

.attention-reasons-cell > span {
  display: block;
  width: max-content;
  max-width: 190px;
  margin: 3px 0;
  padding: 3px 7px;
  border: 1px solid rgb(212 99 88 / 38%);
  border-radius: 999px;
  background: rgb(212 99 88 / 13%);
  color: #efa098;
  font-size: 0.68rem;
  font-weight: 750;
}

.portfolio-filter-empty td {
  padding: 32px;
  color: #91a6ae;
  text-align: center;
}

.procurement-page {
  max-width: 1440px;
}

.procurement-metrics,
.order-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #263d48;
  border-radius: 14px;
  background: #263d48;
}

.procurement-metrics article,
.order-summary > div {
  display: grid;
  min-height: 118px;
  gap: 8px;
  padding: 18px;
  background: #101d23;
}

.procurement-metrics span,
.order-summary span {
  color: #8ca2ab;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.procurement-metrics strong,
.order-summary strong {
  align-self: center;
  color: #edf3f5;
  font-size: 1.25rem;
}

.procurement-metrics small {
  align-self: end;
  color: #718992;
}

.procurement-metrics .procurement-alert strong {
  color: #ed8f86;
}

.procurement-alert-panel,
.receipt-panel,
.receipt-history {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #4d3638;
  border-radius: 14px;
  background: #1b171a;
}

.procurement-alert-panel h2,
.receipt-panel h2,
.receipt-history h2 {
  margin: 4px 0 14px;
}

.procurement-alert-list {
  display: grid;
  gap: 8px;
}

.procurement-alert-list a {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 20px;
  padding: 12px;
  border: 1px solid #583b3d;
  border-radius: 8px;
  color: #e5edef;
  text-decoration: none;
}

.procurement-alert-list a > span,
.procurement-alert-list small {
  display: grid;
  gap: 4px;
}

.procurement-alert-list small,
.procurement-table td small,
.receipt-line small,
.receipt-history small {
  color: #8299a2;
  font-size: 0.72rem;
}

.procurement-table .attention-row {
  background: rgb(145 49 43 / 24%);
  box-shadow: inset 4px 0 0 #df776e;
}

.purchase-status {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid #49616b;
  border-radius: 999px;
  color: #b9c9cf;
  font-size: 0.68rem;
  font-weight: 750;
}

.purchase-status-received {
  border-color: rgb(72 168 137 / 45%);
  color: #75c5a9;
}

.purchase-status-issued,
.purchase-status-partially_received {
  border-color: rgb(223 155 43 / 45%);
  color: #efbd67;
}

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

.receipt-panel,
.receipt-history {
  border-color: #2a414b;
  background: #101d23;
}

.receipt-panel > div > p,
.receipt-history > p {
  color: #91a6ae;
}

.receipt-lines {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.receipt-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, .35fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #2c444e;
  border-radius: 9px;
  background: #0d1920;
}

.receipt-line > div:first-child {
  display: grid;
  align-content: center;
  gap: 4px;
}

.receipt-history article {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid #2a414b;
}

[data-theme="light"] .procurement-metrics,
[data-theme="light"] .order-summary {
  border-color: #cbd6da;
  background: #cbd6da;
}

[data-theme="light"] .procurement-metrics article,
[data-theme="light"] .order-summary > div,
[data-theme="light"] .procurement-alert-panel,
[data-theme="light"] .receipt-panel,
[data-theme="light"] .receipt-history,
[data-theme="light"] .receipt-line {
  border-color: #cbd6da;
  background: #fff;
}

[data-theme="light"] .procurement-metrics strong,
[data-theme="light"] .order-summary strong,
[data-theme="light"] .procurement-alert-list a {
  color: #20343d;
}

[data-theme="light"] .procurement-alert-list a {
  border-color: #d9a6a1;
}

@media (max-width: 900px) {
  .procurement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .receipt-line {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .procurement-metrics,
  .order-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .procurement-alert-list a,
  .receipt-history article {
    grid-template-columns: minmax(0, 1fr);
  }
}

.portfolio-table td small {
  display: block;
  margin-top: 5px;
  color: #718992;
  font-size: 0.72rem;
}

.portfolio-table .attention-row {
  background: rgb(145 49 43 / 24%);
  box-shadow: inset 4px 0 0 #df776e;
}

.portfolio-table .schedule-classification {
  display: inline-flex;
  width: max-content;
  margin: 5px 0 0 auto;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  line-height: 1.25;
}

.portfolio-table .schedule-ahead {
  border-color: rgb(72 168 137 / 44%);
  background: rgb(72 168 137 / 16%);
  color: #75c5a9;
}

.portfolio-table .schedule-on_track {
  border-color: rgb(79 142 201 / 44%);
  background: rgb(79 142 201 / 16%);
  color: #83b7e8;
}

.portfolio-table .schedule-delayed {
  border-color: rgb(212 99 88 / 50%);
  background: rgb(212 99 88 / 18%);
  color: #ef9a91;
}

.portfolio-table .schedule-uncontrolled {
  border-color: rgb(145 166 174 / 35%);
  background: rgb(145 166 174 / 12%);
  color: #b5c4ca;
}

.collaborator-panel {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid #263d48;
  border-radius: 14px;
  background: #101d23;
}

.collaborator-panel h2 {
  margin: 4px 0 18px;
}

.collaborator-list {
  display: grid;
  gap: 10px;
}

.collaborator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid #2b424d;
  border-radius: 10px;
  background: #0d1920;
}

.collaborator-row > div {
  display: grid;
  gap: 4px;
}

.collaborator-row span {
  color: #849aa3;
  font-size: 0.8rem;
}

.collaborator-row form {
  margin: 0;
}

.collaborator-row .button {
  min-height: 38px;
}

[data-theme="light"] .collaborator-panel,
[data-theme="light"] .collaborator-row {
  border-color: #cbd6da;
  background: #fff;
}

@media (max-width: 560px) {
  .collaborator-row {
    align-items: stretch;
    flex-direction: column;
  }

  .collaborator-row .button {
    width: 100%;
  }
}

[data-theme="light"] .read-only-project-badge,
[data-theme="light"] .dashboard-definition-note,
[data-theme="light"] .diagnostic-panel,
[data-theme="light"] .chart-panel,
[data-theme="light"] .dashboard-table-panel,
[data-theme="light"] .intelligence-metric {
  border-color: #cbd6da;
  background: #fff;
}

[data-theme="light"] .attention-trigger:hover {
  background: #fff4f2;
}

[data-theme="light"] .diagnostic-panel {
  background: linear-gradient(145deg, #fff, #f7fafb);
}

[data-theme="light"] .diagnostic-heading p,
[data-theme="light"] .diagnostic-disclaimer,
[data-theme="light"] .diagnostic-empty {
  color: #4e6872;
}

[data-theme="light"] .diagnostic-metrics {
  border-color: #cbd6da;
  background: #cbd6da;
}

[data-theme="light"] .diagnostic-metrics > div,
[data-theme="light"] .diagnostic-block,
[data-theme="light"] .diagnostic-activity-row,
[data-theme="light"] .signal-card {
  border-color: #cedade;
  background: #fff;
}

[data-theme="light"] .diagnostic-metrics strong,
[data-theme="light"] .diagnostic-block-heading h3,
[data-theme="light"] .diagnostic-activity-row,
[data-theme="light"] .signal-card strong,
[data-theme="light"] .diagnostic-disclaimer strong {
  color: #20343d;
}

[data-theme="light"] .diagnostic-metrics span,
[data-theme="light"] .diagnostic-metrics small,
[data-theme="light"] .diagnostic-activity-row small,
[data-theme="light"] .signal-card small,
[data-theme="light"] .signal-card p,
[data-theme="light"] .signal-card > div:first-child span,
[data-theme="light"] .signal-evidence {
  color: #526b75;
}

[data-theme="light"] .diagnostic-activity-row:hover,
[data-theme="light"] .diagnostic-activity-row:focus-visible {
  border-color: #87a0a9;
  background: #edf4f6;
}

[data-theme="light"] .diagnostic-disclaimer,
[data-theme="light"] .portfolio-filter-bar {
  border-color: #d5e0e3;
}

[data-theme="light"] .portfolio-filter {
  border-color: #bdcdd2;
  background: #f3f7f8;
  color: #38545f;
}

[data-theme="light"] .portfolio-filter span {
  background: #dfe9ec;
  color: #29444e;
}

[data-theme="light"] .portfolio-filter:hover,
[data-theme="light"] .portfolio-filter:focus-visible,
[data-theme="light"] .portfolio-filter.is-active {
  border-color: #9a5e00;
  color: #784a00;
}

[data-theme="light"] .portfolio-filter.is-active {
  background: #fff4dd;
}

[data-theme="light"] .attention-reasons-cell > span {
  color: #9d3028;
}

[data-theme="light"] .intelligence-metrics {
  border-color: #cbd6da;
  background: #cbd6da;
}

[data-theme="light"] .intelligence-metric strong,
[data-theme="light"] .dashboard-definition-note strong,
[data-theme="light"] .control-index-row strong {
  color: #20343d;
}

[data-theme="light"] .primary-metric strong {
  color: #9a5e00;
}

[data-theme="light"] .intelligence-metric span,
[data-theme="light"] .intelligence-metric small,
[data-theme="light"] .dashboard-definition-note,
[data-theme="light"] .read-only-project-badge span,
[data-theme="light"] .read-only-note {
  color: #5c737d;
}

[data-theme="light"] .chart-caption {
  color: #48616b;
}

[data-theme="light"] .portfolio-table .attention-row {
  background: rgb(207 77 66 / 10%);
  box-shadow: inset 4px 0 0 #c9574e;
}

[data-theme="light"] .portfolio-table .schedule-ahead {
  color: #176a52;
}

[data-theme="light"] .portfolio-table .schedule-on_track {
  color: #275f91;
}

[data-theme="light"] .portfolio-table .schedule-delayed {
  color: #9d3028;
}

[data-theme="light"] .portfolio-table .schedule-uncontrolled {
  color: #50666f;
}

@media (max-width: 900px) {
  .intelligence-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .chart-panel-wide {
    grid-column: auto;
  }

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

  .diagnostic-block-wide {
    grid-column: auto;
  }

  .diagnostic-activity-row {
    grid-template-columns: minmax(190px, 1fr) auto;
  }

  .diagnostic-value {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .intelligence-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .intelligence-metric {
    min-height: 125px;
  }

  .chart-panel {
    padding: 15px;
  }

  .diagnostic-panel {
    padding: 16px;
  }

  .diagnostic-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .diagnostic-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .diagnostic-activity-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .diagnostic-gap,
  .diagnostic-value {
    grid-column: auto;
    text-align: left;
  }

  .portfolio-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 15px 15px;
  }

  .portfolio-filter {
    flex: 0 0 auto;
  }
}

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