/* ════════════════════════════════════════════════════════════
   quote.css — CNCQuoter quote page · P0/P1 upgrade
   ════════════════════════════════════════════════════════════ */

:root {
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'SF Mono', ui-monospace,
               'Cascadia Code', Menlo, Consolas, monospace;
  --q-step-bg: var(--accent, #eab308);
  --q-step-fg: #fff;
}

/* ── P1-8 · Step number (extracted from inline style) ─────── */
.q-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--q-step-bg);
  color: var(--q-step-fg);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-right: 4px;
  flex-shrink: 0;
}
.q-step-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text2, #888);
  margin-left: 6px;
}

/* ── P1-9 · Mono numerics ─────────────────────────────────── */
.q-mono,
.q-quote-card .unit-price,
.q-quote-card .total .amount,
.q-delivery-row .delta,
.q-eta #etaDate {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ── P1-15 · DFM SVG icon (replaces ✓ emoji) ──────────────── */
.q-dfm-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.q-dfm-status.pass {
  background: rgba(22,163,74,0.08);
  color: #166534;
}
.q-dfm-status.warn {
  background: rgba(217,119,6,0.08);
  color: #92400e;
}
.q-dfm-status.fail {
  background: rgba(220,38,38,0.08);
  color: #991b1b;
}
.q-dfm-status.idle {
  background: rgba(107,114,128,0.08);
  color: #374151;
}
.q-dfm-status .q-dfm-icon {
  flex-shrink: 0;
  color: #16a34a;
}
.q-dfm-status.warn .q-dfm-icon { color: #d97706; }
.q-dfm-status.fail .q-dfm-icon { color: #dc2626; }
.q-dfm-status.idle .q-dfm-icon { color: #6b7280; }
.q-dfm-status .text { flex: 1; }
.q-dfm-status .detail-link {
  color: #16a34a;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.q-dfm-status.warn .detail-link { color: #d97706; }
.q-dfm-status.fail .detail-link { color: #dc2626; }
.q-dfm-status.idle .detail-link { color: #6b7280; }

/* ── Dropzone icon (SVG replaces 📁) ──────────────────────── */
.q-dropzone .icon {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent, #eab308);
}
.q-dropzone .icon svg { display: block; }

/* ── 3D preview placeholder icon (SVG replaces 🧊) ────────── */
.q-preview-canvas .ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: #aaa;
}
.q-preview-canvas .ph .icon {
  color: #ccc;
  opacity: 0.7;
}
.q-preview-canvas .ph .text {
  font-size: 13px;
  color: #888;
}

/* ── P1-11 · 3D preview controls (moved to quote-layout.css §7) ── */

/* ── ETA icon ─────────────────────────────────────────────── */
.q-eta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  background: #fafafa;
  border-radius: 8px;
  font-size: 13px;
  color: #555;
}
.q-eta-icon { flex-shrink: 0; color: var(--accent, #eab308); }

/* ── Secondary CTA (favorite) with SVG icon ───────────────── */
.q-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── P2-18 · Loading skeleton (for 3D preview) ────────────── */
.q-skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #f3f3f3 0%, #ececec 50%, #f3f3f3 100%);
  background-size: 200% 100%;
  animation: q-skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes q-skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Dark mode support (P2-17 prep) ───────────────────────── */
[data-theme="dark"] .q-step-num {
  background: var(--accent, #eab308);
  color: #0a0a0a;
}
[data-theme="dark"] .q-dfm-status.pass {
  background: rgba(22,163,74,0.18);
  color: #86efac;
}
[data-theme="dark"] .q-dfm-status.warn {
  background: rgba(217,119,6,0.18);
  color: #fcd34d;
}
[data-theme="dark"] .q-dfm-status.fail {
  background: rgba(220,38,38,0.18);
  color: #fca5a5;
}
[data-theme="dark"] .q-dfm-status.idle {
  background: rgba(148,163,184,0.12);
  color: #cbd5e1;
}
[data-theme="dark"] .q-dfm-status .detail-link { color: #86efac; }
[data-theme="dark"] .q-dfm-status.warn .detail-link,
[data-theme="dark"] .q-dfm-status.warn .q-dfm-icon { color: #fcd34d; }
[data-theme="dark"] .q-dfm-status.fail .detail-link,
[data-theme="dark"] .q-dfm-status.fail .q-dfm-icon { color: #fca5a5; }
[data-theme="dark"] .q-dfm-status.idle .detail-link,
[data-theme="dark"] .q-dfm-status.idle .q-dfm-icon { color: #cbd5e1; }
[data-theme="dark"] .q-eta {
  background: rgba(255,255,255,0.04);
  color: #ccc;
}
[data-theme="dark"] .q-viewport-ctrl {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .q-viewport-ctrl button { color: rgba(255,255,255,.5); }
[data-theme="dark"] .q-dim-tag { background: rgba(0,0,0,.6); color: rgba(255,255,255,.5); }
[data-theme="dark"] .q-dim-vol { background: rgba(234,179,8,.15); color: #fbbf24; }
[data-theme="dark"] .q-preview-canvas {
  background: linear-gradient(180deg, #0c0c0e 0%, #111113 50%, #08090b 100%);
}
[data-theme="dark"] .q-preview-metrics {
  background: rgba(255,255,255,.02);
  border-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .q-metric { border-right-color: rgba(255,255,255,.06); border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] .q-metric-icon { background: rgba(234,179,8,.12); color: #fbbf24; }
[data-theme="dark"] .q-metric-label { color: rgba(255,255,255,.35); }
[data-theme="dark"] .q-metric-value { color: #e5e5e5; }

/* ── P2-24 · Cross-process config-shared toast ───────────── */
.q-share-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #0f172a;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  animation: q-share-rise .35s ease;
}
.q-share-toast svg { color: #4ade80; flex-shrink: 0; }
.q-share-toast .q-share-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  margin-left: 4px;
}
.q-share-toast .q-share-close:hover { color: #fff; }
.q-share-toast.q-share-fade {
  opacity: 0;
  transition: opacity .8s ease;
}
@keyframes q-share-rise {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── FIX-8 · Inline-style extraction ─────────────────────── */
.q-main-pad { padding-top: 8px; }
.q-section-h2 { font-size: 18px; }
.q-bar-full { grid-column: 1 / -1; }
.q-parsed { color: #16a34a; font-weight: 600; }
.q-parsed::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: middle;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='8 12 11 15 16 9'/></svg>");
}

/* ── P1 · 3D Preview Loading Skeleton (US-011) ────────────── */
.q-skeleton-3d {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 12px;
}
.q-skeleton-cube {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 200%;
  animation: q-shimmer 1.8s ease-in-out infinite;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.q-skeleton-cube::before {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  animation: q-shimmer-inner 2.2s ease-in-out infinite;
}
.q-skeleton-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 200px;
}
.q-skeleton-bar {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: q-shimmer 1.5s ease-in-out infinite;
}
.q-skeleton-bar-1 { width: 70%; animation-delay: 0s; }
.q-skeleton-bar-2 { width: 90%; animation-delay: 0.15s; }
.q-skeleton-bar-3 { width: 50%; animation-delay: 0.3s; }

@keyframes q-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes q-shimmer-inner {
  0%, 100% { opacity: 0.04; }
  50%      { opacity: 0.10; }
}

[data-theme="dark"] .q-skeleton-cube,
[data-theme="dark"] .q-skeleton-bar {
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #1f2937 100%);
  background-size: 200% 200%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .q-skeleton-cube::before {
  background: rgba(255, 255, 255, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .q-skeleton-cube,
  .q-skeleton-cube::before,
  .q-skeleton-bar { animation: none; }
}

/* ════════════════ N-11: local quote history panel ════════════════ */
.q-history-wrap {
  margin: 32px auto 48px;
  max-width: 1180px;
}
.q-history-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text, #0f172a);
}
.q-history-sub {
  font-size: 13px;
  color: var(--text3, #64748b);
  margin: 0 0 16px;
}
.q-history-panel {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px 20px;
}
.q-history-panel .qh-empty {
  color: var(--text3, #64748b);
  font-size: 14px;
  padding: 12px 0;
}
.q-history-panel .qh-offline-banner {
  background: #fef3c7;
  color: #92400e;
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 4px;
  margin-bottom: 12px;
}
[data-theme="dark"] .q-history-panel .qh-offline-banner {
  background: #422006;
  color: #fde68a;
}
.q-history-panel details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 0;
  color: var(--text, #0f172a);
  list-style: none;
}
.q-history-panel details > summary::-webkit-details-marker { display: none; }
.q-history-panel details > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s;
}
.q-history-panel details[open] > summary::before {
  transform: rotate(90deg);
}
.q-history-panel .qh-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.q-history-panel .qh-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px 110px 80px;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border, #e5e7eb);
  font-size: 13px;
  align-items: center;
}
.q-history-panel .qh-row:last-child { border-bottom: none; }
.q-history-panel .qh-ts { color: var(--text3, #64748b); font-family: ui-monospace, monospace; }
.q-history-panel .qh-proc { color: var(--text, #0f172a); }
.q-history-panel .qh-qty { color: var(--text3, #64748b); }
.q-history-panel .qh-amt { color: var(--accent, #eab308); font-weight: 700; text-align: right; }
.q-history-panel .qh-lead { color: var(--text3, #64748b); font-size: 12px; text-align: right; }
.q-history-panel .qh-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.q-history-panel .qh-clear {
  background: transparent;
  border: 1px solid var(--border, #e5e7eb);
  color: var(--text3, #64748b);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.q-history-panel .qh-clear:hover {
  color: #dc2626;
  border-color: #dc2626;
}
.q-history-panel .qh-meta {
  font-size: 11px;
  color: var(--text3, #64748b);
}
@media (max-width: 700px) {
  .q-history-panel .qh-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
  }
  .q-history-panel .qh-ts { grid-column: 1 / -1; font-size: 11px; }
}

/* ── Process hero image (config card top, swaps on tab change) ── */
.proc-hero {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
  background: var(--bg-card, #f3f4f6);
}
[data-theme="dark"] .proc-hero {
  background: rgba(255, 255, 255, 0.04);
}
