/* Shelfy Wireframe System — Lo-fi, structure-focused */

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

:root {
  /* Wireframe grays */
  --wf-bg: #F5F5F5;
  --wf-surface: #FFFFFF;
  --wf-border: #D4D4D4;
  --wf-muted: #A3A3A3;
  --wf-text: #404040;
  --wf-heading: #1A1A1A;
  --wf-placeholder: #E5E5E5;

  /* Single accent to hint at final design */
  --wf-accent: #FF6B35;
  --wf-accent-light: #FFF0EB;

  /* Status colors (muted for wireframe) */
  --wf-success: #6BBF8A;
  --wf-warning: #E5A94E;
  --wf-error: #D46A6A;
  --wf-info: #6A9FD4;
  --wf-purple: #9B8EC4;

  /* Typography */
  --wf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --wf-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  /* Radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
}

body {
  font-family: var(--wf-font);
  color: var(--wf-text);
  background: var(--wf-bg);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Screen wrapper */
.screen {
  width: 1440px;
  min-height: 900px;
  margin: 0 auto;
  background: var(--wf-bg);
  position: relative;
  overflow: hidden;
}

/* Screen label (development only) */
.screen-label {
  position: fixed;
  top: 8px;
  right: 8px;
  background: var(--wf-heading);
  color: white;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  z-index: 9999;
  font-family: var(--wf-mono);
}

/* ---- LAYOUT PRIMITIVES ---- */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.gap-xl { gap: var(--sp-xl); }

/* ---- COMPONENTS ---- */

/* Top bar */
.topbar {
  height: 48px;
  background: var(--wf-surface);
  border-bottom: 1px solid var(--wf-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-lg);
  gap: var(--sp-md);
}
.topbar-back { color: var(--wf-muted); font-size: 16px; cursor: pointer; }
.topbar-title { font-weight: 600; color: var(--wf-heading); font-size: 14px; }
.topbar-subtitle { color: var(--wf-muted); font-size: 12px; }
.topbar-spacer { flex: 1; }
.topbar-status {
  font-size: 11px;
  color: var(--wf-success);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Buttons */
.btn {
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--wf-border);
  background: var(--wf-surface);
  color: var(--wf-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--wf-accent);
  color: white;
  border-color: var(--wf-accent);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 10px 24px; font-size: 14px; }

/* Pills / Badges */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  background: var(--wf-placeholder);
  color: var(--wf-text);
}
.pill-accent { background: var(--wf-accent-light); color: var(--wf-accent); }
.pill-success { background: #E8F5EE; color: #2D7A4F; }
.pill-warning { background: #FFF3E0; color: #B8760A; }
.pill-error { background: #FDEAEA; color: #B83A3A; }
.pill-info { background: #E8F0FD; color: #3A6FB8; }
.pill-purple { background: #F0ECF9; color: #6B5CA5; }

/* Card */
.card {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
}
.card-flat {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-lg);
}

/* Panel (sidebar) */
.panel {
  background: var(--wf-surface);
  border-right: 1px solid var(--wf-border);
  overflow-y: auto;
}
.panel-dark {
  background: #2A2A3A;
  color: #E0E0E0;
}
.panel-section {
  padding: var(--sp-lg);
  border-bottom: 1px solid var(--wf-border);
}
.panel-section:last-child { border-bottom: none; }
.panel-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--wf-muted);
  margin-bottom: var(--sp-sm);
}

/* Input */
.input {
  padding: 6px 10px;
  border: 1px solid var(--wf-border);
  border-radius: var(--r-md);
  font-size: 12px;
  font-family: var(--wf-font);
  background: var(--wf-surface);
  width: 100%;
}
.input-mono {
  font-family: var(--wf-mono);
  font-size: 12px;
}

/* Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.slider-label {
  font-size: 12px;
  color: var(--wf-text);
  min-width: 50px;
}
.slider-track {
  flex: 1;
  height: 4px;
  background: var(--wf-placeholder);
  border-radius: 2px;
  position: relative;
}
.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--wf-accent);
  border-radius: 2px;
}
.slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--wf-accent);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.slider-value {
  font-family: var(--wf-mono);
  font-size: 12px;
  color: var(--wf-heading);
  min-width: 55px;
  text-align: right;
}

/* Segmented control */
.segmented {
  display: flex;
  border: 1px solid var(--wf-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.segmented-item {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--wf-surface);
  border-right: 1px solid var(--wf-border);
  cursor: pointer;
  text-align: center;
}
.segmented-item:last-child { border-right: none; }
.segmented-item.active {
  background: var(--wf-heading);
  color: white;
}

/* Radio */
.radio-group { display: flex; flex-direction: column; gap: var(--sp-sm); }
.radio-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 12px;
  cursor: pointer;
}
.radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--wf-border);
}
.radio-dot.active {
  border-color: var(--wf-accent);
  background: radial-gradient(circle, var(--wf-accent) 40%, transparent 41%);
}

