:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #f4f7f7;
  color: #292727;
  --surface: #ffffff;
  --surface-soft: #f4f7f7;
  --line: rgba(41, 39, 39, 0.12);
  --muted: #666262;
  --brand: #008b8b;
  --brand-strong: #006f75;
  --accent: #ff850f;
  --accent-dark: #d96d00;
  --accent-soft: #fff0e3;
  --dark: #292727;
  --gray: #d8d9da;
  --steel: #4f6668;
  --red: #8f2f2f;
  --amber: #b86628;
  --shadow: 0 6px 18px rgba(10, 25, 25, 0.045);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #f4f7f7 0, #ffffff 58%, #f4f7f7 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-weight: 500;
  line-height: 1.35;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(1880px, calc(100% - 16px));
  margin: 0 auto;
  padding: 8px 0 18px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: clamp(132px, 14vh, 176px);
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid rgba(41, 39, 39, 0.06);
  border-radius: 8px;
  padding: clamp(16px, 2vw, 30px);
  background:
    linear-gradient(120deg, rgba(38, 36, 36, 0.98), rgba(38, 36, 36, 0.95) 58%, rgba(0, 139, 139, 0.92)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  color: #ffffff;
  box-shadow: 0 20px 44px rgba(28, 27, 27, 0.14);
}

.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(680px, 52vw);
  height: 20px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 38%, var(--accent) 38%, var(--accent) 100%);
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
}

.topbar::after {
  content: "";
  position: absolute;
  right: -92px;
  bottom: -120px;
  width: min(420px, 30vw);
  height: 250px;
  background: rgba(255, 133, 15, 0.16);
  transform: skewX(-24deg);
}

.topbar-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
  min-width: 0;
}

.logo-shell {
  display: grid;
  flex: 0 0 auto;
  width: clamp(96px, 7vw, 132px);
  height: clamp(96px, 7vw, 132px);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.brand-logo {
  width: clamp(76px, 5.7vw, 108px);
  height: clamp(76px, 5.7vw, 108px);
  object-fit: contain;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #ffffff;
  font-size: clamp(28px, 2.3vw, 40px);
  line-height: 1.04;
  font-weight: 780;
}

.hero-subtitle {
  max-width: 760px;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.42;
}

h2 {
  font-size: 17px;
}

.run-status {
  position: relative;
  z-index: 1;
  min-width: 210px;
  padding: 13px 16px;
  border: 0;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  text-align: left;
  font-weight: 700;
}

.run-status span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.run-status strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .topbar {
    display: block;
  }

  .topbar-content {
    width: 100%;
  }

  .run-status {
    width: min(320px, 100%);
    min-width: 0;
    margin-top: 16px;
  }

  .hero-subtitle {
    max-width: 100%;
  }
}

