:root {
  color-scheme: dark;
  --bg-primary: #0f1729;
  --bg-secondary: #1a2332;
  --bg-tertiary: #243044;
  --bg-card: #1e2a3a;
  --border-color: #2d3d50;
  --border-light: #374a5e;
  --text-primary: #e8edf5;
  --text-secondary: #8899aa;
  --text-muted: #667788;
  --accent: #6a9674;
  --accent-hover: #587f61;
  --accent-soft: rgba(59, 130, 100, 0.16);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --sidebar-width: 260px;
  --header-height: 86px;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 80;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-140%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.mono,
.mono-label,
.version-text {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at top left, #223c67 0%, #152945 50%, #0c182d 100%);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  transform: translateY(-3vh);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text-primary);
}

.login-logo p {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-card {
  background: #112035;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.login-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
  text-align: center;
}

.login-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-support-link {
  justify-self: flex-start;
  font-size: 12px;
  color: var(--text-secondary);
}

.login-support-link:hover {
  color: var(--text-primary);
}

.login-form .btn {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

.login-secondary-action {
  margin-top: 16px;
  width: 100%;
  justify-content: center;
}

.version-text {
  text-align: center;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* App shell */
.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

#app-view {
  position: relative;
  isolation: isolate;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-header {
  height: var(--header-height);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: var(--text-primary);
  width: 100%;
}

.sidebar-brand-company {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.6px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-primary);
}

.sidebar-brand h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1;
  text-transform: none;
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.sidebar-nav-group {
  display: grid;
  gap: 2px;
}

.sidebar-nav-label {
  padding: 0 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.75;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

.nav-item.active,
.nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  padding: 14px 12px 24px;
  border-top: 1px solid var(--border-color);
  display: grid;
  gap: 6px;
}

.sidebar-portal-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  opacity: 0.6;
  text-align: right;
  white-space: nowrap;
}

.admin-info {
  padding: 0 12px;
  margin: 10px 0;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 12px 0;
}

.logout-link {
  color: var(--text-muted);
  width: auto;
  padding: 10px 12px;
  gap: 10px;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-link:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.18);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 24px;
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.page-heading {
  display: grid;
  gap: 2px;
  align-content: center;
  align-self: center;
  min-width: 0;
  flex: 1;
}

.page-breadcrumb-shell {
  display: flex;
  align-items: center;
  min-height: 18px;
}

.page-kicker,
.page-title,
.page-subtitle,
.page-breadcrumb,
.card-title,
.section-head h3,
.activation-workspace-head h4,
.kit-context h4,
.kit-detail-header h3 {
  margin: 0;
}

.page-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.92;
}

.page-breadcrumb-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}

.page-breadcrumb-link:hover {
  color: var(--text-primary);
}

.page-breadcrumb-separator {
  color: var(--text-muted);
}

.page-kicker {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 2px;
  display: none;
}

.page-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

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

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-meta-copy {
  display: inline;
}

.header-meta-separator {
  color: var(--text-muted);
}

.header-refresh-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.header-refresh-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.header-refresh-link:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.content {
  padding: 8px 24px 20px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.dashboard-panel {
  gap: 18px;
}

.dashboard-card .panel-body {
  padding: 16px;
}

.dashboard-card--pipeline {
  background: transparent;
  border: none;
  box-shadow: none;
}

.dashboard-card--pipeline .panel-body {
  padding: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
}

.card-body {
  padding: 16px;
}

.panel {
  display: grid;
}

.panel-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-head--kits h3 {
  flex: 0 0 164px;
  white-space: nowrap;
  line-height: 1.05;
}

.kits-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-left: auto;
}

.filter-stack {
  display: block;
  width: 190px;
}

.section-head--kits .search-input {
  flex: 0 0 300px !important;
  width: 300px !important;
  max-width: 300px;
  min-width: 0;
}

