/* =========================================================
   Cornelius Production Inspection - app styling
   Palette + typography from app-styling.md; refined layer
   on top with modern soft shadows, better type scale,
   cleaner tables and a proper brand feel in the header.
   ========================================================= */

:root {
  /* Core palette */
  --navy:         #1E2855;
  --navy-900:     #151c3f;
  --navy-700:     #2a3670;
  --navy-600:     #3a488a;
  --navy-100:     #e8eaf3;

  --teal:         #00EFCD;
  --teal-600:     #00C5A8;
  --teal-100:     #D2F8F5;

  --lcyan:        #D2F8F5;
  --white:        #FFFFFF;
  --lgrey:        #F5F5F5;
  --off-white:    #FAFBFC;
  --hairline:     #E5E7EB;
  --hairline-2:   #EEF1F5;

  --dark:         #0F172A;

  --ink:          #1E2855;
  --ink-2:        #3a4370;
  --muted:        #6B7280;
  --muted-2:      #9CA3AF;

  /* Semantic pastels (keep the brief's tokens) */
  --green:        #C6EFCE;
  --amber:        #FFEB9C;
  --red:          #FFC7CE;
  --orange:       #FFCC99;
  --purple:       #E2CFFE;

  /* KPI accents */
  --kpi-green:    #22c55e;
  --kpi-amber:    #f59e0b;
  --kpi-red:      #ef4444;
  --kpi-purple:   #8b5cf6;
  --kpi-teal:     #0ea5e9;

  /* Shadows - multi-layer soft */
  --shadow-xs: 0 1px 2px rgba(17, 24, 55, 0.04);
  --shadow-sm: 0 1px 3px rgba(17, 24, 55, 0.06), 0 1px 2px rgba(17, 24, 55, 0.04);
  --shadow-md: 0 4px 14px rgba(17, 24, 55, 0.06), 0 2px 4px rgba(17, 24, 55, 0.04);
  --shadow-lg: 0 12px 28px rgba(17, 24, 55, 0.10), 0 4px 8px rgba(17, 24, 55, 0.04);
  --shadow-header: 0 1px 0 rgba(17, 24, 55, 0.06), 0 4px 14px rgba(17, 24, 55, 0.04);

  /* Radius scale */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-normal: 200ms ease;
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ---------- landing / search page ---------- */
.landing { max-width: 960px; margin: 0 auto; padding: 0 var(--s-4); }

/* Empty state: centred hero vertically within the viewport. */
.landing-hero {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-4);
  padding-top: clamp(80px, 14vh, 180px);
  transition: padding-top var(--t-normal);
}
.landing-logo { height: 72px; width: auto; display: block; }
.landing-title {
  margin: 0; color: var(--navy);
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
}
.landing-footnote { margin: 0; font-size: 12.5px; }

/* Rounded pill search. */
.landing input.landing-input {
  width: 100%; max-width: 640px;
  padding: 14px 22px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--white);
  font-size: 16px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
}
.landing input.landing-input::placeholder { color: var(--muted-2); }
.landing input.landing-input:hover { border-color: #C7CBD4; }
.landing input.landing-input:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(0,239,205,0.18), var(--shadow-md);
  background: var(--white);
}

/* Typed state: collapse the hero into a compact top bar. */
.landing-hero-top {
  padding-top: var(--s-5);
  flex-direction: row; align-items: center; gap: var(--s-4);
}
.landing-hero-top .landing-logo { height: 36px; }
.landing-hero-top .landing-title,
.landing-hero-top .landing-footnote { display: none; }
.landing .landing-hero-top input.landing-input { max-width: none; flex: 1; padding: 10px 20px; font-size: 15px; }