.base-strip {
  margin-bottom: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.status-panel {
  min-height: 202px;
  padding: 14px;
}

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

.panel-title span,
.panel-title p {
  color: var(--muted);
  font-size: 14px;
}

.output-path {
  max-width: 720px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.missing-obras {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 920px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(143, 47, 47, 0.18);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: #fff3f3;
  color: var(--red) !important;
  font-size: 13px;
  font-weight: 750;
}

.missing-obras[hidden] {
  display: none;
}

.missing-obras span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.missing-obras b {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(143, 47, 47, 0.2);
  border-radius: 999px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--red);
}

.sheet-entry {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.sheet-header,
.sheet-body {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
}

.sheet-body {
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.sheet-header {
  border-bottom: 1px solid var(--line);
  background: #eef3f3;
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sheet-header span {
  min-height: 34px;
  padding: 10px 12px;
}

.sheet-header span + span,
.sheet-body textarea {
  border-left: 1px solid var(--line);
}

.line-numbers {
  position: relative;
  z-index: 2;
  min-height: 118px;
  max-height: 174px;
  overflow: hidden;
  background: #eef3f3;
  color: var(--steel);
  font-size: 13px;
  line-height: 28px;
  text-align: right;
}

.line-numbers div {
  height: 28px;
  padding: 0 12px;
  border-bottom: 1px solid #edf2f7;
}

.line-numbers div.missing-line {
  background: #fff3f3;
  box-shadow:
    inset 4px 0 0 var(--red),
    inset 0 0 0 1px rgba(143, 47, 47, 0.12);
  color: var(--red);
  font-weight: 850;
}

.line-numbers div.repeated-line {
  background: #fff7eb;
  box-shadow:
    inset 4px 0 0 var(--accent),
    inset 0 0 0 1px rgba(255, 133, 15, 0.2);
  color: var(--accent-dark);
  font-weight: 850;
}

.line-numbers div.missing-line.repeated-line {
  background: linear-gradient(90deg, #fff3f3 0%, #fff3f3 54%, #fff7eb 100%);
  box-shadow:
    inset 4px 0 0 var(--red),
    inset 9px 0 0 var(--accent),
    inset 0 0 0 1px rgba(143, 47, 47, 0.16);
  color: var(--red);
}

.row-highlights {
  position: absolute;
  top: 0;
  left: 58px;
  right: 0;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}

.row-highlights div {
  height: 28px;
}

.row-highlights div.missing-row {
  margin: 1px 6px 1px 0;
  border-radius: 6px;
  background: rgba(143, 47, 47, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(143, 47, 47, 0.28),
    0 0 14px rgba(143, 47, 47, 0.34);
}

.row-highlights div.repeated-row {
  margin: 1px 6px 1px 0;
  border-radius: 6px;
  background: rgba(255, 133, 15, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 133, 15, 0.42),
    0 0 14px rgba(255, 133, 15, 0.36);
}

.row-highlights div.missing-row.repeated-row {
  background: linear-gradient(90deg, rgba(143, 47, 47, 0.13), rgba(255, 133, 15, 0.14));
  box-shadow:
    inset 0 0 0 1px rgba(143, 47, 47, 0.3),
    0 0 16px rgba(143, 47, 47, 0.28),
    0 0 14px rgba(255, 133, 15, 0.24);
}

textarea {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 118px;
  max-height: 174px;
  resize: vertical;
  border: 0;
  padding: 0 12px;
  color: var(--dark);
  background: transparent;
  outline: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 28px;
  white-space: pre;
}

textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.14);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.button {
  min-width: 112px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

.input-panel .button {
  min-width: 96px;
  padding: 0 12px;
}

#dedupeButton {
  min-width: 148px;
}

.button.primary {
  background: var(--brand);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--brand-strong);
}

.button.ghost {
  background: #ffffff;
  border-color: var(--line);
  color: var(--dark);
}

.button.ghost:hover {
  border-color: rgba(255, 133, 15, 0.42);
  color: var(--brand);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--brand);
}

.output-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.export-button {
  flex: 0 0 auto;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--dark);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(255, 133, 15, 0.42);
  color: var(--brand);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.base-strip .base-list,
.base-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.upload-box {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
  border-top: 1px solid rgba(0, 139, 139, 0.18);
  padding: 8px 0 0;
  background: #ffffff;
}

.upload-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-title strong {
  color: var(--dark);
  font-size: 15px;
}

.upload-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-message {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f7fbfb;
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
}

.upload-message[hidden] {
  display: none;
}

.upload-message.ok {
  border-color: rgba(0, 139, 139, 0.2);
  border-left-color: var(--brand);
  background: rgba(0, 139, 139, 0.08);
  color: var(--brand-strong);
}

.upload-message.error {
  border-color: rgba(143, 47, 47, 0.18);
  border-left-color: var(--red);
  background: #fff3f3;
  color: var(--red);
}

.upload-message.loading {
  border-color: rgba(255, 133, 15, 0.24);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 62px;
  padding: 8px;
  background: #fbfdfd;
}

.upload-row.selected {
  border-color: rgba(0, 139, 139, 0.38);
  box-shadow: inset 4px 0 0 var(--brand);
}

.upload-row.loading {
  border-color: rgba(255, 133, 15, 0.42);
  box-shadow: inset 4px 0 0 var(--accent);
}

.upload-consulta {
  min-width: 0;
}

.upload-consulta strong {
  display: block;
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.upload-consulta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.upload-picker {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  place-items: center;
  border: 1px solid rgba(0, 139, 139, 0.24);
  border-radius: 6px;
  padding: 0;
  background: #ffffff;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.upload-picker:hover {
  border-color: rgba(255, 133, 15, 0.5);
  color: var(--accent-dark);
}

.upload-picker input {
  display: none;
}

.upload-picker input:disabled {
  cursor: wait;
}

.upload-picker span {
  pointer-events: none;
}

.upload-file {
  grid-column: 1 / span 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-state {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  min-height: 22px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.upload-state.wait {
  background: #eef3f3;
  color: var(--steel);
}

.upload-state.selected {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.upload-state.loading {
  position: relative;
  padding-left: 24px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.upload-state.loading::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border: 2px solid rgba(255, 133, 15, 0.28);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.upload-state.ok {
  background: rgba(0, 139, 139, 0.1);
  color: var(--brand-strong);
}

.upload-state.error {
  background: #ffe3e3;
  color: var(--red);
}

.upload-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
}

.button-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.upload-submit.loading .button-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.base-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 8px 10px;
  background: #fbfdfd;
  box-shadow: var(--shadow);
}

.base-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.base-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
}

.base-copy {
  min-width: 0;
}

.base-loaded {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.base-code,
.base-path {
  color: var(--muted);
  font-size: 11px;
}

.base-status-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.base-status-icon.ok {
  background: rgba(0, 139, 139, 0.12);
  color: var(--brand-strong);
}

.base-status-icon.wait {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: rgba(0, 139, 139, 0.1);
  color: var(--brand-strong);
}

.badge.wait {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.badge.error {
  background: #ffe3e3;
  color: var(--red);
}

.results-panel {
  margin-top: 8px;
  padding: 14px;
}

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

.summary-pill {
  min-width: 92px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 7px 10px;
  text-align: center;
  background: #ffffff;
}

.summary-pill strong {
  display: block;
  font-size: 18px;
}

.summary-pill span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  height: clamp(380px, calc(100vh - 455px), 720px);
  min-height: 340px;
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable both-edges;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(10, 25, 25, 0.06);
}

table {
  width: 100%;
  min-width: 1340px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(41, 39, 39, 0.08);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--dark);
  font-size: 12px;
  text-transform: uppercase;
  text-align: center;
  vertical-align: middle;
  background: linear-gradient(180deg, #ffffff 0%, #f0f6f6 100%);
  border-bottom: 1px solid rgba(41, 39, 39, 0.14);
}

tbody tr:nth-child(even) td {
  background: #fbfdfd;
}

tbody tr:hover td {
  background: rgba(0, 139, 139, 0.06);
}

.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #eef3f3;
  border-left: 1px solid rgba(41, 39, 39, 0.08);
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 139, 139, 0.62);
  border: 3px solid #eef3f3;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 133, 15, 0.78);
}

.table-wrap::-webkit-scrollbar-corner {
  background: #eef3f3;
}

th.qty,
td.qty {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 12px, 1180px);
    padding-top: 8px;
  }

  .topbar,
  .workspace {
    display: block;
  }

  .run-status,
  .status-panel,
  .results-panel {
    margin-top: 14px;
  }

  .panel-title {
    align-items: flex-start;
  }

  h1 {
    font-size: 25px;
  }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-view[hidden],
.app-view[hidden],
.view-panel[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  border: 1px solid rgba(41, 39, 39, 0.1);
  border-left: 6px solid var(--brand);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
  box-shadow: 0 24px 70px rgba(10, 25, 25, 0.13);
}

.login-card h1 {
  color: var(--dark);
  font-size: 30px;
}

.login-card .hero-subtitle {
  color: var(--muted);
}

.login-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
}

.login-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
}

.login-card input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.14);
}