/* Placeholder boxes */
.placeholder {
  background: var(--wf-placeholder);
  border: 1px dashed var(--wf-border);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wf-muted);
  font-size: 12px;
}

/* Cost rail */
.cost-rail {
  height: 64px;
  background: var(--wf-surface);
  border-top: 1px solid var(--wf-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-xl);
  gap: var(--sp-xl);
}
.cost-primary {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--wf-mono);
  color: var(--wf-heading);
}
.cost-meta {
  font-size: 11px;
  color: var(--wf-muted);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: var(--sp-md) var(--sp-lg);
  font-size: 11px;
  font-weight: 600;
  color: var(--wf-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--wf-border);
}
.table td {
  padding: var(--sp-md) var(--sp-lg);
  font-size: 13px;
  border-bottom: 1px solid var(--wf-border);
}
.table tr:hover { background: #FAFAFA; }

/* Sidebar nav */
.sidebar {
  width: 240px;
  background: var(--wf-surface);
  border-right: 1px solid var(--wf-border);
  display: flex;
  flex-direction: column;
}
.sidebar-nav { padding: var(--sp-lg); flex: 1; }
.sidebar-item {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-md);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--wf-text);
}
.sidebar-item.active {
  background: var(--wf-accent-light);
  color: var(--wf-accent);
  font-weight: 500;
}
.sidebar-item:hover:not(.active) { background: var(--wf-bg); }
.sidebar-footer {
  padding: var(--sp-lg);
  border-top: 1px solid var(--wf-border);
  font-size: 12px;
  color: var(--wf-muted);
}

/* Shelf card (builder) */
.shelf-card {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  margin-bottom: var(--sp-sm);
}
.shelf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-sm);
}
.shelf-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--wf-heading);
}
.shelf-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

/* Validation check row */
.check-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
  font-size: 12px;
}
.check-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.check-pass { background: #E8F5EE; color: #2D7A4F; }
.check-warn { background: #FFF3E0; color: #B8760A; }
.check-fail { background: #FDEAEA; color: #B83A3A; }

/* Modal overlay */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--wf-surface);
  border-radius: var(--r-xl);
  width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}
.modal-header {
  padding: var(--sp-xl);
  border-bottom: 1px solid var(--wf-border);
}
.modal-body {
  padding: var(--sp-xl);
}
.modal-footer {
  padding: var(--sp-lg) var(--sp-xl);
  border-top: 1px solid var(--wf-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
}

/* Step indicator */
.steps {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xl);
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--wf-placeholder);
  color: var(--wf-muted);
}
.step-dot.active { background: var(--wf-accent); color: white; }
.step-dot.done { background: var(--wf-success); color: white; }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--wf-placeholder);
}
.step-line.done { background: var(--wf-success); }

/* Navbar (marketing) */
.navbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3xl);
  background: transparent;
}
.navbar-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--wf-heading);
  letter-spacing: -0.5px;
}
.navbar-links {
  display: flex;
  gap: var(--sp-xl);
  margin-left: var(--sp-3xl);
}
.navbar-links a {
  font-size: 13px;
  color: var(--wf-text);
  text-decoration: none;
}
.navbar-spacer { flex: 1; }

/* Expandable row (admin) */
.expand-row {
  background: var(--wf-bg);
  border-bottom: 1px solid var(--wf-border);
  padding: var(--sp-xl);
}

/* KPI cards */
.kpi-row {
  display: flex;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}
.kpi-card {
  flex: 1;
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  cursor: pointer;
}
.kpi-card:hover { border-color: var(--wf-accent); }
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--wf-heading);
  font-family: var(--wf-mono);
}
.kpi-label {
  font-size: 11px;
  color: var(--wf-muted);
  margin-top: var(--sp-xs);
}

/* File chip */
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--wf-bg);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-md);
  font-size: 11px;
  font-family: var(--wf-mono);
  cursor: pointer;
}
.file-chip:hover { border-color: var(--wf-accent); }