/* Results. */
.landing-results { margin-top: var(--s-6); }
.landing-empty { text-align: center; padding: var(--s-6) 0; }
.landing-group { margin-bottom: var(--s-5); }
.landing-group-label {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 var(--s-2) 0;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.landing-group-label .tab-count { background: var(--hairline-2); color: var(--ink-2); }

.landing-result {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  text-decoration: none;
  transition: all var(--t-fast);
}
.landing-result:hover {
  border-color: var(--teal-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.landing-result-main { display: flex; align-items: center; gap: var(--s-4); min-width: 0; flex: 1; }
.landing-result-code { color: var(--navy); font-weight: 700; font-size: 14px; white-space: nowrap; }
.landing-result-name { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-result-side { display: flex; align-items: center; gap: var(--s-3); font-size: 12px; flex-shrink: 0; }
html, body {
  margin: 0; padding: 0;
  background: var(--lgrey);
  color: var(--ink);
  font-family: 'Segoe UI', Calibri, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  background:
    radial-gradient(ellipse 800px 400px at 20% -10%, rgba(0,239,205,0.05), transparent),
    radial-gradient(ellipse 800px 400px at 100% 0%, rgba(30,40,85,0.04), transparent),
    var(--lgrey);
  min-height: 100vh;
}
a { color: var(--navy); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--navy-700); }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  background: var(--navy-100); color: var(--navy);
  padding: 2px 6px; border-radius: var(--r-xs);
  font-size: 0.875em;
}

h1, h2, h3, h4 { color: var(--navy); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 17px; line-height: 1.3; margin-bottom: var(--s-4); }
h3 { font-size: 14px; line-height: 1.3; margin-bottom: var(--s-2); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }

.muted { color: var(--muted); font-size: 12.5px; }
.sep { color: var(--muted-2); font-weight: 400; margin: 0 var(--s-1); }
.text-amber { color: #b45309; font-weight: 600; }
hr.divider { border: 0; border-top: 1px solid var(--hairline); margin: var(--s-5) 0; }

/* ---------- app header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy) 100%);
  color: var(--white);
  box-shadow: var(--shadow-header);
  border-bottom: 1px solid rgba(0,239,205,0.12);
}
.app-header::after {
  content: ''; display: block; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-600) 40%, transparent 85%);
  opacity: 0.55;
}
.app-header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--s-6);
  height: 64px;
  display: flex; align-items: center; gap: var(--s-5);
}

.brand-tile {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--white);
  padding: 7px 14px 7px 10px;
  border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform var(--t-fast);
}
.brand-tile:hover { transform: translateY(-1px); text-decoration: none; }
.brand-tile-lg { padding: 10px 18px; }
.brand-logo {
  color: var(--navy);
  font-weight: 800; font-size: 14px;
  letter-spacing: 0.14em;
  font-family: 'Segoe UI', Calibri, system-ui, sans-serif;
  display: inline-flex; align-items: center; gap: 6px;
}
.brand-logo::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 2px rgba(0,239,205,0.18);
}

.brand-mark {
  display: inline-flex; align-items: center;
  transition: transform var(--t-fast);
}
.brand-mark:hover { transform: translateY(-1px); text-decoration: none; }
.brand-img { display: block; height: auto; }
.brand-img-nav { height: 33px; width: auto; }
.brand-img-lg { height: 54px; width: auto; margin: 0 auto; }

.app-title {
  color: rgba(255,255,255,0.92);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.app-title .sep { color: rgba(255,255,255,0.35); }

.app-nav { display: flex; gap: 2px; margin-left: auto; margin-right: var(--s-4); }
.nav-link {
  color: rgba(255,255,255,0.72);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--t-fast);
  position: relative;
}
.nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  text-decoration: none;
}
.nav-link.active {
  color: var(--white);
  background: rgba(0,239,205,0.12);
}
.nav-link.active::after {
  content: ''; position: absolute;
  left: 14px; right: 14px; bottom: -2px;
  height: 2px; border-radius: 2px;
  background: var(--teal);
}
.nav-link-muted {
  color: rgba(255,255,255,0.55);
  padding: 6px 10px; font-size: 12px;
  transition: color var(--t-fast);
}
.nav-link-muted:hover { color: var(--white); text-decoration: none; }

.app-user { display: flex; align-items: center; gap: var(--s-3); padding-left: var(--s-4); border-left: 1px solid rgba(255,255,255,0.12); }
.user-chip { color: var(--white); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: var(--s-2); }
.role-badge {
  background: rgba(0,239,205,0.18);
  color: var(--teal);
  padding: 3px 8px;
  font-size: 10px; font-weight: 700;
  border-radius: var(--r-pill);
  text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid rgba(0,239,205,0.35);
}

.app-main { max-width: 1440px; margin: 0 auto; padding: var(--s-8) var(--s-6); }

/* ---------- flash / alert ---------- */
.flash, .alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: var(--s-5);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 10px;
}
.flash-ok    { background: #F0FDF4; color: #14532d; border-color: #BBF7D0; }
.flash-error { background: #FEF2F2; color: #7f1d1d; border-color: #FECACA; }
.alert-error { background: #FEF2F2; color: #7f1d1d; border-color: #FECACA; }
.alert-warn  { background: #FFFBEB; color: #78350F; border-color: #FDE68A; }

/* ---------- cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--s-4);
  transition: box-shadow var(--t-normal);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-2);
}
.card-head h2 { margin: 0; }
.card-sub { margin: 0 0 var(--s-4) 0; font-size: 12.5px; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.shop-card { min-width: 360px; }

/* ---------- page head ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--s-5);
  gap: var(--s-3); flex-wrap: wrap;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--hairline);
}
.page-head h1 { margin: 0; line-height: 1.2; }
.head-lead { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.head-meta { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- KPI tiles ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: all var(--t-normal);
}
.kpi::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  background: var(--teal);
}
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-green::before  { background: var(--kpi-green); }
.kpi-amber::before  { background: var(--kpi-amber); }
.kpi-red::before    { background: var(--kpi-red); }
.kpi-purple::before { background: var(--kpi-purple); }
.kpi-teal::before   { background: var(--kpi-teal); }
.kpi-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.kpi-value {
  font-size: 32px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px; color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ---------- toolbar / tabs / search ---------- */
.toolbar {
  display: flex; align-items: center; gap: var(--s-4);
  margin: calc(-1 * var(--s-2)) 0 var(--s-5) 0;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--hairline);
}
.toolbar-spacer { flex: 1; }
.toolbar-search input[type="search"] { width: 280px; }

.tabs {
  display: inline-flex; flex-wrap: wrap;
  gap: 2px;
  background: var(--off-white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 3px;
}
.tab {
  appearance: none;
  border: 0; background: transparent;
  padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all var(--t-fast);
}
.tab:hover { color: var(--navy); background: rgba(30,40,85,0.04); }
.tab.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  font-size: 11px; font-weight: 700;
  background: var(--hairline-2); color: var(--ink-2);
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tab-count { background: var(--teal-100); color: var(--navy); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- admin sub-nav (page-level tabs as anchors) ---------- */
.admin-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  background: var(--off-white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: var(--s-4);
}
.admin-tab {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}
.admin-tab:hover { color: var(--navy); background: rgba(30,40,85,0.04); }
.admin-tab.is-active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-xs); }

/* ---------- admin > settings ---------- */
.settings-grid { display: flex; flex-direction: column; gap: var(--s-4); }
.settings-group-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-3); margin-bottom: var(--s-4);
}
.settings-group-head h2 { margin: 0; }
.settings-group-head p { margin: 4px 0 0; }
.settings-fields {
  display: grid; grid-template-columns: 200px 1fr 140px;
  gap: var(--s-3) var(--s-4);
  align-items: center;
}
.settings-row { display: contents; }
.settings-label { font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.settings-input input { width: 100%; max-width: 480px; }
.settings-hint { font-size: 12px; margin-top: 4px; }
.settings-meta { color: var(--muted); font-size: 12px; text-align: right; }
.settings-secret-tag { font-size: 10px !important; padding: 1px 6px !important; }
.small { font-size: 12px; }

@media (max-width: 720px) {
  .settings-fields { grid-template-columns: 1fr; }
  .settings-meta { text-align: left; }
}

/* ---------- sub-tabs (inside a tab panel) - same visual as top tabs ---------- */
.subtabs {
  display: inline-flex; flex-wrap: wrap;
  gap: 2px;
  background: var(--off-white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 3px;
  margin: 0 0 var(--s-4) 0;
}
.subtab {
  appearance: none; border: 0; background: transparent;
  padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all var(--t-fast);
}
.subtab:hover { color: var(--navy); background: rgba(30,40,85,0.04); }
.subtab.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}
.subtab .tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  font-size: 11px; font-weight: 700;
  background: var(--hairline-2); color: var(--ink-2);
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.subtab.is-active .tab-count { background: var(--teal-100); color: var(--navy); }
.subtab-panel { display: none; }
.subtab-panel.is-active { display: block; }

input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  background: var(--white);
  transition: all var(--t-fast);
}
input[type="search"]:hover { border-color: #C7CBD4; }
input[type="search"]:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(0,239,205,0.18);
}

/* ---------- tables ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}
.data-table thead th {
  background: var(--off-white);
  color: var(--muted);
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline-2);
  vertical-align: middle;
  color: var(--ink);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: rgba(210,248,245,0.32); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.col-actions, .data-table th.col-actions { text-align: right; width: 1%; white-space: nowrap; }
.action-cell {
  display: inline-flex; align-items: center; gap: var(--s-2);
  justify-content: flex-start;
}
.action-cell .tag { flex-shrink: 0; }
.data-table td.col-configure, .data-table th.col-configure {
  text-align: left; width: 1%; white-space: nowrap;
}
.row-actions { display: inline-flex; gap: var(--s-2); }

/* ---------- pagination ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline-2);
}
.pager-summary { font-size: 12.5px; }
.pager-controls { display: flex; align-items: center; gap: 6px; }
.pager-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  background: var(--white);
  transition: all var(--t-fast);
  font-variant-numeric: tabular-nums;
}
.pager-link:hover { border-color: var(--teal-600); color: var(--navy); text-decoration: none; }
.pager-link.is-current {
  background: var(--navy); color: var(--white); border-color: var(--navy);
  cursor: default;
}
.pager-gap { padding: 0 4px; color: var(--muted); font-weight: 700; }
.btn.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ---------- key/value list (used inside configure modal) ---------- */
.kv-list { display: flex; flex-direction: column; gap: var(--s-2); }
.kv-row {
  display: flex; justify-content: space-between; gap: var(--s-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 13px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; font-weight: 700; }
.kv-val { color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- configure modal ---------- */
.modal-wide { max-width: 640px; }
.attr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.attr-chip {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--white);
  font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.attr-chip input { position: absolute; opacity: 0; pointer-events: none; }
.attr-chip:hover { border-color: var(--teal-600); color: var(--navy); }
.attr-chip:has(input:checked) {
  background: var(--teal-100); color: var(--navy);
  border-color: var(--teal-600);
  box-shadow: inset 0 0 0 1px rgba(0,197,168,0.35);
}
.configure-basis {
  font-size: 11.5px; margin: var(--s-2) 0 0 0;
  padding-top: var(--s-3);
  border-top: 1px dashed var(--hairline-2);
}
.ai-result {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: #EDE9FE;
  border: 1px solid #DDD6FE;
  border-radius: var(--r-md);
}
.ai-result-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: 6px; }
.ai-confidence { font-size: 11px; font-weight: 600; color: #5B21B6; font-variant-numeric: tabular-nums; }
.ai-confidence.ai-review { color: #991b1b; }
.ai-rationale { margin: 0; font-size: 12.5px; color: var(--ink); line-height: 1.4; }

/* ---------- row state ---------- */
.row-prefilled { background: rgba(210, 248, 245, 0.35); }
.row-prefilled:hover { background: rgba(210, 248, 245, 0.55) !important; }
.row-missing { background: rgba(255, 199, 206, 0.22); }
.row-missing:hover { background: rgba(255, 199, 206, 0.4) !important; }
.input-missing { border-color: var(--kpi-red) !important; background: #FFF5F5; }
.input-missing:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important; }

/* ---------- status pills ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid transparent;
}
.tag-ready    { background: #DCFCE7; color: #166534; border-color: #BBF7D0; }
.tag-progress { background: #FEF3C7; color: #854d0e; border-color: #FDE68A; }
.tag-fail     { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.tag-info     { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
.tag-neutral  { background: var(--teal-100); color: var(--navy); border-color: #A8E8E0; }
.tag-inline {
  margin-left: var(--s-2);
  font-size: 10px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 500;
}

/* ---------- severity dot ---------- */
.sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(255,255,255,0.85); }
.sev-critical { background: var(--kpi-red); }
.sev-major    { background: var(--kpi-amber); }
.sev-minor    { background: var(--muted-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
  line-height: 1; border: 1px solid transparent;
  cursor: pointer; transition: all var(--t-fast);
  text-decoration: none; font-family: inherit;
  letter-spacing: 0.01em;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover { background: var(--navy-700); color: var(--white); box-shadow: 0 4px 12px rgba(30,40,85,0.22), inset 0 1px 0 rgba(255,255,255,0.12); }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--hairline);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--off-white); border-color: var(--navy); box-shadow: var(--shadow-sm); }
.btn-secondary.btn-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-secondary.btn-active:hover { background: var(--navy-700); border-color: var(--navy-700); }

.btn-block { display: flex; width: 100%; }
.btn-ms {
  background: var(--white);
  color: #1F2937;
  border: 1px solid #CBD5E1;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px;
  font-weight: 600;
}
.btn-ms:hover {
  background: #F3F4F6;
  border-color: #94A3B8;
  text-decoration: none;
}
.btn-ms .ms-icon { flex-shrink: 0; display: inline-block; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  margin: 14px 0;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--hairline);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xl { padding: 14px 24px; font-size: 15.5px; min-height: 52px; min-width: 130px; border-radius: var(--r-md); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.action-bar { display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; flex-wrap: wrap; }
.action-bar .btn-primary { margin-left: auto; }
.action-bar-right { display: flex; gap: var(--s-2); align-items: center; margin-left: auto; }
.action-bar-right .btn-primary { margin-left: 0; }
.sticky-bottom {
  position: sticky; bottom: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(8px);
  padding: var(--s-3) var(--s-6);
  margin: var(--s-5) calc(var(--s-6) * -1) 0;
  border-top: 1px solid var(--hairline);
  box-shadow: 0 -4px 16px rgba(17,24,55,0.06);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.filter-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ---------- forms ---------- */
.form-group { margin-bottom: var(--s-4); display: flex; flex-direction: column; justify-content: flex-end; }
.form-group label {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 6px;
  min-height: 20px;
}
.form-group label .tag-inline { margin-left: 0; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  background: var(--white);
  transition: all var(--t-fast);
}
textarea { min-height: 80px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #C7CBD4; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(0,239,205,0.18);
  background: var(--white);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--off-white); color: var(--muted);
  cursor: not-allowed;
}
.input-sm { width: 92px; padding: 7px 10px; font-size: 13px; display: inline-block; }
.input-md { width: 240px; padding: 9px 11px; display: inline-block; }
.input-xl { font-size: 18px; font-weight: 600; padding: 14px 16px; font-variant-numeric: tabular-nums; border-radius: var(--r-md); }
.num-input { text-align: right; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; }

/* ---------- component photo cell ---------- */
.photo-cell { white-space: nowrap; }
.photo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.photo-btn .photo-btn-check { display: none; color: var(--teal-600); flex-shrink: 0; }
.photo-btn.has-photo {
  background: var(--teal-100);
  border-color: var(--teal-600);
  color: var(--navy);
}
.photo-btn.has-photo .photo-btn-check { display: inline-block; }
.btn-icon { flex-shrink: 0; }

/* ---------- modal ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
  animation: modalFadeIn var(--t-fast);
}
.modal-backdrop[hidden] { display: none; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 80px);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--hairline);
  gap: var(--s-4);
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--navy); }
.modal-sub { margin: 2px 0 0 0; font-size: 12.5px; }
.modal-close {
  appearance: none; background: transparent; border: 0;
  font-size: 28px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 4px;
  transition: color var(--t-fast);
}
.modal-close:hover { color: var(--navy); }
.modal-body { padding: var(--s-5) var(--s-6); overflow-y: auto; }
.modal-hint { font-size: 11.5px; margin: var(--s-3) 0 0 0; text-align: center; }
.modal-foot {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--hairline);
  background: var(--off-white);
}
.modal-foot-spacer { flex: 1; }
.btn-link-danger {
  appearance: none; background: transparent; border: 0;
  padding: 6px 8px;
  color: #b91c1c; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  border-radius: var(--r-xs);
  transition: background var(--t-fast);
}
.btn-link-danger:hover { background: #fee2e2; }

/* ---------- dropzone ---------- */
.dropzone {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--hairline);
  border-radius: var(--r-md);
  background: var(--off-white);
  min-height: 200px;
  padding: var(--s-5);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
}
.dropzone:hover { border-color: var(--teal-600); background: var(--teal-100); }
.dropzone.is-dragover {
  border-color: var(--teal-600);
  background: var(--teal-100);
  box-shadow: 0 0 0 4px rgba(0,239,205,0.18);
}
.dropzone-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.dropzone-empty svg { color: var(--navy-600); margin-bottom: 4px; }
.dz-title { margin: 0; font-size: 14px; color: var(--ink); }
.dz-sub { margin: 0; font-size: 12px; }

/* ---------- preview panel (shown below dropzone only when populated) ---------- */
.preview-panel {
  margin-top: var(--s-4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--white);
  padding: var(--s-3);
  box-shadow: var(--shadow-xs);
}
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px var(--s-2) 2px;
}
.preview-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.preview-img {
  display: block;
  width: 100%; max-height: 280px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--off-white);
}

/* Checkboxes */
input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--navy);
  cursor: pointer;
}

