/* ============================================================
   Manufacturing Cost Oracle — Design System
   Dark Industrial Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── CSS Custom Properties ─── */
:root {
  /* Core palette */
  --bg-primary: #0B1120;
  --bg-secondary: #111827;
  --bg-card: #1A2332;
  --bg-card-hover: #1E2A3B;
  --bg-input: #0F1729;
  --bg-glass: rgba(26, 35, 50, 0.7);

  /* Accent colors */
  --accent-blue: #0EA5E9;
  --accent-blue-dim: rgba(14, 165, 233, 0.15);
  --accent-blue-glow: rgba(14, 165, 233, 0.3);
  --accent-orange: #F97316;
  --accent-orange-dim: rgba(249, 115, 22, 0.15);
  --accent-green: #22C55E;
  --accent-green-dim: rgba(34, 197, 94, 0.15);
  --accent-red: #EF4444;
  --accent-red-dim: rgba(239, 68, 68, 0.15);
  --accent-purple: #A855F7;
  --accent-yellow: #EAB308;

  /* Text */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-accent: #0EA5E9;

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-medium: rgba(148, 163, 184, 0.2);
  --border-active: rgba(14, 165, 233, 0.4);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.15);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ─── Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.sidebar-logo .version {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 10px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent-blue);
  border-radius: 0 3px 3px 0;
}

.nav-item .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ─── Main Content ─── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
.header {
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-green);
}

.header-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Page Container ─── */
.page {
  flex: 1;
  padding: 28px;
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.blue { color: var(--accent-blue); }
.stat-value.green { color: var(--accent-green); }
.stat-value.orange { color: var(--accent-orange); }
.stat-value.red { color: var(--accent-red); }
.stat-value.purple { color: var(--accent-purple); }

.stat-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ─── Grid layouts ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* ─── Forms ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input, .form-select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-dim);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394A3B8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 18px;
  padding-right: 36px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.form-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Buttons ─── */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #0284C7);
  color: white;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #16A34A);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-sm:hover {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.btn-orange {
  background: linear-gradient(135deg, var(--accent-orange), #EA580C);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Tables ─── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.data-table .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-table .align-right {
  text-align: right;
}

/* ─── Chart placeholder ─── */
.chart-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ─── Bar chart (pure CSS) ─── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 200px;
  padding: 0 8px;
  width: 100%;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 60px;
  border-radius: 4px 4px 0 0;
  transition: height var(--transition-slow);
  position: relative;
  min-height: 4px;
}

.bar.blue { background: linear-gradient(180deg, var(--accent-blue), rgba(14,165,233,0.5)); }
.bar.green { background: linear-gradient(180deg, var(--accent-green), rgba(34,197,94,0.5)); }
.bar.orange { background: linear-gradient(180deg, var(--accent-orange), rgba(249,115,22,0.5)); }
.bar.purple { background: linear-gradient(180deg, var(--accent-purple), rgba(168,85,247,0.5)); }
.bar.red { background: linear-gradient(180deg, var(--accent-red), rgba(239,68,68,0.5)); }

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.bar-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ─── Donut chart (CSS) ─── */
.donut-container {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px;
}

.donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100px;
  height: 100px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-total {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.donut-label-small {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-label {
  color: var(--text-secondary);
  flex: 1;
}

.legend-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Breakdown table ─── */
.breakdown-section {
  margin-bottom: 20px;
}

.breakdown-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 2px solid var(--accent-blue);
  margin-bottom: 4px;
}

.breakdown-section-header.materials {
  border-bottom-color: var(--accent-orange);
}

.breakdown-section-header.services {
  border-bottom-color: var(--accent-purple);
}

.breakdown-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breakdown-total-row td {
  font-weight: 700;
  border-top: 2px solid var(--border-medium);
  background: var(--bg-secondary) !important;
}

.grand-total-row td {
  font-weight: 700;
  font-size: 15px;
  border-top: 3px solid var(--accent-blue);
  background: var(--accent-blue-dim) !important;
  color: var(--accent-blue);
}

/* ─── Toast notifications ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.3s ease;
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }

@keyframes slideInToast {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Sensitivity chart (CSS) ─── */
.sensitivity-chart {
  position: relative;
  width: 100%;
  height: 250px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sensitivity-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
}

.sensitivity-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--bg-card);
  transform: translate(-50%, 50%);
  z-index: 2;
}

