*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #111110;
  --surface: #1a1a18;
  --surface2: #222220;
  --border: #2e2e2b;
  --text: #ece8e1;
  --muted: #6e6b64;
  --faint: #3a3835;
  --orange: #e8622a;
  --orange-dim: rgba(232,98,42,0.12);
  --orange-glow: rgba(232,98,42,0.25);
  --green: #5a8a62;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(17,17,16,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.nav-back {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--text); }
.nav-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── MAIN ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* ── PAGE HEADER ── */
.page-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}
.kicker {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  border: 1px solid rgba(232,98,42,0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  margin-bottom: 0.85rem;
}
h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.6rem;
}
.subtitle {
  font-size: 0.925rem;
  color: var(--muted);
  line-height: 1.6;
}

/* summary card */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}
.summary-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.summary-val.orange { color: var(--orange); }
.summary-divider {
  height: 1px;
  background: var(--border);
  margin: 0.2rem 0;
}

/* ── TABLE WRAP ── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.toolbar-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1.1rem;
  border-radius: 5px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-orange {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 2px 12px var(--orange-glow);
}
.btn-orange:hover { box-shadow: 0 4px 20px rgba(232,98,42,0.45); }

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 2px 12px var(--orange-glow); }
  50%       { box-shadow: 0 0 0 6px rgba(232,98,42,0.35), 0 2px 18px rgba(232,98,42,0.55); }
}
.btn-pulse { animation: btn-pulse 1s ease-in-out infinite; }

/* ── TABLE ── */
#bomTable {
  width: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
}

#bomTable thead tr {
  border-bottom: 1px solid var(--border);
}

#bomTable th {
  text-align: left;
  padding: 0.7rem 1.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  overflow: visible;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 1;
  border-right: 2px solid var(--faint);
}

.col-resize-handle:hover,
.col-resize-handle.dragging {
  border-right-color: var(--orange);
}

.col-resize-handle--static {
  cursor: default;
}

.col-resize-handle--static:hover {
  border-right-color: var(--faint);
}

#bomTable td {
  padding: 0.85rem 1.25rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

#bomTable tbody tr:last-child td {
  border-bottom: none;
}

#bomTable tbody tr {
  transition: background 0.15s;
}

#bomTable tbody tr:hover {
  background: var(--surface2);
}

/* total price col - slightly highlighted */
#bomTable td:last-child {
  color: var(--text);
  font-weight: 500;
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .page-header { grid-template-columns: 1fr; }
  .summary-card { min-width: unset; }
  #bomTable th, #bomTable td { padding: 0.7rem 0.75rem; }
}