/* ---------- login ---------- */
.login-page {
  background:
    radial-gradient(ellipse 600px 300px at 50% 0%, rgba(0,239,205,0.12), transparent),
    radial-gradient(ellipse 800px 400px at 50% 100%, rgba(30,40,85,0.08), transparent),
    var(--lgrey);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-container { width: 100%; max-width: 440px; padding: var(--s-5); }
.login-card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: var(--s-8);
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: var(--s-6); }
.login-brand .brand-tile-lg { margin-bottom: var(--s-4); }
.login-brand .brand-img-lg { margin-bottom: var(--s-4); }
.login-brand h1 { margin: var(--s-4) 0 var(--s-1) 0; font-size: 22px; }
.login-subtitle { color: var(--muted); font-size: 13px; margin: 0 0 var(--s-3) 0; }
.login-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--hairline); }

/* ---------- stat list ---------- */
.stat-list { list-style: none; padding: 0; margin: 0; }
.stat-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 13.5px;
}
.stat-list li:last-child { border-bottom: none; }
.stat-list li span { color: var(--ink-2); }
.stat-list b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); font-size: 15px; }

/* ---------- engineering torque ---------- */
.torque-table { table-layout: auto; width: 100%; }
/* Only tight, fixed-width columns stay on a single line; Name + Location wrap. */
.torque-table th:nth-child(1), .torque-table td:nth-child(1),
.torque-table th:nth-child(2), .torque-table td:nth-child(2),
.torque-table th:nth-child(4), .torque-table td:nth-child(4),
.torque-table th:nth-child(5), .torque-table td:nth-child(5),
.torque-table th:nth-child(6), .torque-table td:nth-child(6),
.torque-table th:nth-child(8), .torque-table td:nth-child(8) { white-space: nowrap; }
.torque-table th:nth-child(3), .torque-table td:nth-child(3),
.torque-table th:nth-child(7), .torque-table td:nth-child(7) {
  white-space: normal; word-break: break-word;
}
/* Location input fills whatever space is left in its cell. */
.torque-table td:nth-child(7) input[type="text"] { width: 100%; min-width: 120px; }
.needs-torque-toggle { width: 20px; height: 20px; accent-color: var(--navy); }

