:root {
  --asphalt: #151515;
  --charcoal: #262626;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --yellow: #fdba2d;
  --yellow-soft: #ffe6a6;
  --red: #d71920;
  --concrete: #e5e2dc;
  --steel: #737373;
  --blue: #1e5aa8;
  --green: #16a34a;
  --line: rgba(21, 21, 21, 0.105);
  --line-soft: rgba(21, 21, 21, 0.065);
  --panel: rgba(255, 254, 250, 0.82);
  --panel-quiet: rgba(255, 254, 250, 0.58);
  --shadow-xl: 0 38px 92px rgba(21, 21, 21, 0.26);
  --shadow-card: 0 18px 44px rgba(21, 21, 21, 0.105);
  --shadow-soft: 0 10px 28px rgba(21, 21, 21, 0.075);
  --glow-yellow: 0 24px 78px rgba(253, 186, 45, 0.26);
  --radius-shell: 38px;
  --radius-card: 24px;
  --radius-control: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--asphalt);
  background:
    radial-gradient(circle at 84% 8%, rgba(253, 186, 45, 0.22), transparent 28%),
    radial-gradient(circle at 20% 92%, rgba(255, 255, 255, 0.36), transparent 32%),
    linear-gradient(135deg, #9ea8b6 0%, #b0b6bd 46%, #929bad 100%);
  font: 400 14px/1.48 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  letter-spacing: 0;
}

.app-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 18px;
  width: min(1640px, calc(100vw - 64px));
  min-height: calc(100vh - 80px);
  margin: 40px auto;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-shell);
  background:
    radial-gradient(circle at 86% 14%, rgba(253, 186, 45, 0.24), transparent 29%),
    linear-gradient(135deg, rgba(247, 245, 239, 0.9), rgba(229, 226, 220, 0.76));
  box-shadow:
    var(--shadow-xl),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 0 86px rgba(253, 186, 45, 0.14);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: auto 13% -84px 18%;
  height: 160px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(253, 186, 45, 0.34), transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

.app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 96px, rgba(21, 21, 21, 0.018) 96px 97px);
  pointer-events: none;
}

.sidebar,
.workspace,
.topbar,
.panel {
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px;
  overflow: hidden;
  color: var(--asphalt);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  background: rgba(255, 254, 250, 0.42);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(21, 21, 21, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-soft));
  color: var(--asphalt);
  box-shadow: 0 14px 36px rgba(253, 186, 45, 0.32);
  font-size: 14px;
  font-weight: 800;
}

.brand-block h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-block p,
.eyebrow {
  margin: 0;
  color: var(--steel);
  font-size: 11px;
  font-weight: 620;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.nav-list {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.36);
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 18px;
  color: rgba(21, 21, 21, 0.76);
  text-decoration: none;
  font-size: 13px;
  font-weight: 520;
}

.nav-link.active,
.nav-link:hover {
  background: var(--asphalt);
  color: var(--cream);
  box-shadow: 0 12px 26px rgba(21, 21, 21, 0.16);
}

.sidebar-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  color: rgba(21, 21, 21, 0.76);
  background: rgba(255, 255, 255, 0.34);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(253, 186, 45, 0.14), 0 0 20px rgba(253, 186, 45, 0.72);
}

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

.topbar,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.topbar::before,
.panel::before {
  content: "";
  position: absolute;
  inset: auto 8% -90px 22%;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(253, 186, 45, 0.13), transparent 70%);
  pointer-events: none;
}

.topbar.accentless::before {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 26px 30px;
}

.topbar > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.topbar h2,
.section-heading h3,
.manual-header h4,
.import-zone h4,
.report-grid h4 {
  margin: 0;
}

.topbar h2 {
  font-size: 38px;
  line-height: 0.98;
  font-weight: 520;
  letter-spacing: 0;
}