.muted {
  color: var(--text-secondary);
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(12, 18, 30, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-loading-shell {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(15, 23, 41, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.app-loading-spinner {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2.5px solid rgba(125, 211, 252, 0.22);
  border-top-color: #7dd3fc;
  animation: app-loading-spin 0.8s linear infinite;
}

.app-loading-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Flash */
.flash {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.flash-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.flash-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.flash-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Buttons */
.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  background: var(--accent);
  color: #fff;
}

.btn:hover,
button:hover {
  background: var(--accent-hover);
}

.btn:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.is-loading,
button.is-loading {
  position: relative;
  pointer-events: none;
}

.btn.is-loading::before,
button.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: btn-spin 0.7s linear infinite;
}

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

.btn-secondary,
.button-secondary,
.button-quiet {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover,
.button-secondary:hover,
.button-quiet:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-tertiary);
}

/* Forms */
.form-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-label,
label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
}

.form-label.compact {
  margin-right: 8px;
}

.form-label.is-required::after {
  content: " *";
  color: var(--danger);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-input,
.form-select,
.form-textarea,
input,
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 9px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

main:focus {
  outline: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.form-input.input-invalid,
.form-select.input-invalid,
.form-textarea.input-invalid,
input.input-invalid,
select.input-invalid,
textarea.input-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger-soft);
}

input[type="date"] {
  min-inline-size: 0;
  inline-size: 100%;
  max-inline-size: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.form-select,
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23667788' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-form.tri-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.labels-form {
  display: grid;
  gap: 18px;
}

.labels-form-section {
  display: grid;
  gap: 12px;
}

.labels-form-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.labels-form-row {
  display: grid;
  gap: 12px;
}

.labels-form-row--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.labels-form-row--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.labels-preview-section {
  display: grid;
  gap: 14px;
}

.form-span-all,
.grid-form > button,
.grid-form > .feedback,
.grid-form > .row-inline {
  grid-column: 1 / -1;
}

.inline-form {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: end;
  gap: 10px;
}

.row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gps-inline .form-input {
  flex: 1 1 320px;
}

.toolbar-compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dashboard */
.pipeline-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(36, 48, 68, 0.96), rgba(26, 35, 50, 0.96));
  padding: 12px 14px 14px;
  min-width: 0;
  overflow: hidden;
}

.btn-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

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

.pipeline-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

.pipeline-node {
  --status-color: var(--accent);
  --status-soft: var(--accent-soft);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--status-color) 96%, white 4%) 0 4px, rgba(15, 23, 41, 0) 4px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(15, 23, 41, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  background-clip: padding-box;
  overflow: visible;
  text-align: left;
  color: inherit;
  white-space: normal;
  cursor: pointer;
}

.pipeline-node::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 16px);
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  /* Render the stage connector inside the gap between adjacent tiles. */
  background-color: color-mix(in srgb, var(--status-color) 82%, transparent);
  pointer-events: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6 3l6 6-6 6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6 3l6 6-6 6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.pipeline-node:last-child::after {
  display: none;
}

.pipeline-node.is-empty {
  opacity: 0.62;
}

.pipeline-node.is-active {
  border-color: color-mix(in srgb, var(--status-color) 45%, rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 24px rgba(7, 12, 20, 0.2);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--status-color) 96%, white 4%) 0 4px, rgba(15, 23, 41, 0) 4px),
    linear-gradient(180deg, color-mix(in srgb, var(--status-soft) 48%, rgba(255, 255, 255, 0.05)), transparent),
    rgba(15, 23, 41, 0.62);
}

.pipeline-node:hover {
  border-color: color-mix(in srgb, var(--status-color) 38%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--status-color) 96%, white 4%) 0 4px, rgba(15, 23, 41, 0) 4px),
    linear-gradient(180deg, color-mix(in srgb, var(--status-soft) 28%, rgba(255, 255, 255, 0.03)), transparent),
    rgba(15, 23, 41, 0.56);
}

.pipeline-node-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pipeline-node-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pipeline-node-count {
  color: color-mix(in srgb, var(--status-color) 90%, white 10%);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.search-input {
  min-width: 260px;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}

.table-footer-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.table-empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 12px;
  text-align: center;
}

.table-empty-title {
  font-size: 16px;
  font-weight: 600;
}

.table-empty-copy {
  max-width: 420px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.table-empty-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-secondary);
}