/* ---------- build form ---------- */
.context-bar {
  background: var(--white);
  padding: 12px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--s-5);
  position: sticky; top: 64px; z-index: 20;
  font-size: 13.5px;
}
.ctx-mo { font-weight: 700; color: var(--navy); letter-spacing: 0.02em; }
.ctx-product { flex: 1; color: var(--ink-2); }
.ctx-unit { font-weight: 700; color: var(--navy); }
.ctx-sep { color: var(--muted-2); }

.complete-card { background: var(--off-white); }
.complete-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.complete-eyebrow { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.complete-serial {
  text-align: center; padding: var(--s-3);
  background: var(--lcyan); border: 2px dashed var(--teal-600); border-radius: var(--r-md);
}
.complete-serial-barcode { display: flex; justify-content: center; margin-bottom: var(--s-2); }
.complete-serial-barcode svg { max-width: 320px; height: 56px; }
.complete-serial-text {
  font-size: 24px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--navy); font-variant-numeric: tabular-nums;
}

.torque-comp-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
  padding: 18px 20px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.torque-comp-head {
  display: flex; align-items: center; gap: var(--s-4);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--hairline-2);
}
.torque-comp-head-text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.torque-comp-name { font-size: 15px; font-weight: 600; color: var(--navy); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.torque-comp-code { font-weight: 700; }
.torque-comp-thumb {
  appearance: none; padding: 0;
  display: inline-block;
  width: 72px; height: 72px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--off-white);
  flex-shrink: 0; margin-left: auto;
  cursor: pointer;
  transition: all var(--t-fast);
}
.torque-comp-thumb:hover { transform: scale(1.04); border-color: var(--teal-600); box-shadow: var(--shadow-md); }
.torque-comp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.torque-comp-meta {
  display: flex; gap: var(--s-4); align-items: baseline; flex-wrap: wrap;
  font-size: 12.5px;
}

