/* ── Reset & base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:       #CC1A00;              /* Bulldog Red — master brand accent */
  --red-dk:    #A01500;              /* darker red for pressed/active */
  --red-dim:   rgba(204,26,0,0.15);
  --bg:        #111111;
  --bg2:       #1a1a1a;
  --bg3:       #242424;
  --border:    #2e2e2e;
  --text:      #f0f0f0;
  --muted:     #777777;
  --topbar-h:  56px;
  --sidebar-w: 72px;
  --safe-t:    env(safe-area-inset-top, 0px);
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Top bar ──────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding-top: var(--safe-t);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  z-index: 200;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.topbar-title sup {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  vertical-align: super;
}

.topbar-new-btn {
  width: 36px;
  height: 36px;
  background: var(--red);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

/* ── App body layout ──────────────────────────────────── */
.app-body {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-t));
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 2px;
  padding-bottom: var(--safe-b);
}

.sidebar-btn {
  width: 60px;
  padding: 10px 4px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, background 0.15s;
}

.sidebar-btn svg {
  width: 24px;
  height: 24px;
}

.sidebar-btn span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1;
}

.sidebar-btn.active {
  color: var(--red);
  background: var(--red-dim);
}

.sidebar-btn:active {
  background: var(--red-dim);
}

/* ── Main content ─────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(16px + var(--safe-b));
}

/* ── Capture area ─────────────────────────────────────── */
.capture-area {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.capture-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.capture-placeholder svg { opacity: 0.5; }

.capture-placeholder span {
  font-size: 14px;
  font-weight: 600;
}

.capture-sub {
  font-size: 11px !important;
  font-weight: 400 !important;
  color: var(--muted);
  opacity: 0.7;
}

.capture-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-retake {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Photo overlay — honest "reference photo" state (no implied measurement) */
.dim-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}

.photo-badge {
  background: rgba(0, 0, 0, 0.72);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

/* ── Opening label bar ────────────────────────────────── */
.opening-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.opening-label-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
}

.opening-label-arrow {
  color: var(--muted);
  font-size: 18px;
}

/* ── Fields card ──────────────────────────────────────── */
.fields-card {
  padding: 14px 16px 0;
  flex-shrink: 0;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-item.full-width {
  grid-column: 1 / -1;
}

.field-item label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.field-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  padding: 10px 12px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field-input:focus {
  border-color: var(--red);
}

.field-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  cursor: pointer;
}

.field-input-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.field-unit {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Materials card ───────────────────────────────────── */
.materials-card {
  padding: 14px 16px 0;
  flex-shrink: 0;
}

.materials-header {
  margin-bottom: 10px;
}

.card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.materials-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.material-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.material-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ── Button group (gauge toggle) ──────────────────────── */
.btn-group {
  display: flex;
  gap: 4px;
}

.btn-toggle {
  flex: 1;
  padding: 8px 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.btn-toggle.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Generate bend sheet CTA ──────────────────────────── */
.btn-generate {
  margin: 16px 16px 0;
  padding: 16px;
  background: var(--red);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-generate:active { background: var(--red-dk); }

.generate-arrow {
  font-size: 18px;
  font-weight: 400;
}

/* ── Bend sheet overlay ───────────────────────────────── */
.bend-sheet-overlay, .brakes-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

.bend-sheet-overlay.hidden,
.brakes-overlay.hidden { display: none; }

.bend-sheet-header, .overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding-top: var(--safe-t);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bend-sheet-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--red);
  text-transform: uppercase;
}

.btn-back-sheet {
  background: none;
  border: none;
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-print {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}

.bend-sheet-body, .overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(16px + var(--safe-b));
}

/* ── Bend sheet content styles ────────────────────────── */
.bs-job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--red);
}

.bs-job-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.bs-job-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.bs-brand {
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.06em;
  text-align: right;
}

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

.bs-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.bs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.bs-row:last-child { border-bottom: none; }

.bs-row-label { color: var(--muted); }
.bs-row-value { font-weight: 700; color: var(--text); }
.bs-row-value.accent { color: var(--red); font-size: 17px; }

.bs-bend-step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
}

