/* Syncrocon Inventory — app layer on the CostusWorx Fluent kit (Dynamics 365 look).
   Load order: /static/app.css (legacy) → /static/fluent-kit/fluent-core.css (synced kit, do not edit) → this file.
   Out of the layer on purpose: the printed label sheet (.lbl, mm-based, app.css) and the
   phone task screens' own controls (.m-*, the bottom bar) — those keep their simplified,
   glove-friendly UI. Below 901px the legacy touch sizes (44px buttons, 16px inputs) stay.
   Literals only in TOKENS: php <kit>/tools/check_layer.php app/static/fluent.css   (docs/FLUENT_KIT.md) */

/* ===== TOKENS ===== */
:root {
  /* Syncrocon chrome: navy header, orange stripe (the logo colours) */
  --tenant-primary: #12395C;
  --tenant-accent: #E8720C;
  /* legacy app.css names → kit tokens */
  --bg: var(--v6-canvas); --surface: var(--v6-surface); --surface-2: var(--v6-surface-2);
  --border: var(--v6-hover); --border-strong: var(--v6-stroke2);
  --text: var(--v6-t1); --muted: var(--v6-t3);
  --brand: var(--tenant-primary); --brand-2: var(--v6-action); --accent: var(--tenant-accent);
  --ok: var(--v6-ok); --ok-bg: var(--v6-ok-bg); --warn: var(--v6-warn); --warn-bg: var(--v6-warn-bg);
  --bad: var(--v6-bad); --bad-bg: var(--v6-bad-bg);
  --radius: var(--v6-r-md); --shadow: var(--v6-sh2);
  --mono: var(--v6-font-mono); --sans: var(--v6-font);
  /* app-only */
  --sy-accent-h: #CF6409;
  --sy-grade-new: var(--v6-chart-1); --sy-grade-a: var(--v6-ok); --sy-grade-b: #6F9E39;
  --sy-grade-c: var(--tenant-accent); --sy-grade-scrap: var(--v6-t4);
  --sy-b-bg: #EEF6E9; --sy-b-ink: #3F6B1F;
  --sy-print-ink: #333333; --sy-print-blank: #999999;
  --sy-fs-hero: 42px;
}

/* ===== BASE ===== */
body, body *:not(svg):not(path) { font-family: var(--v6-font) !important; }
body { font-size: var(--v6-fs-body); line-height: var(--v6-lh-body); background: var(--v6-canvas); color: var(--v6-t1); }
a { color: var(--v6-action); }
a:hover { color: var(--v6-action-h); }

/* Shell */
.v6-main { padding-top: 16px; }
.v6-hdr-brand:hover, .v6-hdr-brand:focus { color: var(--v6-surface); text-decoration: none; }
.v6-menu form { margin: 0; }
.v6-search { margin: 0; }
.v6-hdr .v6-search label { margin: 0; display: flex; font-size: var(--v6-fs-body); font-weight: 400; letter-spacing: 0; color: var(--v6-on-chrome-field-ink); }
.v6-hdr .v6-search input { width: auto; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--v6-surface); font-size: var(--v6-fs-body); }
.v6-hdr .v6-search input:focus { outline: none; border: 0; background: transparent; }
@media (min-width: 769px) {
  .sy-hdr-spacer { display: none; }
  .bottom-nav { display: none; }   /* the site map is on screen */
}
@media (max-width: 768px) {
  .v6-hdr { padding-top: env(safe-area-inset-top); }
  .v6-sitemap { top: calc(var(--v6-hdr-h) + 3px + env(safe-area-inset-top)); }
  .v6-main { padding-top: 12px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Page title: each page's .page-head h2 (desktop pages) or the shell's heading (phone task screens) */
.sy-title-wrap { margin: 0 0 12px; }
.page-head { margin-bottom: 16px; gap: 8px; }
.page-head h2 { margin: 0; font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); }
.page-head form { margin: 0; }
.crumb { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); color: var(--v6-t3); margin-bottom: 4px; }
.muted { color: var(--v6-t3); }
.small { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); }
.empty { font-size: var(--v6-fs-body); color: var(--v6-t3); }
.sku { font-size: var(--v6-fs-body); font-weight: 600; }
.sku.small { font-size: var(--v6-fs-cap); }

/* Message bars */
.alert { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 16px; border-radius: var(--v6-r-sm); border: var(--v6-line) solid var(--v6-sel-strong); font-size: var(--v6-fs-body); line-height: var(--v6-lh-body); color: var(--v6-t1); background: var(--v6-sel); }
.alert.success { background: var(--v6-ok-bg); border-color: var(--v6-ok); color: var(--v6-t1); }
.alert.error { background: var(--v6-bad-bg); border-color: var(--v6-bad-line); color: var(--v6-t1); }
.alert.info { background: var(--v6-sel); border-color: var(--v6-sel-strong); color: var(--v6-t1); }
.install-tip { background: var(--v6-sel); border: var(--v6-line) solid var(--v6-sel-strong); color: var(--v6-action-ink); border-radius: var(--v6-r-sm); font-size: var(--v6-fs-body); }