/* Target torque highlighted - the one thing the operator needs at a glance. */
.torque-req {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 12px;
  background: var(--teal-100);
  border: 1px solid rgba(0,197,168,0.4);
  border-radius: var(--r-sm);
  color: var(--navy);
}
.torque-req-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-2);
}
.torque-req-value {
  font-size: 18px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}
.torque-req-uom { font-size: 12px; font-weight: 700; color: var(--muted); }

/* Sub-header dividing torque points per physical component instance when
   qty > 1. Hidden when there's only one unit - no divider needed then. */
.torque-unit-head {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 0 6px 0;
  display: flex; align-items: center; gap: 10px;
}
.torque-unit-head::after {
  content: ''; flex: 1; height: 1px; background: var(--hairline-2);
}

/* Torque points - one row per event, no table chrome. */
.torque-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.torque-points + .torque-unit-head { margin-top: var(--s-3); }
.torque-point {
  display: grid;
  grid-template-columns: 64px 1fr 120px;
  gap: var(--s-4); align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--hairline);
  border-left-width: 4px;
  border-radius: var(--r-sm);
  background: var(--off-white);
  transition: all var(--t-fast);
}
.torque-point.tp-ok      { border-left-color: #16A34A; }
.torque-point.tp-fail    { border-left-color: var(--kpi-red); background: #FEF2F2; }
.torque-point.tp-entered { border-left-color: #16A34A; }
.torque-point.tp-pending { border-left-color: var(--hairline); }

.tp-index {
  font-size: 22px; font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tp-of { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.tp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0;
}
.tp-input-wrap {
  display: flex; align-items: center; gap: 8px;
  max-width: 260px;
}
.tp-input-wrap input { flex: 1; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tp-uom { font-weight: 700; color: var(--ink-2); font-size: 15px; flex-shrink: 0; }
.tp-status { text-align: right; }
.tp-status .tag { min-width: 90px; justify-content: center; }

.tp-attribution {
  grid-column: 2 / 4;
  font-size: 11.5px; line-height: 1.3;
  color: var(--muted);
  margin-top: 2px;
  min-height: 14px;
}
.tp-attribution:empty { display: none; }
.qc-attribution {
  font-size: 11.5px; line-height: 1.3;
  color: var(--muted);
  margin-top: 6px;
}
.qc-attribution:empty { display: none; }

@media (max-width: 720px) {
  .torque-point { grid-template-columns: 48px 1fr; grid-auto-flow: row; }
  .tp-status { grid-column: 1 / -1; text-align: left; }
  .tp-attribution { grid-column: 1 / -1; }
}

.qc-table td { vertical-align: top; }
.check-label { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 32px; }
.check-label span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.stage-details {
  border-top: 1px solid var(--hairline);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
}
.stage-details > summary {
  font-weight: 600; cursor: pointer; padding: var(--s-2) 0;
  color: var(--navy); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.stage-details > summary::before {
  content: '▸'; color: var(--muted-2); font-size: 10px; transition: transform var(--t-fast);
}
.stage-details[open] > summary::before { transform: rotate(90deg); }
.stage-details > summary::-webkit-details-marker { display: none; }

/* ---------- build unit grid ---------- */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: var(--s-3); }
.unit-tile {
  background: var(--white);
  border: 2px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 18px 16px;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
  min-height: 92px;
}
.unit-tile:hover { border-color: var(--teal-600); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.unit-tile-new { }
.unit-tile-in_progress { border-color: var(--kpi-amber); background: linear-gradient(180deg, rgba(245,158,11,0.06), rgba(245,158,11,0.02)); }
.unit-tile-complete { border-color: var(--kpi-green); background: linear-gradient(180deg, rgba(34,197,94,0.06), rgba(34,197,94,0.02)); cursor: default; }
.unit-tile-complete:hover { transform: none; box-shadow: var(--shadow-xs); }
.unit-tile-num { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.unit-tile-state { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.unit-tile-serial { font-size: 12px; color: var(--navy); margin-top: 8px; font-variant-numeric: tabular-nums; font-weight: 500; }

.unit-tile-form { display: contents; }

/* ---------- complete / serial display ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: var(--s-2) var(--s-3); margin: var(--s-5) 0; padding: var(--s-5); background: var(--off-white); border-radius: var(--r-md); border: 1px solid var(--hairline); }
.kv dt { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.kv dd { margin: 0; font-weight: 500; color: var(--ink); font-size: 14px; }
.kv dd.serial {
  font-size: 24px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--navy); font-variant-numeric: tabular-nums;
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s-3);
  background: var(--white);
  border: 2px dashed var(--teal);
  border-radius: var(--r-md);
  margin: var(--s-2) 0;
}

/* ---------- shop-floor XL input override ---------- */
input.input-xl, .torque-input { font-size: 18px; font-weight: 600; min-height: 48px; }

/* ---------- focus ring for everything interactive ---------- */
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,239,205,0.35);
  border-radius: var(--r-sm);
}

/* ---------- print ---------- */
@media print {
  .app-header, .app-nav, .action-bar, .sticky-bottom, .filter-row, .flash { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: var(--white); }
}

@media (max-width: 720px) {
  .app-header-inner { padding: 0 var(--s-4); gap: var(--s-3); }
  .app-title { display: none; }
  .app-main { padding: var(--s-5) var(--s-4); }
  h1 { font-size: 22px; }
  .kpi-value { font-size: 26px; }
}
