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

:root {
  --bg: #080808;
  --surface: #0f0f0f;
  --surface-2: #151515;
  --border: #1d1d1d;
  --border-bright: #282828;
  --text: #e0e0e0;
  --text-muted: #575757;
  --text-dim: #2e2e2e;
  --orange: #ff7300;
  --orange-dim: rgba(255, 115, 0, 0.08);
  --orange-border: rgba(255, 115, 0, 0.22);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.1);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.1);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.1);
}

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

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Navigation ── */
.app-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border-bright);
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-left { display: flex; align-items: center; }
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.03em;
  padding-right: 20px;
  border-right: 1px solid var(--border-bright);
  margin-right: 8px;
  white-space: nowrap;
}
.series-badge {
  font-size: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--orange);
  background: var(--orange-dim);
  border: 1px solid var(--orange-border);
  padding: 2px 7px;
  border-radius: 3px;
}
.nav-links { display: flex; align-items: center; }
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--orange); background: var(--orange-dim); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.role-pill {
  font-size: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--border-bright);
  padding: 2px 8px;
  border-radius: 3px;
}
.nav-logout { transition: color 0.15s; }
.nav-logout:hover { color: var(--text); }

/* ── Layout ── */
.app-main { padding: 32px 28px; }
.content-wide { max-width: 1280px; margin: 0 auto; }
.content-md { max-width: 820px; margin: 0 auto; }
.content-sm { max-width: 600px; margin: 0 auto; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* ── Buttons ── */
.btn {
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
}
.btn-primary { background: var(--orange); color: #000; }
.btn-primary:hover { background: #ff8c1a; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border-bright); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { border-bottom: 1px solid var(--border-bright); }
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.empty-row td {
  text-align: center;
  padding: 56px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-amber { background: var(--amber-dim); color: var(--amber); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-gray { background: var(--border-bright); color: var(--text-muted); }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  padding: 9px 12px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-input[type="file"]::file-selector-button { display: none; }
.form-mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; padding-top: 4px; }
.back-link { font-size: 13px; color: var(--text-muted); transition: color 0.15s; }
.back-link:hover { color: var(--orange); }

option { background: #0f0f0f; color: #e0e0e0; }

/* ── Dashboard stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border-bright);
  border-radius: 8px;
  padding: 20px;
}
.stat-card-orange { border-top-color: var(--orange); }
.stat-card-green { border-top-color: var(--green); }
.stat-card-red { border-top-color: var(--red); }
.stat-card-blue { border-top-color: var(--blue); }
.stat-card-white { border-top-color: #ffffff; }
.stat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 1;
}
.stat-value-orange { color: var(--orange); }
.stat-value-green { color: var(--green); }
.stat-value-red { color: var(--red); }
.stat-value-blue { color: var(--blue); }

/* ── Dashboard sections ── */
.sections-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}
.section-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.quick-action:last-child { border-bottom: none; }
.quick-action:hover { color: var(--text); }
.quick-action-icon {
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--orange);
  font-family: 'Barlow Condensed', sans-serif;
}

/* ── Dashboard hero ── */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 40px 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.hero-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}
.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.hero-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}
.hero-body { display: flex; flex-direction: column; align-items: flex-start; }
.hero-body .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border-bright);
  padding-left: 40px;
}
.hero-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.hero-step:first-child { padding-top: 0; }
.hero-step:last-child { border-bottom: none; padding-bottom: 0; }
.hero-step-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--text-dim);
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
}
.hero-step-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.hero-step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Version watermark ── */
.app-version {
  position: fixed;
  bottom: 16px;
  left: 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

/* ── Part detail ── */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detail-part-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.detail-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.01em;
}
.detail-description { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.detail-field dt {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-field dd { font-size: 14px; font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Nav */
  .app-nav { padding: 0 16px; }
  .app-brand { padding-right: 12px; margin-right: 4px; font-size: 15px; }
  .nav-link { padding: 6px 8px; font-size: 12px; }
  .nav-right { gap: 6px; }

  /* Main layout */
  .app-main { padding: 20px 16px; }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Hero card: stack to single column */
  .hero-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 24px 20px;
  }
  .hero-title { font-size: 24px; }
  .hero-desc { font-size: 13px; }
  .hero-body { margin-bottom: 28px; }

  /* Hero steps: remove the vertical divider, use a top border instead */
  .hero-steps {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-bright);
    padding-top: 4px;
  }

  /* Tables: allow horizontal scroll */
  .card { overflow-x: auto; }
  .data-table { min-width: 560px; }

  /* Page header: tighten up */
  .page-header { margin-bottom: 16px; }
  .page-title { font-size: 22px; }

  /* Forms */
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-card { padding: 16px; }

  /* Detail */
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-card { padding: 20px; }

  /* Version watermark: smaller on mobile so it doesn't crowd content */
  .app-version { font-size: 11px; bottom: 10px; left: 12px; }
}

@media (max-width: 480px) {
  .app-nav { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 4px; }
  .nav-left { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .nav-links { flex-wrap: nowrap; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
