/* PartsFlows: rustige werkbalk boven, compacte statuskaartjes in een raster, één paneel per pakbon. */
:root {
  --bg: #f7f7f8; --surface: #ffffff; --ink: #141414; --muted: #666b70; --line: #dfe1e4; --accent: #1c6bba; --on-accent: #ffffff;
  --grey-bg: #eef0f1; --grey-ink: #4d5257; --grey-bar: #9aa0a6;
  --orange-bg: #fdefdc; --orange-ink: #8f4a00; --orange-bar: #e98300;
  --green-bg: #e3f3e8; --green-ink: #1a6634; --green-bar: #2e9e55;
  --danger: #b3261e; --danger-bg: #fbe9e7;
  --font: "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101213; --surface: #1a1d1f; --ink: #f1f2f3; --muted: #a1a6ab; --line: #2f3336; --accent: #74b3f0; --on-accent: #0b1d2e;
    --grey-bg: #24282b; --grey-ink: #c3c8cc; --grey-bar: #7d848a;
    --orange-bg: #3a2a12; --orange-ink: #ffbd6e; --orange-bar: #e98300;
    --green-bg: #15301f; --green-ink: #86d9a0; --green-bar: #2e9e55;
    --danger: #ff8a80; --danger-bg: #3b1d1a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 22px; font-weight: 500; margin: 0; letter-spacing: .01em; text-wrap: balance; }
h2 { font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; flex-wrap: nowrap; }
.r { text-align: right; }

header.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; min-height: 56px; }
.brand { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 14px; color: var(--ink); text-decoration: none; }
nav.main { display: flex; gap: 4px; flex: 1; }
nav.main a { padding: 18px 10px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.main a.on { color: var(--ink); border-bottom-color: var(--ink); }
.user { display: flex; align-items: center; gap: 10px; margin: 0; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 96px; display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.row.end { justify-content: flex-end; }
.row form, .qty form, .line > form { margin: 0; }

.flash { background: var(--green-bg); color: var(--green-ink); padding: 10px 14px; border-radius: var(--r); }
.flash.error { background: var(--danger-bg); color: var(--danger); }

.btn { border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: var(--r); padding: 9px 16px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.blue { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.quiet { border-color: var(--line); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 14px; }
.input { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 12px; min-height: 40px; width: 100%; }
.input.auto { width: auto; }
.input.small { min-height: 32px; padding: 3px 8px; }
.input.narrow { width: 72px; }
.input.price { width: 100px; }
.input[readonly] { background: var(--bg); color: var(--muted); }
textarea.input { resize: vertical; line-height: 1.45; }
.tick { width: 20px; height: 20px; }
.x { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; color: var(--muted); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f.check-label { flex-direction: row; align-items: center; gap: 8px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin: 0; }
details summary { cursor: pointer; color: var(--accent); }
details > form { margin-top: 12px; }

.paste { border: 1px dashed var(--muted); border-radius: var(--r); background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.paste strong { font-weight: 600; }
.paste summary { list-style: none; width: fit-content; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: 13px; background: var(--bg); }

.tools { display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; gap: 12px; align-items: center; margin: 0; }
.tools.two { grid-template-columns: minmax(200px, 1fr) auto; }
.tools select.input { width: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ordered { background: var(--grey-bar); } .dot.partial { background: var(--orange-bar); } .dot.complete { background: var(--green-bar); }
.dot.backorder { border: 2px solid var(--orange-bar); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { text-align: left; text-decoration: none; border-left: 5px solid; border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card.ordered { background: var(--grey-bg); border-color: var(--grey-bar); color: var(--grey-ink); }
.card.partial { background: var(--orange-bg); border-color: var(--orange-bar); color: var(--orange-ink); }
.card.complete { background: var(--green-bg); border-color: var(--green-bar); color: var(--green-ink); }
.card.draft { background: var(--surface); border: 1px dashed var(--muted); border-left-width: 5px; color: var(--muted); }
.card .name { font-weight: 600; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.card .state { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.late { color: var(--danger); font-weight: 600; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .input { min-height: 34px; padding: 6px 8px; min-width: 110px; }
td .input.narrow { min-width: 0; }
td form { margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; width: min(820px, 100%); margin: 0 auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.panel.wide { width: 100%; }
.panel .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pill { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ordered { background: var(--grey-bg); color: var(--grey-ink); } .pill.partial { background: var(--orange-bg); color: var(--orange-ink); } .pill.complete { background: var(--green-bg); color: var(--green-ink); }

.lines { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); }
.line { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line.done { background: var(--green-bg); }
.line.mee { opacity: .7; }
.check { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer; font-size: 20px; line-height: 1; color: transparent; display: inline-flex; align-items: center; justify-content: center; }
span.check { cursor: default; }
.line.done .check { background: var(--green-bar); border-color: var(--green-bar); color: #fff; }
.line.part .check { border-color: var(--orange-bar); color: var(--orange-bar); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.row.bo { margin-top: 6px; gap: 8px; }
.tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--orange-ink); background: var(--orange-bg); padding: 3px 8px; border-radius: 999px; }
.log { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

.login { max-width: 420px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.login .full { width: 100%; }
.flash .input { margin-top: 6px; background: var(--surface); }
.pager { display: flex; gap: 12px; align-items: center; }
.pager [aria-disabled="true"] { opacity: .4; }

@media (max-width: 680px) {
  .top-in { gap: 12px; justify-content: space-between; }
  nav.main { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
  nav.main a { padding: 14px 4px; font-size: 13px; border-bottom: 0; border-top: 2px solid transparent; margin: -1px 0 0; }
  nav.main a.on { border-top-color: var(--ink); }
  .tools, .tools.two { grid-template-columns: 1fr; }
  .tools select.input { width: 100%; }
  .panel { padding: 16px; }
  .hide-s { display: none; }
}