.login-message {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.portal-topbar {
  min-height: 132px;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 8px;
}

.nav-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--dark);
  cursor: pointer;
  font-weight: 800;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(0, 139, 139, 0.36);
  background: rgba(0, 139, 139, 0.08);
  color: var(--brand-strong);
}

.nav-button.logout {
  margin-left: auto;
}

.view-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.view-panel > * {
  min-width: 0;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.project-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--brand);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.project-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 139, 139, 0.32);
}

.project-card strong {
  font-size: 20px;
  line-height: 1.18;
}

.project-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
}

.project-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 139, 139, 0.1);
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 900;
}

.accent-card {
  border-left-color: var(--accent);
}

.accent-card .project-icon {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 9px 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.context-bar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--dark);
  cursor: pointer;
  font-weight: 800;
}

.segmented-button.active {
  border-color: rgba(0, 139, 139, 0.36);
  background: rgba(0, 139, 139, 0.1);
  color: var(--brand-strong);
}

.materials-workspace {
  grid-template-columns: minmax(310px, 430px) minmax(260px, 1fr);
}

.compact-button {
  min-width: 82px;
  min-height: 34px;
}

.quick-panel {
  display: grid;
  align-content: start;
}

.quick-status {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(0, 139, 139, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 139, 139, 0.06);
}

.quick-status strong {
  font-size: 18px;
}

.quick-status span {
  color: var(--muted);
  font-weight: 800;
}

.ecp-status-panel {
  padding: 10px;
}

.compact-panel {
  padding: 8px;
}

.ecp-base-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ecp-filter-panel,
.ecp-table-panel,
.ecp-detail-panel,
.ecp-chart-panel,
.ecp-aux-panel {
  padding: 10px;
}

.tight-actions {
  margin-top: 0;
}

.ecp-filter-grid {
  display: grid;
  grid-template-columns: 1.06fr 1.06fr 1.35fr 0.95fr;
  gap: 5px 8px;
}