.topbar-actions,
.section-heading,
.manual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.button,
.file-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--asphalt);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 13px;
  font-weight: 540;
  box-shadow: 0 8px 18px rgba(21, 21, 21, 0.045);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button.primary {
  border-color: rgba(253, 186, 45, 0.82);
  background: linear-gradient(180deg, var(--yellow), var(--yellow-soft));
  color: var(--asphalt);
  box-shadow: 0 14px 32px rgba(253, 186, 45, 0.25);
}

.button.secondary,
.file-button {
  background: rgba(255, 255, 255, 0.58);
}

.button:hover,
.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(21, 21, 21, 0.075);
}

.file-button input {
  display: none;
}

.panel {
  padding: 22px 24px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h3 {
  font-size: 21px;
  font-weight: 560;
  letter-spacing: 0;
}

.pill,
.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(21, 21, 21, 0.78);
  font-size: 12px;
  font-weight: 560;
}

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

.form-grid.compact {
  margin-top: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: rgba(21, 21, 21, 0.58);
  font-size: 12px;
  font-weight: 540;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--asphalt);
  font-size: 13px;
  font-weight: 420;
}

input:focus,
select:focus {
  outline: 3px solid rgba(253, 186, 45, 0.2);
  border-color: rgba(253, 186, 45, 0.82);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: rgba(21, 21, 21, 0.78);
  font-size: 13px;
  font-weight: 500;
}

.check input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--yellow);
}

.import-zone,
.manual-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.36);
}

.import-zone p {
  max-width: 720px;
  margin: 4px 0 0;
  color: var(--steel);
  font-size: 13px;
}

.manual-entry {
  display: grid;
  margin-top: 12px;
}

.manual-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 116px 104px 152px;
  gap: 9px;
}

.table-wrap {
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 8px 22px rgba(21, 21, 21, 0.045);
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(21, 21, 21, 0.065);
  text-align: left;
  vertical-align: top;
}

th:first-child,
td:first-child {
  padding-left: 15px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(21, 21, 21, 0.94);
  color: rgba(247, 245, 239, 0.9);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

td {
  font-size: 13px;
}

td strong,
.takeoff-measure strong {
  font-weight: 560;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.22);
}

tbody tr:hover {
  background: rgba(253, 186, 45, 0.105);
}

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

.mapping-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.05fr) minmax(260px, 1fr) 104px 118px;
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 8px 22px rgba(21, 21, 21, 0.045);
}

.mapping-title {
  margin: 0 0 4px;
  font-weight: 580;
}

.mapping-meta,
.microcopy {
  margin: 0;
  color: var(--steel);
  font-size: 12px;
}

.confidence {
  font-size: 18px;
  font-weight: 540;
  color: var(--green);
  letter-spacing: 0;
}

.confidence.low {
  color: var(--red);
}

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

.summary-tile {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 22px rgba(21, 21, 21, 0.045);
}

.summary-tile span {
  display: block;
  color: rgba(21, 21, 21, 0.54);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: 0;
}

.summary-tile.total {
  color: var(--asphalt);
  border-color: rgba(253, 186, 45, 0.72);
  background: linear-gradient(180deg, rgba(253, 186, 45, 0.98), rgba(255, 230, 166, 0.88));
  box-shadow: var(--glow-yellow);
}

.summary-tile.total span {
  color: rgba(21, 21, 21, 0.58);
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.2fr);
  gap: 14px;
}

.flag-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flag-list li {
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  border-radius: 13px;
  background: rgba(255, 243, 205, 0.58);
  font-size: 13px;
}

.flag-list li.critical,
.flag-list li.manager_required {
  border-color: var(--red);
  background: rgba(255, 235, 232, 0.72);
}

.proposal-draft {
  min-height: 260px;
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--asphalt);
  font: 400 12.5px/1.52 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.review-badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--green);
  background: rgba(242, 248, 239, 0.7);
  font-size: 12px;
  font-weight: 520;
}