.bs-step-num {
  width: 28px;
  height: 28px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.bs-step-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.bs-step-dim {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.bs-pieces-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bs-piece-chip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.bs-piece-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.bs-piece-count {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.bs-piece-len {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.bs-total-bar {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.bs-total-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.bs-total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
}

.bs-coil-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  padding: 0 2px;
  line-height: 1.4;
}
.bs-coil-note b { color: var(--text); }

.bs-gotcha {
  background: var(--bg2);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* More / brakes guide */
.brand-section { margin-bottom: 20px; }

.brand-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 4px;
  margin-bottom: 8px;
}

.brake-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.brake-card:active { border-color: var(--red); }
.brake-card-name { font-size: 15px; font-weight: 700; }
.brake-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.brake-card-arrow { color: var(--muted); font-size: 18px; }

.btn-back { background: none; border: none; color: var(--red); font-size: 15px; font-weight: 700; cursor: pointer; padding: 4px 0 16px; -webkit-tap-highlight-color: transparent; }

.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.spec-chip { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.spec-chip-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.spec-chip-value { font-size: 14px; font-weight: 700; color: var(--text); }

.guide-section { margin-bottom: 16px; }
.guide-section-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin-bottom: 8px; }
.guide-list { list-style: none; padding: 0; }
.guide-list li { font-size: 14px; color: var(--text); padding: 7px 0 7px 16px; border-bottom: 1px solid var(--border); line-height: 1.5; position: relative; }
.guide-list li::before { content: '›'; position: absolute; left: 0; color: var(--red); font-weight: 700; }
.guide-list li:last-child { border-bottom: none; }

.brake-detail-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.brake-detail-brand { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 20px; }

/* ── More menu grid ───────────────────────────────────── */
.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}

.more-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s;
}

.more-card:active { border-color: var(--red); }

.more-card-icon { font-size: 22px; margin-bottom: 8px; }
.more-card-name { font-size: 13px; font-weight: 700; color: var(--text); }
.more-card-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Not-yet-implemented tools: visibly de-emphasized + SOON badge */
.more-card-soon { opacity: 0.5; }
.more-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 500;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Utility ──────────────────────────────────────────── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════
   SCREENS (job-centric shell: auth → dashboard → job → editor)
   ══════════════════════════════════════════════════════════ */
.screen {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-t));
  bottom: 0; left: 0; right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dashboard-screen, .job-screen {
  padding: 16px 16px calc(32px + var(--safe-b));
}
.editor-screen {
  display: flex;
  flex-direction: column;
  padding-bottom: calc(28px + var(--safe-b));
}

/* Topbar back + icon buttons */
.topbar-back, .topbar-icon-btn {
  width: 36px; height: 36px;
  background: none; border: none;
  color: var(--text);
  font-size: 20px; line-height: 1;
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.topbar-back { text-align: left; }

/* ── Auth screen ───────────────────────────────────────── */
.auth-screen {
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 360px; text-align: center; }
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: var(--red); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff; letter-spacing: 0.02em;
}
.auth-title { font-size: 26px; font-weight: 800; color: #fff; }
.auth-title sup { font-size: 12px; color: var(--red); }
.auth-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; margin: 4px 0 24px; }
.auth-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.auth-input {
  width: 100%; padding: 14px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 15px;
}
.auth-input:focus { outline: none; border-color: var(--red); }
.btn-primary {
  width: 100%; padding: 15px;
  background: var(--red); border: none; border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 0.03em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { background: var(--red-dk); }
.btn-primary:disabled { opacity: 0.6; }
.auth-submit { margin-bottom: 12px; }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; }
.auth-toggle {
  background: none; border: none; color: var(--muted); font-size: 13px;
  cursor: pointer; margin-top: 8px;
}
.auth-toggle span { color: var(--red); font-weight: 700; }
.btn-text {
  width: 100%; margin-top: 10px; padding: 12px;
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer;
}