.ecp-filter-grid label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ecp-filter-grid span {
  color: var(--dark);
  font-size: 11px;
  font-weight: 850;
}

.ecp-filter-grid select,
.ecp-filter-grid input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 6px;
  background: #ffffff;
  color: var(--dark);
  font-size: 12px;
  outline: none;
}

.ecp-filter-grid select {
  height: 54px;
  overflow-y: auto;
}

.ecp-filter-grid input {
  height: 42px;
}

.ecp-filter-grid label:nth-child(5) {
  grid-column: span 1;
}

.ecp-filter-grid label:nth-child(6) {
  grid-column: span 2;
}

.ecp-filter-grid label:nth-child(7) {
  grid-column: span 1;
}

.ecp-filter-grid select:focus,
.ecp-filter-grid input:focus {
  box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.13);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.filter-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(0, 139, 139, 0.16);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(0, 139, 139, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.filter-chips strong {
  color: var(--dark);
}

.ecp-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.ecp-summary-pill {
  min-height: 58px;
  display: grid;
  align-content: center;
  box-shadow: var(--shadow);
}

.ecp-summary-pill strong {
  font-size: 16px;
}

.ecp-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 8px;
}

.ecp-bars {
  display: grid;
  gap: 6px;
  min-height: 132px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.ecp-list-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.22;
}

.ecp-list-row strong {
  color: var(--brand-strong);
  font-weight: 900;
  text-transform: uppercase;
}

.ecp-list-row.tone-1 strong {
  color: var(--accent-dark);
}

.ecp-list-row.tone-2 strong {
  color: var(--steel);
}

.ecp-list-row.tone-3 strong {
  color: var(--red);
}

.ecp-list-split {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-basis: 100%;
  color: var(--muted);
}

.ecp-list-split small {
  font-size: 10.5px;
  font-weight: 750;
}

.ecp-table-wrap {
  height: clamp(360px, calc(100vh - 600px), 640px);
  min-height: 300px;
}

.ecp-table-wrap table {
  min-width: 2180px;
}

.ecp-detail-table-wrap {
  height: clamp(300px, 44vh, 560px);
  min-height: 280px;
}

.ecp-detail-table-wrap table {
  min-width: 1740px;
}

.icon-cell-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(0, 139, 139, 0.24);
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-strong);
  cursor: pointer;
  font-weight: 900;
}

.icon-cell-button:hover {
  border-color: rgba(255, 133, 15, 0.42);
  color: var(--accent-dark);
}

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

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

.ecp-nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 139, 139, 0.18);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--dark);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.ecp-nav-link span {
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 900;
}

.ecp-nav-link strong {
  font-size: 13px;
  font-weight: 850;
}

.ecp-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ecp-back-link {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--dark);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.ecp-back-link:hover {
  border-color: var(--accent);
  color: var(--brand-strong);
}

.ecp-back-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.centered-title {
  justify-content: center;
  text-align: center;
}

.ecp-analytic-mode > .context-bar,
.ecp-analytic-mode > .ecp-status-panel,
.ecp-analytic-mode > .ecp-nav-actions,
.ecp-analytic-mode > .ecp-filter-panel,
.ecp-analytic-mode > .ecp-summary,
.ecp-analytic-mode > .ecp-dashboard-grid,
.ecp-analytic-mode > .ecp-table-panel,
.ecp-analytic-mode > .ecp-aux-panel,
.ecp-aux-mode > .context-bar,
.ecp-aux-mode > .ecp-status-panel,
.ecp-aux-mode > .ecp-nav-actions,
.ecp-aux-mode > .ecp-filter-panel,
.ecp-aux-mode > .ecp-summary,
.ecp-aux-mode > .ecp-dashboard-grid,
.ecp-aux-mode > .ecp-table-panel,
.ecp-aux-mode > .ecp-detail-panel {
  display: none;
}

.ecp-info-card {
  display: grid;
  gap: 7px;
  min-height: 98px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfd;
}

.ecp-info-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.ecp-info-card > strong {
  color: var(--dark);
  font-size: 17px;
  line-height: 1.25;
}

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

.comparison-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  border-bottom: 1px solid rgba(41, 39, 39, 0.08);
  padding-bottom: 5px;
}

.comparison-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.comparison-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.comparison-list strong {
  color: var(--dark);
  font-size: 12px;
  text-align: right;
}

body.view-ecp {
  background:
    linear-gradient(180deg, rgba(244, 247, 247, 0.98), rgba(247, 248, 248, 1) 62%),
    radial-gradient(circle at 94% 4%, rgba(255, 133, 15, 0.13), transparent 30%),
    radial-gradient(circle at 5% 20%, rgba(0, 139, 139, 0.10), transparent 26%);
}