.table-empty-action {
  min-height: 32px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.kits-grid .kits-col-sbid,
.kits-grid .kits-col-status,
.kits-grid .kits-col-source,
.kits-grid .kits-col-program,
.kits-grid .kits-col-fedex {
  width: 20%;
}

.kits-grid tbody tr {
  transition: background-color 0.08s ease;
}

.kits-grid tbody tr:hover {
  background: var(--bg-secondary);
}

.kits-table-row td:first-child {
  font-weight: 600;
}

.table-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.table-link:hover {
  color: var(--accent);
  background: transparent;
}

.table-link:focus-visible {
  outline: none;
  color: var(--accent);
  text-decoration: underline;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

.status-chip {
  --status-color: var(--accent);
  --status-soft: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--status-color) 42%, transparent);
  color: color-mix(in srgb, var(--status-color) 86%, white 14%);
  background: color-mix(in srgb, var(--status-soft) 92%, rgba(15, 23, 41, 0.9));
  font-size: 11px;
  font-weight: 600;
}

.status-assembled {
  --status-color: #7dd3fc;
  --status-soft: rgba(125, 211, 252, 0.16);
}

.status-activated {
  --status-color: #60a5fa;
  --status-soft: rgba(96, 165, 250, 0.18);
}

.status-sample-collected {
  --status-color: #2dd4bf;
  --status-soft: rgba(45, 212, 191, 0.18);
}

.status-dropped-at-fedex {
  --status-color: #f59e0b;
  --status-soft: rgba(245, 158, 11, 0.18);
}

.status-arrived-at-lab {
  --status-color: #a78bfa;
  --status-soft: rgba(167, 139, 250, 0.18);
}

.status-in-processing {
  --status-color: #f97316;
  --status-soft: rgba(249, 115, 22, 0.18);
}

.status-complete {
  --status-color: #34d399;
  --status-soft: rgba(52, 211, 153, 0.18);
}

.status-unknown {
  --status-color: #94a3b8;
  --status-soft: rgba(148, 163, 184, 0.16);
}

.status-success {
  --status-color: var(--success);
  --status-soft: var(--success-soft);
}

.status-warning {
  --status-color: var(--warning);
  --status-soft: var(--warning-soft);
}

.status-error {
  --status-color: var(--danger);
  --status-soft: var(--danger-soft);
}

.status-muted {
  --status-color: #94a3b8;
  --status-soft: rgba(148, 163, 184, 0.16);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-badge.source-gt {
  color: color-mix(in srgb, var(--accent) 84%, white 16%);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 88%, rgba(15, 23, 41, 0.88));
}

.source-badge.source-in-house {
  color: #cbd5e1;
}

/* Workflow-specific */
.feedback {
  font-size: 13px;
}

.feedback.success {
  color: var(--success);
}

.feedback.error {
  color: var(--danger);
}

.feedback.warning {
  color: var(--warning);
}

.users-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.users-create-form {
  margin-bottom: 18px;
}

.users-toolbar .search-input {
  flex: 1 1 280px;
  min-width: 220px;
}

.users-table {
  table-layout: auto;
}

.users-table td,
.users-table th {
  white-space: normal;
  vertical-align: top;
}

.users-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.button-quiet-danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.28);
}

.button-quiet-danger:hover {
  color: #ffd7d7;
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.panel-skeleton {
  display: grid;
  gap: 10px;
}

.panel-skeleton-bar {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  animation: panel-skeleton-pulse 1.1s ease-in-out infinite;
}

@keyframes panel-skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.table-skeleton-row td {
  padding: 16px 12px;
}

.kit-context.is-loading {
  min-height: 88px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 5px 10px;
  width: fit-content;
  font-size: 12px;
}

.kit-context {
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.09);
  padding: 12px;
}

.kit-context h4 {
  margin-bottom: 4px;
}

.kit-context p {
  color: var(--text-secondary);
  font-size: 13px;
}

.gps-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.gps-status[data-state="capturing"] {
  color: #93c5fd;
}

.gps-status[data-state="success"] {
  color: var(--success);
}

.gps-status[data-state="failed"] {
  color: var(--warning);
}

.activation-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-left: 4px solid rgba(96, 165, 250, 0.9);
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
}

.activation-context-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.activation-context-dismiss {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.activation-context-dismiss:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-tertiary);
}

.sample-load-actions {
  justify-self: start;
}

.sample-load-actions .btn {
  min-width: 122px;
}

.sample-scanner-actions {
  justify-content: flex-end;
}

.activation-scanner-stage {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
}

.activation-actions {
  gap: 10px;
}

.activation-actions .btn {
  justify-content: center;
  min-width: 132px;
}

.activation-workspace {
  margin-top: 16px;
}

.activation-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
}