/* ── Dashboard ─────────────────────────────────────────── */
.dash-greeting { color: var(--muted); font-size: 15px; margin-bottom: 4px; }
.dash-stat { display: flex; align-items: baseline; gap: 10px; margin-bottom: 24px; }
.dash-stat-num { font-size: 44px; font-weight: 800; color: #fff; line-height: 1; }
.dash-stat-label { color: var(--muted); font-size: 14px; }

.section-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
}
.section-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 10px;
}
.link-btn {
  background: none; border: none; color: var(--red);
  font-size: 13px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.workspace-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px;
}
.ws-tile {
  position: relative; text-align: left;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px; cursor: pointer; min-height: 92px;
  -webkit-tap-highlight-color: transparent;
}
.ws-tile-primary { background: var(--red); border-color: var(--red); }
.ws-tile-name { font-size: 16px; font-weight: 800; color: var(--text); }
.ws-tile-primary .ws-tile-name { color: #fff; }
.ws-tile-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ws-tile-primary .ws-tile-sub { color: rgba(255,255,255,0.85); }
.ws-tile-soon { opacity: 0.6; }
.ws-soon {
  position: absolute; top: 12px; right: 12px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}

/* Jobs list */
.jobs-list, .openings-list { display: flex; flex-direction: column; gap: 8px; }
.job-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.job-card:active { border-color: var(--red); }
.job-card-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--bg3); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--red);
}
.job-card-body { flex: 1; min-width: 0; }
.job-card-name { font-size: 15px; font-weight: 700; color: var(--text); }
.job-card-sub {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.status-pill {
  flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 999px;
}
.status-measuring { background: rgba(58,120,255,0.18); color: #6ea0ff; }
.status-cutting   { background: rgba(204,110,0,0.20);  color: #ff9d3d; }
.status-bending   { background: var(--red-dim);        color: #ff6a4d; }
.status-installed { background: rgba(40,170,90,0.18);  color: #4cd07d; }

.muted-row, .empty-row { color: var(--muted); font-size: 13px; padding: 14px 2px; }
.empty-row b { color: var(--red); }

/* ── Job screen ────────────────────────────────────────── */
.job-head { margin-bottom: 4px; }
.job-head-name { font-size: 24px; font-weight: 800; color: #fff; }
.job-head-addr { color: var(--muted); font-size: 13px; margin-top: 2px; }

.opening-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.opening-card:active { border-color: var(--red); }
.opening-card-body { flex: 1; }
.opening-card-name { font-size: 15px; font-weight: 700; color: var(--text); }
.opening-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.opening-card-sub.ok { color: #4cd07d; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
}
.status-dot.ok { background: #4cd07d; }

/* ── CONFIRM gate ──────────────────────────────────────── */
.confirm-card {
  margin: 16px 16px 0;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px;
}
.confirm-card.is-confirmed { border-color: rgba(40,170,90,0.5); }
.confirm-state { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.confirm-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; background: var(--red);
}
.is-confirmed .confirm-icon { background: #28aa5a; }
.confirm-title { font-size: 14px; font-weight: 700; color: var(--text); }
.confirm-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.btn-confirm {
  width: 100%; padding: 13px;
  background: var(--bg3); border: 1px solid var(--red); border-radius: 10px;
  color: var(--red); font-size: 14px; font-weight: 800;
  letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-confirm:active { background: var(--red-dim); }
.is-confirmed .btn-confirm { border-color: var(--border); color: var(--muted); }

/* Generate locked state */
.btn-generate:disabled, .btn-generate.locked {
  background: var(--bg3); color: var(--muted); cursor: not-allowed;
}

/* ── Picker / dialog overlays ──────────────────────────── */
.picker-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.picker-sheet {
  width: 100%; max-width: 480px;
  background: var(--bg2); border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + var(--safe-b));
}
.picker-title { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 14px; }
.picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker-item {
  padding: 18px 12px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.picker-item:active { border-color: var(--red); color: var(--red); }
.picker-sheet .auth-input { margin-bottom: 10px; }

/* ── Print styles ─────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .capture-area, .materials-card,
  .btn-generate, .bend-sheet-header, .btn-back-sheet, .btn-print { display: none !important; }
  .bend-sheet-overlay { position: static; background: #fff; color: #000; }
  .bend-sheet-body { padding: 0; }
  .bs-section-title, .bs-brand { color: #D02B2D; }
  .bs-step-num { background: #D02B2D; }
}