body.view-ecp,
body.view-uploads {
  font-size: 14px;
}

body.view-ecp strong,
body.view-ecp b,
body.view-ecp button,
body.view-uploads strong,
body.view-uploads b,
body.view-uploads button {
  font-weight: 760;
}

body.view-ecp .shell {
  width: min(100%, 1880px);
  padding: clamp(6px, 1.2vh, 14px) clamp(10px, 2vw, 38px) 20px;
}

body.view-ecp .portal-topbar,
body.view-ecp .portal-nav {
  display: none;
}

body.view-ecp #ecpPanel {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ecp-original-hero {
  position: relative;
  min-height: clamp(160px, 19vh, 220px);
  overflow: hidden;
  padding: clamp(22px, 2.6vw, 38px);
  background:
    linear-gradient(120deg, rgba(38, 36, 36, 0.98), rgba(38, 36, 36, 0.95) 57%, rgba(0, 139, 139, 0.92)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  border: 1px solid rgba(41, 39, 39, 0.06);
  box-shadow: 0 20px 44px rgba(28, 27, 27, 0.14);
}

.ecp-original-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 50vw);
  height: 24px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 38%, var(--accent) 38%, var(--accent) 100%);
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
}

.ecp-original-hero::after {
  content: "";
  position: absolute;
  right: -105px;
  bottom: -118px;
  width: min(460px, 32vw);
  height: 270px;
  background: rgba(255, 133, 15, 0.16);
  transform: skewX(-24deg);
}

.ecp-original-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 2.3vw, 42px);
}

.ecp-original-logo-shell {
  display: grid;
  place-items: center;
  width: clamp(112px, 8.2vw, 150px);
  height: clamp(112px, 8.2vw, 150px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.ecp-original-logo {
  width: clamp(88px, 6.6vw, 124px);
  height: clamp(88px, 6.6vw, 124px);
  object-fit: contain;
}

.ecp-original-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: clamp(12px, 0.65vw, 13px);
  font-weight: 800;
  text-transform: uppercase;
}

.ecp-original-copy h1 {
  color: #ffffff;
  font-size: clamp(30px, 2.25vw, 44px);
  line-height: 1.02;
  font-weight: 850;
}

.ecp-original-copy p {
  max-width: 900px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(15px, 0.88vw, 17px);
  line-height: 1.42;
}

.ecp-original-client {
  min-width: 240px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.ecp-original-client span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ecp-original-client strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.upload-page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.upload-page-hero h2 {
  color: var(--dark);
  font-size: 20px;
  font-weight: 850;
}

.upload-page-hero p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.ecp-update-card {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid rgba(41, 39, 39, 0.10);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(10, 25, 25, 0.06);
}

.ecp-update-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ecp-update-title {
  color: var(--dark);
  font-size: 15px;
  font-weight: 850;
}

.ecp-update-sub {
  margin-top: 6px;
  color: #666262;
  font-size: 12px;
  font-weight: 650;
}

.ecp-hidden-switch {
  opacity: 0.92;
}

.ecp-file-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 16px;
}

.ecp-file-button {
  min-height: 40px;
  border: 1px solid rgba(41, 39, 39, 0.20);
  border-radius: 6px;
  background: #ffffff;
  color: #272727;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(10, 25, 25, 0.035);
}

.ecp-file-button:hover {
  border-color: rgba(0, 139, 139, 0.45);
  color: var(--brand-strong);
}

.ecp-update-all {
  width: 100%;
  min-height: 42px;
  margin-bottom: 14px;
  border: 0;
  border-radius: 8px;
  background: #ff4b4b;
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
}

.ecp-update-all:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ecp-update-message {
  min-height: 0;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ecp-update-message.loading,
.ecp-update-message.ok,
.ecp-update-message.error {
  min-height: 28px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 6px;
}

.ecp-update-message.loading {
  background: #fff7eb;
  color: var(--amber);
}

.ecp-update-message.ok {
  background: #e9fbf6;
  color: var(--brand-strong);
}

.ecp-update-message.error {
  background: #fff0f0;
  color: var(--red);
}

.ecp-nav-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin: -1px 0 28px;
}

.ecp-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid rgba(0, 139, 139, 0.18);
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--dark);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 18px rgba(10, 25, 25, 0.045);
}

.ecp-nav-link span {
  display: inline-grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 139, 139, 0.10);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
}

.ecp-nav-link strong {
  color: inherit;
  font-size: 14px;
  font-weight: 850;
}