/* Pills (condition grades and statuses) */
.badge { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); font-weight: 600; letter-spacing: 0; border-radius: var(--v6-r-pill); padding: 2px 8px; border: 0; background: var(--v6-disabled-bg); color: var(--v6-t2); }
.badge.new, .badge.info { background: var(--v6-sel); color: var(--v6-action-ink); }
.badge.a, .badge.ok { background: var(--v6-ok-bg); color: var(--v6-ok-h); }
.badge.b { background: var(--sy-b-bg); color: var(--sy-b-ink); }
.badge.c, .badge.warn { background: var(--v6-warn-bg); color: var(--v6-warn); }
.badge.scrap { background: var(--v6-disabled-bg); color: var(--v6-t2); }
.badge.bad { background: var(--v6-bad-bg); color: var(--v6-bad-h); }

/* Grids (tables): 44px rows, quiet header */
table { font-size: var(--v6-fs-body); }
thead th { height: var(--v6-row-h); padding: 0 8px; font-size: var(--v6-fs-body); font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--v6-t2); background: var(--v6-surface); border-bottom: var(--v6-line) solid var(--v6-stroke); }
tbody td { height: var(--v6-row-h); padding: 4px 8px; line-height: var(--v6-lh-body); border-bottom: var(--v6-line) solid var(--v6-row); }
tbody tr:hover { background: var(--v6-surface-2); }
.num { font-variant-numeric: tabular-nums; }
.sy-pos { color: var(--v6-ok-h); }
.sy-neg { color: var(--v6-bad-h); }
.sy-col-actions { width: 460px; }
.btn-row .btn-row { flex-wrap: nowrap; }   /* inline row forms (issue / return / reset) stay on one 44px row */
.sy-col-progress { width: 130px; }
.sy-col-count { width: 170px; }
.sy-col-bar { width: 45%; }
.sy-col-check { width: 28px; }

/* Pivots (status tabs) */
.tabs { gap: 4px; border-bottom: var(--v6-line) solid var(--v6-stroke); flex-wrap: wrap; }
.tabs a { padding: 8px 12px; font-size: var(--v6-fs-body); font-weight: 400; color: var(--v6-t1); border-bottom: 3px solid transparent; }
.tabs a:hover { background: var(--v6-surface-2); color: var(--v6-t1); }
.tabs a.active { color: var(--v6-t1); font-weight: 600; border-bottom-color: var(--v6-action); }

/* Fields and buttons: colours everywhere, D365 sizes on desktop (phones keep the legacy touch sizes) */
label { font-size: var(--v6-fs-body); font-weight: 400; letter-spacing: 0; color: var(--v6-t2); }
.field .hint { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); color: var(--v6-t3); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], input[type=search], select, textarea {
  color: var(--v6-t1); background: var(--v6-surface); border: var(--v6-line) solid var(--v6-stroke2); border-bottom-color: var(--v6-t3); border-radius: var(--v6-r-sm); }
input:focus, select:focus, textarea:focus { outline: none; border-bottom: 2px solid var(--v6-action); }
input[readonly] { background: var(--v6-surface-2); color: var(--v6-t2); border-color: transparent; }
input[type=checkbox], input[type=radio] { accent-color: var(--v6-action); }
.btn { font-weight: 600; letter-spacing: 0; border-radius: var(--v6-r-sm); border: var(--v6-line) solid var(--v6-stroke2); background: var(--v6-surface); color: var(--v6-t1); gap: 6px; }
.btn:hover { background: var(--v6-surface-2); color: var(--v6-t1); }
.btn.primary { background: var(--v6-action); border-color: var(--v6-action); color: var(--v6-surface); }
.btn.primary:hover { background: var(--v6-action-h); border-color: var(--v6-action-h); color: var(--v6-surface); }
.btn.accent { background: var(--tenant-accent); border-color: var(--tenant-accent); color: var(--v6-surface); }
.btn.accent:hover { background: var(--sy-accent-h); border-color: var(--sy-accent-h); color: var(--v6-surface); }
.btn.danger { color: var(--v6-bad); border-color: var(--v6-bad-line); }
.btn.danger:hover { background: var(--v6-bad-bg); color: var(--v6-bad); }
.btn:disabled { opacity: 1; background: var(--v6-disabled-bg); color: var(--v6-disabled-fg); border-color: transparent; }
@media (min-width: 901px) {
  input[type=text], input[type=password], input[type=number], input[type=date],
  input[type=email], input[type=search], select { height: var(--v6-ctl-h); padding: 0 8px; font-size: var(--v6-fs-body); }
  textarea { padding: 6px 8px; font-size: var(--v6-fs-body); min-height: 64px; }
  .btn { height: var(--v6-ctl-h); padding: 0 12px; font-size: var(--v6-fs-body); line-height: 1; }
  .btn.sm { height: 24px; padding: 0 8px; font-size: var(--v6-fs-cap); }
  .field { margin-bottom: 12px; }
}

