:root {
  --bg: #07111f;
  --panel: rgba(10, 22, 40, 0.9);
  --panel-strong: #0d1c33;
  --border: rgba(121, 183, 255, 0.16);
  --text: #e8f3ff;
  --muted: #8ea5c7;
  --blue: #79b7ff;
  --blue-bright: #47b7ea;
  --green: #56c6a2;
  --amber: #f0b35b;
  --red: #f0837d;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(71, 183, 234, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(34, 74, 141, 0.18), transparent 30%),
    linear-gradient(180deg, #091423 0%, var(--bg) 100%);
}

button,
select,
input,
textarea,
.chip,
.hero-number,
.metric-value,
.nav-link,
.receipt-preview {
  font-family: "IBM Plex Mono", monospace;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: linear-gradient(180deg, #102746 0%, #0a1730 100%);
  color: #f4f9ff;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(121, 183, 255, 0.12);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: white;
  font-weight: 700;
}

.brand h1,
.hero h2,
.section-heading h3,
.panel h4,
.focus-card h5 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  color: #f4f9ff;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.14);
}

.sidebar-card,
.panel,
.hero,
.metric-card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.content {
  max-width: 1180px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.hero {
  border-radius: 28px;
  padding: 28px;
}

.hero-copy {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-panel.active {
  display: flex;
}

.section-heading,
.panel-header,
.toolbar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.two-col,
.card-grid,
.form-grid,
.simple-update-grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.top-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.top-actions {
  margin: 14px 0 18px;
  justify-content: flex-end;
}

.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.order-meta {
  margin-bottom: 14px;
}

.simple-update-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.panel,
.metric-card {
  padding: 20px;
  border-radius: 24px;
}

.metric-card {
  background: var(--panel-strong);
}

.metric-label {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 0.86rem;
}

.metric-value {
  display: block;
  font-size: 2rem;
}

.metric-value.small {
  font-size: 1.4rem;
}

.panel-copy,
.simple-job-note,
.hero-copy,
.simple-job-top p {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(121, 183, 255, 0.08);
  color: var(--text);
  font-size: 0.76rem;
  border: 1px solid var(--border);
}

.chip-blue {
  background: rgba(67, 174, 221, 0.14);
  color: var(--blue);
}

.chip-green {
  background: rgba(86, 198, 162, 0.12);
  color: var(--green);
}

.chip-amber {
  background: rgba(240, 179, 91, 0.12);
  color: var(--amber);
}

.simple-job-list,
.stack-list,
.serial-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simple-job,
.stack-row,
.simple-update-card,
.serial-row,
.focus-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(121, 183, 255, 0.05);
}

.simple-job-top,
.stack-row,
.serial-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.simple-job-top p,
.simple-job-note,
.panel-copy {
  margin: 8px 0 0;
}

.stack-list.mono span,
.serial-code {
  font-family: "IBM Plex Mono", monospace;
}

.update-row {
  align-items: center;
}

.state-select {
  max-width: 180px;
}

.stack-list.compact .stack-row {
  padding: 10px 12px;
}

.serial-row.fail {
  background: rgba(240, 131, 125, 0.08);
}

.serial-status {
  color: var(--red);
}

.selectable {
  cursor: pointer;
}

label {
  display: block;
  margin: 0;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel-strong);
  color: var(--text);
}

textarea {
  min-height: 170px;
  resize: vertical;
}

.paste-block {
  margin-bottom: 16px;
}

button {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
}

button.secondary,
.big-button.secondary {
  background: transparent;
}

.focus-card {
  margin-bottom: 18px;
  background: rgba(17, 34, 60, 0.88);
}

.bench-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.big-button {
  flex: 1;
  min-width: 140px;
  padding: 18px;
  font-size: 1rem;
}

.big-button.pass {
  background: rgba(86, 198, 162, 0.12);
  color: var(--green);
}

.big-button.fail {
  background: rgba(240, 131, 125, 0.12);
  color: var(--red);
}

.receipt-preview {
  background: #ffffff;
  color: #000000;
  border-radius: 18px;
  padding: 22px 20px;
  line-height: 1.35;
  min-height: 520px;
  white-space: pre-wrap;
  font-size: 13px;
  border: 1px solid #d7dde6;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.print-panel {
  background: rgba(11, 22, 38, 0.98);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 9, 19, 0.68);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(1200px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  background: #091423;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-grid {
  margin-top: 16px;
}

.modal-panel {
  margin: 0;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .two-col,
  .four-up,
  .form-grid,
  .simple-update-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 18px;
  }

  .hero,
  .panel,
  .metric-card {
    border-radius: 20px;
  }
}

@media print {
  @page {
    size: auto;
    margin: 10mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .sidebar,
  .hero,
  .section-heading,
  .toolbar-actions,
  button,
  .chip,
  .panel:not(:last-child) {
    display: none !important;
  }

  .app-shell,
  .content,
  .tab-panel,
  .two-col {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .panel {
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    padding: 0 !important;
  }

  .receipt-preview {
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    white-space: pre-wrap !important;
    font-size: 11pt !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
  }
}