.activation-workspace-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(36, 48, 68, 0.98), rgba(26, 35, 50, 0.98));
}

.activation-workspace-head {
  align-items: center;
  margin-bottom: 0;
}

.activation-workspace-head h4 {
  font-size: 14px;
}

.activation-scanner-status {
  min-height: 20px;
}

.activation-scan-flash {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(107, 114, 128, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 41, 0.92);
  box-shadow: 0 16px 32px rgba(3, 7, 18, 0.22);
}

.activation-scan-flash--overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 4;
  max-width: min(460px, calc(100% - 28px));
  margin: 0 auto;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.activation-scan-flash.is-success {
  border-color: rgba(74, 222, 128, 0.42);
  background:
    linear-gradient(180deg, rgba(12, 55, 36, 0.96), rgba(11, 44, 31, 0.94)),
    rgba(15, 23, 41, 0.92);
}

.activation-scan-flash.is-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background:
    linear-gradient(180deg, rgba(74, 45, 7, 0.94), rgba(61, 37, 8, 0.92)),
    rgba(15, 23, 41, 0.92);
}

.activation-scan-flash.is-error {
  border-color: rgba(248, 113, 113, 0.42);
  background:
    linear-gradient(180deg, rgba(86, 22, 33, 0.96), rgba(66, 17, 27, 0.94)),
    rgba(15, 23, 41, 0.92);
}

.activation-scan-flash-sbid {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.activation-scan-flash-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.88);
}

.activation-scanner-reader {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 320px;
  aspect-ratio: 16 / 10;
  max-height: min(62vh, 520px);
  overflow: hidden;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(15, 23, 41, 0.72), rgba(15, 23, 41, 0.9)),
    rgba(15, 23, 41, 0.88);
}

.activation-scanner-reader video {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  transform: scale(1.08);
  transform-origin: center;
}

.activation-scanner-placeholder {
  display: grid;
  gap: 8px;
  max-width: 280px;
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.activation-scanner-placeholder strong {
  color: var(--text-primary);
}

.activation-scanner-placeholder--overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  max-width: none;
  margin: 0;
  padding: 20px;
  align-content: center;
  justify-items: center;
  pointer-events: none;
}

.activation-scanner-stage .activation-scanner-reader {
  width: 100%;
  margin: 0;
}

.activation-scanner-fallbacks {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .activation-scanner-reader {
    width: 100%;
    max-height: none;
    min-height: min(58dvh, 520px);
    aspect-ratio: 3 / 4;
  }
}

.activation-manual-form {
  display: grid;
  gap: 8px;
}

.activation-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.activation-selection-table th:last-child,
.activation-selection-table td:last-child {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.activation-selection-empty td {
  color: var(--text-secondary);
  font-size: 13px;
}

.activation-selected-remove {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.activation-selected-remove:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  color: var(--text-primary);
}

.activation-submit-row {
  margin-top: auto;
}

.activation-submit-row .btn {
  width: 100%;
  justify-content: center;
}

#panel-sample.sample-scanner-mode .card-body.panel-body > :not(#sample-scanner-workspace) {
  display: none;
}

#panel-sample.sample-scanner-mode #sample-scanner-workspace {
  margin-top: 0;
}

#panel-sample.sample-scanner-mode .activation-workspace-panel {
  min-height: calc(100dvh - 220px);
  align-content: start;
}

#panel-sample.sample-scanner-mode .activation-scanner-reader {
  width: 100%;
  max-width: none;
  min-height: min(48dvh, 460px);
  max-height: min(56dvh, 520px);
}

#panel-lab.lab-scanner-mode .card-body.panel-body > :not(#lab-scanner-workspace) {
  display: none;
}

#panel-lab.lab-scanner-mode #lab-scanner-workspace {
  margin-top: 0;
}

#panel-lab.lab-scanner-mode .activation-workspace-panel {
  min-height: calc(100dvh - 220px);
  align-content: start;
}

#panel-lab.lab-scanner-mode .activation-scanner-reader {
  width: 100%;
  max-width: none;
  min-height: min(48dvh, 460px);
  max-height: min(56dvh, 520px);
}

.detail-back-link {
  width: fit-content;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
}

.detail-back-link:hover {
  background: transparent;
  color: var(--text-primary);
}

.kit-detail-header {
  display: grid;
  gap: 4px;
}