/* Details, progress */
.kv { font-size: var(--v6-fs-body); }
.kv dt { font-size: var(--v6-fs-body); color: var(--v6-t3); }
.bar { height: 6px; border-radius: 3px; background: var(--v6-hover); }
.bar > span { background: var(--v6-action); }
.bar.ok > span { background: var(--v6-ok); }
.bar.warn > span { background: var(--tenant-accent); }
.split { background: var(--v6-hover); border-radius: var(--v6-r-sm); }
.sy-g-new { background: var(--sy-grade-new); }
.sy-g-a { background: var(--sy-grade-a); }
.sy-g-b { background: var(--sy-grade-b); }
.sy-g-c { background: var(--sy-grade-c); }
.sy-g-scrap { background: var(--sy-grade-scrap); }
.sy-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Screen pieces that used inline styles */
.sy-hit-title { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); }
.sy-pick-list { max-height: 280px; overflow: auto; border: var(--v6-line) solid var(--v6-row); border-radius: var(--v6-r-sm); }
.sy-notes { margin: 0; padding-left: 18px; line-height: 1.75; }
.sy-check-label { display: flex; gap: 8px; align-items: center; }
.sy-check-label-field { margin-top: 24px; }
.sy-detail-cell { max-width: 420px; word-break: break-word; }
.sy-error-body { text-align: center; padding: 48px 20px; }
.sy-error-code { font-size: var(--sy-fs-hero); line-height: 1.2; font-weight: 700; color: var(--v6-t3); }
.sy-err-title { margin: 8px 0 6px; font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; }
.sy-pick-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.sy-pick-company { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 700; }
.sy-pick-no { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); }
.sy-sign-row { display: flex; gap: 40px; margin-top: 34px; }
.sy-sign { border-top: 1px solid var(--sy-print-ink); padding-top: 5px; }
.sy-blank { border-bottom: 1px solid var(--sy-print-blank); min-width: 60px; }
.sy-blank-wide { min-width: 80px; }

/* Sign-in */
body.sy-login-page { margin: 0; }
.v6-login-card .alert { margin-bottom: 12px; }
.sy-login-foot { margin: 16px 0 0; text-align: center; }

/* Utilities that replaced inline style attributes (they must beat the legacy element rules) */
.u-auto { width: auto !important; }
.u-full { width: 100% !important; }
.u-grow { flex: 1; }
.u-right { text-align: right; }
.u-m0 { margin: 0 !important; }
.u-mt0 { margin-top: 0 !important; }
.u-mt-xs { margin-top: 4px !important; }
.u-mt-sm { margin-top: 8px !important; }
.u-mt { margin-top: 12px !important; }
.u-mb0 { margin-bottom: 0 !important; }
.u-mb-xs { margin-bottom: 8px !important; }
.u-mb-sm { margin-bottom: 12px !important; }
.u-mb { margin-bottom: 16px !important; }
.u-gap-xs { gap: 4px !important; }
.u-w-xs { max-width: 220px; }
.u-w-sm { max-width: 460px; }
.u-w-md { max-width: 760px; }
.u-w-qty { width: 72px !important; }
.u-w-pw { width: 140px !important; }
.u-fw { min-width: 260px; }
.u-lead { margin: -8px 0 16px; max-width: 680px; color: var(--v6-t3); }

/* ===== COMPONENTS ===== */
/* Legacy cards join the kit block family; stat boxes join the tile family. */
.card { border: var(--v6-card-w) solid var(--v6-card-line); border-radius: var(--v6-r-md); box-shadow: var(--v6-raise); background: var(--v6-block-bg); margin: 0 4px 16px 0; }
.card > h2, .card > .card-head { padding: 12px 16px; font-size: var(--v6-fs-sub2); line-height: var(--v6-lh-sub2); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); border-bottom: var(--v6-line) solid var(--v6-row); }
.card-head .small { font-weight: 400; }
.card-body.tight { overflow-x: auto; border-radius: 0 0 var(--v6-r-md) var(--v6-r-md); }
.card-body.tight > table { background: transparent; }
.stat { border: var(--v6-card-w) solid var(--v6-card-line); border-radius: var(--v6-r-md); box-shadow: var(--v6-raise-sm); background: var(--v6-block-bg); padding: 10px 14px 12px; margin-right: 4px; }
.stat.accent { border-left: 6px solid var(--tenant-accent); }
.stat .label { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--v6-t3); }
.stat .value { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .sub { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); color: var(--v6-t3); }
.grid { gap: 16px; }

@media print {
  .card, .stat { border: 0; box-shadow: none; background: var(--v6-surface); margin: 0; }
  .v6-app { height: auto; }
}