/* Locked section */
.locked {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}
.locked::after {
  content: 'Pending structural approval';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--wf-heading);
  color: white;
  padding: 4px 12px;
  border-radius: var(--r-md);
  font-size: 11px;
  white-space: nowrap;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--wf-border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
  color: var(--wf-muted);
  cursor: pointer;
}
.dropzone:hover { border-color: var(--wf-accent); background: var(--wf-accent-light); }

/* Utility */
.text-mono { font-family: var(--wf-mono); }
.text-xs { font-size: 10px; }
.text-sm { font-size: 11px; }
.text-md { font-size: 13px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }
.text-muted { color: var(--wf-muted); }
.text-heading { color: var(--wf-heading); }
.text-accent { color: var(--wf-accent); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.p-sm { padding: var(--sp-sm); }
.p-md { padding: var(--sp-md); }
.p-lg { padding: var(--sp-lg); }
.p-xl { padding: var(--sp-xl); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }

/* ---- NEW UTILITY CLASSES ---- */

/* Tooltip hint — small inline info icon */
.tooltip-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--wf-muted);
  font-size: 10px;
  font-weight: 600;
  color: var(--wf-muted);
  cursor: default;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}
.tooltip-hint::after { content: '?'; }

/* Input editable — slider value that looks clickable/typeable */
.input-editable {
  display: inline-block;
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  font-family: var(--wf-mono);
  font-size: 12px;
  color: var(--wf-heading);
  cursor: text;
  min-width: 48px;
  text-align: right;
}
.input-editable:hover {
  border-color: var(--wf-accent);
}

/* Onboarding hint — dismissable banner at top of canvas */
.onboarding-hint {
  position: relative;
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: var(--r-md);
  padding: var(--sp-sm) var(--sp-2xl) var(--sp-sm) var(--sp-lg);
  text-align: center;
  font-size: 12px;
  color: var(--wf-text);
  line-height: 1.4;
}
.onboarding-hint-close {
  position: absolute;
  top: 50%;
  right: var(--sp-sm);
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--wf-muted);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.onboarding-hint-close:hover { color: var(--wf-heading); }

/* Card annotation — amber left-border feedback card (W7) */
.card-annotation {
  background: #FFFBF0;
  border: 1px solid #E5D5A0;
  border-left: 3px solid #E5A94E;
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: 12px;
  line-height: 1.5;
  color: var(--wf-text);
}

/* Card annotation clickable — hover state for interactive feedback blocks */
.card-annotation-clickable {
  background: #FFFBF0;
  border: 1px solid #E5D5A0;
  border-left: 3px solid #E5A94E;
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: 12px;
  line-height: 1.5;
  color: var(--wf-text);
  cursor: pointer;
  transition: border-left-color 0.15s, background 0.15s;
}
.card-annotation-clickable:hover {
  border-left-color: #B8760A;
  background: #FFF5D6;
}

/* Confirmation dialog — mock dialog card */
.confirmation-dialog {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 400px;
  width: 100%;
}
.confirmation-dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--wf-heading);
  margin-bottom: var(--sp-sm);
}
.confirmation-dialog-body {
  font-size: 13px;
  color: var(--wf-text);
  line-height: 1.5;
  margin-bottom: var(--sp-xl);
}
.confirmation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
}

/* Quality badge — small green inline badge */
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #2D7A4F;
  color: white;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
}

/* Lead time — muted inline indicator with clock placeholder */
.lead-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--wf-muted);
}
.lead-time::before {
  content: '○';
  font-size: 10px;
  color: var(--wf-muted);
}

/* Empty state — centered dashed container */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--wf-border);
  border-radius: var(--r-xl);
  padding: var(--sp-3xl) var(--sp-2xl);
  color: var(--wf-muted);
  gap: var(--sp-md);
}
.empty-state-illustration {
  width: 64px;
  height: 64px;
  background: var(--wf-placeholder);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--wf-muted);
}
.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wf-heading);
}
.empty-state-desc {
  font-size: 12px;
  color: var(--wf-muted);
  max-width: 280px;
  line-height: 1.5;
}

/* Journey node — card style for journey map flow nodes */
.journey-node {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-lg);
  min-width: 160px;
  text-align: center;
}
.journey-node-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--wf-heading);
  margin-bottom: var(--sp-xs);
}
.journey-node-meta {
  font-size: 10px;
  color: var(--wf-muted);
}
.journey-node.active {
  border-color: var(--wf-accent);
  background: var(--wf-accent-light);
}
.journey-node.active .journey-node-label {
  color: var(--wf-accent);
}