.kit-detail-header .muted {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-timeline {
  display: grid;
  gap: 12px;
}

.detail-event {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.detail-event.is-pending {
  opacity: 0.78;
}

.detail-event-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.detail-event-head h4 {
  font-size: 14px;
}

.detail-event-head p {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.detail-event-pending-note {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--text-tertiary, var(--text-secondary));
  margin: 4px 0 0;
}

.detail-event-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.detail-event-field {
  display: grid;
  gap: 2px;
}

.detail-event-field dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

.detail-event-field dd {
  color: var(--text-primary);
}

.labels-preview {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.label-sheet-page {
  width: 8.5in;
  height: 11in;
  padding: 0.5in;
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 24px 70px rgba(8, 15, 30, 0.28);
  border-radius: 20px;
  overflow: hidden;
}

.label-sheet-meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.label-sheet {
  width: 7.5in;
  height: 10in;
  display: grid;
  grid-template-columns: repeat(5, 1.5in);
  grid-template-rows: repeat(10, 1in);
  gap: 0;
  background: #ffffff;
  color: #000000;
  overflow: hidden;
}

.sheet-label {
  width: 1.5in;
  height: 1in;
  box-sizing: border-box;
  display: block;
  border: 1px dashed rgba(15, 23, 41, 0.18);
  overflow: hidden;
  background: #ffffff;
}

.sheet-label-empty {
  background: #ffffff;
}

.sheet-label-rendered {
  width: 100%;
  height: 100%;
  display: block;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.data-grid--reference {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subcard {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.subcard h4 {
  font-size: 14px;
}

.list {
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
}

.reference-note,
.form-note {
  font-size: 12px;
  color: var(--text-secondary);
}

.programs-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.programs-sidebar {
  position: sticky;
  top: 0;
}

.programs-editor {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-list-empty {
  padding: 12px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
}

.record-list-item {
  width: 100%;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-align: left;
}

.record-list-item:hover {
  background: color-mix(in srgb, var(--bg-tertiary) 92%, white 8%);
  border-color: var(--border-light);
}

.record-list-item:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.record-list-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background:
    linear-gradient(180deg, rgba(106, 150, 116, 0.16), rgba(106, 150, 116, 0.08)),
    var(--bg-tertiary);
  box-shadow: inset 0 0 0 1px rgba(106, 150, 116, 0.22);
}

.record-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.record-list-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.checkbox-group {
  align-content: end;
}

.checkbox-input {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 41px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.checkbox-input input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

.sites-table-row {
  cursor: pointer;
}

.sites-table-row:focus-visible td {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent-soft) 72%, rgba(15, 23, 41, 0.94));
}

.sites-table-row.is-selected td {
  background: color-mix(in srgb, var(--accent-soft) 80%, rgba(15, 23, 41, 0.92));
}

.sites-table-empty td {
  color: var(--text-secondary);
}

.reporting-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Mobile */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px;
}

.hamburger-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9;
}

.sidebar-backdrop.open {
  display: block;
}

@media (max-width: 1520px) {
  .pipeline-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(136, 153, 170, 0.45) transparent;
  }

  .pipeline-bar {
    display: flex;
    gap: 28px;
    width: max-content;
    min-width: 100%;
    padding-bottom: 6px;
  }

  .pipeline-node {
    flex: 0 0 178px;
  }

  .pipeline-wrap::-webkit-scrollbar {
    height: 8px;
  }

  .pipeline-wrap::-webkit-scrollbar-thumb {
    background: rgba(136, 153, 170, 0.32);
    border-radius: 999px;
  }

  .data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-form.tri-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activation-workspace-grid {
    grid-template-columns: 1fr;
  }

  .programs-workspace {
    grid-template-columns: 1fr;
  }

  .programs-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .page-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: auto;
    min-height: var(--header-height);
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    align-items: center;
    gap: 10px;
  }

  .page-title {
    font-size: 17px;
    line-height: 1.1;
  }

  .page-header > * {
    min-width: 0;
  }

  .page-subtitle {
    display: none;
  }

  .page-breadcrumb-shell {
    min-height: 0;
  }

  .content {
    padding: 7px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .inline-form,
  .grid-form,
  .grid-form.tri-col,
  .labels-form-row--three,
  .labels-form-row--two,
  .detail-event-fields,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .activation-manual-row {
    grid-template-columns: 1fr;
  }

  .programs-workspace,
  .programs-editor {
    gap: 12px;
  }

  .toolbar-compact,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .activation-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .kits-toolbar {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-stack {
    width: 100%;
  }

  .search-input {
    min-width: 0;
  }

  .section-head--kits .search-input {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .header-actions {
    width: auto;
    justify-content: flex-end;
    align-self: center;
  }

  .header-meta {
    font-size: 0;
    gap: 0;
  }

  .header-meta-copy,
  .header-meta-separator {
    display: none;
  }

  .header-refresh-link {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .section-head--kits {
    gap: 12px;
  }

  .section-head--kits h3 {
    flex: none;
    white-space: normal;
  }

  .sample-load-actions,
  .sample-scanner-actions {
    width: 100%;
  }

  .kits-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "search search"
      "status source";
    width: 100%;
    gap: 10px;
    align-items: stretch;
  }

  .filter-stack {
    width: auto;
    min-width: 0;
  }

  .kits-toolbar .filter-stack:first-child {
    grid-area: status;
  }

  .kits-toolbar .filter-stack:last-of-type {
    grid-area: source;
  }

  .kits-toolbar .search-input {
    grid-area: search;
    grid-column: auto;
    order: initial;
  }

  .kits-toolbar .form-select,
  .kits-toolbar .search-input {
    min-height: 44px;
    height: 44px;
  }

  .sample-load-actions .btn,
  .sample-scanner-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .reporting-actions {
    align-items: stretch;
  }

  .reporting-actions .btn,
  .reporting-actions .pill {
    width: 100%;
    justify-content: center;
  }

  .sample-scanner-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activation-scan-flash--overlay {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  #panel-sample.sample-scanner-mode .activation-workspace-panel {
    min-height: calc(100dvh - 190px);
  }

  #panel-sample.sample-scanner-mode .activation-scanner-reader {
    min-height: min(54dvh, 520px);
    max-height: none;
  }

  #panel-lab.lab-scanner-mode .activation-workspace-panel {
    min-height: calc(100dvh - 190px);
  }

  #panel-lab.lab-scanner-mode .activation-scanner-reader {
    min-height: min(54dvh, 520px);
    max-height: none;
  }

  .section-head--kits .search-input {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none;
    min-width: 0;
  }

  table {
    min-width: 620px;
  }

  .kits-grid .kits-col-sbid {
    width: 125px;
  }

  .kits-grid .kits-col-status {
    width: 150px;
  }

  .kits-grid .kits-col-source,
  .kits-grid .kits-col-program,
  .kits-grid .kits-col-fedex {
    width: auto;
  }

  .login-container {
    transform: none;
  }

  .labels-preview {
    justify-items: stretch;
  }

  .label-sheet-page {
    width: 100%;
    height: auto;
    aspect-ratio: 8.5 / 11;
    padding: 5.882%;
    border-radius: 16px;
  }

  .label-sheet {
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(10, minmax(0, 1fr));
  }

  .sheet-label {
    width: auto;
    height: auto;
    min-height: 0;
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.5in;
  }

  body {
    background: #fff;
    color: #000;
  }

  #login-view,
  .sidebar,
  .page-header,
  #alert,
  #panel-dashboard,
  #panel-activation,
  #panel-sample,
  #panel-dropoff,
  #panel-lab,
  #panel-programs,
  #panel-reporting,
  #generate-form,
  #panel-labels .card-header,
  #panel-labels .muted,
  .section-head,
  .label-sheet-meta {
    display: none !important;
  }

  .main-content,
  .content,
  #panel-labels,
  .labels-preview,
  .label-sheet-page,
  .label-sheet,
  .sheet-label {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .labels-preview {
    gap: 0 !important;
  }

  .label-sheet-page {
    width: 7.5in !important;
    height: 10in !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .label-sheet-page + .label-sheet-page {
    break-before: page;
    page-break-before: always;
  }

  .label-sheet {
    width: 7.5in !important;
    height: 10in !important;
    display: grid !important;
    grid-template-columns: repeat(5, 1.5in) !important;
    grid-template-rows: repeat(10, 1in) !important;
  }

  .sheet-label {
    width: 1.5in !important;
    height: 1in !important;
    display: block !important;
    overflow: hidden !important;
  }
}