.ecp-nav-link:hover {
  border-color: rgba(255, 133, 15, 0.38);
  color: var(--brand-strong);
}

.ecp-company-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -14px 0 28px;
  border: 1px solid rgba(0, 139, 139, 0.18);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdfd);
  box-shadow: 0 10px 24px rgba(10, 25, 25, 0.045);
}

.ecp-company-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ecp-company-panel strong {
  display: block;
  margin-top: 2px;
  color: var(--dark);
  font-size: 18px;
  font-weight: 760;
}

.ecp-company-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(41, 39, 39, 0.09);
  border-radius: 10px;
  background: #f4f7f7;
}

.ecp-company-switch .segmented-button {
  min-width: 124px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ecp-company-switch .segmented-button.active {
  background: #ffffff;
  color: var(--brand-strong);
  box-shadow: 0 6px 14px rgba(10, 25, 25, 0.08);
}

.ecp-filter-panel,
.ecp-table-panel,
.ecp-chart-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ecp-filter-panel {
  border: 1px solid rgba(41, 39, 39, 0.08);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
  box-shadow: 0 12px 28px rgba(10, 25, 25, 0.05);
}

.ecp-section-heading,
.ecp-table-heading {
  margin: 0 0 12px;
}

.ecp-section-heading h2,
.ecp-table-heading h2 {
  color: var(--dark);
  font-size: 16px;
  font-weight: 850;
}

.ecp-section-heading span,
.ecp-table-heading span {
  display: block;
  width: 108px;
  height: 3px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.ecp-filter-grid {
  grid-template-columns: 1.06fr 1.06fr 1.35fr 0.95fr;
  gap: 16px 18px;
  align-items: end;
}

.ecp-filter-grid label {
  gap: 6px;
}

.ecp-filter-grid label > span {
  color: #4a4848;
  font-size: 12px;
  font-weight: 700;
}

.ecp-filter-grid select {
  display: none;
}

.ecp-filter-grid input {
  height: 46px;
  border: 1px solid rgba(41, 39, 39, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(33, 31, 31, 0.035);
  font-size: 13px;
}

.ecp-multiselect {
  position: relative;
}

.ecp-select-box {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(41, 39, 39, 0.12);
  border-radius: 8px;
  padding: 6px 9px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(33, 31, 31, 0.035);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ecp-multiselect.open .ecp-select-box,
.ecp-select-box:focus {
  border-color: rgba(0, 139, 139, 0.36);
  box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.10), 0 12px 24px rgba(10, 25, 25, 0.06);
}

.ecp-select-values {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.ecp-select-placeholder {
  color: #8a8585;
  font-size: 13px;
}

.ecp-select-chip {
  max-width: min(210px, 100%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(0, 139, 139, 0.16);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(0, 139, 139, 0.08);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
}

.ecp-select-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecp-select-chip button,
.ecp-select-clear {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 900;
}

.ecp-select-clear {
  color: #8b8b8b;
  font-size: 16px;
}

.ecp-select-arrow {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
}

.ecp-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(41, 39, 39, 0.14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(10, 25, 25, 0.14);
  display: none;
}

.ecp-multiselect.open .ecp-select-menu,
.ecp-multiselect:focus-within .ecp-select-menu {
  display: block;
}

.ecp-select-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: var(--dark);
  cursor: pointer;
  font-size: 12px;
}

.ecp-select-option:hover {
  background: rgba(0, 139, 139, 0.07);
}

.ecp-select-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.filter-chips {
  gap: 8px;
  margin: 12px 0 14px;
}

.filter-chips span {
  min-height: 32px;
  border: 1px solid rgba(41, 39, 39, 0.10);
  border-radius: 0;
  background: #ffffff;
  color: #4e4c4c;
  font-size: 12px;
  font-weight: 650;
}

.ecp-summary {
  gap: 16px;
  margin: 8px 0 28px;
}

.ecp-summary-pill {
  min-height: 96px;
  align-content: center;
  border: 1px solid rgba(41, 39, 39, 0.08);
  border-left: 5px solid var(--brand);
  border-radius: 0;
  background: #ffffff;
  padding: 12px 15px;
  box-shadow: 0 10px 22px rgba(32, 31, 31, 0.055);
}

.ecp-summary-pill strong {
  color: var(--dark);
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 850;
}

.ecp-summary-pill span {
  color: #615f5f;
  font-size: 13px;
  font-weight: 700;
}

.ecp-dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  margin-bottom: 42px;
}

.ecp-bars {
  min-height: 360px;
  max-height: none;
  overflow: visible;
}

.ecp-funnel-chart {
  min-height: 284px;
  display: grid;
  place-items: center;
  gap: 5px;
  margin: 16px 52px 0;
  border: 1px solid rgba(41, 39, 39, 0.09);
  border-radius: 8px;
  padding: 28px 20px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(10, 25, 25, 0.045);
}

.ecp-funnel-segment {
  width: var(--funnel-width, 100%);
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
  color: #ffffff;
  text-align: center;
  font-weight: 850;
  background: linear-gradient(90deg, #008b8b, #16756f);
  box-shadow: 0 8px 18px rgba(0, 139, 139, 0.16);
}

.ecp-funnel-segment.tone-1 {
  background: linear-gradient(90deg, #16756f, #4f6668);
}

.ecp-funnel-segment.tone-2 {
  background: linear-gradient(90deg, #4f6668, #2c2a2a);
}

.ecp-funnel-segment.tone-3 {
  background: linear-gradient(90deg, #b86628, #ff850f);
}

.ecp-funnel-segment strong {
  color: #ffffff;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(11px, 0.8vw, 13px);
  line-height: 1.15;
  text-transform: uppercase;
}

.ecp-funnel-segment span,
.ecp-funnel-segment small {
  color: #ffffff;
  font-size: clamp(11px, 0.72vw, 12px);
  line-height: 1.15;
}

.ecp-vector-chart {
  overflow: hidden;
}

.ecp-funnel-svg,
.ecp-regional-svg {
  display: block;
  width: 100%;
  height: auto;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.ecp-funnel-shape {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.2;
}

.ecp-funnel-label,
.ecp-funnel-value,
.ecp-funnel-count,
.ecp-regional-total,
.ecp-regional-label,
.ecp-axis-label-svg,
.ecp-grid-lines text {
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
}

.ecp-funnel-label {
  fill: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.ecp-funnel-value {
  fill: rgba(255, 255, 255, 0.96);
  font-size: 16px;
  font-weight: 760;
}

.ecp-funnel-count {
  fill: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 650;
}

.ecp-regional-chart {
  min-height: 390px;
  display: grid;
  gap: 6px;
  padding: 12px 18px 0;
}

.ecp-regional-svg {
  min-height: 332px;
}

.ecp-grid-lines line {
  stroke: rgba(41, 39, 39, 0.09);
  stroke-width: 1;
}

.ecp-grid-lines text {
  fill: #6f6a6a;
  font-size: 10.5px;
  font-weight: 650;
}

.ecp-axis-line {
  stroke: rgba(41, 39, 39, 0.2);
  stroke-width: 1.2;
}

.ecp-regional-material {
  fill: #008b8b;
}

.ecp-regional-mo {
  fill: #ff850f;
}

.ecp-regional-total {
  fill: #292727;
  font-size: 10.5px;
  font-weight: 780;
}

.ecp-regional-label,
.ecp-axis-label-svg {
  fill: #4d4949;
  font-size: 11px;
  font-weight: 700;
}

.ecp-axis-label-svg {
  fill: #777171;
  font-size: 12px;
}

.ecp-loading .ecp-summary,
.ecp-loading .ecp-dashboard-grid,
.ecp-loading .ecp-table-panel {
  opacity: 0.62;
  transition: opacity 0.18s ease;
}

.ecp-regional-chart {
  min-height: 360px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 12px 20px 0;
}

.ecp-chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: #4f6668;
  font-size: 12px;
}

.ecp-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ecp-chart-legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.ecp-vector-chart.ecp-regional-chart {
  grid-template-rows: auto 1fr;
  min-height: 390px;
}

.legend-material,
.ecp-regional-bar .material {
  background: var(--brand);
}

.legend-mo,
.ecp-regional-bar .mo {
  background: var(--accent);
}

.ecp-regional-plot {
  min-height: 270px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 38px;
  border-bottom: 1px solid rgba(41, 39, 39, 0.12);
  background:
    repeating-linear-gradient(to top, transparent, transparent 52px, rgba(41, 39, 39, 0.08) 53px);
}

.ecp-regional-bar-wrap {
  width: min(210px, 22%);
  display: grid;
  justify-items: center;
  gap: 7px;
}

.ecp-regional-bar {
  width: 100%;
  min-width: 80px;
  display: flex;
  flex-direction: column-reverse;
}

.ecp-regional-bar span {
  display: block;
  width: 100%;
}

.ecp-regional-bar-wrap small {
  max-width: 150px;
  color: #758085;
  font-size: 10px;
  text-align: center;
  transform: rotate(-18deg);
  transform-origin: top center;
}

.ecp-axis-label {
  color: #5f6e91;
  text-align: center;
  font-size: 12px;
}

.ecp-table-heading {
  text-align: center;
}

.ecp-table-heading span {
  margin-left: auto;
  margin-right: auto;
}

.ecp-table-heading p {
  margin-top: 6px;
  color: #777;
  font-size: 12px;
  text-align: left;
}

.ecp-table-wrap {
  height: 500px;
  min-height: 500px;
  border: 1px solid rgba(41, 39, 39, 0.12);
  border-radius: 6px;
  background: #ffffff;
}

.ecp-table-wrap table {
  min-width: 2200px;
}

.ecp-row-check {
  width: 16px;
  height: 16px;
}

.ecp-export-bottom {
  min-height: 44px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: var(--dark);
  color: #ffffff;
  cursor: pointer;
  padding: 0 18px;
  font-weight: 850;
}

.ecp-export-bottom:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ecp-analytic-mode > .ecp-original-hero,
.ecp-analytic-mode > .ecp-update-card,
.ecp-analytic-mode > .ecp-file-grid,
.ecp-analytic-mode > .ecp-update-all,
.ecp-analytic-mode > .ecp-update-message,
.ecp-aux-mode > .ecp-original-hero,
.ecp-aux-mode > .ecp-update-card,
.ecp-aux-mode > .ecp-file-grid,
.ecp-aux-mode > .ecp-update-all,
.ecp-aux-mode > .ecp-update-message {
  display: none;
}

.upload-companies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.upload-status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-status-company {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.upload-status-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.upload-status-title strong {
  font-size: 15px;
}

.upload-status-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-status-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.upload-status-item {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fbfdfd;
}

.upload-status-item.ok {
  border-color: rgba(0, 139, 139, 0.18);
  background: rgba(0, 139, 139, 0.06);
}

.upload-status-item.wait {
  border-color: rgba(255, 133, 15, 0.18);
  background: var(--accent-soft);
}

.upload-status-item b {
  color: var(--dark);
  font-size: 12px;
}

.upload-status-item span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
}

.company-upload {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.company-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.company-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-head h3 {
  margin: 0;
  font-size: 20px;
}

.company-head p {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.company-projects {
  display: grid;
  gap: 10px;
}

.portal-upload {
  border: 1px solid rgba(41, 39, 39, 0.1);
  border-radius: 8px;
  padding: 10px;
}

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

.upload-form-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .portal-grid,
  .upload-companies,
  .upload-status-strip,
  .ecp-dashboard-grid,
  .ecp-summary,
  .ecp-info-grid {
    grid-template-columns: 1fr;
  }

  .upload-grid-many,
  .upload-status-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .context-bar,
  .company-head,
  .upload-page-hero {
    display: grid;
  }

  .company-head p {
    text-align: left;
  }

  .nav-button.logout {
    margin-left: 0;
  }

  .ecp-original-hero {
    min-height: 354px;
    padding: 22px 18px 28px;
  }

  .ecp-original-hero::before {
    width: min(330px, 72vw);
    height: 22px;
  }

  .ecp-original-hero::after {
    right: -112px;
    bottom: -92px;
    width: 285px;
    height: 245px;
  }

  .ecp-original-hero-content {
    display: block;
  }

  .ecp-original-logo-shell {
    width: 96px;
    height: 96px;
    margin-bottom: 18px;
  }

  .ecp-original-logo {
    width: 76px;
    height: 76px;
  }

  .ecp-original-copy {
    max-width: 390px;
  }

  .ecp-original-kicker {
    max-width: 310px;
    font-size: 11px;
    line-height: 1.22;
  }

  .ecp-original-copy h1 {
    max-width: 360px;
    font-size: clamp(30px, 8vw, 38px);
  }

  .ecp-original-copy p {
    max-width: 390px;
    font-size: 14px;
  }

  .ecp-original-client {
    max-width: 172px;
    min-width: 0;
    margin-top: 16px;
    padding: 13px 14px;
  }

  .ecp-nav-actions {
    grid-template-columns: 1fr;
  }

  .ecp-company-panel {
    display: grid;
    margin-top: -8px;
  }

  .ecp-company-switch {
    width: 100%;
  }

  .ecp-company-switch .segmented-button {
    flex: 1 1 120px;
  }

  .ecp-funnel-chart {
    margin: 12px 0 0;
    padding: 20px 12px;
  }

  .ecp-funnel-segment {
    min-height: 64px;
  }
}

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

  .ecp-filter-grid label:nth-child(5),
  .ecp-filter-grid label:nth-child(6),
  .ecp-filter-grid label:nth-child(7) {
    grid-column: auto;
  }
}