.review-badge.warn {
  color: var(--red);
  background: rgba(255, 235, 232, 0.7);
}

.mini-select,
.mini-input {
  min-height: 31px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 12.5px;
}

.takeoff-measure {
  display: grid;
  gap: 3px;
  min-width: 120px;
  color: var(--steel);
  font-size: 12px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
}

.icon-button {
  min-width: 34px;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--steel);
  cursor: pointer;
  font-size: 12px;
  font-weight: 520;
}

.icon-button.danger:hover,
.button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}

.scope-tab {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  padding: 7px 11px;
  color: rgba(21, 21, 21, 0.74);
  font-size: 13px;
  font-weight: 520;
  cursor: pointer;
}

.scope-tab.active {
  border-color: rgba(21, 21, 21, 0.88);
  background: var(--asphalt);
  color: var(--cream);
  box-shadow: 0 12px 28px rgba(21, 21, 21, 0.14);
}

.file-warning {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 16px;
  background: #fff3cd;
  border-bottom: 1px solid var(--yellow);
  color: var(--asphalt);
  font-weight: 600;
}

@media (max-width: 980px) {
  body {
    background: #a2aaba;
  }

  .app-shell {
    width: min(100vw - 24px, 980px);
    grid-template-columns: 1fr;
    margin: 12px auto;
    border-radius: 28px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-radius: 20px;
  }

  .form-grid,
  .summary-grid,
  .report-grid,
  .mapping-card {
    grid-template-columns: 1fr;
  }

  .manual-grid {
    grid-template-columns: 1fr 100px 100px 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell,
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .button,
  .manual-grid,
  .nav-list {
    width: 100%;
    grid-template-columns: 1fr;
  }
}


.saved-strip {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.34);
}

.saved-estimate-list {
  display: grid;
  gap: 8px;
}

.saved-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.saved-estimate.active {
  border-color: rgba(253, 186, 45, 0.68);
  box-shadow: 0 10px 24px rgba(253, 186, 45, 0.14);
}

.saved-estimate strong {
  display: block;
  font-weight: 560;
}

.pricing-heading-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

@media (max-width: 980px) {
  .saved-strip {
    grid-template-columns: 1fr;
  }
}


.bottom-actions {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(253, 186, 45, 0.34);
  border-radius: 22px;
  background: rgba(21, 21, 21, 0.88);
  box-shadow: 0 22px 70px rgba(21, 21, 21, 0.24), 0 0 42px rgba(253, 186, 45, 0.18);
  backdrop-filter: blur(18px);
}

.bottom-actions strong {
  display: block;
  margin-top: 2px;
  color: rgba(247, 245, 239, 0.92);
  font-size: 16px;
  font-weight: 620;
}

.bottom-actions .eyebrow {
  color: rgba(253, 186, 45, 0.86);
}

@media (max-width: 760px) {
  .bottom-actions {
    align-items: stretch;
    flex-direction: column;
  }
}


.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.catalog-wrap table {
  min-width: 1080px;
}

.catalog-wrap td:nth-child(3),
.catalog-wrap td:nth-child(4),
.catalog-wrap td:nth-child(5),
.catalog-wrap td:nth-child(6) {
  width: 118px;
}

.catalog-price,
.catalog-text {
  min-height: 32px;
  border-radius: 10px;
  font-size: 12.5px;
}

.catalog-text {
  margin-top: 8px;
}

.catalog-edited {
  background: rgba(253, 186, 45, 0.12);
}

.catalog-check {
  min-height: 24px;
  margin-bottom: 6px;
}

.catalog-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--steel);
  background: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 560;
}

.catalog-state.changed {
  border-color: rgba(253, 186, 45, 0.72);
  color: var(--asphalt);
  background: rgba(253, 186, 45, 0.32);
}

@media (max-width: 980px) {
  .catalog-toolbar {
    grid-template-columns: 1fr;
  }
}
