/* =============================================================================
   screens.css — Os-WMS operative skjermer. Mobil-først. Leser kun tokens.
========================================================================== */

/* App-skall ---------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: var(--hairline) solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.appbar__inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between;
  max-width: var(--shell-max); margin-inline: auto; padding-inline: var(--space-5);
}
.appbar__brand { font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
.appbar__section { color: var(--ink-subtle); font-size: var(--text-sm); font-weight: var(--weight-medium); }

.wrap {
  max-width: var(--content-max); margin-inline: auto;
  padding: var(--space-5) var(--space-5) calc(72px + env(safe-area-inset-bottom));
}

/* Bunn-tabbar — operatørens hovednav på mobil ----------------------------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-sticky);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.1) blur(12px);
  border-top: var(--hairline) solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-3) 0; color: var(--ink-subtle); font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
}
.tabbar__item:hover { text-decoration: none; color: var(--ink-muted); }
.tabbar__item .icon { width: 22px; height: 22px; }
.tabbar__item.is-active { color: var(--accent); }

/* Sidetittel + handling ---------------------------------------------------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.pagehead h1 { font-size: var(--text-2xl); }
.pagehead p { color: var(--ink-muted); font-size: var(--text-sm); }

/* KPI-rutenett ------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.kpi { background: var(--surface); border: var(--hairline) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.kpi__val { font-size: var(--text-3xl); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-tight); }
.kpi__lbl { color: var(--ink-subtle); font-size: var(--text-xs); margin-top: 2px; }

/* Store skann-felt --------------------------------------------------------- */
.scanfield { display: flex; flex-direction: column; gap: var(--space-2); }
.scanfield__label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink); }
.scanfield__label .icon { width: 18px; height: 18px; color: var(--accent); }
.scaninput {
  height: var(--control-h-lg); font-family: var(--font-mono); font-size: var(--text-lg);
  letter-spacing: 1px; padding: 0 var(--space-4);
  background: var(--field-bg); color: var(--field-ink);
  border: 2px solid var(--field-line); border-radius: var(--field-radius); width: 100%;
}
.scaninput:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }

/* Lister / rader ----------------------------------------------------------- */
.rowcard { display: block; background: var(--surface); border: var(--hairline) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.rowcard + .rowcard { margin-top: var(--space-3); }
a.rowcard:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-hover); }
.rowcard__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.rowcard__title { font-weight: var(--weight-semibold); }
.rowcard__meta { color: var(--ink-subtle); font-size: var(--text-xs); margin-top: 2px; }

/* Plukk-linje -------------------------------------------------------------- */
.pickline { background: var(--surface); border: var(--hairline) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.pickline + .pickline { margin-top: var(--space-3); }
.pickline.is-done { border-color: var(--positive); background: color-mix(in srgb, var(--positive-weak) 50%, var(--surface)); }
.pickline__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.pickline__name { font-weight: var(--weight-semibold); }
.pickline__bin { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); color: var(--ink-muted); margin-top: 2px; }
.pickline__bin .icon { width: 15px; height: 15px; }
.pickline__qty { font-size: var(--text-xl); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pickline__qty small { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--ink-subtle); }

/* Fremdriftsstrek */
.progress { height: 6px; background: var(--surface-sunk); border-radius: var(--radius-pill); overflow: hidden; margin-top: var(--space-4); }
.progress__bar { height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width var(--dur) var(--ease); }
.pickline.is-done .progress__bar { background: var(--positive); }

/* Pakkseddel --------------------------------------------------------------- */
.slip { background: var(--surface); border: var(--hairline) solid var(--line); border-radius: var(--radius-lg); }
.slip__head { padding: var(--space-5); border-bottom: var(--hairline) solid var(--line); }
.slip__row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-5); border-bottom: var(--hairline) solid var(--line); font-size: var(--text-sm); }
.slip__row:last-child { border-bottom: 0; }

/* Diverse ------------------------------------------------------------------ */
.btn--xl { height: 56px; font-size: var(--text-md); }
.section-title { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--ink-subtle); font-weight: var(--weight-semibold); margin: var(--space-6) 0 var(--space-3); }
.flash { margin-bottom: var(--space-4); }

@media (min-width: 560px) { .kpis { grid-template-columns: repeat(3, 1fr); } }

/* Innlogging --------------------------------------------------------------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); padding: var(--space-6); }
.login__card { width: 100%; max-width: 400px; }
.login__brand { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
.login__foot { font-size: var(--text-xs); }

/* Bruker-chip i appbar */
.appbar__user { display: flex; align-items: center; gap: var(--space-3); }
.appbar__user .logout { color: var(--ink-subtle); display: inline-flex; }
.appbar__user .logout:hover { color: var(--ink); }
