.page-projects {
  background: var(--ui-warm-white);
}

.page-projects main {
  padding-top: 0;
}

.dashboard-page {
  display: grid;
  gap: 26px;
}

.dashboard-hero {
  position: relative;
  min-height: 248px;
  display: grid;
  align-items: center;
  overflow: hidden;
  margin-right: calc(var(--ui-content-gutter) * -1);
  margin-left: calc(var(--ui-content-gutter) * -1);
  color: #fff;
  background: var(--ui-brand-black);
}

.dashboard-hero::before,
.dashboard-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.dashboard-hero::before {
  z-index: 1;
  background: linear-gradient(90deg, rgba(6, 7, 7, .97) 0%, rgba(8, 9, 9, .88) 41.5%, rgba(8, 9, 9, .1) 73.5%, rgba(8, 9, 9, .18) 100%);
}

.dashboard-hero::after {
  z-index: 2;
  left: auto;
  width: 34%;
  opacity: .28;
  background-image: radial-gradient(circle, #fff 1px, transparent 1.2px);
  background-size: 13px 13px;
  mask-image: linear-gradient(to left, #000, transparent);
}

.dashboard-hero-media {
  position: absolute;
  inset: 0;
}

.dashboard-hero-media picture {
  display: contents;
}

.dashboard-hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 47%;
  filter: saturate(.72) contrast(1.04);
}

.dashboard-hero-copy {
  position: relative;
  z-index: 3;
  min-height: 248px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  align-content: center;
  align-items: center;
  column-gap: 36px;
  padding: 38px calc(var(--ui-content-gutter) + 32px) 44px;
}

.dashboard-hero .eyebrow {
  grid-column: 1;
  margin: 0 0 8px;
  color: var(--ui-brand-yellow);
}

.dashboard-hero h1 {
  grid-column: 1;
  margin: 0;
  color: #fff;
  font-size: clamp(35px, 3.5vw, 48px);
  font-weight: 350;
  letter-spacing: -.045em;
}

.dashboard-catalog-action {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  border-color: rgba(255, 255, 255, .7) !important;
  background: rgba(8, 9, 9, .48) !important;
  color: #fff !important;
}

.dashboard-catalog-action:hover {
  border-color: var(--ui-brand-yellow) !important;
  background: var(--ui-brand-yellow) !important;
  color: var(--ui-brand-black) !important;
}

.dashboard-intro {
  grid-column: 1;
  max-width: 620px;
  margin: 12px 0 0;
  color: #d2d5d3;
  font-size: 15px;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 7px;
  color: #616766;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.new-project-panel,
.project-list-section {
  border: 1px solid var(--ui-border);
  border-radius: 2px;
  background: var(--ui-surface);
  box-shadow: none;
}

.new-project-panel {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 0;
  margin-top: -68px;
  padding: 0;
}

.new-project-heading {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--ui-border);
}

.new-project-heading::after {
  position: absolute;
  inset: 0 0 0 auto;
  width: 32%;
  content: "";
  opacity: .18;
  background-image: radial-gradient(circle, #747a79 1px, transparent 1.2px);
  background-size: 12px 12px;
  mask-image: linear-gradient(to left, #000, transparent);
}

.new-project-heading > div {
  position: relative;
  z-index: 1;
}

.new-project-panel h2,
.project-list-heading h2 {
  margin: 0;
  color: var(--ui-graphite);
  font-size: 20px;
  letter-spacing: -.02em;
}

.new-project-heading p:last-child {
  margin: 5px 0 0;
  color: var(--ui-muted);
  font-size: 12px;
}

.new-project-panel form { padding: 18px 20px 20px; }

.new-project-panel .field-grid {
  grid-template-columns: minmax(190px, 1.35fr) minmax(125px, .8fr) minmax(110px, .7fr) minmax(145px, 1fr) minmax(95px, .6fr) minmax(95px, .6fr) minmax(135px, .8fr) auto;
  grid-template-areas: "name number line construction length width operation action";
  align-items: start;
  gap: 12px;
}

.new-project-panel label {
  display: grid;
  grid-template-rows: 18px 44px minmax(58px, auto);
  gap: 7px;
  color: #4d5352;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.new-project-panel input,
.new-project-panel select {
  min-width: 0;
  min-height: 44px;
  border-color: #adb2b1;
  border-radius: 0;
  background: #fff;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.new-project-panel select:disabled {
  border-color: #c8cccb;
  background: #f1f2ef;
  color: #656a68;
  cursor: not-allowed;
  opacity: 1;
}

.new-project-panel .field-feedback {
  display: block;
  min-height: 58px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.new-project-panel .field-errors {
  display: block;
  color: #9a3d35;
}

.new-project-panel .field-help {
  display: block;
  color: #6e7472;
}

.new-project-field-1 { grid-area: name; }
.new-project-field-2 { grid-area: number; }
.new-project-field-3 { grid-area: line; }
.new-project-field-4 { grid-area: construction; }
.new-project-field-5 { grid-area: length; }
.new-project-field-6 { grid-area: width; }
.new-project-field-7 { grid-area: operation; }
.new-project-actions {
  display: grid;
  grid-area: action;
  grid-template-rows: 18px 44px minmax(58px, auto);
  gap: 7px;
  align-self: stretch;
}

.page-projects .btn {
  min-height: 42px;
  border-radius: 0;
}

.page-projects .btn.primary {
  border-color: var(--ui-brand-yellow);
  background: var(--ui-brand-yellow);
  color: var(--ui-brand-black);
}

.page-projects .btn.primary:hover {
  border-color: var(--ui-brand-yellow-hover);
  background: var(--ui-brand-yellow-hover);
}

.new-project-actions .btn {
  height: 44px;
  min-height: 44px;
  white-space: nowrap;
}

.new-project-action-feedback {
  min-height: 58px;
  display: block;
  max-width: 220px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.new-project-action-feedback.has-error {
  color: #9a3d35;
}

.new-project-action-feedback a {
  display: block;
  width: fit-content;
  margin-top: 4px;
  color: #7e2f29;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-list-section {
  padding: 0;
  overflow: visible;
}

.project-list-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin: 0;
  padding: 19px 20px;
  border-bottom: 1px solid var(--ui-border);
}

.project-list-heading p.muted { margin: 5px 0 0; }

.project-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-filter input,
.project-filter select {
  min-height: 40px;
  border-radius: 0;
}

.project-filter input { min-width: 230px; }

.project-list {
  display: grid;
  gap: 0;
}

.project-row {
  min-height: 110px;
  display: grid;
  grid-template-columns: 120px minmax(220px, 1.15fr) minmax(360px, 1.65fr) auto;
  align-items: center;
  gap: 20px;
  padding: 13px 20px;
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  border-radius: 0;
  background: #fff;
}

.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: #fffefa; }

.project-row-preview {
  position: relative;
  width: 120px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #cfd3d1;
  border-radius: 0;
  background-color: var(--ui-stainless);
  background-image: linear-gradient(#dfe2e0 1px, transparent 1px), linear-gradient(90deg, #dfe2e0 1px, transparent 1px);
  background-size: 10px 10px;
}

.project-row-preview .project-preview-button {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.project-row-preview img { width: 100%; height: 100%; object-fit: cover; }
.project-row-preview .placeholder { color: #656b69; font-size: 10px; }

.project-row.has-worker-logo {
  grid-template-columns: 120px minmax(200px, 1fr) 120px minmax(340px, 1.65fr) auto;
  gap: 18px;
}

.project-worker-logo {
  width: 120px;
  height: 72px;
  display: grid;
  place-items: center;
  padding: 10px 8px;
}

.project-worker-logo img {
  width: 100%;
  height: 100%;
  max-width: 140px;
  max-height: 70px;
  display: block;
  object-fit: contain;
}

.project-summary h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.project-summary p { margin: 5px 0 0; }
.project-number { color: var(--ui-graphite); font-size: 12px; font-weight: 750; }
.project-summary .muted { font-size: 12px; }

.project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  align-items: center;
  gap: 8px 15px;
  color: var(--ui-muted);
  font-size: 12px;
}

.project-facts > span:not(.project-status) {
  min-height: 38px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding-left: 11px;
  border-left: 1px solid var(--ui-border);
  color: var(--ui-graphite);
  font-weight: 700;
}

.project-facts small {
  color: var(--ui-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-creator { overflow-wrap: anywhere; }

.project-status {
  grid-column: 1 / -1;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ui-graphite);
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.project-status::before {
  width: 7px;
  height: 7px;
  content: "";
  background: var(--ui-brand-yellow);
}

.project-status[data-status="archived"] { color: #7a5350; }
.project-status[data-status="archived"]::before { background: #8b908f; }

.project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.project-action-popover { min-width: 185px; }
.project-action-confirm { padding-top: 4px; border-top: 1px solid var(--ui-border); }
.project-action-confirm form { display: grid; gap: 9px; padding: 8px 4px 4px; }
.confirm-choice { color: var(--ui-muted); font-size: 12px; }
.empty-state { padding: 42px 18px; text-align: center; }

.page-projects .icon-button {
  border-radius: 0;
}

@media (max-width: 1180px) {
  .new-project-panel .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "name number line" "construction length width" "operation action action";
  }
  .new-project-actions .btn { width: 100%; }
  .project-row { grid-template-columns: 110px minmax(190px, 1fr) minmax(300px, 1.5fr) auto; gap: 14px; }
  .project-row.has-worker-logo { grid-template-columns: 110px minmax(170px, 1fr) 100px minmax(280px, 1.5fr) auto; }
  .project-row-preview { width: 110px; }
  .project-worker-logo { width: 100px; }
  .project-worker-logo img { width: 90px; }
  .project-actions { flex-wrap: wrap; }
}

@media (max-width: 920px) {
  .dashboard-hero-copy { grid-template-columns: 1fr; }
  .dashboard-catalog-action { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 18px; }
  .dashboard-intro { grid-row: 3; }
  .project-list-heading { grid-template-columns: 1fr; align-items: start; }
  .project-filter { justify-content: flex-start; }
  .project-row { grid-template-columns: 104px minmax(0, 1fr); }
  .project-row-preview { width: 104px; }
  .project-facts, .project-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .project-row.has-worker-logo { grid-template-columns: 104px minmax(0, 1fr); }
  .project-row.has-worker-logo .project-worker-logo { grid-column: 1; width: 104px; }
  .project-row.has-worker-logo .project-facts { grid-column: 2; }
  .project-row.has-worker-logo .project-actions { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .dashboard-hero { min-height: 280px; }
  .dashboard-hero-copy { min-height: 280px; padding: 34px calc(var(--ui-content-gutter) + 14px) 52px; }
  .dashboard-hero h1 { font-size: 36px; }
  .new-project-panel { margin-top: -50px; }
  .new-project-heading, .new-project-panel form, .project-list-heading { padding-inline: 15px; }
  .new-project-panel .field-grid { grid-template-columns: 1fr; grid-template-areas: "name" "number" "line" "construction" "length" "width" "operation" "action"; }
  .project-list-heading { display: grid; }
  .project-row { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .project-row-preview { width: 76px; height: 64px; }
  .project-row.has-worker-logo { grid-template-columns: 76px minmax(0, 1fr); }
  .project-row.has-worker-logo .project-worker-logo { width: 76px; height: 64px; padding-inline: 4px; }
  .project-row.has-worker-logo .project-worker-logo img { width: 68px; height: 32px; }
  .project-facts { grid-template-columns: 1fr; }
  .project-status { grid-column: 1; }
  .project-actions { flex-wrap: wrap; }
  .project-filter input, .project-filter select, .project-filter .btn { width: 100%; }
}