/* ─── Loading ─── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto;
}

/* ─── Result highlight ─── */
.result-highlight {
  background: linear-gradient(135deg, var(--accent-blue-dim), var(--bg-card));
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.result-highlight .value {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-highlight .label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ─── Responsive ───
   (keeping base responsive rules) */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .country-chips { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .process-grid { grid-template-columns: 1fr; }
  .wizard-progress { flex-direction: column; gap: 4px; align-items: flex-start; }
  .wizard-connector { width: 2px; height: 16px; margin: 0 0 0 16px; }
}


/* ═══════════════════════════════════════════
   WIZARD STYLES
   ═══════════════════════════════════════════ */

/* Progress Bar */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 0 32px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.wizard-step.active {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.wizard-step.completed {
  background: var(--accent-green-dim);
  border-color: var(--accent-green);
  cursor: pointer;
}

.wizard-step:not(.active):not(.completed):not(.clickable) {
  cursor: default;
  opacity: 0.6;
}

.wizard-step.completed:hover,
.wizard-step.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition-normal);
}

.wizard-step.active .wizard-step-num {
  background: var(--accent-blue);
  color: white;
}

.wizard-step.completed .wizard-step-num {
  background: var(--accent-green);
  color: white;
}

.wizard-step.completed .wizard-step-num::after {
  content: '✓';
}

.wizard-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-normal);
}

.wizard-step.active .wizard-step-label {
  color: var(--accent-blue);
}

.wizard-step.completed .wizard-step-label {
  color: var(--accent-green);
}

.wizard-connector {
  width: 40px;
  height: 2px;
  background: var(--border-subtle);
  transition: background var(--transition-normal);
}

.wizard-connector.active {
  background: var(--accent-green);
}

/* Wizard Panels */
.wizard-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}
.wizard-panel.active {
  display: block;
}

/* ─── Process Cards ─── */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.process-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.process-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,165,233,0.05), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.process-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 20px rgba(14,165,233,0.1);
}

.process-card:hover::before {
  opacity: 1;
}

.process-card.selected {
  border-color: var(--accent-blue);
  background: var(--accent-blue-dim);
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.2);
}

.process-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: var(--accent-blue);
  border-radius: 50%;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.process-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.process-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.process-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
  padding: 3px 8px;
  border-radius: 100px;
  display: inline-block;
}

/* ─── Selected Process Chip ─── */
.selected-process-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-blue-dim);
  border: 1px solid var(--accent-blue);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
}

/* ─── Material Chip ─── */
.material-chip {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* ─── Config Summary ─── */
.config-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.config-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.config-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  text-align: right;
  word-break: break-word;
}

/* ─── Country Grid ─── */
.country-region-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.country-region-label:first-child { margin-top: 0; }

.country-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.country-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
}

.country-chip:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
}

.country-chip.selected {
  border-color: var(--accent-blue);
  background: var(--accent-blue-dim);
  box-shadow: 0 0 12px rgba(14,165,233,0.15);
}

.country-flag {
  font-size: 18px;
}

.country-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 12px;
}

.country-rate {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Econ Grid ─── */
.econ-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.econ-item {
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.econ-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.econ-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── AI Confidence ─── */
.ai-confidence-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.ai-badge {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

.ai-badge.green {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.ai-badge.yellow {
  background: rgba(234, 179, 8, 0.15);
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.ai-badge.red {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

#ai-confidence-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-source {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── AI Spinner ─── */
.ai-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--accent-blue);
  border-right-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* ─── Detail Grid ─── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.detail-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-value.highlight {
  color: var(--accent-blue);
  font-size: 16px;
}

/* ─── Shimmer Loading ─── */
.shimmer-block {
  background: linear-gradient(90deg,
    var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Surface helper ─── */
.surface-secondary {
  background: var(--surface-secondary, var(--bg-secondary));
}

/* ─── Auth Page ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 30% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
                    radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 40px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-form {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
  backdrop-filter: blur(12px);
}

.auth-form .form-group {
  margin-bottom: 14px;
}

.auth-form .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-primary);
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.sidebar {
  display: flex;
  flex-direction: column;
}
